/* ═══════════════════════════════════════════════════════════════════
   Dashboard Banco de Horas - Design System
   ═══════════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ──────────────────────────────────────────────── */
:root {
    /* Colors */
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #3b82f6;
    --accent-blue-glow: rgba(59, 130, 246, 0.3);
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-green-glow: rgba(16, 185, 129, 0.2);
    --accent-red: #ef4444;
    --accent-red-glow: rgba(239, 68, 68, 0.2);
    --accent-amber: #f59e0b;
    --accent-cyan: #06b6d4;

    --gradient-blue: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-green: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-red: linear-gradient(135deg, #ef4444, #f59e0b);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #ec4899);

    --border-color: rgba(255, 255, 255, 0.06);
    --border-active: rgba(59, 130, 246, 0.4);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.15);
    --shadow-glow-green: 0 0 20px rgba(16, 185, 129, 0.15);
    --shadow-glow-red: 0 0 20px rgba(239, 68, 68, 0.15);

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Icons ──────────────────────────────────────────────────────── */
i[data-lucide] {
    width: 1.2em;
    height: 1.2em;
    stroke-width: 2px;
    vertical-align: middle;
    display: inline-block;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Subtle animated gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout Container ───────────────────────────────────────────── */
.dashboard {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 32px 48px;
}

/* ── Header ─────────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-blue);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-glow-blue);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-blue);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sync-status {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
}

.sync-status .sync-time {
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Period Filter ──────────────────────────────────────────────── */
.period-filter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.period-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.period-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.period-field {
    display: flex;
    align-items: center;
    gap: 6px;
}

.period-field label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.period-field input[type="date"] {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.82rem;
    outline: none;
    transition: all var(--transition-base);
    color-scheme: dark;
}

.period-field input[type="date"]:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-sm {
    padding: 7px 16px;
    font-size: 0.8rem;
}

.td-days {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.td-hours {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
}

/* ── Sede Selector ─────────────────────────────────────────────── */
.sede-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
}

.sede-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.sede-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sede-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.sede-btn:hover:not(:disabled) {
    background: var(--bg-glass-hover);
    border-color: var(--border-active);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.sede-btn.active {
    background: var(--gradient-purple);
    border-color: var(--accent-purple);
    color: white;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.sede-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.sede-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
}

.sede-btn.active .sede-count {
    background: rgba(255, 255, 255, 0.25);
}

.sede-synced {
    color: var(--accent-green);
    font-size: 0.6rem;
}

/* card-neutral (for "No RHiD" card) */
.card-neutral::before {
    background: var(--gradient-purple);
}

.card-neutral .card-icon {
    background: rgba(139, 92, 246, 0.15);
}

.card-neutral .card-value {
    color: var(--accent-purple);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.25);
}

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

.btn-primary.syncing {
    pointer-events: none;
    opacity: 0.8;
}

.btn-primary.syncing .btn-icon {
    animation: spin 1s linear infinite;
}

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

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

.btn-ghost:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.btn-icon {
    font-size: 1.1em;
}

/* ── Charts Section ─────────────────────────────────────────── */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.chart-card {
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.chart-container {
    flex: 1;
    width: 100%;
    min-height: 300px;
}

/* ── Summary Cards ──────────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.card:hover {
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-employees::before {
    background: var(--gradient-blue);
}

.card-positive::before {
    background: var(--gradient-green);
}

.card-negative::before {
    background: var(--gradient-red);
}

.card-sectors::before {
    background: var(--gradient-purple);
}

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

.card-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.card-employees .card-icon {
    background: rgba(59, 130, 246, 0.15);
}

.card-positive .card-icon {
    background: rgba(16, 185, 129, 0.15);
}

.card-negative .card-icon {
    background: rgba(239, 68, 68, 0.15);
}

.card-sectors .card-icon {
    background: rgba(139, 92, 246, 0.15);
}

.card-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.card-employees .card-value {
    color: var(--accent-blue);
}

.card-positive .card-value {
    color: var(--accent-green);
}

.card-negative .card-value {
    color: var(--accent-red);
}

.card-sectors .card-value {
    color: var(--accent-purple);
}

.card-description {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── Filters Bar ────────────────────────────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
}

.filter-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    user-select: none;
}

.chip:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-active);
    color: var(--text-primary);
}

.chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
    box-shadow: var(--shadow-glow-blue);
}

.search-box {
    margin-left: auto;
    position: relative;
}

.search-box input {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px 8px 36px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    width: 260px;
    transition: all var(--transition-base);
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box input:focus {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* ── Table ──────────────────────────────────────────────────────── */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.table-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.table-title {
    font-size: 1rem;
    font-weight: 600;
}

.table-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 4px 10px;
    border-radius: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    padding: 14px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: color var(--transition-fast);
    user-select: none;
    white-space: nowrap;
}

thead th:hover {
    color: var(--text-primary);
}

thead th .sort-icon {
    margin-left: 4px;
    opacity: 0.4;
    font-size: 0.7rem;
}

thead th.sorted .sort-icon {
    opacity: 1;
    color: var(--accent-blue);
}

tbody tr {
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

tbody tr:hover {
    background: var(--bg-glass-hover);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody td {
    padding: 14px 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

.td-name {
    font-weight: 500;
    color: var(--text-primary);
}

.td-setor {
    display: inline-block;
}

.setor-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: rgba(139, 92, 246, 0.12);
    color: var(--accent-purple);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

/* Sector-specific badge colors */
.setor-badge[data-setor="ASSESSORIA"] {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.2);
}

.setor-badge[data-setor="ATENDIMENTO"] {
    background: rgba(6, 182, 212, 0.12);
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.2);
}

.setor-badge[data-setor="COMERCIAL"] {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.2);
}

.setor-badge[data-setor="COMPRAS"] {
    background: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.2);
}

.setor-badge[data-setor="ESTAGIO"] {
    background: rgba(236, 72, 153, 0.12);
    color: #f472b6;
    border-color: rgba(236, 72, 153, 0.2);
}

.setor-badge[data-setor="FINANCEIRO"] {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.2);
}

