@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #0f172a;
    --surface: #1e293b;
    --card: #334155;
    --card-hover: #3b4c63;
    --primary: #38bdf8;
    --primary-dark: #0ea5e9;
    --secondary: #818cf8;
    --success: #4ade80;
    --success-bg: rgba(34, 197, 94, 0.15);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.15);
    --text: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-pill: 9999px;
    --transition: 0.2s ease;
    --max-width: 480px;
    --bottom-nav-height: 72px;
}

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

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--card); border-radius: 4px; }

/* ===== APP SHELL ===== */
#app {
    max-width: var(--max-width);
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

/* Header */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-header .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.15rem;
}

.app-header .logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.header-btn:hover { background: var(--card); color: var(--text); }

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--bg);
}

.notification-item {
    width: 100%;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px;
    text-align: left;
    color: var(--text);
    cursor: pointer;
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.notification-item.unread {
    border-color: rgba(56, 189, 248, 0.28);
    background: rgba(56, 189, 248, 0.08);
}

.notification-item:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.notification-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.notification-body {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin-bottom: 6px;
}

.notification-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.audit-highlight-card {
    border-left: 4px solid var(--danger);
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.08), rgba(30, 41, 59, 0.96));
}

.audit-compact-list .notification-item {
    margin-bottom: 8px;
}

.audit-compact-list .notification-icon {
    font-weight: 700;
    color: var(--danger);
}

.audit-radar-card .list-item-right {
    min-width: 104px;
}

@media (max-width: 480px) {
    .audit-radar-card .list-item,
    .audit-action-card .list-item {
        gap: 8px;
    }

    .audit-radar-card .list-item-right,
    .audit-action-card .list-item-right {
        min-width: 88px;
    }
}

/* Page Content */
.page-content {
    padding: 20px;
    padding-bottom: calc(var(--bottom-nav-height) + 20px);
    min-height: calc(100vh - 70px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--bottom-nav-height);
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    padding: 0 6px env(safe-area-inset-bottom, 0);
    gap: 2px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.62rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    border-radius: var(--radius-sm);
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.nav-item .nav-icon {
    font-size: 1.2rem;
    transition: all var(--transition);
}

.nav-item.active { color: var(--primary); }
.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-group {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.nav-group.active .nav-item {
    color: var(--primary);
}

.nav-group.active .nav-item .nav-icon {
    transform: scale(1.1);
}

.nav-group.active .nav-item::after {
    content: '';
    position: absolute;
    top: 0;
    width: 20px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 3px 3px;
}

.nav-dropup-toggle::before {
    content: '▴';
    position: absolute;
    top: 8px;
    right: 6px;
    font-size: 0.5rem;
    color: currentColor;
    opacity: 0.7;
}

.nav-group.open .nav-dropup-toggle::before {
    transform: rotate(180deg);
}

.nav-dropup-menu {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%) translateY(8px);
    width: min(220px, calc(100vw - 32px));
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-group.open .nav-dropup-menu {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.nav-dropup-item {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.nav-dropup-item:hover,
.nav-dropup-item:focus-visible {
    background: rgba(56, 189, 248, 0.12);
    outline: none;
}

@media (max-width: 420px) {
    .nav-item {
        font-size: 0.58rem;
        padding: 8px 4px;
    }

    .nav-item .nav-icon {
        font-size: 1.1rem;
    }

    .nav-dropup-menu {
        width: min(240px, calc(100vw - 20px));
    }
}

/* ===== CARDS ===== */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}

.card:hover { border-color: rgba(255,255,255,0.12); }

.card-sm {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
}

/* ===== STAT CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.primary::before { background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== SECTION TITLES ===== */
.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title .icon { font-size: 1.1rem; }

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    gap: 4px;
}

.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge.info    { background: rgba(56,189,248,0.15); color: var(--primary); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #f0fdf4;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.25);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.35);
}

.btn-danger { background: var(--danger); color: #fff; }

.btn-block { width: 100%; }

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.form-control::placeholder { color: var(--text-muted); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* ===== SETTINGS ===== */
.settings-hero {
    background: linear-gradient(160deg, rgba(56, 189, 248, 0.18), rgba(129, 140, 248, 0.12) 55%, rgba(30, 41, 59, 0.95));
    border: 1px solid rgba(129, 140, 248, 0.18);
}

.settings-hero-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.settings-avatar {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.25);
}

.settings-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.settings-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.settings-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.settings-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.settings-grid {
    display: grid;
    gap: 16px;
}

.settings-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.settings-panel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 0;
}

.settings-panel-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary);
    flex-shrink: 0;
}

