/* addui-time-27 on the AddUI2 runtime (addui/addui.js, admin.js).
   addui-time-27.css is generated from the design system; what only this app needs lives here. */

/* the addu™ signature (#sign) as a vector; the generated stylesheet carries it as a 54×15 PNG */
:root { --i-addu: url("/addui/img/addu.svg"); }

/* the product logos in dark grey (ink-soft), drawn as masks; a flag keeps its colours on a layer over the grey wordmark
   (com-baseform-intra es/br logo.jspf). The stack takes the system's logo heights: 24px, 20px in Wide and on phones, 32px at login */
#logo .aui-logo-mask, .aui-login .brand .aui-logo-mask { background: var(--ink-soft); }
.aui-logo-stack { position: relative; display: block; height: 24px; aspect-ratio: var(--ratio); }
.aui-logo-stack > .aui-logo-mask, #logo .aui-logo-stack > img, .aui-login .brand .aui-logo-stack > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; aspect-ratio: auto; }
.aui-login .brand .aui-logo-stack { height: 32px; }
@container aui (min-width: 761px) { .aui-wide > #logo .aui-logo-stack { height: 20px; } }
@container aui (max-width: 760px) { #logo .aui-logo-stack { height: 20px; } }

/* the language chooser: EN / PT in the taskbar (kept on phones, where the taskbar shows only icons), a link under the login panel */
#taskbar a.lang, #taskbar a.lang:visited { font-weight: 600; letter-spacing: .04em; }
@container aui (max-width: 760px) {
  #taskbar a.lang, #taskbar a.lang:visited { display: inline-flex; width: auto; padding: 0 var(--space-2); font-size: var(--fs-sm); }
}
.aui-login .help .lang { color: var(--ink-soft); }

/* addui.js turns a.button into <div class="button_out"><button class="green|blue|red small">, without the .button class */
.button_out button:hover { border-color: var(--blue); background: var(--sheet); color: var(--blue); }
.button_out button.green, .button_out button.blue { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button_out button.green:hover, .button_out button.blue:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.button_out button.red { border-color: var(--accent); color: var(--accent); }
.button_out button.red:hover { border-color: var(--accent); background: var(--accent-wash); color: var(--accent); }
.button_out button.small { height: 28px; padding: 0 var(--space-3); font-size: var(--fs-sm) !important; }

/* column widths in the pages and report configs (column.*.html.extraHtml=style="width:80px") are content widths,
   set for AddUI2's 3px padding; the system's header cells are border-box with 24px padding, which left 32px of an
   80px column. Content-box keeps the configured width for the text; 26px + 8px padding + the 2px rule keeps the 36px header. */
.listTable th, .listTable thead td, .listTable tr.thead td, .listTable tr td.header, .listTable tr td.orderHeader {
  box-sizing: content-box; height: 26px;
}

/* field messages written by admin.js (setJSError, handleNumber) */
.iinfo, .errInfo { display: block; padding: 6px 0 0; color: var(--accent); font-size: var(--fs-sm); }

/* admin.js shows a field's title (format hints, maximum length) in #helpbox, appended to <body>: keep it out of the shell grid */
#helpbox { position: absolute; z-index: 40; max-width: 320px; padding: var(--space-2) var(--space-3); background: var(--ink); color: var(--on-ink); font-size: var(--fs-sm); line-height: 16px; pointer-events: none; }
#helpbox strong { font-weight: 600; }
#helpbox .helpFailure { margin-top: var(--space-1); font-weight: 600; }

/* filter bars: one height and one text size for every control, so buttons line up with the fields beside them
   (the pages use .small buttons in toolbars, 28px with 12px text next to 32px fields with 14px text) */
.searchForm .button, .searchForm input[type="submit"], .searchForm input[type="button"], .searchForm .button_out button,
table.aui-subbar .button, table.aui-subbar .button_out button {
  height: var(--ctl); padding: 0 var(--space-4); font-size: var(--fs) !important;
}

/* a report date filter (month and year selects) kept together, labelled for screen readers */
.searchForm .range { display: inline-flex; gap: var(--space-1); }

/* a labelled filter (admin/rep.jsp, saftpSel: "de 1 jan. 2021"): the word as a label, then its controls, on one line */
.searchForm label { display: inline-flex; align-items: center; gap: var(--space-2); white-space: nowrap; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 500; }
.searchForm label select, .searchForm label input { color: var(--ink); font-size: var(--fs); }

@container aui (max-width: 760px) {
  .searchForm .range, .searchForm label { flex: 1 1 100%; }
  .searchForm .range select, .searchForm label > select, .searchForm label > input, .searchForm label > .range { flex: 1 1 0; min-width: 0; }
  .searchForm label > span:not(.range) { flex: 0 0 2.5em; }
}

/* a sub-section with actions on its right (the pages' "Documentos" bar): the h3 look, as a table so the upload form keeps its place */
table.aui-subbar { width: 100%; border-collapse: collapse; border-top: 1px solid var(--rule); }
table.aui-subbar td { padding: var(--space-8) var(--pad) var(--space-3); vertical-align: bottom; }
table.aui-subbar td:first-child { color: var(--ink); font-size: 15px; font-weight: 600; line-height: 20px; }
table.aui-subbar td:last-child { text-align: right; }
table.aui-subbar form { display: inline-flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

/* admin.js sets width:auto inline on input.sNumber; in the timer's field grid the column decides */
.aui-timer .fields input, .aui-timer .fields select { width: 100% !important; min-width: 0; }

/* a form beside its context (time/edit.jsp: the record and the project's contract), stacking when narrow */
.aui-split { display: flex; flex-wrap: wrap; gap: var(--space-8); align-items: flex-start; }
.aui-split > form { flex: 0 1 480px; min-width: 0; }
.aui-split > div { flex: 1 1 240px; min-width: 0; }

/* the record being edited, in the list under the form */
.listTable tbody tr.editing td { background: var(--blue-wash); }

/* absences counted in the hours calendars */
.err-text { color: var(--accent); font-weight: 600; }

/* the pages' label/value form tables (the CayWeb forms), laid out like a .formGrid: one label column, one even gap
   between rows, and every field starting on the same edge. Text fields and selects fill the column; dates and numbers
   share one shorter width. !important beats the views' inline widths (CW/*.xml extraHtml style="width:300px"). */
.formTable { width: 100%; max-width: 720px; }
.formTable > * > tr > td { padding: 0 0 var(--space-3); }
.formTable > * > tr > td:first-child { width: 160px; padding: calc((var(--ctl) - 16px) / 2) var(--space-6) var(--space-3) 0; line-height: 16px; }
.formTable td:first-child > label { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 500; }
/* a read-only value: centred on the label's line like a field would be */
.formTable > * > tr > td:last-child:not(:has(input:not([type="hidden"]), select, textarea)) { padding-top: calc((var(--ctl) - 20px) / 2); line-height: 20px; }
.formTable > * > tr > td:last-child > :is(input[type="text"], input[type="password"], input[type="email"], input[type="url"], input[type="tel"], input[type="number"], input:not([type]), select, textarea) { width: 100% !important; }
.formTable > * > tr > td:last-child > :is(input.sDate, input.sNumber, input.sDecimal, input.sEuro) { width: 12em !important; }
.formTable > * > tr > td:last-child > :is(input.sNumber, input.sDecimal, input.sEuro) { text-align: right; }
/* a group of fields in one value cell (despesa.jsp: the payment) */
.formTable table.compact td { padding: 0 var(--space-2) 0 0; }
@container aui (max-width: 560px) {
  .formTable > * > tr > td { display: block; width: auto; }
  .formTable > * > tr > td:first-child { width: auto; padding: 0 0 var(--space-1); }
  .formTable > * > tr > td:last-child:not(:has(input:not([type="hidden"]), select, textarea)) { padding-top: 0; }
}

/* a record shown read-only (factura, nota de crédito, recebimento): its fields across the sheet, label above value.
   addui2-bridge.js marks long values (.wide: they take a whole row) and empty ones (.blank: a dash) */
.formTable:not(:has(input:not([type="hidden"]), select, textarea, button)) { display: block; max-width: none; }
.formTable:not(:has(input:not([type="hidden"]), select, textarea, button)) > tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 var(--space-6); }
.formTable:not(:has(input:not([type="hidden"]), select, textarea, button)) > tbody > tr { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
.formTable:not(:has(input:not([type="hidden"]), select, textarea, button)) > tbody > tr > td { display: block; width: auto; padding: 0 !important; line-height: 20px; }
.formTable:not(:has(input:not([type="hidden"]), select, textarea, button)) > tbody > tr > td:last-child { font-weight: 500; overflow-wrap: anywhere; }
.formTable:not(:has(input:not([type="hidden"]), select, textarea, button)) > tbody > tr.wide { grid-column: 1 / -1; }
.formTable td.blank::before { content: "—"; color: var(--ink-faint); font-weight: 400; }

/* a report's "no results": the system's empty state, without the paragraphs a-report2 writes around it */
p:empty:has(+ .empty), .empty + p:empty { display: none; }

/* a read-only value beside its label in a .formGrid */
.formGrid > .val { display: flex; align-items: center; min-height: var(--ctl); }

/* the page title is the page's h1 */
h1#titleFrame { margin: 0; }

/* the zone drawer toggle is a real control */
#leftFrameHead:focus-visible, #navToggle:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