.setor-badge[data-setor="JURIDICO"] {
    background: rgba(244, 63, 94, 0.12);
    color: #fb7185;
    border-color: rgba(244, 63, 94, 0.2);
}

.setor-badge[data-setor="PRODUCAO"],
.setor-badge[data-setor*="PRODU"] {
    background: rgba(251, 146, 60, 0.12);
    color: #fb923c;
    border-color: rgba(251, 146, 60, 0.2);
}

.setor-badge[data-setor="RH"] {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
    border-color: rgba(168, 85, 247, 0.2);
}

.setor-badge[data-setor="TECNOLOGIA"] {
    background: rgba(34, 211, 238, 0.12);
    color: #67e8f9;
    border-color: rgba(34, 211, 238, 0.2);
}

.td-positive {
    color: var(--accent-green);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.td-negative {
    color: var(--accent-red);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.td-saldo {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.td-saldo.positive {
    color: var(--accent-green);
}

.td-saldo.negative {
    color: var(--accent-red);
}

.td-saldo.neutral {
    color: var(--text-muted);
}

.td-date {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.td-actions {
    text-align: center;
}

.btn-detail {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    padding: 5px 10px;
    font-size: 0.78rem;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.btn-detail:hover {
    background: var(--bg-glass-hover);
    color: var(--accent-blue);
    border-color: var(--accent-blue);
}

/* ── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px) scale(0.97);
    transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    z-index: 10;
}

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

.modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.modal-body {
    padding: 24px 28px;
}

.modal-summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.modal-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.modal-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.modal-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.modal-card-value.positive {
    color: var(--accent-green);
}

.modal-card-value.negative {
    color: var(--accent-red);
}

.modal-card-value.neutral {
    color: var(--text-muted);
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table thead th {
    font-size: 0.72rem;
    padding: 10px 14px;
}

.detail-table tbody td {
    padding: 10px 14px;
    font-size: 0.82rem;
}

/* ── Loading State ──────────────────────────────────────────────── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ── Empty State ────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-state-text {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.empty-state-subtext {
    font-size: 0.85rem;
}

/* ── Toast Notification ────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: all var(--transition-base);
    font-size: 0.85rem;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 3px solid var(--accent-green);
}

.toast.error {
    border-left: 3px solid var(--accent-red);
}

.toast.info {
    border-left: 3px solid var(--accent-blue);
}

/* ── Skeleton ───────────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-glass) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            var(--bg-glass) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease-out;
}

.cards-grid .card:nth-child(1) {
    animation-delay: 0ms;
}

.cards-grid .card:nth-child(2) {
    animation-delay: 60ms;
}

.cards-grid .card:nth-child(3) {
    animation-delay: 120ms;
}

.cards-grid .card:nth-child(4) {
    animation-delay: 180ms;
}

@media (max-width: 1100px) {

    .cards-grid,
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard {
        padding: 16px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .header-right {
        width: 100%;
        justify-content: space-between;
    }

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

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        margin-left: 0;
    }

    .search-box input {
        width: 100%;
    }

    .modal-summary-cards {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.8rem;
    }

    thead th,
    tbody td {
        padding: 10px 12px;
    }
}

/* ── Config Page ───────────────────────────────────────────────── */
.config-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
}

.config-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.config-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-base);
}

.form-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input-full {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-base);
}

.form-input-full:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-base);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.25);
}

.btn-delete-sm {
    color: var(--text-muted);
    margin-left: 4px;
}

.btn-delete-sm:hover {
    color: var(--accent-red) !important;
    border-color: var(--accent-red) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* ── Footer ────────────────────────────────────────────────────────── */

.app-footer {
    text-align: center;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
    opacity: 0.7;
}