/* Paleta e composição do Claro_Intranet (segsing-layout.css e tema.css).
   O escuro é padrão; a impressão usa a paleta clara. */
:root {
    color-scheme: light;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --ink: #243247;
    --heading: #263a5e;
    --muted: #667085;
    --line: #d8e2e9;
    --accent: #087bbd;
    --accent-light: #eef7fd;
    --link: #16598e;
    --soft: #f2f8fc;
    --field-bg: #ffffff;
    --field-ink: #243247;
    --field-border: #cfd9e2;
    --button-bg: #eef3f8;
    --button-ink: #263a5e;
    --button-border: #cfd9e2;
    --button-hover: #e5edf5;
    --primary-bg: #087bbd;
    --primary-border: #087bbd;
    --primary-hover: #075f91;
    --nav-ink: #475467;
    --nav-active-bg: #eef7fd;
    --nav-active-ink: #087bbd;
    --nav-hover: #f8fafc;
    --table-bg: #f2f8fc;
    --table-ink: #475467;
    --row-hover: #fafcff;
    --pending-bg: #fff5e8;
    --pending-ink: #975a16;
    --neutral-bg: #edf2f9;
    --neutral-ink: #475467;
    --tag-bg: #eef7fd;
    --tag-ink: #075f91;
    --shadow: 0 2px 10px rgba(15, 23, 42, .03);
}

@media screen {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --bg: #101925;
        --surface: #192637;
        --ink: #e0e8f4;
        --heading: #e3ecfb;
        --muted: #a9b9cd;
        --line: #35465c;
        --accent: #71c7ff;
        --accent-light: #223a50;
        --link: #86ceff;
        --soft: #213348;
        --field-bg: #111d2c;
        --field-ink: #e3ecf8;
        --field-border: #465c74;
        --button-bg: #26394e;
        --button-ink: #e0eafa;
        --button-border: #465c74;
        --button-hover: #234562;
        --primary-bg: #126a9f;
        --primary-border: #268cc6;
        --primary-hover: #075f91;
        --nav-ink: #d2dfef;
        --nav-active-bg: #234562;
        --nav-active-ink: #a4dcff;
        --nav-hover: #234562;
        --table-bg: #213348;
        --table-ink: #d3e2f4;
        --row-hover: #243b51;
        --pending-bg: #423923;
        --pending-ink: #f5d491;
        --neutral-bg: #223a50;
        --neutral-ink: #a9b9cd;
        --tag-bg: #234562;
        --tag-ink: #b6e2ff;
        --shadow: none;
    }
}

