/* ============================================================
   ADUANA — Futuristic UI Design System
   ============================================================ */

/* Import Inter font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─── CSS VARIABLES ─── */
:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 68px;
    --topbar-height: 60px;

    /* Color palette */
    --bg-sidebar: linear-gradient(195deg, #0a1628 0%, #0f2744 40%, #112d4e 100%);
    --bg-sidebar-solid: #0c1e35;
    --bg-body: #f0f2f8;
    --bg-topbar: rgba(255, 255, 255, 0.82);
    --bg-card: #ffffff;
    --bg-card-hover: #f8faff;

    --accent-primary: #4f6ef7;
    --accent-primary-light: #7b93ff;
    --accent-secondary: #00d4aa;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-info: #06b6d4;

    --text-sidebar: rgba(255, 255, 255, 0.65);
    --text-sidebar-active: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border-color: rgba(0, 0, 0, 0.06);
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --border-radius-sm: 8px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(79, 110, 247, 0.15);

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── BASE RESET ─── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ─── CUSTOM SCROLLBAR ─── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base), transform var(--transition-base);
    overflow: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.app-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, rgba(79, 110, 247, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 212, 170, 0.08) 0%, transparent 60%);
    pointer-events: none;
}

/* Sidebar brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    min-height: var(--topbar-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: relative;
    z-index: 1;
    text-decoration: none;
}

.sidebar-brand:hover {
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.15rem;
    color: #fff;
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.3);
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand-text .brand-title {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.sidebar-brand-text .brand-subtitle {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 500;
}

/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
    position: relative;
    z-index: 1;
}

.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-nav-section {
    padding: 0 12px;
    margin-bottom: 4px;
}

.sidebar-nav-section-title {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 10px 12px 6px;
    white-space: nowrap;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    margin: 1px 0;
    border-radius: var(--border-radius-sm);
    color: var(--text-sidebar);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 450;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.sidebar-nav-link i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.sidebar-nav-link:hover {
    color: var(--text-sidebar-active);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
}

.sidebar-nav-link:hover i {
    color: var(--accent-primary-light);
}

.sidebar-nav-link.active {
    color: var(--text-sidebar-active);
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.2), rgba(79, 110, 247, 0.08));
    font-weight: 500;
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary));
}

.sidebar-nav-link.active i {
    color: var(--accent-primary-light);
}

/* Sidebar user footer */
.sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 16px;
    position: relative;
    z-index: 1;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
}

.sidebar-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.2;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================================
   TOPBAR
   ============================================================ */
.app-topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-topbar);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1030;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    transition: left var(--transition-base);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.topbar-breadcrumb .breadcrumb-title {
    color: var(--text-primary);
    font-weight: 600;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(79, 110, 247, 0.08), rgba(79, 110, 247, 0.04));
    color: var(--accent-primary);
    border: 1px solid rgba(79, 110, 247, 0.15);
}

.topbar-branch-badge i {
    font-size: 0.85rem;
}

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.1rem;
    text-decoration: none;
}

.topbar-btn:hover {
    background: rgba(79, 110, 247, 0.06);
    color: var(--accent-primary);
    border-color: rgba(79, 110, 247, 0.2);
    text-decoration: none;
}

.btn-sidebar-toggle {
    display: none;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.app-main {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}

.app-main > .container-fluid {
    padding: 24px 28px;
    max-width: 1600px;
}

/* ============================================================
   CARDS — Glass Morphism Style
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    background: rgba(0, 0, 0, 0.01);
    border-top: 1px solid var(--border-color);
    padding: 12px 20px;
}

/* ─── KPI Cards ─── */
.kpi-card {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-base);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.kpi-card .card-body {
    position: relative;
    z-index: 1;
    padding: 20px;
}

.kpi-card .kpi-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 14px;
}

.kpi-card .kpi-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.kpi-card .kpi-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.kpi-card .kpi-trend {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 8px;
    padding: 2px 8px;
    border-radius: 6px;
}

.kpi-card::after {
    content: '';
    position: absolute;
    top: -30%;
    right: -20%;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    opacity: 0.06;
    transition: all var(--transition-slow);
}

.kpi-card:hover::after {
    transform: scale(1.2);
    opacity: 0.1;
}

/* KPI color variants */
.kpi-card--blue { background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%); }
.kpi-card--blue .kpi-icon { background: rgba(79, 110, 247, 0.1); color: var(--accent-primary); }
.kpi-card--blue::after { background: var(--accent-primary); }

