* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --primary-dark: #1e40af;
    --primary-soft: #dbeafe;
    --secondary: #10b981;
    --secondary-dark: #047857;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --warning: #f59e0b;
    --info: #06b6d4;
    --light: #f5f7fb;
    --dark: #1f2937;
    --text: #374151;
    --muted: #6b7280;
    --border: #d8dee9;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.28);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12);
    --radius-sm: 6px;
    --radius-md: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a,
button,
input,
select,
textarea,
summary,
[tabindex] {
    outline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary);
    box-shadow: var(--focus-ring);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(216, 222, 233, 0.8);
    backdrop-filter: blur(10px);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary);
}

nav {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease, color 0.2s ease;
}

nav a:hover,
nav a.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.unidade-atual-header {
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--surface-muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    width: 100%;
    text-align: right;
}

.unidade-atual-header strong {
    color: var(--primary);
}

body.dark-mode .unidade-atual-header {
    background: #374151;
    color: #e5e7eb;
}

/* Agenda diaria */
.agenda-page {
    padding-bottom: 60px;
}

.agenda-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 22px;
    align-items: stretch;
    margin-bottom: 24px;
    padding: 28px;
    border-radius: 18px;
    background: linear-gradient(135deg, #172554, #2563eb 58%, #0f766e);
    color: #fff;
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.2);
}

.agenda-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: #a7f3d0;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.agenda-hero h1 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 38px;
    line-height: 1.1;
}

.agenda-hero p {
    margin: 0;
    max-width: 760px;
    color: #dbeafe;
    font-size: 16px;
}

.agenda-hero__panel {
    padding: 18px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 14px;
    background: rgba(255,255,255,.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.agenda-hero__panel span,
.agenda-hero__panel small {
    color: #dbeafe;
}

.agenda-hero__panel strong {
    font-size: 24px;
    color: #fff;
}

.agenda-toolbar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
}

.agenda-date-control,
.agenda-tabs,
.agenda-metrics,
.agenda-pen-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.agenda-date-control input,
.agenda-toolbar select {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
}

.agenda-tabs {
    padding: 5px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
}

.agenda-tab {
    min-height: 38px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #475569;
    font-weight: 900;
    cursor: pointer;
}

.agenda-tab.active {
    background: #1e40af;
    color: #fff;
}

.agenda-grid-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 22px;
    align-items: start;
}

.agenda-day,
.agenda-side > * {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.agenda-day {
    overflow: hidden;
}

.agenda-day__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.agenda-day__header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
}

.agenda-day__header p {
    margin: 2px 0 0;
    color: #64748b;
}