html, body { background: var(--bg); color: var(--ink); }
body { font-family: Inter, "Segoe UI", Arial, sans-serif; line-height: 1.48; -webkit-font-smoothing: antialiased; }
a { color: var(--link); }
h1, h2, h3 { color: var(--heading); font-weight: 800; }
h1 { font-size: 24px; letter-spacing: -.015em; }
h2 { font-size: 20px; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 1001;
    min-height: 92px;
    padding: 12px 24px;
    gap: 20px;
    justify-content: flex-start;
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow);
}
.topbar-segsing { width: 94px; height: 64px; object-fit: contain; flex: none; }
.topbar-claro { width: 56px; height: 56px; object-fit: contain; flex: none; }
.system-brand { flex: 1; min-width: 220px; }
.system-brand strong { display: block; color: var(--heading); font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.system-brand small { font-size: 10.5px; letter-spacing: .1em; line-height: 1.4; color: var(--muted); margin-top: 6px; }
.topbar-actions { gap: 8px; flex-wrap: wrap; }
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 16px; padding: 16px; align-items: start; }
.shell .sidebar {
    position: sticky;
    inset: auto;
    top: 112px;
    width: auto;
    min-width: 0;
    max-height: calc(100vh - 132px);
    padding: 12px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
    z-index: 1;
}
.nav-caption { margin: 3px 14px 12px; padding: 0; font-size: 10px; letter-spacing: .1em; color: var(--muted); text-transform: uppercase; font-weight: 800; }
.sidebar nav { display: grid; gap: 6px; overflow: auto; }
.sidebar .nav-link { min-height: 46px; margin: 0; padding: 12px 14px; border: 0; border-radius: 9px; background: transparent; box-shadow: none; color: var(--nav-ink); font-size: 12.5px; line-height: 1.25; font-weight: 750; }
.sidebar .nav-link:hover { background: var(--nav-hover); color: var(--nav-active-ink); }
.sidebar .nav-link.active { background: var(--nav-active-bg); color: var(--nav-active-ink); box-shadow: none; }
.sidebar-note { margin: 16px 6px 0; padding: 14px 10px 3px; border-top: 1px solid var(--line); color: var(--nav-ink); font-size: 11px; }
.sidebar-note small { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; }
.shell .workspace { margin: 0; min-width: 0; }
.workspace .content { margin: 0; padding: 0; min-width: 0; max-width: none; }
.page-heading { margin: 2px 0 20px; padding: 0 2px; }
.eyebrow { color: var(--muted); font-size: 10px; letter-spacing: .1em; margin-bottom: 6px; }
.page-heading p:not(.eyebrow) { margin-top: 6px; font-size: 12px; }
.stats { gap: 12px; margin-bottom: 20px; }
.stat { padding: 18px; min-height: 126px; border-radius: 12px; }
.stat-top { font-size: 12px; line-height: 1.3; }
.stat-icon { background: var(--accent-light); color: var(--accent); }
.stat-number { color: var(--heading); font-size: 30px; font-weight: 800; }
.stat small { font-size: 11px; }
a.stat:hover { background: var(--nav-active-bg); border-color: var(--field-border); transform: none; }
.field > label { font-size: 12px; font-weight: 700; color: var(--nav-ink); }
.pill { background: var(--tag-bg); color: var(--tag-ink); border-radius: 999px; font-size: 10.5px; }
.pill.pending { background: var(--pending-bg); color: var(--pending-ink); }
.pill.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
.summary-strip, .callout, .empty-state, .step { background: var(--soft); border-color: var(--line); }
.step-number { background: var(--tag-bg); color: var(--tag-ink); }
.table-wrap { border-color: var(--line); }
.data-table { font-size: 12px; }
.data-table th { background: var(--table-bg); color: var(--table-ink); font-size: 11px; padding: 10px 11px; font-weight: 800; }
.data-table td { padding: 11px; border-color: var(--line); }
.data-table td small { font-size: 10.5px; }
.data-table tbody tr:hover td { background: var(--row-hover); }
.chart-bar, .legend span:before { background: #1a5c91; }
.chart-bar.secondary, .legend span:nth-child(2):before { background: #cf392d; }
.equipment-map { border-color: var(--line); background: repeating-linear-gradient(35deg, transparent 0, transparent 80px, var(--line) 81px, var(--line) 84px, transparent 85px), var(--soft); }
.header-format > label { color: var(--muted); }

/* Inclui os overlays anexados ao body pelo PrimeFaces. */
body .ui-widget { font-family: inherit; font-size: 14px; }
body .ui-widget-content { color: var(--ink); border-color: var(--line); }
body .ui-panel { background: var(--surface); color: var(--ink); border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 16px; padding: 20px; }
body .ui-panel .ui-panel-titlebar { color: var(--heading); font-size: 20px; line-height: 1.25; font-weight: 800; background: transparent; border: 0; padding: 0; margin: 0 0 16px; }
body .ui-panel .ui-panel-titlebar .ui-panel-title { display: block; float: none; margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; }
/* O contorno pertence ao painel externo, sem uma segunda borda no conteúdo. */
body .ui-panel .ui-panel-content { background: var(--surface); color: var(--ink); border: 0; border-radius: 0; padding: 0; }
body .ui-button { min-height: 40px; border-radius: 9px; font-size: 12px; line-height: 1.2; font-weight: 700; padding: 0; vertical-align: middle; }
body .ui-button.ui-button-text-only .ui-button-text { padding: 9px 14px; font-size: 12px; line-height: 1.2; font-weight: 700; }
body .ui-button.ui-button-text-icon-left .ui-button-text { padding: 9px 14px 9px 32px; font-size: 12px; line-height: 1.2; }
body .ui-button.ui-button-text-icon-right .ui-button-text { padding: 9px 32px 9px 14px; font-size: 12px; line-height: 1.2; }
body .ui-button.ui-button-icon-only { width: 40px; }
body .ui-button.ui-button-icon-only .ui-button-text { padding: 9px; line-height: 1.2; }
body .ui-button:not(.ui-button-outlined):not(.ui-button-flat):not(.ui-button-secondary) { color: #fff; background: var(--primary-bg); border-color: var(--primary-border); }
body .ui-button:not(.ui-button-outlined):not(.ui-button-flat):not(.ui-button-secondary):hover { background: var(--primary-hover); }
body .ui-button.ui-button-secondary, body .ui-button.ui-button-outlined, body .ui-button.ui-button-flat { background: var(--button-bg); color: var(--button-ink); border: 1px solid var(--button-border); }
body .ui-button.ui-button-secondary:hover, body .ui-button.ui-button-outlined:hover, body .ui-button.ui-button-flat:hover { background: var(--button-hover); color: var(--nav-active-ink); border-color: var(--field-border); }
body .ui-button.ui-state-disabled { opacity: .45; }
body .ui-inputfield, body .ui-selectonemenu, body .field .ui-selectonemenu, body .ui-selectonemenu .ui-selectonemenu-label, body .ui-selectonemenu .ui-selectonemenu-trigger {
    background: var(--field-bg); color: var(--field-ink); border-color: var(--field-border); border-radius: 9px;
}
body .ui-inputfield { min-height: 42px; padding: 9px 11px; font-size: 13px; font-weight: 400; line-height: 1.35; }
body .ui-inputfield::placeholder { color: var(--muted); opacity: .85; }
body .ui-inputfield:focus, body .ui-selectonemenu.ui-state-focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-light); }
body .ui-selectonemenu-panel, body .ui-selectonemenu-panel .ui-selectonemenu-items-wrapper, body .ui-selectonemenu-panel .ui-selectonemenu-filter-container { background: var(--surface); color: var(--ink); border-color: var(--line); }
body .ui-selectonemenu-panel .ui-selectonemenu-items .ui-selectonemenu-item { color: var(--ink); background: transparent; }
body .ui-selectonemenu-panel .ui-selectonemenu-items .ui-selectonemenu-item.ui-state-hover,
body .ui-selectonemenu-panel .ui-selectonemenu-items .ui-selectonemenu-item.ui-state-highlight { background: var(--nav-active-bg); color: var(--nav-active-ink); }
body .ui-tabs, body .ui-tabs .ui-tabs-panels { background: var(--surface); color: var(--ink); border-color: var(--line); }
body .ui-tabs .ui-tabs-nav { background: var(--surface); border-color: var(--line); }
body .ui-tabs .ui-tabs-nav li { background: var(--button-bg); border-color: var(--button-border); border-radius: 9px 9px 0 0; }
body .ui-tabs .ui-tabs-nav li a { color: var(--button-ink); font-weight: 700; }
body .ui-tabs .ui-tabs-nav li.ui-tabs-selected { background: var(--primary-bg); border-color: var(--primary-border); }
body .ui-tabs .ui-tabs-nav li.ui-tabs-selected a { color: #fff; }
body .ui-dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; }
body .ui-dialog .ui-dialog-content, body .ui-dialog .ui-dialog-titlebar { background: var(--surface); color: var(--ink); border-color: var(--line); }
body .ui-dialog .ui-dialog-titlebar-icon { color: var(--ink); }
body .ui-datepicker .ui-datepicker-panel, body .ui-datepicker .ui-datepicker-header,
body .ui-datepicker-panel .ui-datepicker-header, body .ui-datepicker-panel {
    background: var(--surface); color: var(--ink); border-color: var(--line);
}
body .ui-datepicker .ui-datepicker-calendar td a, body .ui-datepicker-panel .ui-datepicker-calendar td a { color: var(--ink); background: transparent; }
body .ui-datepicker .ui-datepicker-calendar td a:hover, body .ui-datepicker-panel .ui-datepicker-calendar td a:hover { background: var(--nav-active-bg); color: var(--nav-active-ink); }
body .ui-datepicker .ui-datepicker-calendar td a.ui-state-active, body .ui-datepicker-panel .ui-datepicker-calendar td a.ui-state-active { background: var(--primary-bg); color: #fff; }
body .ui-datepicker .ui-datepicker-title select, body .ui-datepicker-panel .ui-datepicker-title select { background: var(--field-bg); color: var(--field-ink); border-color: var(--field-border); }
body .ui-datepicker .ui-datepicker-prev, body .ui-datepicker .ui-datepicker-next, body .ui-datepicker-panel .ui-datepicker-prev, body .ui-datepicker-panel .ui-datepicker-next { color: var(--ink); }
body .ui-datepicker .ui-datepicker-calendar th, body .ui-datepicker-panel .ui-datepicker-calendar th { color: var(--muted); }
body .ui-datepicker .ui-datepicker-title, body .ui-datepicker-panel .ui-datepicker-title { color: var(--heading); }
body .ui-chkbox .ui-chkbox-box { background: var(--field-bg); border-color: var(--field-border); }
body .ui-chkbox .ui-chkbox-box.ui-state-active { background: var(--primary-bg); border-color: var(--primary-border); color: #fff; }
body .ui-selectbooleancheckbox-label { color: var(--nav-ink); }

/* Medidas de segsing-layout.css, sem somar o padding nativo do PrimeFaces. */
html { font-size: 16px; }
h1 { margin: 0; line-height: 1.25; }
.fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 0 0 16px; }
.field { flex: 0 1 auto; min-width: 150px; max-width: 100%; gap: 6px; }
.field > label { line-height: 1.3; }
.field.search-field { flex: 1; min-width: 200px; }
.field.wide { flex-basis: 100%; }
.field .ui-inputtext { width: 220px; max-width: 100%; }
.field.search-field .ui-inputtext { width: 100%; }
.field .ui-selectonemenu { width: auto; min-width: 170px !important; max-width: 100%; min-height: 42px; padding: 0; }
body .ui-selectonemenu .ui-selectonemenu-label { min-height: 40px; padding: 9px 34px 9px 11px; font-size: 13px; line-height: 1.35; }
body .ui-selectonemenu .ui-selectonemenu-trigger { width: 30px; }
.field .ui-datepicker { display: inline-flex; width: 180px; max-width: 100%; }
.field .ui-datepicker input { width: calc(100% - 34px); min-width: 0; }
body .field .ui-datepicker-trigger.ui-button { width: 34px; min-width: 34px; min-height: 42px; }
.field.short-field { min-width: 120px; }
.field.short-field .ui-inputtext { width: 155px; }
.field.address-field .ui-inputtext { width: 410px; }
.actions { gap: 12px; align-items: flex-end; margin: 0 0 16px; }
.actions:last-child { margin-bottom: 0; }
.inline-checks { column-gap: 24px; row-gap: 12px; margin-bottom: 16px; }
/* O componente inclui caixa e rótulo: apenas a caixa tem largura fixa. */
body .ui-chkbox { display: inline-flex; align-items: center; gap: 8px; width: auto; height: auto; flex: 0 0 auto; margin: 0; vertical-align: middle; }
body .ui-chkbox .ui-chkbox-box { width: 18px; min-width: 18px; height: 18px; flex: 0 0 18px; }
body .ui-chkbox .ui-chkbox-box .ui-chkbox-icon { width: 12px; height: 12px; font-size: 12px; line-height: 12px; top: 50%; left: 50%; margin: 0; transform: translate(-50%, -50%); }
body .ui-chkbox .ui-chkbox-label,
body .ui-chkbox > label,
body .ui-selectbooleancheckbox-label { margin: 0; padding: 0; font-size: 12px; line-height: 18px; color: var(--nav-ink); white-space: nowrap; cursor: pointer; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats.metrics-top { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stats.closing-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats.finance-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { min-width: 0; }
.stat-top { display: block; font-weight: 400; }
.stat-number { line-height: 1.48; margin: 9px 0 5px; letter-spacing: normal; }
.closing-cards .stat-number { font-size: 32px; }
.finance-cards .stat-number { font-size: clamp(22px, 2.2vw, 30px); }
.stat small { line-height: 1.45; }
.two-columns { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 22px; }
.page-overview .two-columns { display: block; }
.section-note, .muted { font-size: 12px; line-height: 1.5; }
.table-wrap { margin: 16px 0 0; max-height: 640px; border: 0; border-radius: 0; }
.data-table { white-space: normal; }
.data-table caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.data-table th { position: sticky; top: 0; z-index: 1; letter-spacing: .02em; }
.data-table td { min-width: 95px; line-height: 1.45; vertical-align: top; }
.data-table td:first-child { font-weight: 400; }
.data-table td small { max-width: 340px; margin-top: 4px; line-height: 1.4; }
.pill { margin: 2px 4px 2px 0; font-weight: 600; }
body .ui-tabs { padding: 0; }
body .ui-tabs .ui-tabs-nav { gap: 8px; padding: 0; border: 0; margin: 0 0 18px; }
body .ui-tabs .ui-tabs-nav li { margin: 0; border: 1px solid var(--button-border); border-radius: 9px; }
body .ui-tabs .ui-tabs-nav li a { padding: 9px 14px; min-height: 38px; font-size: 12px; line-height: 1.2; }
body .ui-tabs .ui-tabs-panel { padding: 0; }
body .ui-dialog { max-width: calc(100vw - 32px); }
body .ui-dialog .ui-dialog-titlebar { padding: 26px 26px 16px; border: 0; }
body .ui-dialog .ui-dialog-titlebar .ui-dialog-title { font-size: 20px; line-height: 1.25; }
body .ui-dialog .ui-dialog-content { padding: 0 26px 26px; }
body .ui-dialog .fields { display: grid; grid-template-columns: minmax(0, 1fr); }
body .ui-dialog .field .ui-inputfield, body .ui-dialog .field .ui-selectonemenu, body .ui-dialog .field .ui-datepicker { width: 100%; }
.dialog-actions { gap: 12px; margin-top: 16px; }
.header-format { flex-direction: column; align-items: stretch; gap: 4px; }
.header-format > label { display: block; font-size: 10.5px; line-height: 1.2; }
.header-format .ui-selectonemenu { min-height: 36px; padding: 0; }
body .header-format .ui-selectonemenu .ui-selectonemenu-label { min-height: 34px; padding: 7px 30px 7px 10px; font-size: 12px !important; line-height: 1.35; }
.page-footer { margin-top: 16px; padding: 16px 0; }

@media (min-width: 1001px) {
    .topbar { height: 92px; }
}
@media (max-width: 1400px) {
    .stats.metrics-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1150px) {
    .two-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1100px) {
    .stats.finance-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen {
    [data-theme="dark"] .topbar-segsing { background: #fff; border-radius: 7px; padding: 4px; }
}
@media (max-width: 1200px) {
    .shell { grid-template-columns: 215px minmax(0, 1fr); }
    .sidebar .nav-link { font-size: 12px; padding: 13px 12px; }
    .topbar { gap: 14px; padding-left: 18px; padding-right: 18px; }
    .system-brand strong { font-size: 20px; }
    .topbar-segsing { width: 80px; height: 56px; }
    .topbar-claro { width: 48px; height: 48px; }
}
@media (max-width: 1000px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .shell .sidebar { position: static; top: auto; max-height: none; padding: 10px; }
    .sidebar nav { display: flex; overflow-x: auto; }
    .sidebar .nav-link { white-space: nowrap; flex: none; min-height: 44px; padding: 12px 14px; }
    .nav-caption, .sidebar-note { display: none; }
    .topbar { position: static; flex-wrap: wrap; min-height: 76px; }
    .topbar-actions { flex-basis: 100%; justify-content: flex-end; }
}
@media (max-width: 650px) {
    .shell { padding: 10px; gap: 14px; }
    .topbar { padding: 10px 14px; gap: 10px; }
    .system-brand { min-width: 150px; }
    .system-brand strong { font-size: 18px; }
    .system-brand small { font-size: 9px; letter-spacing: .04em; }
    .topbar-segsing { width: 65px; height: 46px; }
    .topbar-claro { width: 38px; height: 38px; }
    .topbar-actions { justify-content: flex-start; }
    .header-format { flex-wrap: wrap; }
    .topbar-actions > .ui-button { flex: 1; min-width: 105px; }
    .header-format { flex-basis: 100%; }
    .header-format .ui-selectonemenu { width: 100%; }
    h1 { font-size: 22px; }
    h2, body .ui-panel .ui-panel-titlebar, body .ui-panel .ui-panel-titlebar .ui-panel-title { font-size: 18px; }
    body .ui-panel { padding: 16px; }
    .stats, .stats.metrics-top, .stats.closing-cards, .stats.finance-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat { padding: 14px; min-height: 115px; }
    .stat-number, .closing-cards .stat-number { font-size: 27px; }
    .finance-cards .stat-number { font-size: 23px; }
    .fields { gap: 12px; }
    .field, .field.search-field { flex-basis: 100%; min-width: 0; width: 100%; }
    .field .ui-inputtext, .field .ui-selectonemenu, .field .ui-datepicker, .field.address-field .ui-inputtext { width: 100%; }
    .field.short-field .ui-inputtext { width: 155px; }
}
@media (max-width: 520px) {
    .stats.finance-cards { grid-template-columns: minmax(0, 1fr); }
}
@media print {
    .shell { display: block; padding: 0; }
    .shell .sidebar { display: none; }
    .ui-panel, .stat { box-shadow: none; }
    .table-wrap { max-height: none; overflow: visible; }
    .data-table th { position: static; }
}