.kpi-card--green { background: linear-gradient(135deg, #ffffff 0%, #ecfdf5 100%); }
.kpi-card--green .kpi-icon { background: rgba(0, 212, 170, 0.1); color: var(--accent-secondary); }
.kpi-card--green::after { background: var(--accent-secondary); }

.kpi-card--amber { background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%); }
.kpi-card--amber .kpi-icon { background: rgba(245, 158, 11, 0.1); color: var(--accent-warning); }
.kpi-card--amber::after { background: var(--accent-warning); }

.kpi-card--red { background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%); }
.kpi-card--red .kpi-icon { background: rgba(239, 68, 68, 0.1); color: var(--accent-danger); }
.kpi-card--red::after { background: var(--accent-danger); }

.kpi-card--cyan { background: linear-gradient(135deg, #ffffff 0%, #ecfeff 100%); }
.kpi-card--cyan .kpi-icon { background: rgba(6, 182, 212, 0.1); color: var(--accent-info); }
.kpi-card--cyan::after { background: var(--accent-info); }

/* ============================================================
   TABLES
   ============================================================ */
.table {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.table > thead > tr > th {
    background: linear-gradient(180deg, #f8fafc, #f1f5f9);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 10px 14px;
    white-space: nowrap;
}

.table > tbody > tr {
    transition: all var(--transition-fast);
}

.table > tbody > tr:hover {
    background: rgba(79, 110, 247, 0.025) !important;
}

.table > tbody > tr > td {
    padding: 10px 14px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    color: var(--text-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: rgba(0, 0, 0, 0.012);
}

/* Table wrapper with card */
.table-card {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table-card .table-responsive {
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--border-radius-sm);
    padding: 8px 18px;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), #6366f1);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 110, 247, 0.25);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, #6366f1, var(--accent-primary));
    box-shadow: 0 4px 16px rgba(79, 110, 247, 0.35);
    transform: translateY(-1px);
    color: #fff;
}

.btn-outline-primary {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.btn-outline-primary:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 110, 247, 0.25);
}

.btn-outline-secondary {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--text-secondary);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

.btn-outline-success {
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.btn-outline-success:hover {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-danger {
    color: var(--accent-danger);
    border-color: var(--accent-danger);
}

.btn-outline-danger:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: #fff;
}

.btn-outline-light {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control, .form-select {
    border-radius: var(--border-radius-sm);
    border: 1px solid #e2e8f0;
    padding: 9px 14px;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    background: #fff;
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--text-muted);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.form-check-input:checked {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
}

/* ─── Money inputs ─── */
.js-money-gs,
.js-money-usd {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--accent-primary), #6366f1) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, #10b981, var(--accent-secondary)) !important;
}

.badge.bg-warning {
    background: linear-gradient(135deg, var(--accent-warning), #f97316) !important;
    color: #fff !important;
}

.badge.bg-info {
    background: linear-gradient(135deg, var(--accent-info), #0284c7) !important;
    color: #fff !important;
}

.badge.bg-danger {
    background: linear-gradient(135deg, var(--accent-danger), #dc2626) !important;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
}

/* ============================================================
   ALERTS & LIST GROUPS
   ============================================================ */
.alert {
    border-radius: var(--border-radius-sm);
    border: none;
    font-size: 0.875rem;
}

.list-group-item {
    border-color: var(--border-color);
    transition: background var(--transition-fast);
    padding: 12px 20px;
}

.list-group-item:hover {
    background: rgba(79, 110, 247, 0.02);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a1628 0%, #0f2744 50%, #112d4e 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(79, 110, 247, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 212, 170, 0.1) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 80%, rgba(139, 92, 246, 0.08) 0%, transparent 40%);
    animation: loginBgPulse 12s ease-in-out infinite;
}

@keyframes loginBgPulse {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-2%, 1%) rotate(1deg); }
    66% { transform: translate(1%, -1%) rotate(-0.5deg); }
}

/* Particle dots */
.login-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
        radial-gradient(1.5px 1.5px at 10% 20%, rgba(255,255,255,0.12) 50%, transparent 50%),
        radial-gradient(1px 1px at 30% 60%, rgba(255,255,255,0.08) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 50% 30%, rgba(255,255,255,0.1) 50%, transparent 50%),
        radial-gradient(1px 1px at 70% 70%, rgba(255,255,255,0.07) 50%, transparent 50%),
        radial-gradient(2px 2px at 90% 40%, rgba(255,255,255,0.06) 50%, transparent 50%),
        radial-gradient(1px 1px at 15% 85%, rgba(255,255,255,0.09) 50%, transparent 50%),
        radial-gradient(1.5px 1.5px at 85% 15%, rgba(255,255,255,0.08) 50%, transparent 50%),
        radial-gradient(1px 1px at 45% 90%, rgba(255,255,255,0.06) 50%, transparent 50%);
    animation: loginStars 20s linear infinite;
}

@keyframes loginStars {
    0%   { opacity: 0.6; }
    50%  { opacity: 1; }
    100% { opacity: 0.6; }
}

.login-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 20px;
}

.login-card .card {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-lg);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.login-card .card-body {
    padding: 40px;
}

.login-card .login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .login-logo-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.3);
}

.login-card h4 {
    color: #fff;
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.login-card .login-subtitle {
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
    margin-bottom: 0;
}

.login-card .form-label {
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.login-card .form-control {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 11px 16px;
}

.login-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.login-card .form-control:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.2);
    color: #fff;
}

.login-card .form-check-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
}