.agenda-metrics span {
    padding: 8px 10px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.agenda-metrics strong {
    color: #0f172a;
}

.agenda-timeline {
    position: relative;
    min-height: 1380px;
    padding: 0 16px 20px 78px;
}

.agenda-slot {
    height: 60px;
    position: relative;
}

.agenda-slot__hora {
    position: absolute;
    left: -58px;
    top: -9px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.agenda-slot__linha {
    border-top: 1px solid #e2e8f0;
}

.agenda-event {
    position: absolute;
    left: 86px;
    right: 18px;
    min-height: 54px;
    padding: 10px 14px;
    border: 1px solid #bfdbfe;
    border-left: 5px solid #3b82f6;
    border-radius: 10px;
    background: #eff6ff;
    color: #0f172a;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .12);
}

.agenda-event span,
.agenda-event small {
    display: block;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.agenda-event strong {
    display: block;
    margin: 2px 0;
    font-size: 15px;
}

.agenda-event--alta { border-left-color: #f59e0b; background: #fffbeb; border-color: #fde68a; }
.agenda-event--critica { border-left-color: #ef4444; background: #fef2f2; border-color: #fecaca; }
.agenda-event--baixa { border-left-color: #10b981; background: #ecfdf5; border-color: #bbf7d0; }
.agenda-event--feito { opacity: .76; }

.agenda-empty {
    position: absolute;
    top: 26px;
    left: 90px;
    right: 20px;
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-weight: 800;
}

.agenda-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 116px;
}

.agenda-rasbic-card,
.agenda-pen-card {
    padding: 18px;
}

.agenda-rasbic-card {
    background: linear-gradient(180deg, #ffffff, #f0fdfa);
    border-color: #99f6e4;
}

.agenda-rasbic-card h2,
.agenda-pen-card h2 {
    margin: 0 0 8px;
    color: #0f172a;
}

.agenda-rasbic-card p {
    margin: 0 0 12px;
    color: #475569;
}

.agenda-rasbic-card dl {
    display: grid;
    gap: 10px;
    margin: 0 0 14px;
}

.agenda-rasbic-card dt {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.agenda-rasbic-card dd {
    margin: 0;
    color: #0f172a;
}

.agenda-anexos-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-anexo {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #1e40af;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.agenda-anexo-vazio {
    color: #64748b;
    font-size: 13px;
}

.agenda-edit-selected {
    margin-top: 12px;
}

#agenda-canvas {
    width: 100%;
    height: 240px;
    margin: 12px 0;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #fff;
    touch-action: none;
}

.agenda-swatch {
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-radius: 999px;
    background: var(--swatch);
    cursor: pointer;
}

.agenda-swatch.active {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
}

.agenda-modal-content {
    max-width: 920px;
}

.agenda-form-rasbic,
.agenda-form-accountability {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
}

.agenda-form-rasbic h3,
.agenda-form-accountability h3 {
    margin: 0 0 12px;
    color: #0f172a;
}

body.dark-mode .agenda-toolbar,
body.dark-mode .agenda-day,
body.dark-mode .agenda-side > *,
body.dark-mode .agenda-form-rasbic,
body.dark-mode .agenda-form-accountability {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .agenda-day__header,
body.dark-mode .agenda-slot__linha {
    border-color: #334155;
}

body.dark-mode .agenda-day__header h2,
body.dark-mode .agenda-rasbic-card h2,
body.dark-mode .agenda-pen-card h2,
body.dark-mode .agenda-form-rasbic h3,
body.dark-mode .agenda-form-accountability h3,
body.dark-mode .agenda-rasbic-card dd {
    color: #e5e7eb;
}

body.dark-mode .agenda-day__header p,
body.dark-mode .agenda-slot__hora,
body.dark-mode .agenda-rasbic-card p,
body.dark-mode .agenda-rasbic-card dt,
body.dark-mode .agenda-anexo-vazio {
    color: #cbd5e1;
}

body.dark-mode .agenda-metrics span,
body.dark-mode .agenda-empty {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark-mode .agenda-metrics strong {
    color: #fff;
}

body.dark-mode .agenda-rasbic-card {
    background: linear-gradient(180deg, #1e293b, #0f172a);
}

body.dark-mode .agenda-anexo,
body.dark-mode #agenda-canvas {
    background: #0f172a;
    border-color: #334155;
}

@media (max-width: 1080px) {
    .agenda-grid-shell,
    .agenda-hero {
        grid-template-columns: 1fr;
    }

    .agenda-side {
        position: static;
    }
}

@media (max-width: 720px) {
    .agenda-hero {
        padding: 22px;
        border-radius: 14px;
    }

    .agenda-hero h1 {
        font-size: 30px;
    }

    .agenda-toolbar,
    .agenda-date-control,
    .agenda-tabs {
        width: 100%;
    }

    .agenda-date-control input,
    .agenda-date-control .btn,
    .agenda-tab,
    #agenda-nova {
        flex: 1;
        min-height: 46px;
    }

    .agenda-day__header,
    .agenda-metrics {
        flex-direction: column;
        align-items: stretch;
    }

    .agenda-timeline {
        min-height: auto;
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agenda-slot {
        display: none;
    }

    .agenda-event,
    .agenda-empty {
        position: static;
        width: 100%;
        min-height: 76px;
    }

    #agenda-canvas {
        height: 300px;
    }
}

/* Agenda executiva - layout alinhado ao prototipo S Pen */
.agenda-page {
    max-width: 1480px;
}

.agenda-hero--executiva {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 18px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.agenda-hero__main,
.agenda-hero--executiva .agenda-hero__panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
}

.agenda-hero__main {
    padding: clamp(22px, 3vw, 34px);
    background:
        linear-gradient(135deg, rgba(15, 23, 42, .97), rgba(37, 99, 235, .9)),
        #0f172a;
    color: #fff;
}

.agenda-hero__main h1 {
    max-width: 900px;
    font-size: clamp(32px, 4.5vw, 54px);
    line-height: .98;
}

.agenda-hero__main p {
    max-width: 820px;
    font-size: clamp(15px, 2vw, 18px);
    line-height: 1.55;
}

.agenda-hero--executiva .agenda-hero__panel {
    background: #fff;
    color: #0f172a;
}

.agenda-hero--executiva .agenda-hero__panel span,
.agenda-hero--executiva .agenda-hero__panel small {
    color: #64748b;
}

.agenda-hero--executiva .agenda-hero__panel strong {
    color: #0f172a;
}

.agenda-toolbar {
    box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
}

.agenda-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.agenda-metric-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .05);
}

.agenda-metric-card span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.agenda-metric-card strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: 30px;
    line-height: 1;
}

.agenda-focus-panel {
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
    overflow: hidden;
}

.agenda-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.agenda-panel-head h2 {
    margin: 4px 0 0;
    color: #0f172a;
    font-size: 21px;
}

.agenda-risk-body {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr);
    gap: 16px;
    padding: 16px;
}

.agenda-risk-body .agenda-rasbic-card,
.agenda-risk-body .agenda-pen-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

.agenda-dropzone {
    display: grid;
    place-items: center;
    min-height: 112px;
    margin: 14px 0;
    padding: 16px;
    border: 2px dashed #93c5fd;
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8;
    text-align: center;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.agenda-dropzone small {
    display: block;
    margin-top: 4px;
    color: #64748b;
    font-weight: 750;
}

#agenda-canvas {
    height: 280px;
    border-style: solid;
    border-radius: 14px;
}

.agenda-pen-tools {
    justify-content: space-between;
    padding: 12px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

.agenda-swatch {
    width: 36px;
    height: 36px;
    min-height: 36px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px var(--border);
}

.agenda-grid-shell--single {
    display: block;
}

.agenda-view-tabs {
    display: flex;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.agenda-view-tab {
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-weight: 900;
    cursor: pointer;
}

.agenda-view-tab.active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.agenda-day-badge {
    display: grid;
    gap: 2px;
    min-width: 190px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f1f5f9;
}

.agenda-day-badge span {
    color: #64748b;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.agenda-day-badge strong {
    color: #0f172a;
}

@media (pointer: coarse) {
    .agenda-tab,
    .agenda-view-tab,
    .agenda-event,
    .agenda-dropzone,
    .agenda-date-control input,
    .agenda-toolbar .btn {
        min-height: 48px;
    }
}

@media (max-width: 1000px) {
    .agenda-hero--executiva,
    .agenda-risk-body {
        grid-template-columns: 1fr;
    }

    .agenda-dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .agenda-dashboard-metrics {
        grid-template-columns: 1fr;
    }

    .agenda-panel-head {
        flex-direction: column;
    }

    .agenda-panel-head .btn,
    .agenda-pen-tools .btn {
        width: 100%;
    }

    .agenda-day-badge {
        width: 100%;
    }
}

body.dark-mode .agenda-hero__main {
    border-color: #334155;
}

body.dark-mode .agenda-hero--executiva .agenda-hero__panel,
body.dark-mode .agenda-metric-card,
body.dark-mode .agenda-focus-panel,
body.dark-mode .agenda-view-tab {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .agenda-panel-head,
body.dark-mode .agenda-pen-tools,
body.dark-mode .agenda-day-badge {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .agenda-hero--executiva .agenda-hero__panel strong,
body.dark-mode .agenda-metric-card strong,
body.dark-mode .agenda-panel-head h2,
body.dark-mode .agenda-view-tab,
body.dark-mode .agenda-day-badge strong {
    color: #e5e7eb;
}

body.dark-mode .agenda-hero--executiva .agenda-hero__panel span,
body.dark-mode .agenda-hero--executiva .agenda-hero__panel small,
body.dark-mode .agenda-metric-card span,
body.dark-mode .agenda-day-badge span {
    color: #cbd5e1;
}

/* Agenda semanal igual ao quadro executivo */
.agenda-page {
    max-width: none;
    padding: 0 20px 48px;
}

.agenda-board {
    border: 1px solid #d6e2f1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.agenda-day-console {
    margin-bottom: 16px;
    border: 1px solid #d6e2f1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.agenda-day-console__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid #d6e2f1;
    background: #f8fafc;
}

.agenda-day-console__head h1 {
    margin: 2px 0 4px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.15;
}

.agenda-day-console__head p {
    margin: 0;
    color: #52667f;
    font-size: 14px;
    font-weight: 800;
}

.agenda-day-nav {
    display: grid;
    grid-template-columns: 52px minmax(92px, auto) 52px;
    gap: 8px;
}

.agenda-icon-button,
.agenda-day-nav__today {
    min-height: 52px;
    border: 1px solid #c8d7e8;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.agenda-icon-button {
    font-size: 22px;
}

.agenda-day-nav__today {
    padding: 0 18px;
}

.agenda-day-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #d6e2f1;
}

.agenda-day-metric {
    min-width: 0;
    padding: 12px;
    border: 1px solid #d6e2f1;
    border-radius: 10px;
    background: #ffffff;
}

button.agenda-day-metric {
    text-align: left;
}

.agenda-day-metric--clickable {
    cursor: pointer;
    touch-action: manipulation;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.agenda-day-metric--clickable:hover,
.agenda-day-metric--clickable:focus-visible {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
    outline: none;
}

.agenda-day-metric span,
.agenda-day-metric strong,
.agenda-day-metric small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-day-metric span {
    color: #64748b;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.agenda-day-metric strong {
    margin-top: 5px;
    color: #0f172a;
    font-size: 18px;
    line-height: 1.2;
}

.agenda-day-metric small {
    margin-top: 3px;
    color: #52667f;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
}

.agenda-day-list {
    display: grid;
    gap: 8px;
    padding: 12px 16px 16px;
    background: #ffffff;
}

.agenda-report-panel {
    margin-bottom: 16px;
    border: 1px solid #d6e2f1;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.agenda-report-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #d6e2f1;
    background: #f8fafc;
}

.agenda-report-panel__head h2 {
    margin: 2px 0 0;
    color: #0f172a;
    font-size: 18px;
    line-height: 1.2;
}

.agenda-report-controls {
    display: grid;
    grid-template-columns: 160px 140px 180px minmax(180px, 1fr);
    gap: 10px;
    align-items: center;
    padding: 12px 16px 16px;
}

.agenda-report-controls .agenda-board-filter {
    width: 100%;
}

.agenda-report-controls span {
    color: #475569;
    font-size: 13px;
    font-weight: 900;
}

.agenda-day-empty {
    display: grid;
    gap: 4px;
    padding: 16px;
    border: 1px dashed #c8d7e8;
    border-radius: 10px;
    background: #f8fafc;
}

.agenda-day-empty strong {
    color: #0f172a;
    font-size: 16px;
}

.agenda-day-empty span {
    color: #52667f;
    font-size: 14px;
}

.agenda-day-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: stretch;
    border: 1px solid #d6e2f1;
    border-left: 5px solid #2563eb;
    border-radius: 10px;
    background: #eff6ff;
    overflow: hidden;
}

.agenda-day-item--feito {
    border-left-color: #059669;
    background: #ecfdf5;
}

.agenda-day-item--bloqueado {
    border-left-color: #dc2626;
    background: #fff0f0;
}

.agenda-day-item--excesso {
    border-color: #fecaca;
    border-left-color: #dc2626;
    background: #fff0f0;
}

.agenda-day-item--excesso .agenda-day-item__main strong,
.agenda-day-item--excesso .agenda-day-item__main time {
    color: #991b1b;
}

.agenda-day-item__main {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 12px;
    border: 0;
    background: transparent;
    color: #1e3a8a;
    text-align: left;
    cursor: pointer;
}

.agenda-day-item__main time,
.agenda-day-item__main strong,
.agenda-day-item__main span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-day-item__main time {
    color: #475569;
    font-size: 12px;
    font-weight: 900;
}

.agenda-day-item__main strong {
    color: #0f172a;
    font-size: 16px;
    line-height: 1.2;
}

.agenda-day-item__main span {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.agenda-day-item__actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(86px, auto));
    gap: 6px;
    align-items: center;
    padding: 8px;
}

.agenda-day-item__actions button {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid #c8d7e8;
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.agenda-pending-list,
.agenda-completed-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 8px;
    padding: 12px 16px 16px;
}

.agenda-pendencias-modal-content,
.agenda-concluidas-modal-content {
    width: min(960px, calc(100vw - 24px));
    max-height: min(86vh, 820px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.agenda-concluidas-modal-content .modal-header p {
    margin: 4px 0 0;
    color: #52667f;
    font-size: 13px;
    font-weight: 900;
}

.agenda-pending-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    border: 1px solid #d6e2f1;
    border-left: 5px solid #d97706;
    border-radius: 10px;
    background: #fff8e6;
    overflow: hidden;
}

.agenda-completed-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: stretch;
    border: 1px solid #bbf7d0;
    border-left: 5px solid #059669;
    border-radius: 10px;
    background: #ecfdf5;
    overflow: hidden;
}

.agenda-pending-item--excesso {
    border-color: #fecaca;
    border-left-color: #dc2626;
    background: #fff0f0;
}

.agenda-pending-item__main {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.agenda-completed-item__main {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 11px 12px;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.agenda-pending-item__main time,
.agenda-pending-item__main strong,
.agenda-pending-item__main span,
.agenda-pending-item__main small,
.agenda-completed-item__main time,
.agenda-completed-item__main strong,
.agenda-completed-item__main span,
.agenda-completed-item__main small,
.agenda-day-item__main small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-pending-item__main time {
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
}

.agenda-pending-item__main strong {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.2;
}

.agenda-completed-item__main time {
    color: #047857;
    font-size: 12px;
    font-weight: 900;
}

.agenda-completed-item__main strong {
    color: #0f172a;
    font-size: 15px;
    line-height: 1.2;
}

.agenda-pending-item__main span {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.agenda-pending-item__main small,
.agenda-completed-item__main small,
.agenda-day-item__main small {
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.agenda-completed-item__main span {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.agenda-pending-item__actions {
    display: grid;
    gap: 6px;
    align-content: center;
    padding: 8px;
}

.agenda-completed-item__actions {
    display: grid;
    gap: 6px;
    align-content: center;
    padding: 8px;
}

.agenda-pending-item__actions button {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #c8d7e8;
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.agenda-completed-item__actions button {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .84);
    color: #0f172a;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    touch-action: manipulation;
}

.agenda-pending-empty,
.agenda-pending-more,
.agenda-completed-empty {
    padding: 12px;
    border: 1px dashed #c8d7e8;
    border-radius: 10px;
    background: #f8fafc;
    color: #52667f;
    font-size: 13px;
    font-weight: 800;
}

.agenda-board,
.agenda-detail-panel,
.agenda-modal-content {
    touch-action: manipulation;
}

.agenda-board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border-bottom: 1px solid #d6e2f1;
    background: #fff;
}

.agenda-board-tabs,
.agenda-board-actions,
.agenda-scope-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.agenda-board-tab,
.agenda-board-button {
    min-height: 50px;
    padding: 12px 18px;
    border: 1px solid #d6e2f1;
    border-radius: 10px;
    background: #ffffff;
    color: #0f172a;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.agenda-board-tab.active {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, .35);
}

.agenda-board-button--primary {
    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;
}

.agenda-board-actions input,
.agenda-board-filter {
    width: 112px;
    min-height: 50px;
    padding: 10px 12px;
    border: 1px solid #d6e2f1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
}

.agenda-board-filter {
    width: 178px;
    max-width: 100%;
}

.agenda-board-date-field {
    display: none;
}

.agenda-scope-row {
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #d6e2f1;
    background: #f8fafc;
}

.agenda-week-label {
    color: #475569;
    font-size: 13px;
    font-weight: 900;
}

.agenda-week-grid {
    display: grid;
    grid-template-columns: 110px repeat(6, minmax(190px, 1fr));
    overflow-x: auto;
    background: #fff;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.agenda-week-body {
    display: contents;
}

.agenda-week-corner,
.agenda-week-day,
.agenda-week-time,
.agenda-week-slot {
    border-right: 1px solid #d6e2f1;
    border-bottom: 1px solid #d6e2f1;
}

.agenda-week-corner,
.agenda-week-day {
    min-height: 74px;
    background: #f8fafc;
}

.agenda-week-day {
    padding: 14px;
}

.agenda-week-day strong,
.agenda-week-day span,
.agenda-week-day small {
    display: block;
}

.agenda-week-day strong {
    color: #0f172a;
    font-size: 17px;
    line-height: 1.2;
}

.agenda-week-day span,
.agenda-week-day small {
    color: #52667f;
    font-size: 14px;
}

.agenda-week-day small {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 800;
}

.agenda-week-time {
    min-height: 74px;
    padding: 14px 12px;
    background: #f8fafc;
    color: #52667f;
    font-size: 17px;
    font-weight: 900;
}

.agenda-week-slot {
    position: relative;
    min-height: 74px;
    padding: 7px;
    background: #ffffff;
}

.agenda-week-slot--ocupado {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(37, 99, 235, .12) 0,
            rgba(37, 99, 235, .12) 8px,
            rgba(37, 99, 235, .03) 8px,
            rgba(37, 99, 235, .03) 16px
        ),
        #f8fbff;
}

.agenda-week-slot--ocupado::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 1px dashed rgba(37, 99, 235, .28);
    border-radius: 8px;
    pointer-events: none;
}

.agenda-week-slot--excesso {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(220, 38, 38, .18) 0,
            rgba(220, 38, 38, .18) 8px,
            rgba(220, 38, 38, .05) 8px,
            rgba(220, 38, 38, .05) 16px
        ),
        #fff5f5;
}

.agenda-week-slot--excesso::before {
    border-color: rgba(220, 38, 38, .42);
}

.agenda-week-task {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 59px;
    padding: 10px 12px;
    border: 0;
    border-left: 4px solid #2563eb;
    border-radius: 9px;
    background: #eff6ff;
    color: #1e3a8a;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.agenda-week-task + .agenda-week-task {
    margin-top: 6px;
}

.agenda-week-task strong {
    overflow: hidden;
    color: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-week-task small {
    overflow: hidden;
    color: #0f2f57;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-category-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .72);
    color: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-category-chip--excesso {
    background: #fee2e2;
    color: #991b1b;
}

.agenda-week-task--operacao {
    border-left-color: #059669;
    background: #e8f8ef;
    color: #006b51;
}

.agenda-week-task--reuniao {
    border-left-color: #d97706;
    background: #fff8e6;
    color: #9a3412;
}

.agenda-week-task--critica {
    border-left-color: #dc2626;
    background: #fff0f0;
    color: #b91c1c;
}

.agenda-week-task--excesso {
    border-left-color: #dc2626;
    background: #fff0f0;
    color: #991b1b;
    box-shadow: inset 0 0 0 1px rgba(220, 38, 38, .2);
}

.agenda-week-task--feito {
    border-left-color: #059669;
    background: #ecfdf5;
    color: #065f46;
    opacity: .78;
}

.agenda-mobile-list {
    display: none;
}

.agenda-detail-panel {
    margin-top: 18px;
    border: 1px solid #d6e2f1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.agenda-mobile-day {
    border: 1px solid #d6e2f1;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    min-width: 0;
}

.agenda-mobile-day h3 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
    padding: 12px;
    background: #f8fafc;
    color: #0f172a;
    font-size: 15px;
}

.agenda-mobile-day h3 span,
.agenda-mobile-day p {
    color: #64748b;
    font-size: 12px;
}

.agenda-mobile-day p {
    margin: 0;
    padding: 12px;
}

.agenda-mobile-day .agenda-week-task {
    border-radius: 0;
    border-left-width: 5px;
}

body.agenda-device-tablet .agenda-page {
    padding: 0 14px 38px;
}

body.agenda-device-tablet .agenda-day-console__head {
    padding: 14px;
}

body.agenda-device-tablet .agenda-day-console__head h1 {
    font-size: 22px;
}

body.agenda-device-tablet .agenda-day-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 10px 14px;
}

body.agenda-device-tablet .agenda-day-list {
    padding: 10px 14px 14px;
}

body.agenda-device-tablet .agenda-report-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.agenda-device-tablet .agenda-day-item__main {
    min-height: 68px;
}

body.agenda-device-tablet .agenda-day-item__actions button {
    min-height: 46px;
}

body.agenda-device-tablet .agenda-board-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

body.agenda-device-tablet .agenda-board-tabs,
body.agenda-device-tablet .agenda-board-actions {
    display: grid;
    width: 100%;
    gap: 8px;
}

body.agenda-device-tablet .agenda-board-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.agenda-device-tablet .agenda-board-actions {
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 1fr) auto auto;
}

body.agenda-device-tablet .agenda-board-tab,
body.agenda-device-tablet .agenda-board-button,
body.agenda-device-tablet .agenda-board-filter {
    min-height: 48px;
    font-size: 15px;
    min-width: 0;
    width: 100%;
}

body.agenda-device-tablet .agenda-board-tab,
body.agenda-device-tablet .agenda-board-button {
    padding: 10px 12px;
}

body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-grid {
    grid-template-columns: 86px repeat(6, minmax(142px, 1fr));
    overflow-x: hidden;
}

body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-day,
body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-time,
body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-slot {
    min-height: 82px;
}

body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-day {
    padding: 10px;
}

body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-time {
    padding: 12px 10px;
    font-size: 15px;
}

body.agenda-device-tablet.agenda-orientation-landscape .agenda-week-task {
    min-height: 64px;
    padding: 8px 9px;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-week-grid {
    display: none;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-day-console__head {
    align-items: stretch;
    flex-direction: column;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-day-nav {
    grid-template-columns: 64px 1fr 64px;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-day-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-day-item {
    grid-template-columns: 1fr;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-day-item__actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 0;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-pending-list,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-completed-list {
    grid-template-columns: 1fr;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-pending-item,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-completed-item {
    grid-template-columns: 1fr;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-pending-item__actions,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-completed-item__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-mobile-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 12px;
    background: #f8fafc;
    -webkit-overflow-scrolling: touch;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-board-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.agenda-device-tablet.agenda-orientation-portrait #agenda-filtro-unidade,
body.agenda-device-tablet.agenda-orientation-portrait #agenda-filtro-categoria {
    grid-column: span 1;
}

body.agenda-device-tablet.agenda-orientation-portrait .agenda-mobile-day .agenda-week-task {
    min-height: 72px;
}

body.agenda-device-tablet .agenda-risk-body {
    grid-template-columns: 1fr;
}

body.agenda-device-tablet #agenda-canvas {
    height: 240px;
}

body.agenda-device-tablet .agenda-modal-content {
    width: min(94vw, 880px);
    max-height: min(92vh, 980px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.agenda-device-mobile .agenda-board,
body.agenda-device-mobile .agenda-detail-panel,
body.agenda-device-mobile .agenda-day-console,
body.agenda-device-mobile .agenda-report-panel,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-board,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-day-console,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-report-panel,
body.agenda-device-tablet.agenda-orientation-portrait .agenda-detail-panel {
    border-radius: 10px;
}

@media (max-width: 900px) {
    .agenda-board-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-board-tabs,
    .agenda-board-actions {
        width: 100%;
    }

    .agenda-board-tab,
    .agenda-board-button,
    .agenda-board-actions input,
    .agenda-board-filter {
        flex: 1;
    }
}

@media (max-width: 720px) {
    .agenda-page {
        padding: 0 10px 34px;
    }

    .agenda-week-grid {
        display: none;
    }

    .agenda-day-console__head {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
    }

    .agenda-day-console__head h1 {
        font-size: 20px;
    }

    .agenda-day-nav {
        grid-template-columns: 58px 1fr 58px;
    }

    .agenda-day-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px 12px;
    }

    .agenda-day-list {
        padding: 10px 12px 12px;
    }

    .agenda-report-panel__head {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
    }

    .agenda-report-controls {
        grid-template-columns: 1fr;
        padding: 10px 12px 12px;
    }

    .agenda-day-item {
        grid-template-columns: 1fr;
    }

    .agenda-day-item__actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding-top: 0;
    }

    .agenda-day-item__actions button {
        min-width: 0;
        padding: 8px 6px;
        font-size: 12px;
    }

    .agenda-pending-list,
    .agenda-completed-list {
        grid-template-columns: 1fr;
        padding: 10px 12px 12px;
    }

    .agenda-pending-item,
    .agenda-completed-item {
        grid-template-columns: 1fr;
    }

    .agenda-pending-item__actions,
    .agenda-completed-item__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 0;
    }

    .agenda-mobile-list {
        display: grid;
        gap: 10px;
        padding: 12px;
        background: #f8fafc;
    }

    .agenda-board-tab,
    .agenda-board-button {
        min-height: 48px;
        padding: 10px 12px;
        font-size: 15px;
    }

    .agenda-board-tabs,
    .agenda-board-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .agenda-board-filter,
    .agenda-board-actions input {
        width: 100%;
        min-width: 0;
    }

    .agenda-board-button--primary,
    #agenda-filtro-unidade,
    #agenda-filtro-categoria {
        grid-column: 1 / -1;
    }

    .agenda-mobile-day h3 {
        align-items: flex-start;
        flex-direction: column;
    }

    .agenda-mobile-day .agenda-week-task {
        min-height: 70px;
        padding: 11px 12px;
    }

    .agenda-scope-row {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-week-label {
        line-height: 1.35;
    }

    .agenda-panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-risk-body {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    #agenda-canvas {
        height: 220px;
    }

    .agenda-pen-tools {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .agenda-pen-tools input[type="range"],
    .agenda-pen-tools .btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .agenda-modal-content {
        width: calc(100vw - 18px);
        max-height: calc(100dvh - 18px);
        margin: 9px auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .agenda-modal-content .form-grid {
        grid-template-columns: 1fr;
    }
}

body.dark-mode .agenda-board,
body.dark-mode .agenda-detail-panel,
body.dark-mode .agenda-day-console,
body.dark-mode .agenda-report-panel,
body.dark-mode .agenda-mobile-day {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .agenda-board-toolbar,
body.dark-mode .agenda-scope-row,
body.dark-mode .agenda-day-console__head,
body.dark-mode .agenda-report-panel__head,
body.dark-mode .agenda-week-corner,
body.dark-mode .agenda-week-day,
body.dark-mode .agenda-week-time,
body.dark-mode .agenda-mobile-day h3 {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .agenda-week-slot {
    background: #111827;
    border-color: #334155;
}

body.dark-mode .agenda-week-slot--ocupado {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(96, 165, 250, .18) 0,
            rgba(96, 165, 250, .18) 8px,
            rgba(96, 165, 250, .05) 8px,
            rgba(96, 165, 250, .05) 16px
        ),
        #111827;
}

body.dark-mode .agenda-week-slot--ocupado::before {
    border-color: rgba(96, 165, 250, .34);
}

body.dark-mode .agenda-week-slot--excesso {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(248, 113, 113, .22) 0,
            rgba(248, 113, 113, .22) 8px,
            rgba(248, 113, 113, .06) 8px,
            rgba(248, 113, 113, .06) 16px
        ),
        #1f1115;
}

body.dark-mode .agenda-week-slot--excesso::before {
    border-color: rgba(248, 113, 113, .4);
}

body.dark-mode .agenda-day-metrics,
body.dark-mode .agenda-day-list {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .agenda-day-metric,
body.dark-mode .agenda-day-empty,
body.dark-mode .agenda-day-item,
body.dark-mode .agenda-pending-empty,
body.dark-mode .agenda-pending-more,
body.dark-mode .agenda-completed-empty,
body.dark-mode .agenda-pending-item,
body.dark-mode .agenda-completed-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .agenda-day-item--excesso,
body.dark-mode .agenda-pending-item--excesso,
body.dark-mode .agenda-week-task--excesso {
    background: #3f1518;
    border-color: #7f1d1d;
    color: #fecaca;
}

body.dark-mode .agenda-day-item--excesso .agenda-day-item__main strong,
body.dark-mode .agenda-day-item--excesso .agenda-day-item__main time,
body.dark-mode .agenda-category-chip--excesso {
    color: #fecaca;
}

body.dark-mode .agenda-category-chip--excesso {
    background: #7f1d1d;
}

body.dark-mode .agenda-week-day strong,
body.dark-mode .agenda-board-tab,
body.dark-mode .agenda-board-button,
body.dark-mode .agenda-icon-button,
body.dark-mode .agenda-day-nav__today,
body.dark-mode .agenda-day-console__head h1,
body.dark-mode .agenda-report-panel__head h2,
body.dark-mode .agenda-day-metric strong,
body.dark-mode .agenda-day-metric small,
body.dark-mode .agenda-day-empty strong,
body.dark-mode .agenda-day-item__main strong,
body.dark-mode .agenda-day-item__actions button,
body.dark-mode .agenda-pending-item__main strong,
body.dark-mode .agenda-pending-item__actions button,
body.dark-mode .agenda-completed-item__main strong,
body.dark-mode .agenda-completed-item__actions button,
body.dark-mode .agenda-mobile-day h3 {
    color: #e5e7eb;
}

body.dark-mode .agenda-week-day span,
body.dark-mode .agenda-week-day small,
body.dark-mode .agenda-week-time,
body.dark-mode .agenda-week-label,
body.dark-mode .agenda-day-console__head p,
body.dark-mode .agenda-report-controls span,
body.dark-mode .agenda-day-metric span,
body.dark-mode .agenda-day-empty span,
body.dark-mode .agenda-day-item__main time,
body.dark-mode .agenda-day-item__main span,
body.dark-mode .agenda-pending-empty,
body.dark-mode .agenda-pending-more,
body.dark-mode .agenda-completed-empty,
body.dark-mode .agenda-pending-item__main time,
body.dark-mode .agenda-pending-item__main span,
body.dark-mode .agenda-completed-item__main time,
body.dark-mode .agenda-completed-item__main span,
body.dark-mode .agenda-mobile-day p {
    color: #cbd5e1;
}

body.dark-mode .agenda-icon-button,
body.dark-mode .agenda-day-nav__today,
body.dark-mode .agenda-day-item__actions button,
body.dark-mode .agenda-pending-item__actions button,
body.dark-mode .agenda-completed-item__actions button {
    background: #111827;
    border-color: #334155;
}

/* Main Content */
main {
    margin-bottom: 40px;
}

.page-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 30px;
    color: var(--dark);
}

.page-subtitle {
    color: #6b7280;
    margin-top: -15px;
    margin-bottom: 25px;
}

.page-header {
    margin-bottom: 20px;
}

.page-header__title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.page-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.unidade-selector {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 200px;
    max-width: 240px;
}

.unidade-selector label {
    font-weight: 600;
    color: #4b5563;
}

.unidade-selector select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 14px;
    width: 100%;
}

#unidade-contexto {
    color: #6b7280;
    font-size: 12px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid rgba(216, 222, 233, 0.85);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    border-color: rgba(148, 163, 184, 0.75);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.09);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--dark);
}

.card-header {
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    padding-bottom: 12px;
}

.card-header__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.card-header__row h2 {
    margin: 0;
}

.card-header__row p {
    margin: 4px 0 0;
    color: #6b7280;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.tabela-vazia {
    text-align: center;
    color: var(--muted);
    padding: 30px 14px;
    background: var(--surface-muted);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Grid */
.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 20px;
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Ferramentas */
.tools-header {
    display: flex;
    gap: 30px;
    align-items: stretch;
}

.tools-header__copy {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tools-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: var(--primary);
}

.tools-lead {
    color: #4b5563;
}

.tools-header__cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.tools-header__meta {
    flex-basis: 320px;
    background: #0f172a;
    color: white;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tools-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
}

.tools-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    font-size: 13px;
}

.tools-stat strong {
    font-size: 20px;
    display: block;
}

.tools-panels {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.tool-panel {
    background: white;
    border-radius: 18px;
    padding: 24px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-panel__header {
    display: flex;
    gap: 14px;
    align-items: center;
}

.tool-panel__icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(59, 130, 246, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}

.tool-panel__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tool-panel__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 12px;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Indicadores */
.indicador {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.indicador.completo {
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
}

.indicador.andamento {
    background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
}

.indicador.nao-iniciado {
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.indicador-valor {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

.indicador-label {
    font-size: 14px;
    opacity: 0.9;
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead {
    background-color: var(--light);
}

th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid #e5e7eb;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background-color: #e5e7eb;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

tbody tr:hover {
    background-color: var(--light);
}

tbody tr.completo {
    background-color: #f0fdf4;
}

tbody tr.andamento {
    background-color: #fffbeb;
}

tbody tr.nao-iniciado {
    background-color: #fef2f2;
}

/* Equipamentos descartados/inativos ficam em cinza, independente do status */
tbody tr.descartado {
    background-color: #f3f4f6;
    color: #9ca3af;
}

tbody tr.descartado:hover {
    background-color: #e5e7eb;
}

tbody tr.descartado .badge {
    opacity: 0.75;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    border: 1px solid transparent;
    white-space: nowrap;
}

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
    border-color: #a7f3d0;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.badge-info {
    background-color: #cffafe;
    color: #164e63;
    border-color: #a5f3fc;
}

.badge-secondary {
    background-color: #e5e7eb;
    color: #374151;
    border-color: #cbd5e1;
}

/* Controle eletrico industrial */
.eletrico-hero {
    align-items: flex-start;
    padding: 22px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #ecfeff);
}

.eletrico-kpi-grid .kpi-card {
    cursor: pointer;
}

.eletrico-panels {
    align-items: start;
}

.eletrico-filtros {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px !important;
    padding: 0 !important;
    margin: 0 !important;
    min-width: min(100%, 860px);
}

.eletrico-filtros select,
.eletrico-filtros input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.eletrico-alertas {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.eletrico-alerta-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
}

.eletrico-alerta-card--vencido,
.eletrico-alerta-card--nao_conforme {
    border-left: 5px solid #ef4444;
}

.eletrico-alerta-card--a_vencer,
.eletrico-alerta-card--sem_evidencia {
    border-left: 5px solid #f59e0b;
}

.eletrico-row--vencido,
.eletrico-row--nao_conforme {
    background: #fff7f7;
}

.eletrico-row--a_vencer,
.eletrico-row--sem_evidencia {
    background: #fffbeb;
}

.eletrico-validade,
.eletrico-status-stack,
.eletrico-plano {
    display: grid;
    gap: 5px;
}

.eletrico-validade strong,
.eletrico-plano strong {
    color: #0f172a;
    font-size: 13px;
}

.eletrico-prazo,
.eletrico-doc-link,
.eletrico-muted {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.eletrico-prazo--ok {
    background: #dcfce7;
    color: #047857;
}

.eletrico-prazo--alerta {
    background: #fef3c7;
    color: #92400e;
}

.eletrico-prazo--vencido {
    background: #fee2e2;
    color: #b91c1c;
}

.eletrico-doc-link {
    border: 1px solid #bae6fd;
    background: #ecfeff;
    color: #0369a1;
    text-decoration: none;
}

.eletrico-doc-link:hover {
    border-color: #0284c7;
}

.eletrico-muted {
    background: #f1f5f9;
    color: #64748b;
}

.eletrico-status-stack small,
.eletrico-plano span {
    color: #475569;
    font-size: 12px;
}

.eletrico-alerta-card strong,
.eletrico-alerta-card span {
    display: block;
}

.eletrico-alerta-card > div > span {
    font-size: 12px;
    color: #6b7280;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.radio-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 6px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

/* Botes */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.3;
    min-height: 40px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    text-align: center;
    user-select: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
    background-color: #ffffff;
    color: #0f766e;
    border-color: #99f6e4;
}

.btn-secondary:hover {
    background-color: #ccfbf1;
    border-color: #5eead4;
    color: #115e59;
}

.btn-danger {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-dark);
    border-color: var(--danger-dark);
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 32px;
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn[disabled],
.btn.disabled,
button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    transform: none;
    box-shadow: none;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Formulrios */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

input::placeholder,
textarea::placeholder {
    color: #9aa5b5;
}

input:disabled,
select:disabled,
textarea:disabled {
    background-color: #eef2f7;
    color: #7c8797;
    cursor: not-allowed;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 8px;
    cursor: pointer;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    margin-bottom: 0;
}

.checkbox-item:hover {
    border-color: var(--primary);
}

.checkbox-item:has(input:checked) {
    border-color: var(--secondary);
    background: #ecfdf5;
}

.checkbox-item input[type="checkbox"] {
    margin: 0;
}

.checkbox-item span {
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

.checkbox-item--descarte:has(input:checked) {
    border-color: var(--danger);
    background: #fef2f2;
}

.checkbox-item:has(input:disabled) {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f3f4f6;
}

.checkbox-item input:disabled {
    cursor: not-allowed;
}

/* Zona avanada (acoes pouco frequentes, ex: descarte) */
.zona-avancada {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    background: #fafafa;
}

.zona-avancada summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    list-style: none;
    user-select: none;
}

.zona-avancada summary::-webkit-details-marker {
    display: none;
}

.zona-avancada summary:hover {
    color: var(--danger);
}

.zona-avancada[open] {
    border-color: var(--danger);
    background: #fff;
}

.zona-avancada[open] summary {
    color: var(--danger);
    margin-bottom: 12px;
}

.zona-avancada__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: var(--shadow-md);
}

.modal-content--lg {
    max-width: 860px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
}

.modal-subtitle {
    margin-top: 4px;
    color: #6b7280;
    font-size: 14px;
}

.modal-close {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text);
    width: 36px;
    height: 36px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.modal-close:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #991b1b;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    position: sticky;
    bottom: -30px;
    background: white;
}

/* Sees e grid de formulrio */
.form-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section__title {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 20px;
}

.form-grid .form-group {
    margin-bottom: 12px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}

.input-codigo {
    font-weight: 700;
    color: var(--primary-dark);
    background-color: #eef2ff !important;
}

/* Filtros */
.filtros {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 15px;
    align-items: start;
}

.filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filtro-grupo label {
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.filtro-grupo select,
.filtro-grupo input {
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: white;
}

.filtro-grupo select:focus,
.filtro-grupo input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.filtro-grupo--unidade {
    min-width: 240px;
}

.filtro-grupo--busca {
    min-width: 220px;
}

.filtro-botoes {
    justify-content: flex-end;
}

.filtro-botoes__label {
    user-select: none;
    color: transparent;
}

.btn-limpar {
    width: 100%;
}

.filtro-hint {
    margin-bottom: 20px;
    padding: 8px 14px;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    font-size: 13px;
    color: #1e40af;
}

/* Paginao */
.paginacao {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-top: 20px;
}

.paginacao a,
.paginacao span {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text);
    font-size: 13px;
}

.paginacao a:hover {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.paginacao .ativo {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Historico de alteracoes */
.historico-json {
    background: #0f172a;
    color: #e2e8f0;
    padding: 14px;
    border-radius: 8px;
    font-size: 12px;
    max-height: 260px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.badge-acao-criado {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-acao-editado {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-acao-deletado {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Grficos */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

/* Alertas */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    border-left: 4px solid;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.alert-success {
    background-color: #f0fdf4;
    border-color: var(--secondary);
    color: #065f46;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background-color: #fffbeb;
    border-color: var(--warning);
    color: #92400e;
}

.alert-info {
    background-color: #f0f9ff;
    border-color: var(--info);
    color: #164e63;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.24), transparent 32%),
        linear-gradient(135deg, #0f172a, #1e40af);
    padding: 20px;
}

.login-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 28px;
    width: min(920px, 100%);
    align-items: stretch;
}

.login-intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.login-intro h1 {
    margin: 0 0 12px;
    color: #fff;
    font-size: clamp(32px, 6vw, 54px);
    line-height: 1;
}

.login-intro p {
    max-width: 520px;
    margin: 0;
    color: #dbeafe;
    font-size: 17px;
    line-height: 1.6;
}

.login-card {
    background: white;
    border-radius: 14px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    padding: 40px;
    width: 100%;
}

.login-card__logo {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 6px;
}

.login-card__subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 28px;
    font-size: 14px;
}

.login-card .btn {
    width: 100%;
    margin-top: 8px;
}

@media (max-width: 760px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-intro {
        padding: 24px;
    }
}

/* Usuario logado no cabealho */
.usuario-logado {
    display: flex;
    align-items: center;
    gap: 12px;
}

.usuario-logado__nome {
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.usuario-logado__perfil {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: white;
    background: var(--primary);
    padding: 2px 8px;
    border-radius: 999px;
}

/* Shell de navegacao responsiva */
.app-header__container {
    display: grid;
    grid-template-columns: minmax(220px, auto) minmax(280px, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.app-header__brand {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.app-header__unit {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.app-header__unit strong {
    color: var(--primary-dark);
}

.app-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.app-nav__group {
    position: relative;
}

.app-nav__summary {
    list-style: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.app-nav__summary::-webkit-details-marker {
    display: none;
}

.app-nav__summary::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.app-nav__summary:hover,
.app-nav__summary.active,
.app-nav__group[open] .app-nav__summary {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.app-nav__menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    min-width: 210px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transform: translateX(-50%);
    z-index: 120;
}

.app-nav__menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.app-nav__menu a:hover,
.app-nav__menu a.active {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.app-nav__menu-link--featured {
    margin-bottom: 4px;
    border: 1px solid rgba(37, 99, 235, 0.28);
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 8px 18px rgba(37, 99, 235, 0.12);
    color: #1d4ed8;
}

.app-nav__menu-link--featured:hover,
.app-nav__menu-link--featured.active {
    border-color: rgba(37, 99, 235, 0.46);
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    color: #1e3a8a;
}

.app-nav__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

.app-nav__icon--calendar {
    position: relative;
}

.app-nav__icon--calendar::before {
    content: "";
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-radius: 4px;
    background:
        linear-gradient(currentColor, currentColor) 3px 5px / 9px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 4px 9px / 2px 2px no-repeat,
        linear-gradient(currentColor, currentColor) 8px 9px / 2px 2px no-repeat;
}

.app-nav__icon--calendar span::before,
.app-nav__icon--calendar span::after {
    content: "";
    position: absolute;
    top: 6px;
    width: 2px;
    height: 5px;
    border-radius: 999px;
    background: currentColor;
}

.app-nav__icon--calendar span::before {
    left: 9px;
}

.app-nav__icon--calendar span::after {
    right: 9px;
}

.app-header__user {
    justify-content: flex-end;
    flex-wrap: wrap;
}

/* Gerenciar equipamentos */
.gerenciar-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    padding: 28px 30px;
    margin-bottom: 22px;
    border: 1px solid #dbe3ef;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.88));
    color: #fff;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16);
}

.gerenciar-hero .page-title {
    color: #fff;
    margin-bottom: 8px;
}

.gerenciar-hero .page-subtitle {
    color: #dbeafe;
    margin: 0;
    max-width: 800px;
}

.gerenciar-eyebrow,
.gerenciar-actions__label {
    display: inline-flex;
    margin-bottom: 8px;
    color: #bfdbfe;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gerenciar-hero__status {
    min-width: 240px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

.gerenciar-hero__status strong {
    display: block;
    margin-top: 8px;
    color: #fff;
    line-height: 1.3;
}

.gerenciar-panel,
.gerenciar-actions {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.gerenciar-panel__header,
.gerenciar-table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}

.gerenciar-panel__header h2,
.gerenciar-table-toolbar h2 {
    margin: 0;
    color: var(--dark);
    font-size: 18px;
}

.gerenciar-panel__header p,
.gerenciar-table-toolbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.gerenciar-filtros {
    margin-bottom: 10px;
}

.unidade-sync-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #cfe0ff;
    border-radius: 10px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 13px;
    font-weight: 800;
}

.unidade-sync-status__dot {
    width: 10px;
    height: 10px;
    flex: 0 0 10px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.unidade-sync-status--loading {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.unidade-sync-status--loading .unidade-sync-status__dot {
    animation: pulseDot 1s ease-in-out infinite;
}

.unidade-sync-status--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #047857;
}

.unidade-sync-status--error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.gerenciar-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.gerenciar-actions__group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.gerenciar-actions__label {
    width: 100%;
    margin-bottom: 2px;
    color: #64748b;
}

.gerenciar-table-card {
    padding: 0;
    overflow: hidden;
}

.gerenciar-table-toolbar {
    padding: 18px 20px 0;
}

.gerenciar-table-wrapper {
    max-height: 68vh;
    border-top: 1px solid #e2e8f0;
}

.gerenciar-table-wrapper table {
    min-width: 1280px;
}

.gerenciar-table-wrapper thead th {
    position: sticky;
    top: 0;
    z-index: 3;
}

.gerenciar-table-wrapper th:last-child,
.gerenciar-table-wrapper td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    background: inherit;
    box-shadow: -10px 0 16px rgba(15, 23, 42, 0.06);
}

.gerenciar-table-wrapper thead th:last-child {
    z-index: 4;
}

.equip-tag,
.equip-name {
    color: #0f172a;
}

.equip-unit {
    color: #475569;
    font-size: 13px;
}

.equip-progress {
    width: 120px;
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e2e8f0;
}

.equip-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3b82f6, #10b981);
}

.table-actions {
    min-width: 190px;
}

.gerenciar-selection-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 20px 18px;
    color: #475569;
    font-size: 13px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .gerenciar-hero,
    .gerenciar-panel__header,
    .gerenciar-table-toolbar {
        flex-direction: column;
    }

    .gerenciar-hero__status {
        min-width: 0;
        width: 100%;
    }

    .gerenciar-actions {
        grid-template-columns: 1fr;
    }

    .gerenciar-table-wrapper {
        max-height: none;
    }
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s ease-in-out infinite;
}

.loading-state,
.empty-state,
.error-state {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 96px;
    padding: 24px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--surface-muted);
    color: var(--muted);
    text-align: center;
}

.error-state {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

[aria-busy="true"] {
    cursor: progress;
}

[aria-busy="true"] .btn,
.btn[aria-busy="true"] {
    pointer-events: none;
    opacity: 0.72;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseDot {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(0.86);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

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

/* Responsivo */
@media (max-width: 768px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    nav {
        gap: 15px;
    }

    table {
        font-size: 12px;
    }

    th,
    td {
        padding: 8px;
    }

    .filtros {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 20px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .tools-header {
        flex-direction: column;
    }

    .tools-header__meta {
        flex-basis: auto;
    }

    .tools-header__cta {
        flex-direction: column;
        align-items: stretch;
    }

    .app-header__container {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .app-nav {
        justify-content: stretch;
    }

    .app-nav__group {
        width: 100%;
    }

    .app-nav__summary {
        width: 100%;
        background: var(--surface-muted);
        border: 1px solid var(--border);
    }

    .app-nav__menu {
        position: static;
        width: 100%;
        min-width: 0;
        margin-top: 6px;
        transform: none;
        box-shadow: var(--shadow-sm);
    }

    .app-header__user {
        justify-content: flex-start;
    }
}

/* Modo Escuro */
body.dark-mode {
    background-color: #1f2937;
    color: #e5e7eb;
}

body.dark-mode .card,
body.dark-mode .filtros,
body.dark-mode header,
body.dark-mode .filtro-hint {
    background-color: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

body.dark-mode nav a {
    color: #e5e7eb;
}

body.dark-mode nav a:hover,
body.dark-mode nav a.active {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.2);
}

body.dark-mode .filtro-grupo select,
body.dark-mode .filtro-grupo input {
    background-color: #4b5563;
    color: #e5e7eb;
    border-color: #6b7280;
}

body.dark-mode .filtro-grupo label {
    color: #cbd5e1;
}

body.dark-mode .filtro-hint {
    background-color: #1e3a8a;
    color: #bfdbfe;
    border-color: #1d4ed8;
}

body.dark-mode table {
    background-color: #374151;
    color: #e5e7eb;
}

body.dark-mode thead {
    background-color: #4b5563;
}

body.dark-mode th {
    color: #e5e7eb;
    border-bottom-color: #4b5563;
}

body.dark-mode td {
    border-bottom-color: #4b5563;
}

body.dark-mode tbody tr:hover {
    background-color: #4b5563;
}

body.dark-mode tbody tr.descartado {
    background-color: #2d3441;
    color: #9ca3af;
}

body.dark-mode tbody tr.descartado:hover {
    background-color: #374151;
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #4b5563;
    color: #e5e7eb;
    border-color: #5a6b7a;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #cbd5e1;
}

body.dark-mode .modal-content {
    background-color: #374151;
    color: #e5e7eb;
    border-color: #4b5563;
}

body.dark-mode .modal-close {
    background: #1f2937;
    border-color: #4b5563;
    color: #e5e7eb;
}

body.dark-mode .modal-close:hover {
    background: #7f1d1d;
    border-color: #991b1b;
    color: #fee2e2;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer,
body.dark-mode .form-section {
    border-color: #4b5563;
}

body.dark-mode .modal-footer {
    background-color: #374151;
}

body.dark-mode .modal-subtitle {
    color: #9ca3af;
}

body.dark-mode .checkbox-item {
    background-color: #4b5563;
    border-color: #5a6b7a;
}

body.dark-mode .checkbox-item:has(input:checked) {
    background-color: #065f46;
    border-color: var(--secondary);
}

body.dark-mode .checkbox-item--descarte:has(input:checked) {
    background-color: #7f1d1d;
    border-color: var(--danger);
}

body.dark-mode .checkbox-item:has(input:disabled) {
    background-color: #374151;
}

body.dark-mode .zona-avancada {
    border-color: #4b5563;
    background: #2d3441;
}

body.dark-mode .zona-avancada[open] {
    background: #374151;
}

body.dark-mode .checkbox-item span {
    color: #e5e7eb;
}

body.dark-mode .input-codigo {
    background-color: #1f2937 !important;
    color: #93c5fd;
}

body.dark-mode .page-title {
    color: #e5e7eb;
}

body.dark-mode .tabela-vazia,
body.dark-mode .loading-state,
body.dark-mode .empty-state {
    background: #2d3441;
    border-color: #4b5563;
    color: #cbd5e1;
}

body.dark-mode .error-state {
    background: #451a1a;
    border-color: #991b1b;
    color: #fecaca;
}

body.dark-mode .btn-secondary {
    background: #1f2937;
    border-color: #4b5563;
    color: #a7f3d0;
}

body.dark-mode .btn-secondary:hover {
    background: #064e3b;
    border-color: #0f766e;
    color: #d1fae5;
}

body.dark-mode .app-header__unit,
body.dark-mode .app-nav__summary,
body.dark-mode .app-nav__menu a {
    color: #cbd5e1;
}

body.dark-mode .app-header__unit strong {
    color: #bfdbfe;
}

body.dark-mode .app-nav__menu {
    background: #1f2937;
    border-color: #4b5563;
}

body.dark-mode .app-nav__menu-link--featured {
    border-color: rgba(96, 165, 250, 0.38);
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.5), rgba(15, 23, 42, 0.98));
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.12), 0 10px 22px rgba(15, 23, 42, 0.3);
    color: #dbeafe;
}

body.dark-mode .app-nav__menu-link--featured:hover,
body.dark-mode .app-nav__menu-link--featured.active {
    border-color: rgba(147, 197, 253, 0.62);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.74), rgba(30, 41, 59, 0.98));
    color: #ffffff;
}

body.dark-mode .app-nav__icon {
    background: #60a5fa;
    color: #0f172a;
}

body.dark-mode .gerenciar-panel,
body.dark-mode .gerenciar-actions,
body.dark-mode .gerenciar-actions__group,
body.dark-mode .gerenciar-table-card,
body.dark-mode .gerenciar-selection-info {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .gerenciar-actions__group,
body.dark-mode .gerenciar-selection-info {
    background: #0f172a;
}

body.dark-mode .gerenciar-panel__header h2,
body.dark-mode .gerenciar-table-toolbar h2,
body.dark-mode .equip-tag,
body.dark-mode .equip-name {
    color: #f8fafc;
}

body.dark-mode .gerenciar-panel__header p,
body.dark-mode .gerenciar-table-toolbar p,
body.dark-mode .equip-unit {
    color: #cbd5e1;
}

body.dark-mode .unidade-sync-status {
    border-color: #1d4ed8;
    background: #172554;
    color: #bfdbfe;
}

body.dark-mode .unidade-sync-status--loading {
    border-color: #9a3412;
    background: #431407;
    color: #fed7aa;
}

body.dark-mode .unidade-sync-status--success {
    border-color: #047857;
    background: #052e16;
    color: #bbf7d0;
}

body.dark-mode .unidade-sync-status--error {
    border-color: #b91c1c;
    background: #450a0a;
    color: #fecaca;
}

body.dark-mode .equip-progress {
    background: #334155;
}

/* Unidades */
.unidades-hero {
    align-items: flex-start;
    padding: 22px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
}

.unidades-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.unidades-overview__item {
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.unidades-overview__item span {
    display: block;
    margin-bottom: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.unidades-overview__item strong {
    color: #0f172a;
    font-size: 28px;
    line-height: 1;
}

.unidades-alerta {
    margin-top: 14px;
}

.unidades-code {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.unidades-table__row--ativa {
    background: #eff6ff;
}

.unidades-status-pill {
    display: inline-flex;
    max-width: 220px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.unidades-status-pill--ativa {
    background: #dbeafe;
    color: #1d4ed8;
}

.unidades-actions {
    gap: 6px;
    min-width: 245px;
}

body.dark-mode .unidades-hero,
body.dark-mode .unidades-overview__item {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .unidades-overview__item span,
body.dark-mode .unidades-status-pill {
    color: #cbd5e1;
}

body.dark-mode .unidades-overview__item strong {
    color: #f8fafc;
}

body.dark-mode .unidades-table__row--ativa {
    background: #172554;
}

body.dark-mode .unidades-status-pill {
    background: #0f172a;
}

body.dark-mode .unidades-status-pill--ativa {
    background: #1e3a8a;
    color: #bfdbfe;
}

body.dark-mode .eletrico-hero,
body.dark-mode .eletrico-alerta-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .eletrico-row--vencido,
body.dark-mode .eletrico-row--nao_conforme {
    background: #3f1d1d;
}

body.dark-mode .eletrico-row--a_vencer,
body.dark-mode .eletrico-row--sem_evidencia {
    background: #3b2f12;
}

body.dark-mode .eletrico-validade strong,
body.dark-mode .eletrico-plano strong {
    color: #f8fafc;
}

body.dark-mode .eletrico-status-stack small,
body.dark-mode .eletrico-plano span {
    color: #cbd5e1;
}

body.dark-mode .eletrico-doc-link {
    border-color: #0e7490;
    background: #164e63;
    color: #cffafe;
}

body.dark-mode .eletrico-muted {
    background: #0f172a;
    color: #cbd5e1;
}

/* Painel executivo */
.pexec-hero {
    align-items: flex-start;
    padding: 22px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
}

.pexec-executive-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: -8px 0 24px;
}

.pexec-strip-card {
    padding: 16px;
    border: 1px solid #dbe3ef;
    border-left: 5px solid #3b82f6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.pexec-strip-card--critico {
    border-left-color: #ef4444;
}

.pexec-strip-card--ok {
    border-left-color: #10b981;
}

.pexec-strip-card--foco {
    border-left-color: #f59e0b;
}

.pexec-strip-card span,
.pexec-strip-card small {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
}

.pexec-strip-card span {
    margin-bottom: 8px;
    text-transform: uppercase;
}

.pexec-strip-card strong {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
    font-size: 20px;
    line-height: 1.15;
}

.financeiro-hero,
.admin-hero {
    align-items: flex-start;
    padding: 22px;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: linear-gradient(135deg, #f8fafc, #f0fdf4);
}

.admin-hero {
    background: linear-gradient(135deg, #f8fafc, #f5f3ff);
}

body.dark-mode .financeiro-hero,
body.dark-mode .admin-hero {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .pexec-hero,
body.dark-mode .pexec-strip-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .pexec-strip-card strong {
    color: #f8fafc;
}

body.dark-mode .pexec-strip-card span,
body.dark-mode .pexec-strip-card small {
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .unidades-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pexec-executive-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .unidades-overview {
        grid-template-columns: 1fr;
    }

    .unidades-actions {
        min-width: 0;
    }
}

/* Upload de fotos */
.foto-upload-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.foto-upload-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.foto-upload-group input[type="file"] {
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    cursor: pointer;
}

.foto-preview {
    width: 100%;
    height: 180px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.foto-preview::before {
    content: "Sem foto";
    color: #94a3b8;
    font-size: 14px;
}

.foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.foto-preview.has-image::before {
    content: none;
}

.foto-remover {
    align-self: flex-start;
}

.visualizar-valor {
    font-size: 14px;
    padding: 8px 0;
    color: var(--text);
    min-height: 1.2em;
}

.foto-preview--visualizar {
    height: 220px;
    cursor: zoom-in;
}

.tabela-foto-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    display: block;
    border: 1px solid #e2e8f0;
    cursor: pointer;
}

.tabela-foto-vazia {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
}

@media (max-width: 768px) {
    .foto-upload-grid {
        grid-template-columns: 1fr;
    }
}

/* Grid de permissoes */
.permissoes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.permissao-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    background: #f8fafc;
    transition: all 0.2s ease;
}

.permissao-card:hover {
    border-color: #94a3b8;
    background: #f1f5f9;
}

.permissao-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.permissao-card__check {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.permissao-card__check::after {
    content: '';
    color: white;
    font-size: 14px;
    font-weight: bold;
    display: none;
}

.permissao-card input[type="checkbox"]:checked + .permissao-card__check {
    background: #10b981;
    border-color: #10b981;
}

.permissao-card input[type="checkbox"]:checked + .permissao-card__check::after {
    display: block;
}

.permissao-card input[type="checkbox"]:disabled + .permissao-card__check {
    background: #e2e8f0;
    border-color: #cbd5e1;
    cursor: not-allowed;
}

.permissao-card__content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.permissao-card__titulo {
    font-size: 15px;
    color: #1e293b;
}

.permissao-card__desc {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .permissoes-grid {
        grid-template-columns: 1fr;
    }
}

/* Dashboard - Novos KPIs */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-left: 5px solid #cbd5e1;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kpi-total { border-left-color: #3b82f6; }
.kpi-completo { border-left-color: #10b981; }
.kpi-andamento { border-left-color: #f59e0b; }
.kpi-nao-iniciado { border-left-color: #64748b; }
.kpi-descartado { border-left-color: #ef4444; }

.kpi-icon {
    font-size: 28px;
    line-height: 1;
}

.kpi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kpi-valor {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
}

.kpi-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.dashboard-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dashboard-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.card-destaque {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px;
}

.card-big-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    line-height: 1;
    margin: 8px 0;
}

.card-big-value small {
    font-size: 20px;
    font-weight: 600;
    margin-top: 6px;
}

.card-caption {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.card-conformidade .card-big-value { color: #10b981; }
.card-progresso .card-big-value { color: #3b82f6; }

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 5px;
    transition: width 0.6s ease;
}

.prazos-lista {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prazo-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 14px;
}

.prazo-label {
    font-weight: 500;
    color: #475569;
}

.prazo-valor {
    font-weight: 700;
    font-size: 18px;
    min-width: 30px;
    text-align: right;
}

.prazo-atraso { border-left: 4px solid #ef4444; }
.prazo-vencendo { border-left: 4px solid #f59e0b; }
.prazo-sem { border-left: 4px solid #94a3b8; }

.etapas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.etapa-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.etapa-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.etapa-label {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 8px;
    font-weight: 500;
}

.etapa-valor {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.etapa-projeto .etapa-valor { color: #3b82f6; }
.etapa-execucao .etapa-valor { color: #06b6d4; }
.etapa-procedimento .etapa-valor { color: #8b5cf6; }
.etapa-validacao .etapa-valor { color: #f59e0b; }
.etapa-laudos .etapa-valor { color: #10b981; }

body.dark-mode .kpi-card,
body.dark-mode .etapa-card,
body.dark-mode .prazo-item {
    background-color: #4b5563;
    border-color: #6b7280;
}

body.dark-mode .kpi-label,
body.dark-mode .card-caption,
body.dark-mode .etapa-label,
body.dark-mode .prazo-label {
    color: #d1d5db;
}

body.dark-mode .kpi-valor,
body.dark-mode .etapa-valor,
body.dark-mode .prazo-valor,
body.dark-mode .card-big-value {
    color: #f9fafb;
}

body.dark-mode .progress-bar {
    background-color: #6b7280;
}

@media (max-width: 768px) {
    .dashboard-grid-2,
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }

    .kpi-card {
        padding: 14px;
    }

    .kpi-valor {
        font-size: 22px;
    }

    .card-big-value {
        font-size: 36px;
    }
}

/* ===== Resumo por Unidade  visao executiva ===== */
.resumo-legenda {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    font-size: 12.5px;
    color: #64748b;
    margin: 4px 0 20px 0;
    padding: 10px 16px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.resumo-legenda__ponto {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.resumo-legenda__ponto--alto { background: #10b981; }
.resumo-legenda__ponto--medio { background: #f59e0b; }
.resumo-legenda__ponto--baixo { background: #ef4444; }

.resumo-legenda__ordem {
    margin-left: auto;
    font-style: italic;
    color: #94a3b8;
}

.resumo-unidades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.resumo-unidade-card {
    position: relative;
    border: 1px solid #e2e8f0;
    border-left: 6px solid #cbd5e1;
    border-radius: 14px;
    padding: 20px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: transform 0.15s, box-shadow 0.15s;
}

.resumo-unidade-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
}

.resumo-unidade-card--alto { border-left-color: #10b981; }
.resumo-unidade-card--medio { border-left-color: #f59e0b; }
.resumo-unidade-card--baixo { border-left-color: #ef4444; }

.resumo-unidade-card__top {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.resumo-unidade-card__anel {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resumo-unidade-card__anel::before {
    content: '';
    position: absolute;
    inset: 6px;
    background: white;
    border-radius: 50%;
}

.resumo-unidade-card__anel-valor {
    position: relative;
    font-size: 16px;
    font-weight: 800;
    color: #1e293b;
}

.resumo-unidade-card__info {
    flex: 1;
    min-width: 0;
}

.resumo-unidade-card__codigo {
    font-weight: 800;
    font-size: 17px;
    color: #1e293b;
    display: block;
}

.resumo-unidade-card__nome {
    font-size: 12.5px;
    color: #64748b;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resumo-unidade-card__status {
    display: inline-block;
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 3px 9px;
    border-radius: 20px;
}

.resumo-unidade-card__status--alto { background: #d1fae5; color: #047857; }
.resumo-unidade-card__status--medio { background: #fef3c7; color: #92400e; }
.resumo-unidade-card__status--baixo { background: #fee2e2; color: #b91c1c; }

.resumo-unidade-card__nr12-linha {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #334155;
    margin-bottom: 6px;
}

.resumo-unidade-card__nr12-linha strong {
    color: #1e293b;
}

.resumo-unidade-card__nr10 {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e2e8f0;
}

.resumo-unidade-card__nr10-titulo {
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.resumo-unidade-card__nr10-barra {
    display: flex;
    width: 100%;
    height: 10px;
    border-radius: 6px;
    overflow: hidden;
    background: #e2e8f0;
    margin-bottom: 8px;
}

.resumo-unidade-card__nr10-barra span {
    height: 100%;
}

.resumo-unidade-card__nr10-legenda {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 11.5px;
    color: #64748b;
}

.resumo-unidade-card__nr10-legenda span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.resumo-unidade-card__nr10-legenda i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.resumo-unidade-card__nr10-vazio {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
}

body.dark-mode .resumo-unidade-card {
    background: #374151;
    border-color: #4b5563;
    border-left-width: 6px;
}

body.dark-mode .resumo-unidade-card__anel::before {
    background: #374151;
}

body.dark-mode .resumo-unidade-card__anel-valor,
body.dark-mode .resumo-unidade-card__codigo {
    color: #f9fafb;
}

body.dark-mode .resumo-unidade-card__nr12-linha strong {
    color: #f1f5f9;
}

body.dark-mode .resumo-unidade-card__nr10 {
    border-top-color: #4b5563;
}

body.dark-mode .resumo-unidade-card__nr10-titulo {
    color: #e5e7eb;
}

body.dark-mode .resumo-legenda {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.table-alertas {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table-alertas th,
.table-alertas td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table-alertas th {
    background: #f1f5f9;
    font-weight: 600;
}

/* Seleo em massa na tabela de equipamentos */
.tabela-equipamentos-com-selecao th,
.tabela-equipamentos-com-selecao td {
    vertical-align: middle;
}

.col-selecao {
    width: 40px;
    text-align: center;
}

.col-selecao input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.linha-selecionada {
    background-color: #eff6ff !important;
}

.th-ordenavel {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 18px !important;
}

.th-ordenavel:hover {
    background-color: #e2e8f0;
}

.th-ordenavel::after {
    content: '';
    position: absolute;
    right: 4px;
    opacity: 0.35;
    font-size: 11px;
}

.th-ordenavel.th-ordenado-asc::after {
    content: '';
    opacity: 1;
    color: #2563eb;
}

.th-ordenavel.th-ordenado-desc::after {
    content: '';
    opacity: 1;
    color: #2563eb;
}

/* Linha do tempo visual (timeline) do equipamento */
.timeline-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}
.timeline-status--verde { background: #dcfce7; color: #166534; }
.timeline-status--amarelo { background: #fef9c3; color: #854d0e; }
.timeline-status--vermelho { background: #fee2e2; color: #991b1b; }
.timeline-status--cinza { background: #f1f5f9; color: #475569; }

.timeline-bloco { margin-bottom: 18px; }
.timeline-bloco__legenda {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}
.timeline-trilha {
    position: relative;
    width: 100%;
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.timeline-trilha__fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s;
}
.timeline-trilha__marcador {
    position: absolute;
    top: -4px;
    width: 2px;
    height: 20px;
    background: #1e293b;
}
body.dark-mode .timeline-trilha__marcador { background: #e2e8f0; }

.timeline-etapas {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    position: relative;
}
.timeline-etapa {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1;
    text-align: center;
}
.timeline-etapa__ponto {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: #cbd5e1;
}
.timeline-etapa--feita .timeline-etapa__ponto { background: #10b981; }
.timeline-etapa__label { font-size: 11px; color: #64748b; }

body.dark-mode .timeline-trilha { background: #475569; }
body.dark-mode .timeline-bloco__legenda,
body.dark-mode .timeline-etapa__label { color: #cbd5e1; }

/* Avisao de expiracao de sessao */
.modal-timeout-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.modal-timeout-overlay--visivel {
    display: flex;
}

.modal-timeout-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.modal-timeout-card h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #92400e;
}

.modal-timeout-card p {
    margin: 0 0 20px;
    color: #475569;
    font-size: 14px;
}

.modal-timeout-card #modal-timeout-contagem {
    color: #dc2626;
    font-variant-numeric: tabular-numes;
}

.modal-timeout-acoes {
    display: flex;
    gap: 10px;
    justify-content: center;
}

body.dark-mode .linha-selecionada {
    background-color: #1e3a8a !important;
}

/* Painel de resumo de importao */
.import-resumo {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.import-resumo__titulo {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--dark);
}

.import-resumo__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.import-resumo__item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.import-resumo__item--destaque {
    border-color: var(--primary);
    background: #eff6ff;
}

.import-resumo__valor {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.import-resumo__valor--zero {
    color: #9ca3af;
}

.import-resumo__valor--erro {
    color: #dc2626;
}

.import-resumo__label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
    line-height: 1.3;
}

.import-resumo__atencao {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    color: #c2410c;
    padding: 10px 12px;
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.4;
}

.import-resumo__atencao strong {
    display: block;
    margin-bottom: 4px;
}

.import-resumo__lista {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    margin-top: 10px;
}

.import-resumo__lista table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.import-resumo__lista th,
.import-resumo__lista td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.import-resumo__lista th {
    background: #f1f5f9;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.import-resumo__lista tr:last-child td {
    border-bottom: none;
}

body.dark-mode .import-resumo {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .import-resumo__item,
body.dark-mode .import-resumo__lista,
body.dark-mode .import-resumo__atencao {
    background: #111827;
    border-color: #374151;
}

body.dark-mode .import-resumo__label,
body.dark-mode .import-resumo__valor--zero {
    color: #9ca3af;
}

body.dark-mode .import-resumo__lista th {
    background: #1f2937;
}

.fin-acum-edit {
    width: 100%;
    min-width: 120px;
    text-align: right;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #111827;
    font-size: 14px;
}

.fin-acum-edit:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

body.dark-mode .fin-acum-edit {
    background: #111827;
    border-color: #374151;
    color: #f3f4f6;
}