.settings-panel-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.settings-panel-subtitle {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.settings-panel-body {
    padding: 16px 20px 20px;
}

.settings-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.settings-note {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.settings-result {
    margin-top: 14px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(74, 222, 128, 0.12);
    border: 1px solid rgba(74, 222, 128, 0.35);
    font-size: 0.82rem;
    line-height: 1.5;
}

.settings-participants {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.participant-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.42);
    border: 1px solid var(--border);
}

.participant-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.participant-icon.manager {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
}

.participant-icon.worker {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.participant-main {
    flex: 1;
    min-width: 0;
}

.participant-name {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.participant-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.45;
    word-break: break-word;
}

.participant-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

@media (max-width: 420px) {
    .settings-inline-grid {
        grid-template-columns: 1fr;
    }
}

.materials-intro {
    padding: 16px 18px;
    background: linear-gradient(155deg, rgba(56, 189, 248, 0.16), rgba(15, 23, 42, 0.96) 55%, rgba(30, 41, 59, 1));
    border-color: rgba(56, 189, 248, 0.2);
}

.materials-intro-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.materials-intro-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.16);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.materials-intro-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.materials-intro-text {
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.materials-intro-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.material-card {
    overflow: hidden;
}

.material-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.material-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.material-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.material-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.material-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

.material-meta-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.material-link-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid var(--border);
    font-size: 0.8rem;
}

.material-link-row a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.material-image {
    height: 160px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--border);
}

.material-note {
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.material-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
}

.material-price {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.material-price span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.material-total {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.material-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.material-approval-summary {
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.material-approval-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.material-approval-card {
    padding: 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    line-height: 1.5;
}

.material-approval-card.manager {
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.18);
}

.material-approval-card.worker {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.18);
}

.material-rejection-box {
    margin-top: 12px;
    font-size: 0.75rem;
    color: var(--danger);
    background: rgba(248, 113, 113, 0.1);
    padding: 10px;
    border-radius: 10px;
    line-height: 1.5;
}

@media (max-width: 420px) {
    .material-meta-grid,
    .material-approval-grid {
        grid-template-columns: 1fr;
    }

    .material-card-foot,
    .material-link-row,
    .material-card-head {
        flex-direction: column;
        align-items: stretch;
    }

    .material-actions {
        justify-content: stretch;
    }

    .material-actions .btn {
        width: 100%;
    }
}

/* ===== LIST ITEMS ===== */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all var(--transition);
    cursor: pointer;
}

.list-item:hover { background: var(--card); }

.list-item-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.list-item-body { flex: 1; min-width: 0; }
.list-item-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.list-item-right {
    text-align: right;
    flex-shrink: 0;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--card);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* ===== LOGIN PAGE ===== */
.login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.3);
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 32px;
    text-align: center;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.3s ease;
    max-width: calc(var(--max-width) - 40px);
    text-align: center;
    box-shadow: var(--shadow);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--success); color: #0a2010; }
.toast.error { background: var(--danger); color: #fff; }
.toast.info { background: var(--primary); color: #0a1628; }

/* ===== LOADING SPINNER ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.page-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 48px;
}

/* ===== CHART PLACEHOLDER ===== */
.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chart-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    width: 90px;
    flex-shrink: 0;
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--card);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(0,0,0,0.7);
}

.chart-bar-fill.mao-obra { background: linear-gradient(90deg, var(--primary), var(--secondary)); }
.chart-bar-fill.material { background: linear-gradient(90deg, var(--success), #22d3ee); }

/* ===== RESPONSIVE ===== */
@media (min-width: 481px) {
    #app { border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
}

/* ===== FAB ===== */
.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: calc(50% - var(--max-width)/2 + 20px);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    z-index: 90;
}

.fab:hover { transform: scale(1.08); }

@media (max-width: 480px) {
    .fab { right: 20px; }
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show { display: flex; }

.modal {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: var(--max-width);
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px 20px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--card);
    color: var(--text-secondary);
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== TAB BAR ===== */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.tab-item {
    flex: 1;
    padding: 10px;
    text-align: center;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition);
}

.tab-item.active {
    background: var(--card);
    color: var(--text);
}
