/* ── Navigation ─────────────────────────────────────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    text-decoration: none;
}
.nav-item:hover {
    background: rgba(255,255,255,0.08);
    color: #e2e8f0;
}
.nav-item.active {
    background: rgba(79, 139, 249, 0.15);
    color: #4F8BF9;
}

/* ── Metric cards ──────────────────────────────────────────────────── */
.metric-card {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s;
}
.metric-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ── Section header ────────────────────────────────────────────────── */
.section-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

/* ── Tables ─────────────────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}
.data-table th {
    background: #f1f5f9;
    padding: 0.625rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
}
.data-table td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
}
.data-table tbody tr:hover {
    background: #f8fafc;
}
.data-table tbody tr:nth-child(even) {
    background: #fafbfc;
}
.data-table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}

/* ── Forms ──────────────────────────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fafbfc;
    font-size: 0.875rem;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus {
    outline: none;
    border-color: #4F8BF9;
    box-shadow: 0 0 0 3px rgba(79,139,249,0.15);
}
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.25rem;
}
.form-select {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    background: #fafbfc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E") no-repeat right 0.5rem center;
    background-size: 1.25rem;
    font-size: 0.875rem;
    color: #1e293b;
    appearance: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select:focus {
    outline: none;
    border-color: #4F8BF9;
    box-shadow: 0 0 0 3px rgba(79,139,249,0.15);
}

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
}
.btn-primary {
    background: #4F8BF9;
    color: white;
}
.btn-primary:hover {
    background: #3b7aec;
}
.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}
.btn-secondary:hover {
    background: #e2e8f0;
}
.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}
.btn-danger:hover {
    background: #fecaca;
}
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    animation: toast-in 0.3s ease-out;
    max-width: 400px;
}
.toast-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.toast-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.toast-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to   { transform: translateX(100%); opacity: 0; }
}

/* ── Bonus card ────────────────────────────────────────────────────── */
.bonus-card {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
}

/* ── Skeleton loading ──────────────────────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Page header ───────────────────────────────────────────────────── */
.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
}
.page-header p {
    color: #64748b;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ── Collapsible details ───────────────────────────────────────────── */
details summary {
    cursor: pointer;
    user-select: none;
}
details summary::-webkit-details-marker {
    display: none;
}

/* ── Badge ─────────────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-green { background: #dcfce7; color: #166534; }
.badge-orange { background: #ffedd5; color: #9a3412; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f1f5f9; color: #475569; }
