:root {
    --accent:#d89232;
    --accent-soft:#fff1d6;
    --success:#2f8f4e;
    --success-soft:#e8f7ed;
    --info-soft:#e8f3f8;
    --danger-soft:#ffe7df;
    --surface-glass:rgba(255,253,248,.78);
    --surface-strong:#fffaf0;
    --ring:0 0 0 4px rgba(47,143,78,.13);
    --chrome:rgba(13,25,17,.88);
}

body[data-theme="terra"] {
    --primary:#1f6446;
    --primary-strong:#174a34;
    --primary-soft:#e4f1e7;
    --dark:#101812;
    --dark-2:#18231b;
    --accent:#d89232;
    --accent-soft:#fff1d6;
    --line:#d8cab4;
    --line-strong:#bfa783;
    background:
        radial-gradient(circle at 20% 0%, rgba(31,100,70,.14), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(216,146,50,.12), transparent 28%),
        linear-gradient(135deg,#f7f0e5,#e7dcc9 62%,#efe7d9);
}

body[data-theme="industria"] {
    --primary:#275f72;
    --primary-strong:#173d4c;
    --primary-soft:#e4f0f4;
    --dark:#101820;
    --dark-2:#182531;
    --accent:#dd8b2d;
    --accent-soft:#fff0dc;
    --success:#2d8b62;
    --line:#c8d1d3;
    --line-strong:#9fb0b5;
    background:
        radial-gradient(circle at 18% 0%, rgba(39,95,114,.18), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(221,139,45,.13), transparent 28%),
        linear-gradient(135deg,#eef3f3,#d8e1e2 58%,#eef0e8);
}

body[data-theme="grafite"] {
    --primary:#7b5b39;
    --primary-strong:#463523;
    --primary-soft:#f0e8de;
    --dark:#111111;
    --dark-2:#22201d;
    --accent:#c77b12;
    --accent-soft:#fff0d6;
    --success:#3e8a54;
    --line:#d4c8b7;
    --line-strong:#b9a890;
    background:
        radial-gradient(circle at 18% 0%, rgba(123,91,57,.15), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(199,123,18,.14), transparent 28%),
        linear-gradient(135deg,#ece7df,#d9d0c2 58%,#eee8df);
}

body[data-theme="safira"] {
    --primary:#235c84;
    --primary-strong:#173d5a;
    --primary-soft:#e4eef6;
    --dark:#0e1720;
    --dark-2:#142232;
    --accent:#2f9a6b;
    --accent-soft:#def5e9;
    --success:#2f8f6a;
    --line:#c6d2dd;
    --line-strong:#9badbd;
    background:
        radial-gradient(circle at 18% 0%, rgba(35,92,132,.19), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(47,154,107,.13), transparent 28%),
        linear-gradient(135deg,#edf4f8,#d7e3eb 58%,#eef3ee);
}

body[data-theme="noturno"] {
    color-scheme:dark;
    --bg:#07120e;
    --panel:#111d17;
    --panel-strong:#16261f;
    --surface-glass:rgba(17,29,23,.88);
    --surface-strong:#16261f;
    --text:#edf8f0;
    --muted:#9fb0a5;
    --primary:#74d58a;
    --primary-strong:#3fa963;
    --primary-soft:#142a1f;
    --dark:#050a08;
    --dark-2:#0b1712;
    --accent:#f0b85a;
    --accent-soft:#332611;
    --success:#77df91;
    --success-soft:#12351f;
    --info:#79b8df;
    --info-soft:#102b3d;
    --danger:#f07d66;
    --danger-soft:#3b1712;
    --line:rgba(151,185,160,.26);
    --line-strong:rgba(151,185,160,.46);
    --shadow:0 22px 58px rgba(0,0,0,.42);
    --shadow-soft:0 14px 38px rgba(0,0,0,.34);
    background:
        radial-gradient(circle at 18% 0%, rgba(116,213,138,.16), transparent 30%),
        radial-gradient(circle at 92% 8%, rgba(240,184,90,.10), transparent 28%),
        linear-gradient(135deg,#07120e,#0d1814 58%,#111512);
}

body {
    font-feature-settings:"ss01" 1, "liga" 1;
}

body::before {
    content:"";
    position:fixed;
    inset:auto -12vw -18vh auto;
    width:46vw;
    height:46vw;
    border-radius:999px;
    pointer-events:none;
    background:radial-gradient(circle, rgba(31,100,70,.12), transparent 62%);
    filter:blur(4px);
}

.page-read-progress {
    position:fixed;
    z-index:999;
    inset:0 0 auto 0;
    height:4px;
    transform:scaleX(0);
    transform-origin:left;
    background:linear-gradient(90deg,var(--primary),#74b97e,var(--accent));
    box-shadow:0 0 22px rgba(47,143,78,.34);
    pointer-events:none;
}

.sidebar {
    scrollbar-width:thin;
    scrollbar-color:rgba(255,255,255,.28) transparent;
}

.sidebar::after {
    content:"";
    position:sticky;
    bottom:0;
    display:block;
    height:48px;
    margin:18px -16px -26px;
    background:linear-gradient(180deg,transparent,rgba(11,18,13,.94));
    pointer-events:none;
}

.sidebar h1::after {
    content:"";
    display:block;
    width:58px;
    height:4px;
    margin-top:12px;
    border-radius:999px;
    background:linear-gradient(90deg,#68b47d,var(--accent));
    box-shadow:0 0 24px rgba(104,180,125,.35);
}

.sidebar-brand {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:22px;
}

.sidebar-brand-copy {
    min-width:0;
    transition:opacity .18s ease, width .18s ease;
}

.sidebar-toggle-button {
    flex:0 0 auto;
    display:grid;
    justify-items:center;
    gap:2px;
    min-width:50px;
    padding:8px 9px;
    border:1px solid rgba(255,255,255,.16);
    border-radius:14px;
    background:rgba(255,255,255,.075);
    color:#fff7eb;
    box-shadow:0 10px 22px rgba(0,0,0,.18);
}

.sidebar-toggle-button:hover {
    transform:translateY(-1px);
    background:rgba(255,255,255,.12);
    border-color:rgba(255,255,255,.26);
}

.sidebar-toggle-icon {
    font-weight:950;
    letter-spacing:-.08em;
}

.sidebar-toggle-label {
    font-size:.68rem;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:rgba(255,255,255,.62);
}

.sidebar a {
    position:relative;
    min-height:42px;
}

.sidebar a::before {
    content:"";
    width:8px;
    height:8px;
    border-radius:999px;
    background:rgba(255,255,255,.20);
    box-shadow:0 0 0 4px rgba(255,255,255,.035);
}

.sidebar a.active::before {
    background:#8be29d;
    box-shadow:0 0 0 4px rgba(139,226,157,.12),0 0 22px rgba(139,226,157,.42);
}

.sidebar-section {
    position:relative;
}

.sidebar-section::after {
    content:"";
    position:absolute;
    inset:auto 10px -8px;
    height:1px;
    background:linear-gradient(90deg,transparent,rgba(255,255,255,.12),transparent);
}

.main {
    max-width:1780px;
    width:100%;
}

.topbar {
    position:sticky;
    top:14px;
    z-index:180;
    border:1px solid rgba(31,100,70,.34) !important;
    background:
        linear-gradient(135deg,rgba(255,253,248,.99),rgba(255,248,235,.96)),
        radial-gradient(circle at 0% 0%,rgba(31,100,70,.12),transparent 42%);
    box-shadow:0 26px 64px rgba(18,25,19,.22),0 0 0 1px rgba(255,255,255,.62) inset !important;
    overflow:hidden;
}

.topbar::before {
    content:"";
    position:absolute;
    inset:0;
    border-radius:inherit;
    pointer-events:none;
    background:linear-gradient(120deg,rgba(255,255,255,.52),transparent 34%,rgba(216,146,50,.08));
}

.topbar::after {
    content:"";
    position:absolute;
    inset:auto 18px 0;
    height:5px;
    border-radius:999px 999px 0 0;
    background:linear-gradient(90deg,var(--primary),var(--accent),transparent);
    opacity:.72;
}

.topbar > * {
    position:relative;
    z-index:1;
}

.theme-cycle-button {
    border-color:rgba(31,100,70,.20);
    background:linear-gradient(180deg,#f7fff7,#edf7ef);
}

.theme-cycle-button span {
    margin-left:6px;
    padding:3px 8px;
    border-radius:999px;
    background:var(--primary);
    color:white;
    font-size:.72rem;
    font-weight:950;
}

.shell-command-button span {
    margin-left:6px;
    padding:3px 7px;
    border-radius:999px;
    background:rgba(31,100,70,.08);
    color:#1c5d3f;
    font-size:.72rem;
    font-weight:950;
}

.shell-focus-button {
    border-color:#bddabf;
    background:linear-gradient(180deg,#f8fff7,#edf8ef);
}

.quick-action-bar {
    position:sticky;
    top:98px;
    z-index:170;
    border:1px solid rgba(31,100,70,.34) !important;
    background:
        linear-gradient(135deg,rgba(255,253,248,.98),rgba(255,248,235,.94)),
        radial-gradient(circle at 0% 50%,rgba(47,143,78,.10),transparent 38%);
    box-shadow:0 22px 56px rgba(18,25,19,.18),0 0 0 1px rgba(255,255,255,.56) inset !important;
}

.quick-action-bar::before {
    content:"";
    width:10px;
    height:10px;
    border-radius:999px;
    background:var(--success);
    box-shadow:0 0 0 5px rgba(47,143,78,.12),0 0 24px rgba(47,143,78,.34);
}

.quick-action-bar .button {
    border-color:rgba(31,100,70,.14);
}

.quick-action-bar .button:hover {
    background:#eef8ef;
}

.quick-action-label {
    color:var(--primary) !important;
}

.logout-form {
    display:inline-flex;
}

.shutdown-form {
    display:inline-flex;
}

.shutdown-button {
    border-color:rgba(185,63,49,.32);
    background:linear-gradient(135deg,#b93f31,#7b241c);
    color:white;
    box-shadow:0 10px 24px rgba(185,63,49,.18);
}

.logout-button {
    border-color:rgba(185,63,49,.24);
    background:linear-gradient(180deg,#fff9f5,#fff0e8);
    color:#7f2d1f;
}

.topbar strong {
    letter-spacing:-.02em;
}

.app-top-shell {
    position:sticky;
    top:14px;
    z-index:260;
    display:grid;
    gap:0;
    margin-bottom:20px;
}

.app-top-shell .topbar {
    position:relative;
    top:auto;
    margin-bottom:0;
    display:grid;
    grid-template-columns:minmax(170px,auto) minmax(420px,1fr) auto;
    align-items:center;
    gap:12px;
    padding:8px 10px;
    border-radius:22px 22px 0 0;
}

.topbar-nav-row {
    position:relative;
    z-index:240;
    display:grid;
    grid-template-columns:1fr;
    gap:10px;
    align-items:center;
    padding:7px 10px;
    border:1px solid rgba(31,100,70,.24);
    border-top:0;
    border-radius:0 0 20px 20px;
    background:
        linear-gradient(135deg,rgba(255,253,248,.94),rgba(255,248,235,.88)),
        radial-gradient(circle at 100% 0,rgba(31,100,70,.10),transparent 42%);
    box-shadow:0 16px 42px rgba(18,25,19,.14),0 0 0 1px rgba(255,255,255,.52) inset;
    backdrop-filter:blur(14px);
}

.topbar-identity {
    display:grid;
    gap:3px;
    min-width:154px;
    padding:6px 8px;
    border-radius:16px;
    background:rgba(255,253,248,.52);
    border:1px solid rgba(31,100,70,.13);
}

.topbar-identity strong {
    font-size:.92rem;
    line-height:1.05;
}

.topbar-identity .topbar-meta {
    gap:5px;
    margin-top:0;
    font-size:.72rem;
}

.topbar-identity .badge,
.topbar-identity .muted {
    padding:3px 7px;
    font-size:.68rem;
}

.topbar-nav-row:empty {
    display:none;
}

.topbar-nav-row .breadcrumbs,
.topbar-nav-row .quick-action-bar {
    margin:0;
    border:0;
    box-shadow:none;
    background:transparent;
    backdrop-filter:none;
}

.primary-shortcuts {
    display:flex;
    gap:6px;
    align-items:center;
    min-width:0;
    overflow-x:auto;
    scrollbar-width:thin;
}

.primary-shortcut {
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:34px;
    padding:7px 11px;
    border-radius:999px;
    border:1px solid rgba(31,100,70,.18);
    background:rgba(255,253,248,.76);
    color:var(--primary);
    text-decoration:none;
    font-size:.86rem;
    font-weight:900;
    letter-spacing:.01em;
    box-shadow:0 6px 14px rgba(18,25,19,.06);
}

.primary-shortcut:hover {
    background:#eff8f0;
    border-color:rgba(31,100,70,.32);
    transform:translateY(-1px);
}

.primary-shortcut.primary {
    color:white;
    border-color:var(--primary);
    background:linear-gradient(135deg,var(--primary),var(--primary-strong));
}

.primary-shortcut.recent-link {
    max-width:128px;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#5a654f;
    border-style:dashed;
}

.primary-shortcut.recent-link:not(.is-empty) {
    color:#174b31;
    border-style:solid;
    background:#f5fbf5;
}

.topbar-control-grid {
    display:grid !important;
    grid-template-columns:repeat(2, minmax(58px, 1fr));
    gap:5px;
    flex:0 0 auto;
}

.topbar-control-grid .inline-form {
    display:block;
}

.topbar-control-grid .button,
.topbar-control-grid button {
    width:100%;
}

.topbar-icon-button,
.topbar-control-grid .button,
.topbar-control-grid button {
    min-height:30px;
    padding:5px 8px;
    border-radius:10px;
    font-size:.75rem;
    white-space:nowrap;
}

.shell-command-button {
    display:inline-flex;
    align-items:center;
    gap:6px;
}

.command-icon {
    position:relative;
    display:inline-block;
    width:14px;
    height:14px;
    flex:0 0 14px;
}

.command-icon::before {
    content:"";
    position:absolute;
    inset:1px 3px 3px 1px;
    border:2px solid var(--primary);
    border-radius:999px;
}

.command-icon::after {
    content:"";
    position:absolute;
    right:0;
    bottom:1px;
    width:7px;
    height:2px;
    border-radius:999px;
    background:var(--primary);
    transform:rotate(45deg);
    transform-origin:center;
}

.instrument-photo-thumb {
    width:52px;
    height:42px;
    object-fit:cover;
    border-radius:12px;
    border:1px solid rgba(31,100,70,.20);
    background:#f8f4eb;
    box-shadow:0 6px 16px rgba(18,25,19,.10);
}

.instrument-photo-empty {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:52px;
    min-height:34px;
    padding:5px 8px;
    border-radius:12px;
    border:1px dashed rgba(31,100,70,.24);
    color:var(--muted);
    font-size:.74rem;
    font-weight:800;
    background:#fbf8f1;
}

.instrument-hero-main {
    display:flex;
    align-items:center;
    gap:16px;
    min-width:0;
}

.instrument-hero-photo {
    width:118px;
    height:92px;
    flex:0 0 118px;
    display:grid;
    place-items:center;
    overflow:hidden;
    border-radius:22px;
    border:1px solid rgba(31,100,70,.20);
    background:
        radial-gradient(circle at 20% 10%,rgba(31,100,70,.14),transparent 36%),
        linear-gradient(135deg,#fffdf8,#f0eadf);
    color:var(--muted);
    font-size:.82rem;
    font-weight:900;
    box-shadow:0 12px 28px rgba(18,25,19,.12);
}

.instrument-hero-photo img {
    width:100%;
    height:100%;
    object-fit:cover;
}

.topbar-nav-row .breadcrumbs {
    min-width:0;
    padding:0;
    flex-wrap:nowrap;
    overflow:visible;
    scrollbar-width:thin;
}

.topbar-nav-row .quick-action-bar {
    justify-content:flex-end;
    padding:0;
    flex-wrap:nowrap;
    overflow-x:auto;
    scrollbar-width:thin;
}

.topbar-nav-row .quick-action-bar:only-child {
    grid-column:1 / -1;
}

.topbar-nav-row .quick-action-bar .button,
.topbar-nav-row .quick-action-bar button,
.topbar-nav-row .breadcrumb-chip {
    white-space:nowrap;
    padding:8px 11px;
}

.sidebar a::before {
    content:"•";
    width:28px;
    height:28px;
    flex:0 0 28px;
    display:grid;
    place-items:center;
    border-radius:12px;
    font-size:1rem;
    line-height:1;
    background:linear-gradient(135deg,rgba(255,255,255,.13),rgba(255,255,255,.035));
    box-shadow:0 0 0 1px rgba(255,255,255,.08) inset,0 8px 18px rgba(0,0,0,.14);
}

.sidebar a.active::before {
    background:linear-gradient(135deg,#eaffef,#7dd994);
    color:#123b27;
    box-shadow:0 0 0 4px rgba(139,226,157,.12),0 0 22px rgba(139,226,157,.42);
}

.sidebar a[href="/"]::before { content:"⌂"; }
.sidebar a[href*="layout-fabrica"]::before { content:"▣"; }
.sidebar a[href*="setores"]::before { content:"◇"; }
.sidebar a[href="/maquinas/"]::before { content:"⚙"; }
.sidebar a[href*="cronograma"]::before { content:"◷"; }
.sidebar a[href="/os/"]::before { content:"✎"; }
.sidebar a[href*="execucoes"]::before { content:"✓"; }
.sidebar a[href*="planos"]::before { content:"▤"; }
.sidebar a[href*="dias-nao-uteis"]::before { content:"⊘"; }
.sidebar a[href*="modelos"]::before { content:"⬡"; }
.sidebar a[href*="produtos"]::before { content:"▦"; }
.sidebar a[href*="ferramentais"]::before { content:"⌘"; }
.sidebar a[href="/instrumentos/"]::before { content:"⌖"; }
.sidebar a[href*="calibracoes"]::before { content:"◉"; }
.sidebar a[href*="msa"]::before { content:"△"; }
.sidebar a[href*="historico"]::before { content:"◴"; }
.sidebar a[href*="auditoria"]::before { content:"◈"; }
.sidebar a[href*="importacao"]::before { content:"⇅"; }
.sidebar a[href*="usuarios"]::before { content:"♙"; }
.sidebar a[href*="admin"]::before { content:"⚒"; }

.panel,
.stat,
li.item,
.machine-card,
.os-mini-card {
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.panel:hover,
.stat:hover,
li.item:hover,
.machine-card:hover,
.os-mini-card:hover {
    border-color:rgba(31,100,70,.18);
}

.panel h2,
.panel h3,
.panel h4 {
    text-wrap:balance;
}

.main > section,
.main > form,
.main > div:not(.topbar):not(.quick-action-bar) {
    animation:finish-rise .34s ease both;
}

@keyframes finish-rise {
    from {
        opacity:0;
        transform:translateY(10px);
    }
    to {
        opacity:1;
        transform:translateY(0);
    }
}

.panel:hover,
.stat:hover,
.machine-card:hover,
.os-mini-card:hover {
    border-color:rgba(31,100,70,.24);
    box-shadow:0 18px 42px rgba(20,26,20,.10);
}

.elevated-panel {
    position:relative;
    overflow:hidden;
    background:
        radial-gradient(circle at 0 0, rgba(216,146,50,.10), transparent 32%),
        linear-gradient(135deg,rgba(255,253,248,.94),rgba(255,248,235,.88));
}

.elevated-panel::after {
    content:"";
    position:absolute;
    right:-70px;
    top:-90px;
    width:220px;
    height:220px;
    border-radius:999px;
    background:linear-gradient(135deg,rgba(31,100,70,.13),rgba(216,146,50,.10));
    pointer-events:none;
}

.section-heading {
    position:relative;
    z-index:1;
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:16px;
    margin-bottom:16px;
}

.section-heading h2,
.section-heading h3 {
    margin:2px 0 4px;
}

.eyebrow {
    display:inline-flex;
    align-items:center;
    gap:8px;
    color:#1c5d3f;
    font-size:.75rem;
    font-weight:950;
    letter-spacing:.13em;
    text-transform:uppercase;
}

.eyebrow::before {
    content:"";
    width:22px;
    height:2px;
    border-radius:999px;
    background:linear-gradient(90deg,var(--primary),var(--accent));
}

.hero-finish {
    position:relative;
    overflow:hidden;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:20px;
    align-items:center;
    min-height:188px;
    padding:26px;
    border:1px solid rgba(31,100,70,.18);
    border-radius:30px;
    background:
        radial-gradient(circle at 12% 20%, rgba(104,180,125,.22), transparent 34%),
        radial-gradient(circle at 92% 10%, rgba(216,146,50,.18), transparent 30%),
        linear-gradient(135deg,#fffdf8,#f4ead8 64%,#e9f2e7);
    box-shadow:0 26px 60px rgba(20,26,20,.14);
}

.hero-finish::before {
    content:"";
    position:absolute;
    inset:18px;
    border:1px solid rgba(255,255,255,.72);
    border-radius:24px;
    pointer-events:none;
}

.hero-finish h2 {
    margin:6px 0 8px;
    max-width:850px;
    font-size:clamp(2rem,4vw,4rem);
    line-height:.95;
    letter-spacing:-.06em;
}

.hero-finish h2,
.sector-hero-main h2,
.panel h2 {
    text-wrap:balance;
}

.hero-finish p {
    max-width:780px;
    margin:0;
    color:#536058;
    font-size:1.05rem;
    line-height:1.5;
}

.hero-finish-actions {
    position:relative;
    z-index:1;
    display:grid;
    gap:10px;
    min-width:190px;
}

.hero-finish-import::after {
    content:"XLSX";
    position:absolute;
    right:22px;
    bottom:8px;
    color:rgba(31,100,70,.065);
    font-size:5.8rem;
    line-height:1;
    font-weight:950;
    letter-spacing:-.08em;
}

.button.glass {
    background:rgba(255,255,255,.50);
    backdrop-filter:blur(12px);
}

.button,
button {
    position:relative;
    overflow:hidden;
}

.button::after,
button::after {
    content:"";
    position:absolute;
    inset:0;
    opacity:0;
    background:linear-gradient(120deg,transparent,rgba(255,255,255,.42),transparent);
    transform:translateX(-100%);
    transition:opacity .2s ease, transform .55s ease;
    pointer-events:none;
}

.button:hover::after,
button:hover::after {
    opacity:1;
    transform:translateX(100%);
}

.success-badge {
    background:var(--success-soft);
    color:#225d37;
    border-color:#c4dfca;
}

.process-ribbon {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}

.process-ribbon article {
    position:relative;
    display:grid;
    gap:6px;
    padding:16px;
    border:1px solid rgba(216,202,180,.92);
    border-radius:20px;
    background:linear-gradient(135deg,rgba(255,253,248,.92),rgba(250,246,238,.84));
    box-shadow:0 10px 28px rgba(20,26,20,.07);
}

.process-ribbon article::after {
    content:"";
    position:absolute;
    inset:auto 16px 12px 62px;
    height:3px;
    border-radius:999px;
    background:linear-gradient(90deg,rgba(31,100,70,.28),transparent);
}

.process-ribbon span {
    display:inline-grid;
    place-items:center;
    width:34px;
    height:34px;
    border-radius:999px;
    background:linear-gradient(135deg,var(--primary),#2e7e55);
    color:white;
    font-size:.82rem;
    font-weight:950;
    box-shadow:0 8px 18px rgba(31,100,70,.20);
}

.process-ribbon strong {
    font-size:1rem;
}

.process-ribbon small {
    color:var(--muted);
    line-height:1.35;
}

.choice-board {
    position:relative;
    z-index:1;
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:12px;
}

.choice-tile {
    display:flex;
    gap:12px;
    align-items:flex-start;
    min-height:92px;
    padding:14px;
    border:1px solid rgba(216,202,180,.92);
    border-radius:18px;
    background:rgba(255,255,255,.70);
    cursor:pointer;
    box-shadow:0 8px 20px rgba(20,26,20,.045);
}

.choice-tile:hover {
    border-color:#b9d9c2;
    background:#f5fbf4;
    transform:translateY(-1px);
}

.choice-tile input[type="checkbox"],
input[type="checkbox"],
input[type="radio"] {
    width:auto;
    min-width:18px;
    height:18px;
    accent-color:var(--primary);
}

.choice-tile strong {
    display:block;
    margin-bottom:4px;
}

.choice-tile small {
    color:var(--muted);
    line-height:1.35;
}

.sticky-action-row {
    position:sticky;
    bottom:12px;
    z-index:4;
    margin-top:16px;
    padding:12px;
    border:1px solid rgba(216,202,180,.92);
    border-radius:18px;
    background:rgba(255,253,248,.82);
    backdrop-filter:blur(14px);
    box-shadow:0 14px 34px rgba(20,26,20,.10);
}

.command-palette-open {
    overflow:hidden;
}

.command-palette-overlay {
    position:fixed;
    z-index:900;
    inset:0;
    display:grid;
    place-items:start center;
    padding:9vh 18px 18px;
    background:rgba(9,16,11,.48);
    backdrop-filter:blur(10px);
}

.command-palette-overlay[hidden] {
    display:none;
}

.command-palette {
    width:min(760px,100%);
    overflow:hidden;
    border:1px solid rgba(255,255,255,.40);
    border-radius:28px;
    background:
        radial-gradient(circle at 0 0, rgba(104,180,125,.18), transparent 36%),
        linear-gradient(135deg,rgba(255,253,248,.96),rgba(246,239,226,.94));
    box-shadow:0 34px 90px rgba(0,0,0,.34);
}

.command-palette-top {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    padding:16px 18px 10px;
}

.command-palette-input {
    margin:0 18px 12px;
    width:calc(100% - 36px);
    padding:16px 18px;
    border-radius:18px;
    font-size:1.05rem;
    font-weight:800;
    background:white;
    box-shadow:inset 0 0 0 1px rgba(31,100,70,.08);
}

.command-palette-list {
    display:grid;
    gap:6px;
    max-height:52vh;
    overflow:auto;
    padding:0 12px 12px;
}

.command-palette-item {
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    width:100%;
    padding:13px 14px;
    border-radius:17px;
    border:1px solid transparent;
    background:rgba(255,255,255,.56);
    text-align:left;
    box-shadow:none;
}

.command-palette-item:hover,
.command-palette-item.active {
    transform:none;
    border-color:#b9d9c2;
    background:#edf8ef;
    box-shadow:0 12px 28px rgba(31,100,70,.10);
}

.command-palette-item strong {
    display:block;
    font-size:1rem;
}

.command-palette-item small {
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-weight:650;
}

.command-palette-item em {
    color:#1d6041;
    font-style:normal;
    font-size:.78rem;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.command-palette-empty,
.command-palette-footer {
    padding:12px 18px 16px;
    color:var(--muted);
    font-size:.88rem;
}

.command-palette-footer {
    border-top:1px solid rgba(216,202,180,.72);
    background:rgba(255,253,248,.48);
}

body.focus-mode .sidebar {
    width:86px;
    padding-left:12px;
    padding-right:12px;
}

body.focus-mode .layout {
    grid-template-columns:86px 1fr;
}

body.focus-mode .sidebar h1,
body.focus-mode .sidebar p,
body.focus-mode .sidebar-brand-copy,
body.focus-mode .sidebar-section-title,
body.focus-mode .sidebar-link-note,
body.focus-mode .sidebar a .nav-label {
    display:none;
}

body.focus-mode .sidebar-brand {
    justify-content:center;
    margin-bottom:18px;
}

body.focus-mode .sidebar-brand-copy {
    display:none;
}

body.focus-mode .sidebar-toggle-button {
    min-width:48px;
    padding:10px 8px;
}

body.focus-mode .sidebar a {
    justify-content:center;
    align-items:center;
    min-height:54px;
    height:54px;
    padding:0;
    gap:0;
    border-radius:18px;
}

body.focus-mode .sidebar a::before {
    width:34px;
    height:34px;
    flex-basis:34px;
    font-size:1.18rem;
    border-radius:14px;
    margin:0;
}

body.focus-mode .quick-action-bar {
    margin-top:-12px;
}

body.focus-mode .main {
    max-width:1900px;
}

.panel.stat strong,
.stat strong {
    background:linear-gradient(135deg,#112218,#2f8f4e);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
}

.badge {
    box-shadow:inset 0 1px 0 rgba(255,255,255,.62);
}

.status-light {
    position:relative;
}

.status-light::after {
    content:"";
    position:absolute;
    inset:-7px;
    border-radius:inherit;
    border:1px solid currentColor;
    opacity:.10;
}

.screen-map {
    position:fixed;
    z-index:360;
    right:18px;
    top:185px;
    display:grid;
    gap:8px;
    width:172px;
    max-height:calc(100vh - 220px);
    padding:12px;
    border:1px solid rgba(216,202,180,.72);
    border-radius:20px;
    background:rgba(255,253,248,.36);
    backdrop-filter:blur(8px);
    box-shadow:0 14px 34px rgba(20,26,20,.10);
    opacity:.66;
    transform:translateX(0);
    transition:opacity .16s ease, background .16s ease, transform .18s ease, backdrop-filter .16s ease;
}

.screen-map:hover,
.screen-map:focus-within {
    background:rgba(255,253,248,.78);
    opacity:1;
    backdrop-filter:blur(14px);
}

.screen-map.is-collapsed {
    transform:translateX(calc(100% - 8px));
    opacity:.82;
}

.screen-map.is-collapsed:hover,
.screen-map.is-collapsed:focus-within {
    opacity:.92;
}

.screen-map.is-collapsed strong,
.screen-map.is-collapsed nav,
.screen-map.is-collapsed .screen-map-top {
    opacity:0;
    pointer-events:none;
}

.screen-map-toggle {
    position:absolute;
    left:-42px;
    top:18px;
    width:42px;
    height:96px;
    border-radius:18px 0 0 18px;
    padding:8px 5px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    font-size:.82rem;
    font-weight:950;
    color:#f7fff9;
    background:linear-gradient(180deg,#245f3e,#153c29);
    border:1px solid rgba(20,74,46,.58);
    border-right:0;
    box-shadow:-8px 10px 24px rgba(20,26,20,.18);
    cursor:pointer;
}

.screen-map-toggle-text {
    writing-mode:vertical-rl;
    text-transform:uppercase;
    letter-spacing:.08em;
}

.screen-map-toggle-arrow {
    font-size:1.1rem;
    line-height:1;
}

.screen-map strong {
    color:#1c5d3f;
    font-size:.74rem;
    font-weight:950;
    letter-spacing:.11em;
    text-transform:uppercase;
}

.screen-map nav {
    display:grid;
    gap:5px;
    overflow:auto;
    padding-right:2px;
}

.screen-map a {
    display:flex;
    align-items:center;
    gap:8px;
    min-height:30px;
    padding:7px 8px;
    border-radius:12px;
    color:#59635c;
    text-decoration:none;
    font-size:.78rem;
    font-weight:800;
    line-height:1.2;
}

.screen-map a span {
    width:7px;
    height:7px;
    border-radius:999px;
    background:#c3cabb;
    flex:0 0 auto;
}

.screen-map a:hover,
.screen-map a.active {
    background:#edf8ef;
    color:#174b31;
}

.screen-map a.active span {
    background:#2f8f4e;
    box-shadow:0 0 0 4px rgba(47,143,78,.14),0 0 18px rgba(47,143,78,.28);
}

.screen-map-top {
    padding:7px 9px;
    border-radius:12px;
    font-size:.78rem;
}

body.focus-mode .screen-map {
    right:22px;
}

.cockpit-dock {
    position:fixed;
    z-index:420;
    right:18px;
    bottom:18px;
    display:flex;
    gap:8px;
    padding:8px;
    border:1px solid rgba(31,100,70,.24);
    border-radius:22px;
    background:rgba(255,253,248,.82);
    backdrop-filter:blur(16px);
    box-shadow:0 20px 52px rgba(18,25,19,.18);
    transform:translateY(0);
    opacity:.96;
    pointer-events:auto;
    transition:opacity .2s ease, transform .2s ease;
}

.cockpit-dock.is-visible {
    opacity:1;
    transform:translateY(-2px);
}

.cockpit-dock-button {
    display:grid;
    gap:2px;
    min-width:78px;
    padding:9px 10px;
    border-radius:16px;
    text-align:left;
}

.cockpit-dock-button span {
    font-size:.86rem;
    font-weight:950;
}

.cockpit-dock-button small {
    color:var(--muted);
    font-size:.68rem;
    font-weight:900;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.upload-dropzone {
    position:relative;
    padding:16px;
    border:1px dashed #b9d9c2;
    border-radius:22px;
    background:linear-gradient(135deg,rgba(245,251,244,.78),rgba(255,253,248,.82));
}

.upload-dropzone input[type="file"] {
    padding:18px;
    border-style:dashed;
    background:white;
}

table {
    border-collapse:separate;
    border-spacing:0;
}

.layout,
.main,
.panel,
.datagrid-shell,
.home-hero,
.executive-kpi-stage,
.system-landscape {
    min-width:0;
}

.main {
    max-width:100%;
    overflow-x:clip;
}

.panel {
    max-width:100%;
}

th:first-child,
td:first-child {
    padding-left:14px;
}

th:last-child,
td:last-child {
    padding-right:14px;
}

thead tr:first-child th:first-child {
    border-top-left-radius:14px;
}

thead tr:first-child th:last-child {
    border-top-right-radius:14px;
}

.datagrid-shell {
    max-width:100%;
    overflow-x:auto;
    padding:10px;
    border:1px solid rgba(216,202,180,.74);
    border-radius:20px;
    background:rgba(255,253,248,.48);
}

.datagrid-shell table {
    width:max-content;
    min-width:100%;
    table-layout:fixed;
}

.datagrid-toolbar {
    padding:4px;
    align-items:flex-start;
}

.datagrid-toolbar-left {
    flex:1 1 620px;
    min-width:min(100%, 420px);
}

.datagrid-toolbar-right {
    flex:0 0 auto;
    justify-content:flex-end;
}

.datagrid-toolbar input {
    min-width:min(300px,100%);
    border-radius:999px;
}

.datagrid-selection-actions {
    display:flex;
    align-items:center;
    gap:6px;
    flex-wrap:wrap;
    min-height:38px;
    padding:5px 7px;
    border:1px solid rgba(47,143,78,.22);
    border-radius:999px;
    background:
        linear-gradient(135deg,rgba(255,255,255,.90),rgba(237,248,239,.84));
    box-shadow:0 8px 18px rgba(20,26,20,.07);
}

.datagrid-selection-actions[hidden] {
    display:none !important;
}

.datagrid-selection-actions strong {
    padding:0 7px;
    color:#174b31;
    font-size:.8rem;
    white-space:nowrap;
}

.datagrid-selection-actions .button {
    padding:6px 9px;
    border-radius:999px;
    font-size:.76rem;
    line-height:1;
}

.datagrid-bulk-dialog-backdrop {
    position:fixed;
    inset:0;
    z-index:900;
    display:grid;
    place-items:center;
    padding:22px;
    background:rgba(13,20,15,.34);
    backdrop-filter:blur(8px);
}

.datagrid-bulk-dialog {
    width:min(520px, 100%);
    display:grid;
    gap:10px;
    padding:18px;
    border:1px solid rgba(31,100,70,.24);
    border-radius:24px;
    background:
        radial-gradient(circle at 0 0, rgba(47,143,78,.13), transparent 34%),
        linear-gradient(135deg,#fffdf8,#f5eddf);
    box-shadow:0 28px 80px rgba(11,18,13,.28);
}

.datagrid-bulk-dialog-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:14px;
}

.datagrid-bulk-dialog-head strong {
    display:block;
    font-size:1.18rem;
}

.datagrid-bulk-dialog-head span {
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-size:.84rem;
}

.datagrid-bulk-dialog label {
    margin-top:4px;
    color:#284132;
    font-size:.82rem;
    font-weight:900;
    letter-spacing:.04em;
    text-transform:uppercase;
}

.datagrid-bulk-dialog select,
.datagrid-bulk-dialog input {
    border-radius:14px;
}

.datagrid-bulk-close {
    width:34px;
    height:34px;
    padding:0;
    border-radius:999px;
}

.datagrid-bulk-warning {
    border:1px solid #e7d0a5;
    border-radius:14px;
    padding:10px 12px;
    background:#fff8e9;
    color:#72521a;
    font-size:.84rem;
    font-weight:800;
}

.datagrid-bulk-actions {
    display:flex;
    justify-content:flex-end;
    gap:8px;
    flex-wrap:wrap;
    margin-top:4px;
}

.datagrid-enabled thead tr:first-child th {
    background:linear-gradient(180deg,#fbf6ea,#f1eadc);
    position:relative;
    font-size:.78rem;
    line-height:1.15;
}

.datagrid-filter-row th {
    background:#fffaf1;
    padding:5px 6px;
}

.datagrid-filter-row input {
    border-radius:999px;
    font-size:.78rem;
    padding:7px 9px;
}

.datagrid-filter-control {
    position:relative;
    display:flex;
    align-items:center;
    gap:5px;
    min-width:108px;
}

.datagrid-filter-control input {
    min-width:0;
    padding-right:8px;
}

.datagrid-facet-button {
    flex:0 0 auto;
    width:26px;
    height:26px;
    padding:0;
    border-radius:999px;
    display:grid;
    place-items:center;
    font-size:.72rem;
    font-weight:950;
    color:#245139;
    background:linear-gradient(180deg,#ffffff,#edf6ee);
}

.datagrid-enabled th,
.datagrid-enabled td {
    max-width:280px;
    padding:7px 8px;
    font-size:.84rem;
    line-height:1.2;
    overflow:hidden;
    text-overflow:ellipsis;
}

.datagrid-enabled th {
    white-space:normal;
}

.datagrid-enabled td {
    white-space:normal;
    overflow-wrap:anywhere;
}

.datagrid-enabled tbody td:first-child {
    padding-left:6px;
}

.datagrid-enabled td .actions {
    flex-wrap:nowrap;
}

.datagrid-enabled td .button,
.datagrid-enabled td button {
    padding:6px 8px;
    font-size:.78rem;
}

.datagrid-column-resizer {
    position:absolute;
    top:6px;
    right:-2px;
    bottom:6px;
    width:9px;
    cursor:col-resize;
    border-radius:999px;
    opacity:.18;
    transition:opacity .16s ease, background .16s ease;
}

.datagrid-column-resizer:hover {
    opacity:1;
    background:#2f7b4d;
}

body.datagrid-resizing {
    cursor:col-resize !important;
    user-select:none;
}

.datagrid-facet-menu {
    position:fixed;
    z-index:500;
    max-height:390px;
    padding:10px;
    border:1px solid rgba(36,90,63,.22);
    border-radius:18px;
    background:rgba(255,253,248,.98);
    box-shadow:0 22px 56px rgba(20,26,20,.18);
    display:grid;
    gap:8px;
}

.datagrid-facet-head,
.datagrid-facet-actions {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:8px;
}

.datagrid-facet-head strong {
    font-size:.86rem;
}

.datagrid-facet-close,
.datagrid-facet-clear {
    padding:6px 9px;
    border-radius:999px;
    font-size:.78rem;
}

.datagrid-facet-search {
    border-radius:999px !important;
    font-size:.84rem !important;
}

.datagrid-facet-list {
    display:grid;
    gap:4px;
    max-height:245px;
    overflow:auto;
    padding-right:2px;
}

.datagrid-facet-option {
    width:100%;
    justify-content:flex-start;
    text-align:left;
    padding:7px 9px;
    border-radius:11px;
    box-shadow:none;
    font-size:.82rem;
    white-space:normal;
    line-height:1.25;
}

.datagrid-facet-option:hover {
    background:#eaf4ec;
    border-color:#b9d9c2;
}

.datagrid-facet-empty {
    padding:10px;
    color:var(--muted);
    font-size:.82rem;
    text-align:center;
}

.datagrid-head-check,
.datagrid-row-check {
    width:15px;
    height:15px;
    min-width:15px;
    margin:0 8px 0 0;
    accent-color:#2f7b4d;
    vertical-align:middle;
}

.datagrid-sort-label .datagrid-head-check {
    flex:0 0 auto;
}

.datagrid-enabled tbody td:first-child {
    white-space:nowrap;
}

.status-chip,
.instrument-type-chip {
    display:inline-flex;
    align-items:center;
    gap:6px;
    border-radius:999px;
    white-space:nowrap;
    font-weight:800;
}

.status-chip {
    padding:5px 10px;
    font-size:.82rem;
}

.instrument-type-chip {
    padding:4px 8px;
    border:1px solid rgba(42,84,61,.18);
    background:linear-gradient(180deg,#eff7ef,#e1efe3);
    color:#245139;
    font-size:.76rem;
}

.sector-link-chip,
.instrument-state-chip,
.instrument-sector-card {
    display:inline-flex;
    align-items:center;
    gap:7px;
    max-width:100%;
    padding:5px 9px;
    border-radius:999px;
    border:1px solid rgba(42,84,61,.16);
    font-size:.78rem;
    font-weight:850;
    white-space:nowrap;
    text-decoration:none;
}

.sector-link-chip {
    background:linear-gradient(180deg,#f9fbf6,#edf5ed);
    color:#214e36;
}

.sector-inline-link {
    color:var(--primary);
    font-weight:850;
    text-decoration:none;
    border-bottom:1px dotted rgba(31,100,70,.44);
}

.sector-inline-link:hover {
    color:var(--primary-strong);
    border-bottom-style:solid;
}

.instrument-sector-card {
    min-width:180px;
    padding:10px 12px;
    border-radius:16px;
    background:
        radial-gradient(circle at top left,rgba(47,143,78,.14),transparent 42%),
        linear-gradient(135deg,#fbfff9,#eff8ec);
    color:#173f2b;
    border-color:rgba(47,123,77,.24);
    box-shadow:0 10px 22px rgba(31,100,70,.09);
}

.instrument-sector-card span:last-child {
    display:grid;
    gap:1px;
    line-height:1.15;
}

.instrument-sector-card small {
    color:#52705d;
    font-size:.72rem;
    font-weight:900;
    letter-spacing:.07em;
    text-transform:uppercase;
}

.instrument-sector-card strong {
    font-size:.95rem;
}

.instrument-sector-card em {
    color:#66756b;
    font-size:.75rem;
    font-style:normal;
    font-weight:750;
}

.sector-link-chip:hover {
    border-color:rgba(47,123,77,.42);
    box-shadow:0 8px 22px rgba(30,84,51,.12);
}

.instrument-state-chip {
    color:#34423a;
    background:#f2eee5;
}

.instrument-state-ativo { background:#dff2e1; color:#1f6b33; }
.instrument-state-vencido,
.instrument-state-bloqueado { background:#f8d1d1; color:#8b1e1e; }
.instrument-state-em_calibracao { background:#d7e9ff; color:#1c4f8c; }
.instrument-state-inativo { background:#ececec; color:#666; }

.status-neutro { background:#efe6d3; color:#6b5630; }
.status-sucesso { background:#dff2e1; color:#1f6b33; }
.status-alerta { background:#ffe7c2; color:#995a00; }
.status-critico { background:#f8d1d1; color:#8b1e1e; }
.status-info { background:#d7e9ff; color:#1c4f8c; }
.status-info-claro { background:#e5effa; color:#315578; }
.status-cinza { background:#ececec; color:#666; }

.sector-instruments-panel {
    position:relative;
    overflow:hidden;
}

.sector-instruments-panel::before {
    content:"";
    position:absolute;
    inset:-120px -80px auto auto;
    width:300px;
    height:300px;
    border-radius:999px;
    background:
        radial-gradient(circle,rgba(47,123,77,.18),transparent 60%);
    pointer-events:none;
}

.sector-instruments-head {
    position:relative;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:18px;
    align-items:center;
}

.sector-instruments-title {
    display:flex;
    align-items:flex-start;
    gap:14px;
}

.sector-instrument-emblem {
    position:relative;
    width:54px;
    height:54px;
    border-radius:18px;
    display:grid;
    place-items:center;
    color:#f7fff7;
    background:
        radial-gradient(circle at 30% 24%,rgba(255,255,255,.34),transparent 26%),
        linear-gradient(135deg,#1f6b42,#0f3c27);
    box-shadow:0 16px 34px rgba(19,73,42,.22);
}

.sector-instrument-emblem::before {
    content:"";
    width:24px;
    height:24px;
    border:3px solid currentColor;
    border-radius:999px 999px 6px 6px;
}

.sector-instrument-emblem::after {
    content:"";
    position:absolute;
    width:3px;
    height:20px;
    margin-top:30px;
    background:currentColor;
    transform:rotate(42deg);
    border-radius:999px;
}

.sector-instrument-health {
    min-width:260px;
    padding:12px;
    border:1px solid rgba(216,202,180,.72);
    border-radius:18px;
    background:rgba(255,255,255,.68);
}

.sector-instrument-health strong {
    display:block;
    margin-bottom:8px;
    font-size:.88rem;
}

.sector-instrument-health-bar {
    display:flex;
    gap:4px;
    height:12px;
    border-radius:999px;
    overflow:hidden;
    background:#e8e1d4;
}

.sector-instrument-health-bar span {
    min-width:8px;
}

.sector-instrument-health-bar .danger { background:#d86b55; }
.sector-instrument-health-bar .warn { background:#d69b31; }
.sector-instrument-health-bar .ok { background:#33864d; }
.sector-instrument-health-bar .off { background:#9aa19a; }

.sector-instrument-summary {
    display:grid;
    grid-template-columns:repeat(5,minmax(90px,1fr));
    gap:10px;
    margin:12px 0 14px;
}

.sector-instrument-summary span {
    display:flex;
    flex-direction:column;
    gap:2px;
    padding:12px;
    border:1px solid rgba(216,202,180,.72);
    border-radius:16px;
    background:rgba(255,255,255,.68);
}

.sector-instrument-summary strong {
    font-size:1.28rem;
}

.sector-instrument-summary small {
    color:var(--muted);
    font-weight:700;
}

.sector-instrument-grid {
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(260px,1fr));
    gap:10px;
}

.sector-instrument-card {
    position:relative;
    display:flex;
    gap:11px;
    align-items:flex-start;
    min-height:126px;
    padding:12px;
    border:1px solid rgba(216,202,180,.72);
    border-radius:18px;
    background:linear-gradient(135deg,rgba(255,255,255,.86),rgba(247,241,229,.68));
    color:inherit;
    text-decoration:none;
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.sector-instrument-card::before {
    content:"";
    position:absolute;
    inset:0 auto 0 0;
    width:5px;
    border-radius:18px 0 0 18px;
    background:#8d988f;
}

.sector-instrument-card.instrument-alert-danger::before { background:#d86b55; }
.sector-instrument-card.instrument-alert-warn::before { background:#d69b31; }
.sector-instrument-card.instrument-alert-ok::before { background:#33864d; }
.sector-instrument-card.instrument-alert-info::before { background:#4a8cc7; }
.sector-instrument-card.instrument-alert-off::before { background:#9aa19a; }

.sector-instrument-card:hover {
    transform:translateY(-2px);
    border-color:rgba(44,111,70,.34);
    box-shadow:0 16px 34px rgba(45,38,26,.10);
}

.sector-instrument-photo,
.sector-instrument-avatar {
    flex:0 0 54px;
    width:54px;
    height:54px;
    border-radius:16px;
    object-fit:cover;
    border:1px solid rgba(42,84,61,.14);
    background:#eef4eb;
}

.sector-instrument-avatar {
    display:grid;
    place-items:center;
    color:#245139;
    font-size:1.2rem;
    font-weight:950;
}

.sector-instrument-body {
    min-width:0;
    flex:1;
    display:flex;
    flex-direction:column;
    gap:6px;
}

.sector-instrument-topline {
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:flex-start;
}

.sector-instrument-code {
    color:#174b31;
    font-weight:950;
}

.sector-instrument-name {
    color:#26342d;
    font-weight:850;
    line-height:1.25;
}

.sector-instrument-meta {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    align-items:center;
}

.sector-instrument-calibration {
    display:flex;
    justify-content:space-between;
    gap:8px;
    align-items:center;
    margin-top:auto;
    padding-top:8px;
    border-top:1px dashed rgba(90,84,71,.18);
}

.sector-instrument-calibration small {
    color:var(--muted);
    font-weight:750;
}

tbody tr:hover td {
    background:rgba(232,247,237,.62);
}

.executive-kpi-stage {
    position:relative;
    overflow:hidden;
}

.executive-kpi-stage::before {
    content:"";
    position:absolute;
    inset:-40% -15% auto auto;
    width:360px;
    height:360px;
    border-radius:999px;
    background:radial-gradient(circle,rgba(31,100,70,.14),transparent 62%);
    pointer-events:none;
}

.executive-kpi-card,
.executive-bar-card {
    position:relative;
    overflow:hidden;
}

.executive-kpi-card::after,
.executive-bar-card::after {
    content:"";
    position:absolute;
    inset:auto -30px -44px auto;
    width:120px;
    height:120px;
    border-radius:999px;
    background:rgba(31,100,70,.06);
    pointer-events:none;
}

.executive-ring {
    animation:ring-pop .55s ease both;
}

.executive-bar-track {
    min-height:18px !important;
    padding:2px;
    gap:2px;
    background:linear-gradient(180deg,#e6dccb,#f5eee2) !important;
    box-shadow:inset 0 1px 2px rgba(20,26,20,.10);
}

.executive-bar-segment {
    min-width:4px;
    border-radius:999px;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.24);
    transform-origin:left center;
    animation:bar-grow .7s ease both;
}

body[data-theme="noturno"] .layout::before {
    background-image:
        linear-gradient(rgba(116,213,138,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(116,213,138,.035) 1px, transparent 1px);
}

body[data-theme="noturno"] .main {
    color:var(--text);
}

body[data-theme="noturno"] .topbar,
body[data-theme="noturno"] .topbar-nav-row,
body[data-theme="noturno"] .quick-action-bar,
body[data-theme="noturno"] .breadcrumbs,
body[data-theme="noturno"] .panel,
body[data-theme="noturno"] .stat,
body[data-theme="noturno"] li.item,
body[data-theme="noturno"] .machine-card,
body[data-theme="noturno"] .os-mini-card,
body[data-theme="noturno"] .datagrid-shell,
body[data-theme="noturno"] .screen-map,
body[data-theme="noturno"] .cockpit-dock,
body[data-theme="noturno"] .executive-kpi-stage,
body[data-theme="noturno"] .executive-kpi-card,
body[data-theme="noturno"] .executive-bar-card,
body[data-theme="noturno"] .routine-card,
body[data-theme="noturno"] .home-hero,
body[data-theme="noturno"] .home-role-card,
body[data-theme="noturno"] .priority-card,
body[data-theme="noturno"] .sector-hero,
body[data-theme="noturno"] .users-hero,
body[data-theme="noturno"] .profile-card,
body[data-theme="noturno"] .hero-finish,
body[data-theme="noturno"] .process-ribbon article,
body[data-theme="noturno"] .choice-tile {
    border-color:var(--line) !important;
    background:
        radial-gradient(circle at 0 0, rgba(116,213,138,.08), transparent 34%),
        linear-gradient(135deg,rgba(17,29,23,.94),rgba(11,23,18,.90)) !important;
    color:var(--text);
    box-shadow:0 22px 54px rgba(0,0,0,.30);
}

body[data-theme="noturno"] .datagrid-facet-menu {
    border-color:rgba(151,185,160,.30);
    background:linear-gradient(135deg,rgba(17,29,23,.98),rgba(11,23,18,.96));
    box-shadow:0 24px 58px rgba(0,0,0,.48);
}

body[data-theme="noturno"] .datagrid-column-resizer:hover {
    background:#9bf0ad;
}

body[data-theme="noturno"] .topbar,
body[data-theme="noturno"] .topbar-nav-row,
body[data-theme="noturno"] .quick-action-bar {
    border-color:rgba(116,213,138,.40) !important;
    box-shadow:0 26px 70px rgba(0,0,0,.48),0 0 0 1px rgba(116,213,138,.12) inset !important;
}

body[data-theme="noturno"] .muted,
body[data-theme="noturno"] .datagrid-help,
body[data-theme="noturno"] .datagrid-count,
body[data-theme="noturno"] .datagrid-table-note,
body[data-theme="noturno"] .hero-finish p,
body[data-theme="noturno"] .machine-gauge-caption span,
body[data-theme="noturno"] .process-ribbon small,
body[data-theme="noturno"] .choice-tile small,
body[data-theme="noturno"] .command-palette-item small,
body[data-theme="noturno"] .cockpit-dock-button small {
    color:var(--muted) !important;
}

body[data-theme="noturno"] a,
body[data-theme="noturno"] .breadcrumbs a,
body[data-theme="noturno"] .machine-card-title,
body[data-theme="noturno"] .ref-mini-card a,
body[data-theme="noturno"] .os-mini-card-title {
    color:#9bf0ad;
}

body[data-theme="noturno"] .button,
body[data-theme="noturno"] button,
body[data-theme="noturno"] .breadcrumb-chip,
body[data-theme="noturno"] .badge,
body[data-theme="noturno"] .datagrid-filter-pill,
body[data-theme="noturno"] .instrument-type-chip,
body[data-theme="noturno"] .sector-link-chip,
body[data-theme="noturno"] .instrument-state-chip,
body[data-theme="noturno"] .instrument-sector-card {
    border-color:rgba(151,185,160,.28);
    background:linear-gradient(180deg,#182820,#101c16);
    color:var(--text);
}

body[data-theme="noturno"] .sector-instrument-summary span,
body[data-theme="noturno"] .sector-instrument-card,
body[data-theme="noturno"] .sector-instrument-health {
    border-color:rgba(151,185,160,.24);
    background:linear-gradient(135deg,rgba(20,35,28,.92),rgba(12,24,18,.84));
}

body[data-theme="noturno"] .sector-instrument-name,
body[data-theme="noturno"] .sector-instrument-code {
    color:#dff8e5;
}

body[data-theme="noturno"] .sector-instrument-avatar,
body[data-theme="noturno"] .sector-instrument-photo {
    border-color:rgba(151,185,160,.22);
    background:#13221a;
    color:#9bf0ad;
}

body[data-theme="noturno"] .sector-inline-link,
body[data-theme="noturno"] .instrument-sector-card small,
body[data-theme="noturno"] .instrument-sector-card em {
    color:#9bf0ad;
}

body[data-theme="noturno"] .button.primary,
body[data-theme="noturno"] button.primary {
    background:linear-gradient(135deg,#2e9652,#1f6b3f);
    color:white;
    border-color:#54c878;
}

body[data-theme="noturno"] .logout-button,
body[data-theme="noturno"] .shutdown-button,
body[data-theme="noturno"] button.danger,
body[data-theme="noturno"] .button.danger {
    background:linear-gradient(135deg,#7a2c23,#4a1714);
    color:#ffeae6;
    border-color:rgba(240,125,102,.42);
}

body[data-theme="noturno"] input,
body[data-theme="noturno"] select,
body[data-theme="noturno"] textarea,
body[data-theme="noturno"] .command-palette-input {
    border-color:rgba(151,185,160,.30);
    background:#0d1a14;
    color:var(--text);
}

body[data-theme="noturno"] input::placeholder,
body[data-theme="noturno"] textarea::placeholder {
    color:#75887c;
}

body[data-theme="noturno"] th,
body[data-theme="noturno"] td {
    border-bottom-color:rgba(151,185,160,.18);
}

body[data-theme="noturno"] th,
body[data-theme="noturno"] .datagrid-enabled thead tr:first-child th,
body[data-theme="noturno"] .datagrid-filter-row th {
    background:#13221a !important;
    color:#dff3e4;
}

body[data-theme="noturno"] tbody tr:hover td,
body[data-theme="noturno"] .datagrid-selected,
body[data-theme="noturno"] .datagrid-row-selected td,
body[data-theme="noturno"] .datagrid-active-cell {
    background:#173322 !important;
}

body[data-theme="noturno"] .command-palette {
    background:
        radial-gradient(circle at 0 0, rgba(116,213,138,.14), transparent 36%),
        linear-gradient(135deg,rgba(17,29,23,.98),rgba(11,23,18,.96));
    color:var(--text);
}

body[data-theme="noturno"] .command-palette-footer {
    background:rgba(10,20,16,.74);
    border-top-color:rgba(151,185,160,.20);
}

body[data-theme="noturno"] .command-palette-item {
    background:rgba(22,38,31,.74);
    color:var(--text);
}

body[data-theme="noturno"] .command-palette-item:hover,
body[data-theme="noturno"] .command-palette-item.active,
body[data-theme="noturno"] .screen-map a:hover,
body[data-theme="noturno"] .screen-map a.active {
    background:#183823;
    border-color:rgba(116,213,138,.34);
    color:#dff8e5;
}

body[data-theme="noturno"] .machine-gauge,
body[data-theme="noturno"] .machine-card-metrics span,
body[data-theme="noturno"] .os-mini-card-kpis span,
body[data-theme="noturno"] .ref-mini-card {
    background:#101d17;
    border-color:rgba(151,185,160,.20);
}

body[data-theme="noturno"] .machine-gauge-face::after {
    background:#101d17;
}

body[data-theme="noturno"] .panel.stat strong,
body[data-theme="noturno"] .stat strong {
    background:linear-gradient(135deg,#f1fff4,#74d58a);
    -webkit-background-clip:text;
    background-clip:text;
}

@keyframes ring-pop {
    from { transform:scale(.94); opacity:.72; }
    to { transform:scale(1); opacity:1; }
}

@keyframes bar-grow {
    from { transform:scaleX(.12); opacity:.5; }
    to { transform:scaleX(1); opacity:1; }
}

.breadcrumbs {
    font-size:1.02rem;
}

.breadcrumb-chip {
    padding:10px 14px;
    font-weight:850;
}

.messages .message {
    border-left:5px solid var(--success);
    box-shadow:0 10px 24px rgba(20,26,20,.06);
}

:focus-visible {
    outline:3px solid rgba(47,143,78,.38);
    outline-offset:2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration:.01ms !important;
        animation-iteration-count:1 !important;
        scroll-behavior:auto !important;
        transition-duration:.01ms !important;
    }
}

@media (max-width:1180px) {
    .process-ribbon {
        grid-template-columns:repeat(2,minmax(0,1fr));
    }

    .hero-finish {
        grid-template-columns:1fr;
    }

    .hero-finish-actions {
        display:flex;
        flex-wrap:wrap;
    }
}

@media (max-width:1500px) {
    .screen-map {
        display:none;
    }
}

@media (max-width:760px) {
    .app-top-shell {
        position:relative;
        top:auto;
    }

    .topbar,
    .quick-action-bar {
        position:relative;
        top:auto;
    }

    .topbar-nav-row {
        grid-template-columns:1fr;
    }

    .app-top-shell .topbar {
        grid-template-columns:1fr;
    }

    .hero-finish {
        padding:20px;
        border-radius:24px;
    }

    .process-ribbon {
        grid-template-columns:1fr;
    }
}

.factory-andon-hero {
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto;
    gap:22px;
    align-items:center;
    margin-bottom:18px;
    overflow:hidden;
    position:relative;
}

.factory-andon-hero::after {
    content:"";
    position:absolute;
    inset:auto -60px -120px auto;
    width:280px;
    height:280px;
    border-radius:999px;
    background:radial-gradient(circle, rgba(47,143,78,.16), transparent 68%);
    pointer-events:none;
}

.factory-andon-hero h2 {
    margin:6px 0 8px;
    font-size:clamp(2rem, 4vw, 3.7rem);
    letter-spacing:-.06em;
}

.factory-andon-summary {
    display:grid;
    grid-template-columns:repeat(4, minmax(86px, 1fr));
    gap:10px;
    min-width:min(560px, 100%);
}

.factory-andon-summary div {
    border:1px solid rgba(216,202,180,.9);
    border-radius:18px;
    padding:14px;
    background:linear-gradient(145deg, rgba(255,255,255,.9), rgba(248,243,233,.86));
    box-shadow:0 10px 24px rgba(20,26,20,.06);
}

.factory-andon-summary strong {
    display:block;
    font-size:2rem;
    letter-spacing:-.05em;
}

.factory-andon-summary span {
    color:var(--muted);
    font-size:.86rem;
    font-weight:800;
}

.factory-andon-grid {
    display:grid;
    grid-template-columns:1fr;
    gap:18px;
    align-items:start;
}

.factory-map-panel {
    overflow:hidden;
}

.factory-map-toolbar {
    display:flex;
    justify-content:space-between;
    gap:14px;
    align-items:flex-start;
    margin-bottom:14px;
}

.factory-map-toolbar h3 {
    margin:0 0 4px;
}

.factory-map-legend {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
    font-size:.84rem;
    color:var(--muted);
    font-weight:800;
}

.factory-map-legend span {
    display:inline-flex;
    align-items:center;
    gap:6px;
    border:1px solid rgba(216,202,180,.8);
    border-radius:999px;
    padding:6px 9px;
    background:rgba(255,255,255,.76);
}

.factory-map-shell {
    overflow:auto;
    cursor:grab;
    touch-action:none;
    user-select:none;
    border:1px solid var(--line);
    border-radius:22px;
    background:linear-gradient(135deg, rgba(13,21,15,.04), transparent), #fffdf8;
    max-height:calc(100vh - 270px);
    min-height:520px;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.52);
}

.factory-map-shell.is-panning {
    cursor:grabbing;
    user-select:none;
}

.factory-map-canvas {
    position:relative;
    width:1900px;
    max-width:none;
}

.factory-map-shell img {
    display:block;
    width:100%;
    max-width:none;
    height:auto;
    opacity:.82;
    filter:contrast(1.03) saturate(.92);
    user-select:none;
    -webkit-user-drag:none;
}

.andon-marker {
    position:absolute;
    left:var(--x);
    top:var(--y);
    transform:translate(-50%, -50%);
    width:24px;
    height:24px;
    z-index:3;
    text-decoration:none;
    color:#fff;
    cursor:pointer;
}

.andon-marker-pulse,
.andon-marker-core {
    position:absolute;
    inset:0;
    border-radius:999px;
}

.andon-marker-pulse {
    opacity:.32;
    transform:scale(1.35);
    animation:andonPulse 1.9s ease-in-out infinite;
}

.andon-marker-core {
    display:grid;
    place-items:center;
    border:2px solid rgba(255,255,255,.86);
    box-shadow:0 8px 22px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.36);
    font-size:.58rem;
    font-weight:950;
    letter-spacing:-.03em;
}

.andon-marker-machine {
    width:28px;
    height:24px;
}

.andon-marker-machine .andon-marker-core {
    font-size:.50rem;
    letter-spacing:-.06em;
}

.factory-edit-actions {
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
    margin-top:14px;
}

.factory-edit-status {
    color:var(--muted);
    font-size:.9rem;
    font-weight:800;
}

.factory-edit-status[data-kind="ok"] {
    color:#2f8f4e;
}

.factory-edit-status[data-kind="warn"] {
    color:#9a6412;
}

.factory-edit-status[data-kind="danger"] {
    color:#b23c2d;
}

.factory-edit-tip {
    margin:0 0 12px;
    border:1px solid #e6c98a;
    border-radius:16px;
    padding:10px 12px;
    background:#fff5dc;
    color:#75500c;
    font-weight:850;
}

.factory-map-shell.is-editing {
    cursor:default;
    border-color:#d49122;
    box-shadow:inset 0 0 0 2px rgba(212,145,34,.18), 0 16px 34px rgba(20,26,20,.10);
}

.factory-map-shell.is-editing .andon-marker {
    cursor:grab;
}

.factory-map-shell.is-editing.is-panning {
    cursor:default;
}

.factory-map-shell.is-editing .andon-marker-core {
    border-color:#fff;
    box-shadow:0 8px 22px rgba(0,0,0,.28), 0 0 0 4px rgba(212,145,34,.18), inset 0 1px 0 rgba(255,255,255,.36);
}

.factory-map-shell.is-editing .andon-card {
    display:none;
}

.andon-marker-dragging {
    cursor:grabbing !important;
    z-index:50;
}

.andon-marker-dragging .andon-marker-core {
    transform:scale(1.18);
}

.andon-marker-dirty .andon-marker-core {
    outline:2px solid #f6cf62;
    outline-offset:2px;
}

.andon-marker-ok .andon-marker-core,
.andon-marker-ok .andon-marker-pulse,
.andon-dot.ok {
    background:#2f8f4e;
}

.andon-marker-warn .andon-marker-core,
.andon-marker-warn .andon-marker-pulse,
.andon-dot.warn {
    background:#d49122;
}

.andon-marker-danger .andon-marker-core,
.andon-marker-danger .andon-marker-pulse,
.andon-dot.danger {
    background:#c8472f;
}

.andon-marker-off .andon-marker-core,
.andon-marker-off .andon-marker-pulse,
.andon-dot.off {
    background:#7e8780;
}

.andon-marker-unknown .andon-marker-core,
.andon-marker-unknown .andon-marker-pulse,
.andon-dot.unknown {
    background:#587288;
}

.andon-marker-danger .andon-marker-pulse,
.andon-marker-warn .andon-marker-pulse {
    opacity:.44;
}

.andon-card {
    position:absolute;
    left:36px;
    top:50%;
    transform:translateY(-50%) translateX(-6px);
    width:260px;
    display:grid;
    gap:5px;
    padding:12px;
    border:1px solid rgba(216,202,180,.95);
    border-radius:16px;
    background:rgba(255,253,248,.96);
    color:var(--text);
    box-shadow:0 18px 40px rgba(20,26,20,.18);
    opacity:0;
    pointer-events:none;
    transition:opacity .14s ease, transform .14s ease;
    z-index:10;
}

.andon-card strong {
    font-size:.98rem;
}

.andon-card small,
.andon-card span,
.andon-card em {
    color:var(--muted);
    font-size:.8rem;
    line-height:1.25;
}

.andon-card em {
    font-style:normal;
    color:#435146;
}

.andon-marker:hover,
.andon-marker:focus {
    z-index:12;
}

.andon-marker:hover .andon-card,
.andon-marker:focus .andon-card {
    opacity:1;
    transform:translateY(-50%) translateX(0);
}

.andon-dot {
    display:inline-block;
    width:10px;
    height:10px;
    border-radius:999px;
    box-shadow:0 0 0 4px rgba(0,0,0,.06);
}

.factory-andon-side {
    position:static;
    max-height:none;
    overflow:visible;
}

.factory-andon-side h3 {
    margin-top:0;
}

.factory-point-list {
    margin-top:12px;
}

.factory-marker-table-head {
    display:flex;
    justify-content:space-between;
    gap:16px;
    align-items:flex-start;
}

.factory-marker-table-head h3 {
    margin:0 0 4px;
}

.factory-marker-table-head p {
    margin:0;
}

.factory-point-item {
    display:grid;
    gap:6px;
}

.factory-point-item a {
    display:flex;
    gap:8px;
    align-items:center;
    color:var(--text);
    text-decoration:none;
}

.factory-point-item a:hover {
    color:var(--primary);
}

.factory-point-item small,
.factory-point-item p {
    margin:0;
    color:var(--muted);
    font-size:.82rem;
}

.factory-model-table-wrap,
.factory-marker-table-wrap {
    margin-top:12px;
    max-height:380px;
    overflow:auto;
    border:1px solid rgba(216,202,180,.8);
    border-radius:16px;
}

.factory-model-table,
.factory-marker-table {
    min-width:520px;
    background:rgba(255,253,248,.78);
}

.factory-marker-table {
    min-width:980px;
}

.factory-model-table th,
.factory-marker-table th {
    position:sticky;
    top:0;
    z-index:2;
    background:#f7f3ea;
}

.factory-model-table td,
.factory-marker-table td {
    font-size:.84rem;
}

.factory-model-table a,
.factory-marker-table a {
    color:var(--primary);
    font-weight:850;
    text-decoration:none;
}

.factory-model-table a:hover,
.factory-marker-table a:hover {
    text-decoration:underline;
}

.factory-model-table small,
.factory-marker-table small {
    display:block;
    color:var(--muted);
    font-size:.74rem;
    line-height:1.2;
}

.factory-marker-table input,
.factory-marker-table select {
    min-width:190px;
    padding:8px 9px;
    border-radius:10px;
    font-size:.86rem;
}

.factory-marker-table .button {
    padding:7px 10px;
    font-size:.82rem;
}

.factory-model-status {
    display:inline-flex;
    align-items:center;
    gap:6px;
    white-space:nowrap;
    font-weight:800;
}

@keyframes andonPulse {
    0%, 100% { transform:scale(1.14); opacity:.20; }
    50% { transform:scale(1.62); opacity:.44; }
}

html[data-theme="dark"] .factory-map-shell,
html[data-theme="grafite"] .factory-map-shell {
    background:#151a16;
}

html[data-theme="dark"] .factory-map-shell img,
html[data-theme="grafite"] .factory-map-shell img {
    opacity:.72;
    filter:invert(.92) hue-rotate(180deg) contrast(.92) saturate(.6);
}

html[data-theme="dark"] .andon-card,
html[data-theme="grafite"] .andon-card {
    background:rgba(22,28,24,.97);
}

@media (max-width:1180px) {
    .factory-andon-hero {
        grid-template-columns:1fr;
    }

    .factory-map-shell {
        max-height:70vh;
    }
}

@media (max-width:720px) {
    .factory-andon-summary {
        grid-template-columns:repeat(2, minmax(0, 1fr));
        min-width:0;
    }

    .factory-map-toolbar {
        display:grid;
    }

    .factory-map-legend {
        justify-content:flex-start;
    }
}

/* Iconografia SVG/CSS: evita caracteres quebrados por encoding e deixa o menu mais tecnico. */
.sidebar a::before {
    display:none !important;
}

.sidebar a {
    justify-content:flex-start;
}

.sidebar-link-note {
    margin-left:auto;
}

.nav-ico {
    position:relative;
    flex:0 0 30px;
    width:30px;
    height:30px;
    display:inline-grid;
    place-items:center;
    border-radius:12px;
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.34), transparent 25%),
        linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.045));
    box-shadow:0 0 0 1px rgba(255,255,255,.10) inset,0 8px 18px rgba(0,0,0,.16);
    overflow:hidden;
}

.active .nav-ico,
.system-map-card:hover .nav-ico {
    background:
        radial-gradient(circle at 30% 22%, rgba(255,255,255,.82), transparent 24%),
        linear-gradient(135deg,#eaffef,#7dd994);
    color:#123b27;
    box-shadow:0 0 0 4px rgba(139,226,157,.12),0 0 22px rgba(139,226,157,.36),0 8px 18px rgba(0,0,0,.12);
}

.nav-ico::before,
.nav-ico::after {
    content:"";
    position:absolute;
    box-sizing:border-box;
    border-color:currentColor;
}

.nav-ico { color:#f5fff5; }
.system-map-card .nav-ico { color:#174b31; background:linear-gradient(135deg,#eef8ef,#dceee0); }

.nav-ico-dashboard::before { width:18px; height:18px; border:2px solid currentColor; border-radius:6px; box-shadow:inset 7px 0 0 rgba(255,255,255,.22), inset 0 7px 0 rgba(255,255,255,.16); }
.nav-ico-andon::before { width:18px; height:14px; border:2px solid currentColor; border-radius:4px; transform:skew(-8deg); }
.nav-ico-andon::after { width:5px; height:5px; border-radius:999px; background:currentColor; box-shadow:7px 2px 0 currentColor, -7px 2px 0 currentColor; }
.nav-ico-setores::before { width:8px; height:8px; border:2px solid currentColor; border-radius:3px; box-shadow:10px 0 0 -2px currentColor, 0 10px 0 -2px currentColor, 10px 10px 0 -2px currentColor; }
.nav-ico-maquinas::before { width:18px; height:18px; border:3px dashed currentColor; border-radius:999px; }
.nav-ico-maquinas::after { width:6px; height:6px; border-radius:999px; background:currentColor; }
.nav-ico-cronograma::before { width:18px; height:18px; border:2px solid currentColor; border-radius:5px; }
.nav-ico-cronograma::after { width:14px; height:2px; top:9px; background:currentColor; box-shadow:0 5px 0 rgba(255,255,255,.55); }
.nav-ico-os::before { width:15px; height:19px; border:2px solid currentColor; border-radius:4px; }
.nav-ico-os::after { width:9px; height:2px; background:currentColor; box-shadow:0 5px 0 currentColor; }
.nav-ico-execucoes::before { width:17px; height:17px; border:2px solid currentColor; border-radius:999px; }
.nav-ico-execucoes::after { width:10px; height:6px; border-left:3px solid currentColor; border-bottom:3px solid currentColor; transform:rotate(-45deg); top:10px; }
.nav-ico-planos::before { width:17px; height:18px; border:2px solid currentColor; border-radius:4px; }
.nav-ico-planos::after { width:11px; height:2px; background:currentColor; box-shadow:0 5px 0 currentColor,0 -5px 0 currentColor; }
.nav-ico-dias::before { width:18px; height:18px; border:2px solid currentColor; border-radius:999px; }
.nav-ico-dias::after { width:20px; height:2px; background:currentColor; transform:rotate(-38deg); }
.nav-ico-modelos::before { width:18px; height:15px; border:2px solid currentColor; border-radius:5px; transform:perspective(18px) rotateX(18deg); }
.nav-ico-modelos::after { width:8px; height:8px; border:2px solid currentColor; border-radius:3px; right:5px; bottom:5px; }
.nav-ico-produtos::before { width:18px; height:18px; border:2px solid currentColor; border-radius:5px; transform:rotate(45deg); }
.nav-ico-produtos::after { width:8px; height:8px; border:2px solid currentColor; border-radius:3px; }
.nav-ico-ferramentais::before { width:19px; height:5px; background:currentColor; border-radius:999px; transform:rotate(-35deg); }
.nav-ico-ferramentais::after { width:8px; height:12px; border:2px solid currentColor; border-radius:2px; transform:rotate(-35deg); right:6px; bottom:5px; }
.nav-ico-instrumentos::before { width:18px; height:18px; border:2px solid currentColor; border-radius:999px 999px 5px 5px; }
.nav-ico-instrumentos::after { width:2px; height:14px; background:currentColor; transform:rotate(45deg); }
.nav-ico-calibracoes::before { width:18px; height:18px; border:2px solid currentColor; border-radius:999px; }
.nav-ico-calibracoes::after { width:8px; height:8px; border-radius:999px; background:currentColor; box-shadow:0 0 0 4px rgba(255,255,255,.18); }
.nav-ico-msa::before { width:0; height:0; border-left:10px solid transparent; border-right:10px solid transparent; border-bottom:18px solid currentColor; top:6px; }
.nav-ico-msa::after { width:8px; height:8px; border-radius:999px; background:rgba(255,255,255,.75); top:13px; }
.nav-ico-historico::before { width:18px; height:18px; border:2px solid currentColor; border-radius:999px; border-left-color:transparent; }
.nav-ico-historico::after { width:8px; height:2px; background:currentColor; transform-origin:left center; transform:rotate(35deg); left:14px; top:15px; }
.nav-ico-auditoria::before { width:17px; height:20px; border:2px solid currentColor; border-radius:9px 9px 5px 5px; }
.nav-ico-auditoria::after { width:7px; height:7px; border-left:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(-45deg); top:13px; }
.nav-ico-relatorios::before { width:18px; height:19px; border:2px solid currentColor; border-radius:4px; clip-path:polygon(0 0, 72% 0, 100% 28%, 100% 100%, 0 100%); }
.nav-ico-relatorios::after { width:12px; height:9px; border-left:3px solid currentColor; border-bottom:3px solid currentColor; box-shadow:5px -4px 0 -3px currentColor; transform:skew(-10deg); top:13px; }
.nav-ico-importacao::before { width:18px; height:14px; border:2px solid currentColor; border-radius:4px; }
.nav-ico-importacao::after { width:9px; height:9px; border-right:3px solid currentColor; border-bottom:3px solid currentColor; transform:rotate(45deg); top:8px; }
.nav-ico-usuarios::before,
.nav-ico-funcionarios::before { width:9px; height:9px; border-radius:999px; background:currentColor; top:7px; box-shadow:8px 3px 0 -1px currentColor; }
.nav-ico-usuarios::after,
.nav-ico-funcionarios::after { width:19px; height:9px; border:2px solid currentColor; border-radius:999px 999px 4px 4px; bottom:6px; }
.nav-ico-admin::before { width:18px; height:18px; border:2px solid currentColor; border-radius:5px; transform:rotate(45deg); }
.nav-ico-admin::after { width:12px; height:3px; background:currentColor; transform:rotate(-25deg); }

body.focus-mode .sidebar a {
    gap:0;
}

body.focus-mode .sidebar .nav-ico {
    width:36px;
    height:36px;
    flex-basis:36px;
    border-radius:15px;
}

.sector-card-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
    gap:10px;
    margin-top:12px;
}

.sector-mini-card {
    position:relative;
    display:grid;
    gap:7px;
    min-height:124px;
    padding:12px;
    border:1px solid var(--line);
    border-radius:18px;
    background:linear-gradient(135deg,rgba(255,255,255,.95),rgba(250,246,237,.86));
    color:var(--text);
    text-decoration:none;
    box-shadow:0 8px 18px rgba(20,26,20,.06);
}

.sector-mini-card:hover {
    transform:translateY(-1px);
    border-color:rgba(31,100,70,.28);
    box-shadow:0 15px 28px rgba(20,26,20,.10);
}

.sector-mini-status {
    display:flex;
    align-items:center;
    gap:8px;
    font-size:.82rem;
    font-weight:900;
    color:var(--muted);
}

.sector-mini-card strong {
    font-size:1.05rem;
    line-height:1.1;
}

.sector-mini-card small {
    color:var(--muted);
    line-height:1.2;
}

.sector-mini-metrics {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:5px;
    margin-top:2px;
}

.sector-mini-metrics em {
    padding:5px 6px;
    border-radius:10px;
    background:#f4efe5;
    color:#405047;
    font-size:.75rem;
    font-style:normal;
    font-weight:900;
    text-align:center;
}

.sector-mini-danger { border-color:#dfb1a5; background:linear-gradient(135deg,#fffafa,#ffe9e1); }
.sector-mini-warn { border-color:#e7c888; background:linear-gradient(135deg,#fffdf7,#fff2d1); }
.sector-mini-ok { border-color:#b9d8bf; background:linear-gradient(135deg,#fbfff9,#eef8ef); }
.sector-mini-off { opacity:.72; filter:saturate(.75); }

.inventory-table th,
.inventory-table td {
    padding-top:5px;
    padding-bottom:5px;
    line-height:1.12;
    font-size:.86rem;
}

.inventory-table .button,
.inventory-table button {
    padding:5px 7px !important;
    border-radius:9px !important;
    font-size:.76rem !important;
}

.tool-model-stack {
    display:flex;
    gap:4px;
    flex-wrap:wrap;
    align-items:center;
    max-width:320px;
}

.tool-model-chip,
.tool-model-more,
.tool-model-empty {
    display:inline-flex;
    align-items:center;
    gap:4px;
    max-width:150px;
    min-height:22px;
    padding:3px 6px;
    border:1px solid #d8e5d8;
    border-radius:999px;
    background:#f4fbf4;
    color:#244d34;
    font-size:.72rem;
    font-weight:850;
    white-space:nowrap;
}

.tool-model-chip a {
    color:#174b31;
    text-decoration:none;
    font-weight:950;
}

.tool-model-chip small {
    max-width:62px;
    overflow:hidden;
    text-overflow:ellipsis;
    color:#647067;
    font-size:.68rem;
}

.tool-model-chip em {
    color:#5b674f;
    font-size:.68rem;
    font-style:normal;
}

.tool-model-empty {
    border-style:dashed;
    background:#fbf8f1;
    color:var(--muted);
}

.admin-vault-hero {
    position:relative;
    overflow:hidden;
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(220px,320px);
    gap:22px;
    align-items:center;
    margin-bottom:18px;
    padding:28px;
    border:1px solid rgba(185,63,49,.22);
    border-radius:32px;
    background:
        radial-gradient(circle at 0 0, rgba(185,63,49,.16), transparent 34%),
        radial-gradient(circle at 100% 0, rgba(31,100,70,.14), transparent 32%),
        linear-gradient(135deg,#fffdf8,#f4e8d7);
    box-shadow:0 28px 70px rgba(20,26,20,.14);
}

.admin-vault-hero::after {
    content:"ADMIN";
    position:absolute;
    right:22px;
    bottom:-18px;
    color:rgba(185,63,49,.055);
    font-size:6.4rem;
    line-height:1;
    font-weight:950;
    letter-spacing:-.08em;
}

.admin-vault-hero h2 {
    margin:8px 0 8px;
    font-size:clamp(2.4rem,5vw,4.6rem);
    line-height:.92;
    letter-spacing:-.07em;
}

.admin-vault-hero p {
    max-width:780px;
    margin:0;
    color:#536058;
    font-size:1.04rem;
    line-height:1.45;
}

.admin-vault-gauge {
    position:relative;
    z-index:1;
    display:grid;
    gap:6px;
    padding:22px;
    border:1px solid rgba(185,63,49,.20);
    border-radius:24px;
    background:rgba(255,255,255,.72);
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.58),0 16px 36px rgba(20,26,20,.10);
}

.admin-vault-gauge strong {
    font-size:3.3rem;
    line-height:.9;
    letter-spacing:-.07em;
    color:#8e251d;
}

.admin-vault-gauge span {
    color:var(--muted);
    font-weight:850;
}

.admin-vault-grid {
    display:grid;
    grid-template-columns:minmax(420px,.95fr) minmax(520px,1.25fr);
    gap:16px;
    align-items:start;
}

.admin-vault-panel {
    overflow:hidden;
}

.admin-vault-filter {
    display:grid;
    grid-template-columns:90px minmax(0,1fr);
    gap:9px 10px;
    align-items:center;
    padding:12px;
    border:1px solid #e6d8c1;
    border-radius:18px;
    background:#fffaf1;
}

.admin-vault-filter .button {
    grid-column:2;
    justify-self:start;
}

.admin-vault-filter label,
.admin-vault-danger-form label {
    color:#365142;
    font-size:.78rem;
    font-weight:950;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.admin-vault-preview {
    display:grid;
    gap:8px;
    margin:14px 0;
}

.admin-vault-event {
    display:grid;
    grid-template-columns:auto 1fr;
    gap:4px 9px;
    align-items:center;
    padding:10px;
    border:1px solid #ead4c8;
    border-radius:15px;
    background:linear-gradient(135deg,#fffafa,#fff2ea);
}

.admin-vault-event small {
    grid-column:2;
    color:var(--muted);
}

.admin-vault-danger-form {
    display:grid;
    gap:10px;
    margin-top:12px;
    padding:14px;
    border:1px solid #dfb1a5;
    border-radius:18px;
    background:linear-gradient(135deg,#fff8f6,#ffe8e0);
}

.admin-vault-danger-form button:disabled {
    opacity:.48;
    cursor:not-allowed;
    filter:saturate(.55);
}

.admin-clean-grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
    gap:10px;
}

.admin-clean-card {
    border:1px solid #e4d6bf;
    border-radius:18px;
    background:linear-gradient(135deg,rgba(255,255,255,.94),rgba(250,246,237,.86));
    overflow:hidden;
}

.admin-clean-card summary {
    display:grid;
    grid-template-columns:38px 1fr;
    gap:10px;
    align-items:center;
    padding:12px;
    cursor:pointer;
    list-style:none;
}

.admin-clean-card summary::-webkit-details-marker {
    display:none;
}

.admin-clean-card summary strong {
    display:block;
    line-height:1.12;
}

.admin-clean-card summary small {
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-weight:800;
}

.admin-clean-list {
    display:grid;
    gap:7px;
    padding:0 12px 12px;
}

.admin-clean-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:8px;
    align-items:center;
    padding:8px;
    border:1px solid #ece4d6;
    border-radius:13px;
    background:#fffdf8;
}

.admin-clean-row a {
    min-width:0;
    overflow:hidden;
    color:#1c5137;
    text-overflow:ellipsis;
    white-space:nowrap;
    text-decoration:none;
    font-weight:850;
}

.admin-clean-row .button {
    padding:6px 8px;
    border-radius:10px;
    font-size:.76rem;
}

.admin-pending-panel {
    margin-top:16px;
}

.admin-pending-list {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(250px,1fr));
    gap:10px;
}

.admin-pending-item {
    position:relative;
    overflow:hidden;
    display:grid;
    gap:7px;
    padding:14px;
    border:1px solid #e4d6bf;
    border-radius:18px;
    background:linear-gradient(135deg,#fffdf8,#f7f0e6);
}

.admin-pending-item::after {
    content:"";
    position:absolute;
    right:-24px;
    top:-24px;
    width:78px;
    height:78px;
    border-radius:999px;
    opacity:.16;
    background:var(--pending-color,#2f789b);
}

.admin-pending-item span {
    width:max-content;
    padding:4px 8px;
    border-radius:999px;
    background:var(--pending-color,#2f789b);
    color:white;
    font-size:.72rem;
    font-weight:950;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.admin-pending-item strong {
    line-height:1.16;
}

.admin-pending-item p {
    margin:0;
    color:var(--muted);
    line-height:1.35;
    font-size:.9rem;
}

.admin-pending-item.prioridade-alta { --pending-color:#b93f31; }
.admin-pending-item.prioridade-media { --pending-color:#c77b12; }
.admin-pending-item.prioridade-baixa { --pending-color:#2f789b; }

.nav-ico-admin-vault::before {
    width:18px;
    height:14px;
    border:2px solid currentColor;
    border-radius:4px;
    bottom:6px;
}

.nav-ico-admin-vault::after {
    width:12px;
    height:9px;
    border:2px solid currentColor;
    border-bottom:0;
    border-radius:999px 999px 0 0;
    top:6px;
}

.nav-ico-backup::before {
    width:18px;
    height:18px;
    border:2px solid currentColor;
    border-radius:999px;
    box-shadow:inset 0 -6px 0 rgba(255,255,255,.20);
}

.nav-ico-backup::after {
    width:10px;
    height:8px;
    border-left:3px solid currentColor;
    border-bottom:3px solid currentColor;
    transform:rotate(-45deg);
    top:9px;
}

.admin-command-hero {
    margin-bottom:12px;
}

.admin-tabs {
    position:sticky;
    top:88px;
    z-index:55;
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:0 0 16px;
    padding:10px;
    border:1px solid rgba(223,210,185,.82);
    border-radius:22px;
    background:rgba(255,252,246,.88);
    box-shadow:0 14px 32px rgba(26,31,24,.10);
    backdrop-filter:blur(16px);
}

.admin-tab {
    display:inline-flex;
    gap:8px;
    align-items:center;
    min-height:42px;
    padding:9px 13px;
    border:1px solid rgba(214,195,164,.88);
    border-radius:999px;
    color:#244937;
    text-decoration:none;
    font-weight:950;
    font-size:.88rem;
    background:linear-gradient(135deg,rgba(255,255,255,.92),rgba(245,240,229,.78));
    transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.admin-tab:hover {
    transform:translateY(-1px);
    box-shadow:0 10px 22px rgba(34,54,39,.13);
}

.admin-tab.active {
    color:white;
    border-color:#1f5a3b;
    background:linear-gradient(135deg,#1f5a3b,#2f7650);
}

.admin-tab-grid {
    display:grid;
    grid-template-columns:minmax(0,1.1fr) minmax(320px,.9fr);
    gap:16px;
    align-items:start;
}

.admin-tab-card {
    overflow:hidden;
}

.admin-tab-card.highlight {
    background:
        radial-gradient(circle at top right, rgba(47,118,80,.16), transparent 34%),
        linear-gradient(135deg,#fffdf8,#f3ecdf);
}

.admin-tab-card.compact {
    align-self:start;
}

.embedded-main {
    min-height:100vh;
    padding:16px;
    background:
        radial-gradient(circle at 18% 0%, rgba(31,100,70,.10), transparent 30%),
        linear-gradient(135deg,#f8f2e8,#eee2d0);
}

body.is-embedded-page {
    background:#f8f2e8;
}

body.is-embedded-page .panel {
    box-shadow:0 8px 22px rgba(20,26,20,.07);
}

body.is-embedded-page .breadcrumbs {
    margin-top:0;
}

.admin-embedded-panel {
    padding:14px;
}

.admin-embedded-frame {
    width:100%;
    min-height:72vh;
    height:calc(100vh - 265px);
    border:1px solid rgba(216,202,180,.95);
    border-radius:18px;
    background:#f8f2e8;
    box-shadow:inset 0 0 0 1px rgba(255,255,255,.55);
}

.admin-tab-card h3 {
    margin:.15rem 0 .45rem;
}

.admin-tab-card p {
    margin:.3rem 0 .9rem;
    color:var(--muted);
    line-height:1.45;
}

.admin-action-row {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    align-items:center;
}

.admin-action-row.compact {
    justify-content:flex-end;
}

.admin-action-row.compact .button {
    padding:7px 10px;
    border-radius:12px;
    font-size:.78rem;
}

.admin-mini-table,
.admin-log-list,
.admin-backup-list {
    display:grid;
    gap:8px;
}

.admin-mini-row,
.admin-log-row,
.admin-backup-row {
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:12px;
    align-items:center;
    padding:10px 12px;
    border:1px solid #e8ddca;
    border-radius:16px;
    background:rgba(255,255,255,.72);
    text-decoration:none;
    color:inherit;
}

.admin-mini-row:hover,
.admin-backup-row:hover {
    border-color:#b8cdbb;
    background:#fff;
}

.admin-mini-row strong,
.admin-backup-row strong {
    display:block;
    overflow:hidden;
    max-width:100%;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.admin-mini-row span,
.admin-stat-pill {
    width:max-content;
    padding:4px 8px;
    border-radius:999px;
    background:#eaf2e8;
    color:#1f5a3b;
    font-size:.72rem;
    font-weight:950;
}

.admin-mini-row small,
.admin-backup-row small,
.admin-log-row small {
    display:block;
    margin-top:3px;
    color:var(--muted);
    font-size:.78rem;
}

.admin-log-row {
    grid-template-columns:auto minmax(0,1fr) auto;
}

.admin-log-row time {
    color:var(--muted);
    font-size:.78rem;
    font-weight:850;
    white-space:nowrap;
}

.admin-stat-row {
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    margin:8px 0 12px;
}

.admin-stat-pill strong {
    margin-left:6px;
    color:#0f261b;
}

.admin-link-card {
    display:block;
    margin:8px 0;
    padding:12px;
    border:1px solid #e0d4be;
    border-radius:16px;
    color:#1f5a3b;
    background:#fffdf8;
    text-decoration:none;
    font-weight:950;
}

.admin-backup-config {
    display:grid;
    grid-template-columns:120px minmax(0,1fr);
    gap:9px;
    align-items:center;
}

.admin-backup-config label {
    color:#365142;
    font-size:.76rem;
    font-weight:950;
    letter-spacing:.06em;
    text-transform:uppercase;
}

.admin-backup-config button {
    grid-column:2;
    justify-self:start;
}

.admin-backup-meta {
    display:grid;
    gap:6px;
    margin-top:12px;
    padding:10px;
    border-radius:14px;
    background:#f7f1e7;
    color:var(--muted);
    font-size:.8rem;
    font-weight:800;
}

.admin-backup-row {
    grid-template-columns:minmax(0,1fr) auto;
}

.admin-backup-row form {
    margin:0;
}

.admin-restore-alert {
    display:flex;
    gap:16px;
    align-items:center;
    justify-content:space-between;
    margin:16px 0;
    border-color:#d98f6b;
    background:linear-gradient(135deg,#fff3ea,#fffaf4);
}

.admin-restore-alert h3 {
    margin:.15rem 0 .25rem;
    color:#8d361d;
}

body[data-theme="dark"] .admin-tabs {
    border-color:rgba(255,255,255,.12);
    background:rgba(25,31,26,.86);
}

body[data-theme="dark"] .admin-tab {
    color:#dfeee2;
    border-color:rgba(255,255,255,.12);
    background:linear-gradient(135deg,rgba(40,49,42,.95),rgba(27,34,29,.9));
}

body[data-theme="dark"] .admin-tab.active {
    background:linear-gradient(135deg,#2f7650,#4f9a69);
}

body[data-theme="dark"] .admin-mini-row,
body[data-theme="dark"] .admin-log-row,
body[data-theme="dark"] .admin-backup-row,
body[data-theme="dark"] .admin-link-card {
    border-color:rgba(255,255,255,.10);
    background:rgba(255,255,255,.04);
}

@media (max-width:1180px) {
    .admin-vault-grid,
    .admin-vault-hero,
    .admin-tab-grid {
        grid-template-columns:1fr;
    }
}

@media (max-width:760px) {
    .admin-tabs {
        top:72px;
        overflow:auto;
        flex-wrap:nowrap;
    }

    .admin-tab {
        white-space:nowrap;
    }

    .admin-log-row,
    .admin-backup-row,
    .admin-mini-row {
        grid-template-columns:1fr;
    }

    .admin-backup-config,
    .admin-vault-filter {
        grid-template-columns:1fr;
    }

    .admin-backup-config button,
    .admin-vault-filter .button {
        grid-column:1;
    }
}
