:root {
    --brand: #0057b7;
    --brand-dark: #003f86;
    --brand-soft: #e7f1ff;
    --accent: #ffd700;
    --accent-dark: #5b4b00;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --border: #cbd8e8;
    --muted: #536274;
    --focus: #ffd700;
}

body { background: var(--canvas); color: #182433; }
header { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); border-bottom: 5px solid var(--accent); }
button { background: var(--brand); border-radius: 9px; font-weight: 650; }
button:hover { background: var(--brand-dark); }
button:disabled { cursor: not-allowed; opacity: .55; }
a, .auth-container h2, .section h3, .edit-panel h3 { color: var(--brand-dark) !important; }
input:focus, select:focus, button:focus-visible, a:focus-visible {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, .72);
    outline: 2px solid transparent;
}
.section, .mobile-nav, .summary-card { border: 1px solid var(--border); }
.summary-card { border-left: 5px solid var(--accent); box-shadow: 0 3px 10px rgba(0, 63, 134, .06); }
.summary-card-value { color: var(--brand-dark); }
.master-badge { background: var(--accent); color: var(--accent-dark); }

.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; border: 0; overflow: visible; }
.nav-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; align-content: flex-start; flex-wrap: wrap; gap: 4px; }
.nav-group-title { flex-basis: 100%; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 2px 8px 5px; text-transform: uppercase; }
.tab-btn { border-radius: 8px; border-bottom: 0; min-height: 40px; padding: 8px 10px; }
.tab-btn:hover { background: var(--brand-soft); color: var(--brand-dark); }
.tab-btn.active { background: var(--brand); color: #fff; border-bottom: 0; }

.hero-dashboard { background: linear-gradient(145deg, #fff 0%, var(--brand-soft) 100%); }
.dashboard-geral-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.priority-list { display: grid; gap: 8px; }
.priority-item { border-left: 5px solid var(--accent); background: #fff9d6; color: #463b00; border-radius: 8px; padding: 11px 13px; }
.priority-item.ok { border-left-color: #218838; background: #eaf7ed; color: #155724; }
.offline-banner { position: sticky; top: 0; z-index: 7000; padding: 10px 16px; text-align: center; background: #fff3cd; color: #5c4700; border-bottom: 2px solid #d39e00; font-weight: 700; }

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

@media (max-width: 700px) {
    .tabs { display: none; }
    .mobile-nav label { color: var(--brand-dark); font-weight: 800; }
    .dashboard-geral-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .summary-card { padding: 12px 8px; text-align: left; }
    .summary-card-value { font-size: 20px; }
    .summary-card-label { font-size: 11px; }
    .mobile-card-table { min-width: 0 !important; width: 100%; border-collapse: separate; border-spacing: 0 10px; }
    .mobile-card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .mobile-card-table tbody, .mobile-card-table tr, .mobile-card-table td { display: block; width: 100%; }
    .mobile-card-table tr { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; box-shadow: 0 2px 8px rgba(0, 63, 134, .06); }
    .mobile-card-table td { display: grid; grid-template-columns: minmax(105px, 38%) 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px solid #edf1f6; overflow-wrap: anywhere; }
    .mobile-card-table td:last-child { border-bottom: 0; }
    .mobile-card-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
    .mobile-card-table button { width: auto; min-height: 40px; }
    .table-wrap:has(.mobile-card-table) { border: 0; overflow: visible; }
}

@media (max-width: 380px) {
    .dashboard-geral-grid, .budget-summary { grid-template-columns: 1fr; }
}

.header-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.header-brand h1 { line-height: 1.15; }
.header-emblem {
    width: 76px;
    height: 76px;
    flex: 0 0 76px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 24, 63, .28));
}

@media (max-width: 700px) {
    .header-brand { gap: 10px; }
    .header-emblem { width: 60px; height: 60px; flex-basis: 60px; }
    .header-brand h1 { font-size: 19px; }
}