.login-card .btn-primary {
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.login-card .text-muted {
    color: rgba(255, 255, 255, 0.3) !important;
}

/* ============================================================
   DASHBOARD SPECIFIC
   ============================================================ */
.dashboard-chart-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all var(--transition-fast);
}

.dashboard-chart-row:last-child {
    border-bottom: none;
}

.dashboard-chart-row:hover {
    background: rgba(79, 110, 247, 0.02);
    padding-left: 6px;
    padding-right: 6px;
    border-radius: 6px;
}

.dashboard-chart-row .chart-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dashboard-chart-row .chart-value {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Alert notification cards */
.alert-notification {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 20px;
}

.alert-notification .alert-content strong {
    font-size: 0.88rem;
    display: block;
    margin-bottom: 2px;
}

.alert-notification .alert-content div {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ============================================================
   ANIMATIONS — Fade-in on page load
   ============================================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.45s ease-out forwards;
}

.animate-delay-1 { animation-delay: 0.05s; }
.animate-delay-2 { animation-delay: 0.1s; }
.animate-delay-3 { animation-delay: 0.15s; }
.animate-delay-4 { animation-delay: 0.2s; }
.animate-delay-5 { animation-delay: 0.25s; }

/* ============================================================
   RESPONSIVE — Mobile sidebar overlay
   ============================================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1035;
    backdrop-filter: blur(2px);
}

@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .app-topbar {
        left: 0;
    }

    .app-main {
        margin-left: 0;
    }

    .btn-sidebar-toggle {
        display: flex !important;
    }

    .app-main > .container-fluid {
        padding: 16px;
    }
}

/* ============================================================
   MODALS — Glass style
   ============================================================ */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 16px 24px;
}

/* ============================================================
   MISC UTILITIES
   ============================================================ */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--accent-primary), #6366f1) !important;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot--active { background: var(--accent-secondary); box-shadow: 0 0 6px rgba(0, 212, 170, 0.4); }
.status-dot--warning { background: var(--accent-warning); box-shadow: 0 0 6px rgba(245, 158, 11, 0.4); }
.status-dot--danger { background: var(--accent-danger); box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.95rem;
    max-width: 360px;
    margin: 0 auto;
}

