/* =============================================
   MiniETBIS — Premium Design System
   60-30-10 Color Rule | Glassmorphism | Inter
   ============================================= */

:root {
    /* 60% — Base / Background */
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f1f5f9;

    /* 30% — Secondary / Accent surfaces */
    --surface-elevated: #ffffff;
    --border-light: #e2e8f0;
    --border-subtle: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* 10% — Accent / Brand */
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-soft: rgba(99, 102, 241, 0.08);
    --accent-medium: rgba(99, 102, 241, 0.15);

    /* Status */
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.1);

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

    /* Shadows — Soft UI */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.06), 0 8px 10px -6px rgba(0,0,0,0.04);

    /* Transitions */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 150ms;
    --duration-normal: 250ms;
    --duration-slow: 400ms;
}

/* ===== Base ===== */
* { box-sizing: border-box; }

html {
    font-size: 15px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin-bottom: 70px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.6;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-light);
    padding: 0.6rem 0;
    z-index: 1030;
    transition: box-shadow var(--duration-normal) var(--ease-out);
}

.navbar:hover {
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary) !important;
    letter-spacing: -0.3px;
}

.brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.45rem 0.75rem !important;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-out);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent) !important;
    background: var(--accent-soft);
}

.user-badge {
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    font-weight: 400;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.8rem;
    padding: 0.35rem 0.9rem;
    transition: all var(--duration-fast) var(--ease-out);
}

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

.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 0.35rem 1rem;
    transition: all var(--duration-fast) var(--ease-out);
}

.btn-accent:hover {
    background: var(--accent-hover);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* ===== Toast Alerts ===== */
.toast-alert {
    display: flex;
    align-items: center;
    padding: 0.85rem 1.2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.toast-success {
    background: var(--success-soft);
    color: #065f46;
    border-color: rgba(16,185,129,0.2);
}

.toast-error {
    background: var(--danger-soft);
    color: #991b1b;
    border-color: rgba(239,68,68,0.2);
}

/* ===== Page Headings ===== */
.page-header {
    margin-bottom: 1.5rem;
    animation: slideDown 0.5s var(--ease-out) forwards;
}

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin: 0;
}

.page-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.25rem 0 0;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    animation: slideDown 0.5s var(--ease-out) forwards;
}

/* ===== Cards ===== */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transition: all var(--duration-normal) var(--ease-out);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-header {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

/* ===== KPI Cards ===== */
.kpi-card {
    opacity: 0;
    animation: fadeInUp 0.55s var(--ease-out) forwards;
}
.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.12s; }
.kpi-card:nth-child(3) { animation-delay: 0.19s; }
.kpi-card:nth-child(4) { animation-delay: 0.26s; }

.kpi-card .card {
    border: none;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.kpi-card .card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    transform: translate(20px, -20px);
}

.kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.kpi-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.3rem;
    letter-spacing: -0.5px;
}

.kpi-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* KPI Color Variants */
.kpi-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; }
.kpi-indigo .kpi-icon { background: rgba(255,255,255,0.2); }

.kpi-cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); color: #fff; }
.kpi-cyan .kpi-icon { background: rgba(255,255,255,0.2); }

