.dashboard-cards { display: grid; gap: 18px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.summary-card { background: #fff; border-left: 4px solid var(--accent); border-radius: 10px; box-shadow: 0 3px 12px rgba(15, 23, 42, .07); padding: 20px; }
.summary-card span { color: #64748b; display: block; font-size: .88rem; }
.summary-card strong { color: #0f172a; display: block; font-size: 1.65rem; margin-top: 10px; }
.dashboard-grid { display: grid; gap: 24px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 24px; }
.dashboard-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-card { min-height: 350px; }
.chart-card h2, .dashboard-list h2 { color: #0f172a; font-size: 1.05rem; margin: 0 0 20px; }
.chart-card canvas { height: 270px !important; max-width: 100%; }
.dashboard-list ul { list-style: none; margin: 0; padding: 0; }
.dashboard-list li { align-items: center; border-bottom: 1px solid #e2e8f0; display: flex; gap: 16px; justify-content: space-between; padding: 12px 0; }
.dashboard-list li:last-child { border-bottom: 0; }
.dashboard-list li span { min-width: 0; overflow-wrap: anywhere; }
.dashboard-list li small { color: #64748b; display: block; font-size: .78rem; margin-top: 4px; }
.dashboard-list .event-item time { color: #64748b; flex-shrink: 0; font-size: .78rem; }
.empty-state { color: #64748b; margin: 0; }
.page-toolbar { align-items: center; display: flex; justify-content: space-between; margin-bottom: 22px; }
.page-toolbar .page-heading { margin: 0; }
.button { border: 0; border-radius: 7px; cursor: pointer; display: inline-block; font-size: .82rem; font-weight: 700; padding: 10px 16px; text-decoration: none; }
.button-primary { background: var(--accent); color: #fff; }
.button-primary:hover { background: #1d4ed8; }
.button-secondary { background: #e2e8f0; color: #334155; }
.button-secondary:hover { background: #cbd5e1; }
.alert { border-radius: 7px; margin: 0 0 18px; padding: 12px 16px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.filter-form { align-items: end; display: flex; flex-wrap: wrap; gap: 12px; }
.filter-form label, .form-card label { color: #334155; display: flex; flex-direction: column; font-size: .86rem; font-weight: 700; gap: 7px; }
.filter-form select, .filter-form input, .form-card input:not([type="radio"]):not([type="checkbox"]), .form-card select, .form-card textarea {
    border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-weight: 400; min-height: 40px; padding: 9px 10px;
}
.form-card { margin-bottom: 24px; }
.form-card h2 { color: #0f172a; font-size: 1.1rem; margin: 0 0 20px; }
.form-card h2 { color: var(--text); }
.form-card textarea { resize: vertical; width: 100%; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.form-wide { grid-column: span 2; }
.form-card fieldset { border: 1px solid #cbd5e1; border-radius: 6px; margin: 0 0 18px; padding: 14px; }
.form-card legend { color: #334155; font-size: .86rem; font-weight: 700; padding: 0 6px; }
.inline-option, .toggle-option { display: inline-flex !important; flex-direction: row !important; font-weight: 400 !important; margin-right: 18px; }
.toggle-option { margin-bottom: 18px; }
.notes-grid { grid-template-columns: repeat(7, minmax(70px, 1fr)); margin-bottom: 8px; }
.table-card { padding: 0; }
.table-wrapper { overflow-x: auto; }
table { border-collapse: collapse; min-width: 900px; width: 100%; }
th, td { border-bottom: 1px solid #e2e8f0; padding: 14px 16px; text-align: left; vertical-align: middle; }
th { background: #f8fafc; color: #475569; font-size: .76rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .88rem; }
.status-badge { border-radius: 999px; display: inline-block; font-size: .75rem; font-weight: 700; padding: 5px 9px; }
.status-active { background: #dcfce7; color: #166534; }
.status-inactive { background: #e2e8f0; color: #475569; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline; }
.actions-cell a, .link-button { color: var(--accent); font-size: .82rem; margin-right: 10px; }
.link-button { background: none; border: 0; cursor: pointer; padding: 0; }
.danger-link { color: #b91c1c; }
.summary-card, .modal-card { background: var(--surface-raised); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.summary-card span, .summary-card strong, .chart-card h2, .dashboard-list h2 { color: var(--text); }
.dashboard-list li, .dashboard-list li small, .dashboard-list .event-item time { border-color: var(--border); color: var(--muted); }
.select-with-action { align-items: center; display: flex; gap: 8px; }
.select-with-action select { min-width: 0; width: 100%; }
.button-small { flex: 0 0 38px; font-size: 1rem; padding: 8px 10px; text-align: center; }
.form-card small { color: var(--muted); font-size: .75rem; font-weight: 400; }
.modal-card h2 { color: var(--text); }
.modal-card label { color: #d9e2f0; }
.modal-card input { background: #0f1826; border-color: #40516b; color: var(--text); }
.filter-wrap { align-items: end; }
.section-heading { color: #0f172a; font-size: 1.05rem; margin: 0; padding: 20px 26px 0; }
.form-note { color: #64748b; font-size: .86rem; margin: -4px 0 18px; }
.costs-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); }
.currency-input { align-items: center; display: flex; gap: 6px; }
.currency-input > span { color: #64748b; font-size: .85rem; }
.currency-input input { min-width: 0; width: 100%; }
.modal-backdrop { align-items: center; background: rgba(15, 23, 42, .55); display: flex; inset: 0; justify-content: center; position: fixed; z-index: 10; }
.modal-backdrop[hidden] { display: none; }
.modal-card { background: var(--surface-raised); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 15px 40px rgba(0, 0, 0, .35); max-width: 440px; padding: 28px; position: relative; width: calc(100% - 32px); }
.modal-card h2 { color: var(--text); margin: 0 0 22px; }
.modal-card label { color: #d9e2f0; display: flex; flex-direction: column; font-size: .86rem; font-weight: 700; gap: 7px; margin-bottom: 18px; }
.modal-card select, .modal-card input, .modal-card textarea { background: #0f1826; border: 1px solid #40516b; border-radius: 6px; color: var(--text); font: inherit; min-height: 40px; padding: 9px 10px; }
.modal-close { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.7rem; line-height: 1; position: absolute; right: 16px; top: 14px; }
.estoque-item { align-items: end; border-bottom: 1px solid var(--border); grid-template-columns: repeat(3, minmax(0, 1fr)) auto; padding-bottom: 16px; }
.subtotal-row th { background: var(--accent-strong); color: #fff; }
.audit-details { min-width: 260px; padding: 12px 0; }
.audit-details strong { display: block; margin-top: 8px; }
.audit-details dl { display: grid; grid-template-columns: minmax(100px, .4fr) minmax(120px, 1fr); margin: 4px 0 10px; }
.audit-details dt, .audit-details dd { border-bottom: 1px solid var(--border); padding: 4px; }
.audit-details dt { font-weight: 700; }
.audit-details dd { margin: 0; overflow-wrap: anywhere; }
:root {
    --sidebar: #101827;
    --sidebar-hover: #273852;
    --sidebar-muted: #a9b8ce;
    --accent: #4f8cff;
    --accent-strong: #2f6fe4;
    --background: #0b111c;
    --surface: #151f2f;
    --surface-raised: #1b2739;
    --border: #2b3a52;
    --text: #e7edf7;
    --muted: #9eacc0;
}

* { box-sizing: border-box; }

.landing-page { background: var(--background); min-height: 100vh; }
.landing-portal { position: fixed; right: 28px; top: 24px; z-index: 1; }
.landing-main { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 72px 24px 64px; }
.landing-hero { display: block; height: auto; max-height: calc(100vh - 136px); max-width: min(100%, 1100px); object-fit: contain; width: auto; }
.landing-footer { bottom: 18px; color: var(--muted); font-size: .8rem; left: 0; position: fixed; right: 0; text-align: center; }

body {
    background: var(--background);
    color: var(--text);
    font-family: Arial, sans-serif;
    margin: 0;
}

.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    background: var(--sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: fixed;
    width: 248px;
}
.sidebar-brand { border-bottom: 1px solid var(--border); padding: 26px 22px 22px; }
.sidebar-brand strong { display: block; font-size: 1.3rem; }
.sidebar-brand span, .user-label { color: var(--sidebar-muted); font-size: .8rem; }
.main-nav { padding: 18px 12px; }
.nav-link, .reports-menu summary {
    border-radius: 7px;
    color: #e6edf8;
    cursor: pointer;
    display: block;
    font-size: .83rem;
    font-weight: 700;
    letter-spacing: .03em;
    padding: 13px 12px;
    text-decoration: none;
}
.nav-link:hover, .nav-link.active, .reports-menu summary:hover { background: var(--sidebar-hover); }
.reports-menu summary { list-style: none; }
.reports-menu summary::-webkit-details-marker { display: none; }
.reports-menu summary::after { content: '+'; float: right; }
.reports-menu[open] summary::after { content: '-'; }
.submenu { border-left: 1px solid #43516a; margin: 0 0 6px 18px; padding-left: 9px; }
.submenu a { color: var(--sidebar-muted); display: block; font-size: .8rem; padding: 8px 6px; text-decoration: none; }
.submenu a:hover { color: #fff; }
.sidebar-user { border-top: 1px solid var(--border); margin-top: auto; padding: 18px 22px 22px; }
.sidebar-user strong { display: block; margin: 5px 0 14px; overflow-wrap: anywhere; }
.logout-button {
    background: transparent;
    border: 1px solid #64748b;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    padding: 8px 14px;
}
.logout-button:hover { background: #334155; }
.page-area { margin-left: 248px; min-height: 100vh; width: calc(100% - 248px); }
.topbar {
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    min-height: 68px;
    padding: 0 34px;
}
.topbar-title { font-size: 1.15rem; font-weight: 700; }
.version { color: #64748b; font-size: .85rem; }
.main-content { padding: 34px; }
.page-heading { margin: 0 0 22px; }
.content-card {
    background: var(--surface);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    padding: 26px;
}
.page-footer { color: var(--muted); font-size: .8rem; padding: 0 34px 24px; }

.page-heading { color: #f6f8fc; }
.topbar-title { color: #f6f8fc; }
.version, .empty-state, .form-note { color: var(--muted); }
.button-primary { background: var(--accent-strong); }
.button-primary:hover { background: var(--accent); }
.button-secondary { background: #27364e; color: #e7edf7; }
.button-secondary:hover { background: #344967; }
.form-card input, .form-card select, .form-card textarea, .filter-form select, .filter-form input { background: #0f1826; border-color: #40516b; color: var(--text); }
.form-card input::placeholder, .form-card textarea::placeholder { color: #8291a7; }
.form-card fieldset { border-color: var(--border); }
.form-card legend, .form-card label, .filter-form label { color: #d9e2f0; }
table { color: var(--text); }
th { background: #1d2a3d; color: #c5d1e2; }
th, td { border-color: var(--border); }
.table-card input { background: #0f1826; border: 1px solid #40516b; border-radius: 6px; color: var(--text); max-width: 130px; min-height: 36px; padding: 7px 9px; }
.status-inactive { background: #27364e; color: #c7d3e5; }
.danger-link { color: #ff8d8d; }

@media (max-width: 720px) {
    .landing-portal { right: 16px; top: 16px; }
    .landing-main { padding: 68px 16px 52px; }
    .landing-hero { max-height: calc(100vh - 120px); max-width: 100%; }
    .sidebar { position: static; width: 210px; }
    .page-area { margin-left: 0; width: calc(100% - 210px); }
    .topbar, .main-content { padding-left: 20px; padding-right: 20px; }
    .main-content { padding-top: 24px; }
    .dashboard-cards, .dashboard-grid, .dashboard-grid-wide { grid-template-columns: 1fr; }
    .form-grid, .notes-grid { grid-template-columns: 1fr; }
    .costs-grid { grid-template-columns: 1fr 1fr; }
    .form-wide { grid-column: auto; }
    .filter-form label { min-width: 100%; }
}