/* Pulse animation for live indicators */
@keyframes pulse {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(1.3); opacity: 0.6; }
    100% { transform: scale(1); opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Progress bar mini */
.progress-mini {
    height: 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-top: 8px;
}

.progress-mini .progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.progress-mini .progress-bar.bg-primary { background: linear-gradient(90deg, var(--accent-primary), #6366f1); }
.progress-mini .progress-bar.bg-success { background: linear-gradient(90deg, #10b981, var(--accent-secondary)); }
.progress-mini .progress-bar.bg-warning { background: linear-gradient(90deg, var(--accent-warning), #f97316); }
.progress-mini .progress-bar.bg-danger { background: linear-gradient(90deg, var(--accent-danger), #dc2626); }

/* ============================================================
   SIDEBAR COLLAPSED (desktop)
   ============================================================ */
.app-sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.app-sidebar.collapsed .sidebar-brand-text,
.app-sidebar.collapsed .sidebar-nav-section-title,
.app-sidebar.collapsed .sidebar-nav-link span,
.app-sidebar.collapsed .sidebar-user-info {
    opacity: 0;
    width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity var(--transition-fast);
}

.app-sidebar.collapsed .sidebar-brand {
    justify-content: center;
    padding: 18px 8px;
}

.app-sidebar.collapsed .sidebar-nav-link {
    justify-content: center;
    padding: 9px 0;
}

.app-sidebar.collapsed .sidebar-nav-link i {
    font-size: 1.2rem;
}

.app-sidebar.collapsed .sidebar-user {
    justify-content: center;
}

.app-sidebar.collapsed ~ .app-topbar {
    left: var(--sidebar-collapsed);
}

.app-sidebar.collapsed ~ .sidebar-overlay ~ .app-topbar {
    left: var(--sidebar-collapsed);
}

.app-sidebar.collapsed ~ .sidebar-overlay ~ header ~ .app-main,
.app-sidebar.collapsed ~ .sidebar-overlay ~ .app-main {
    margin-left: var(--sidebar-collapsed);
}

/* General sibling rule for collapsed */
body.sidebar-collapsed .app-topbar {
    left: var(--sidebar-collapsed);
}
body.sidebar-collapsed .app-main {
    margin-left: var(--sidebar-collapsed);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-success {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3) !important;
}

.toast-error {
    background: linear-gradient(135deg, var(--accent-danger), #dc2626) !important;
    color: #fff !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3) !important;
}

.toast-info {
    background: linear-gradient(135deg, var(--accent-primary), #6366f1) !important;
    color: #fff !important;
    border-radius: var(--border-radius) !important;
    box-shadow: 0 8px 24px rgba(79, 110, 247, 0.3) !important;
}

.toast .toast-body {
    font-weight: 500;
    font-size: 0.88rem;
}

/* Toast slide-in animation */
.toast-container .toast {
    animation: slideInRight 0.4s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ============================================================
   TABLE FILTER / SEARCH BAR
   ============================================================ */
.table-filter {
    position: relative;
}

.table-filter input {
    padding-left: 36px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
    background: var(--bg-card);
}

.table-filter input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 110, 247, 0.1);
}

.table-filter i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Row count */
.table-row-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ============================================================
   SUBMIT SPINNER / DOUBLE-SUBMIT GUARD
   ============================================================ */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.75;
}

.btn-loading .btn-text {
    visibility: hidden;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
}

@keyframes btnSpin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   CONFIRMATION MODAL
   ============================================================ */
.confirm-modal .modal-header {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
    border-bottom: 1px solid rgba(239, 68, 68, 0.1);
}

.confirm-modal .modal-title {
    color: var(--accent-danger);
    font-weight: 600;
}

.confirm-modal .confirm-icon {
    font-size: 2.5rem;
    color: var(--accent-danger);
    opacity: 0.8;
}

/* ============================================================
   DARK MODE
   ============================================================ */
[data-bs-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263244;
    --bg-topbar: rgba(30, 41, 59, 0.88);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] body {
    background: var(--bg-body);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .card-header {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .table {
    color: var(--text-primary);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

[data-bs-theme="dark"] .table thead th {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-bs-theme="dark"] .table td {
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .page-header h3 {
    background: linear-gradient(135deg, #93c5fd, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-bs-theme="dark"] .modal-content {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .list-group-item {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-bs-theme="dark"] .app-topbar {
    background: var(--bg-topbar);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .topbar-btn {
    color: var(--text-secondary);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .topbar-btn:hover {
    background: rgba(79, 110, 247, 0.12);
}

[data-bs-theme="dark"] .breadcrumb-title {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .kpi-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-bs-theme="dark"] .table-filter input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

[data-bs-theme="dark"] dl dd,
[data-bs-theme="dark"] dl dt {
    color: var(--text-primary);
}

[data-bs-theme="dark"] .alert-info {
    background: rgba(6, 182, 212, 0.1);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent-info);
}

/* ============================================================
   PRINT — Hide sidebar & topbar
   ============================================================ */
@media print {
    .app-sidebar,
    .app-topbar,
    .sidebar-overlay,
    .btn-sidebar-toggle {
        display: none !important;
    }
    .app-main {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }
}