.kpi-emerald { background: linear-gradient(135deg, #10b981, #059669); color: #fff; }
.kpi-emerald .kpi-icon { background: rgba(255,255,255,0.2); }

.kpi-amber { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.kpi-amber .kpi-icon { background: rgba(255,255,255,0.2); }

/* ===== Chart Cards ===== */
.chart-card {
    opacity: 0;
    animation: fadeInUp 0.6s var(--ease-out) forwards;
    animation-delay: 0.3s;
}

.chart-card .card {
    border: 1px solid var(--border-light);
}

.chart-card .card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-card .card-header i {
    color: var(--accent);
    font-size: 1rem;
}

/* ===== Tables ===== */
.modern-table {
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xs);
}

.modern-table .table {
    margin-bottom: 0;
}

.modern-table .table thead th {
    background: var(--bg-surface-hover);
    border-bottom: 1px solid var(--border-light);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 0.85rem 1rem;
    white-space: nowrap;
}

.modern-table .table tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.modern-table .table tbody tr {
    transition: background var(--duration-fast) ease;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.modern-table .table tbody tr:hover {
    background: var(--accent-soft);
}

.modern-table .table tbody tr:nth-child(1)  { animation-delay: 0.03s; }
.modern-table .table tbody tr:nth-child(2)  { animation-delay: 0.06s; }
.modern-table .table tbody tr:nth-child(3)  { animation-delay: 0.09s; }
.modern-table .table tbody tr:nth-child(4)  { animation-delay: 0.12s; }
.modern-table .table tbody tr:nth-child(5)  { animation-delay: 0.15s; }
.modern-table .table tbody tr:nth-child(6)  { animation-delay: 0.18s; }
.modern-table .table tbody tr:nth-child(7)  { animation-delay: 0.21s; }
.modern-table .table tbody tr:nth-child(8)  { animation-delay: 0.24s; }
.modern-table .table tbody tr:nth-child(9)  { animation-delay: 0.27s; }
.modern-table .table tbody tr:nth-child(10) { animation-delay: 0.30s; }

/* ===== Badges ===== */
.badge-soft {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    transition: transform var(--duration-fast) ease;
}

.badge-soft:hover { transform: scale(1.05); }

.badge-soft-indigo { background: var(--accent-soft); color: var(--accent); }
.badge-soft-success { background: var(--success-soft); color: #065f46; }
.badge-soft-warning { background: var(--warning-soft); color: #92400e; }
.badge-soft-info { background: var(--info-soft); color: #1e40af; }
.badge-soft-muted { background: #f1f5f9; color: var(--text-secondary); }

/* ===== Buttons ===== */
.btn {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) var(--ease-out);
    font-size: 0.875rem;
}

.btn:hover {
    transform: translateY(-1px);
}

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

.btn-primary {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}
.btn-primary:hover {
    background: var(--accent-hover) !important;
    border-color: var(--accent-hover) !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-outline-primary {
    color: var(--accent) !important;
    border-color: var(--accent) !important;
}
.btn-outline-primary:hover {
    background: var(--accent) !important;
    color: #fff !important;
}

.btn:focus, .btn:active:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px var(--accent-medium) !important;
    border-color: var(--accent) !important;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.875rem;
    transition: all var(--duration-fast) ease;
    background: var(--bg-surface);
}

.form-control:hover, .form-select:hover {
    border-color: #cbd5e1;
}

.form-label {
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

/* ===== Filter Bar ===== */
.filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-xs);
    animation: fadeInUp 0.4s var(--ease-out) forwards;
}

/* ===== Auth Cards ===== */
.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: fadeInUp 0.6s var(--ease-out) forwards;
}

.auth-card .card-header {
    background: var(--accent) !important;
    color: #fff !important;
    padding: 1.5rem;
    border: none;
    text-align: center;
}

.auth-card .card-header h4 {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
}

.auth-card .card-body {
    padding: 1.75rem;
}

.auth-card .card-footer {
    background: var(--bg-surface-hover);
    border-top: 1px solid var(--border-subtle);
    padding: 1rem;
    text-align: center;
    font-size: 0.85rem;
}

/* ===== Detail Cards ===== */
.detail-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s var(--ease-out) forwards;
}

.detail-card dt {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.15rem;
}

.detail-card dd {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1.1rem;
}

/* ===== Footer ===== */
.site-footer {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 1rem 0;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Pagination ===== */
.pagination .page-link {
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: var(--radius-sm) !important;
    margin: 0 2px;
    padding: 0.4rem 0.75rem;
    transition: all var(--duration-fast) ease;
}

.pagination .page-link:hover {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent-medium);
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.5s var(--ease-out) forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ===== Utility ===== */
.text-accent { color: var(--accent); }
.bg-accent-soft { background: var(--accent-soft); }
.fw-semibold { font-weight: 600; }
.section-gap { margin-top: 1.75rem; }