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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;
    --primary-50: #f0f0ff;
    --success: #10b981;
    --success-dark: #059669;
    --success-light: #ecfdf5;
    --warning: #f59e0b;
    --warning-dark: #d97706;
    --warning-light: #fffbeb;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --danger-light: #fef2f2;
    --info: #3b82f6;
    --info-light: #eff6ff;
    --dark: #0f172a;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.03), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.04);
    --shadow-lg: 0 12px 24px -6px rgb(0 0 0 / 0.06), 0 4px 8px -4px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 20px 40px -8px rgb(0 0 0 / 0.08);
    --sidebar-width: 260px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    margin: 0;
    overflow-x: hidden;
}

/* ============================
   SIDEBAR
   ============================ */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(226,232,240,0.6);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.25rem 1.25rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    margin: 0 0.75rem 0;
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.0625rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 1rem;
    color: var(--dark);
    letter-spacing: -0.025em;
}

.sidebar-brand .brand-version {
    font-size: 0.625rem;
    color: var(--gray-400);
    font-weight: 500;
    margin-left: auto;
    background: var(--gray-100);
    padding: 0.125rem 0.5rem;
    border-radius: 20px;
}

.sidebar-nav {
    padding: 0.5rem 0.75rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.sidebar-section {
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    padding: 1.25rem 0.75rem 0.5rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 0.75rem;
    border-radius: var(--radius-xs);
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 1px;
    position: relative;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar .nav-link:hover {
    background: var(--gray-100);
    color: var(--gray-800);
}
.sidebar .nav-link:hover i {
    transform: scale(1.1);
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, var(--primary-light), #f5f3ff);
    color: var(--primary);
    font-weight: 600;
}
.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.sidebar .nav-link.active i {
    color: var(--primary);
}

/* ============================
   MAIN CONTENT
   ============================ */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================
   TOPBAR
   ============================ */
.topbar {
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(226,232,240,0.5);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-shrink: 0;
}

.topbar-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}

/* ============================
   PAGE CONTENT
   ============================ */
.page-content {
    padding: 1.75rem 1.75rem 3rem;
    flex: 1;
}

/* ============================
   CARDS (Glassmorphism)
   ============================ */
.card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226,232,240,0.5);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1.25rem;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(226,232,240,0.8);
    transform: translateY(-1px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.125rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-header h6 {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--gray-800);
    margin: 0;
    letter-spacing: -0.01em;
}

.card-body {
    padding: 1.25rem;
}

/* ============================
   STAT CARDS (Premium)
   ============================ */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    border-radius: var(--radius);
    padding: 1.375rem 1.5rem;
    position: relative;
    overflow: hidden;
    border: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.stat-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 50%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.stat-card-primary {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    color: #fff;
}
.stat-card-primary:hover { box-shadow: 0 16px 32px -8px rgba(99,102,241,0.35); }

.stat-card-success {
    background: linear-gradient(135deg, #10b981, #34d399);
    color: #fff;
}
.stat-card-success:hover { box-shadow: 0 16px 32px -8px rgba(16,185,129,0.35); }

.stat-card-warning {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #fff;
}
.stat-card-warning:hover { box-shadow: 0 16px 32px -8px rgba(245,158,11,0.35); }

.stat-card-danger {
    background: linear-gradient(135deg, #ef4444, #f87171);
    color: #fff;
}
.stat-card-danger:hover { box-shadow: 0 16px 32px -8px rgba(239,68,68,0.35); }

.stat-card-info {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    color: #fff;
}
.stat-card-info:hover { box-shadow: 0 16px 32px -8px rgba(59,130,246,0.35); }

.stat-card-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.625rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.stat-card-icon {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.1;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.stat-card:hover .stat-card-icon {
    opacity: 0.15;
    transform: translateY(-50%) scale(1.05);
}

/* ============================
   TABLES (Premium)
   ============================ */
.table {
    margin: 0;
    font-size: 0.8125rem;
    width: 100%;
}

.table thead th {
    background: var(--gray-50);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-500);
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
    white-space: nowrap;
}

.table td {
    padding: 0.875rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}

.table tbody tr {
    transition: background 0.15s ease;
}

.table tbody tr:hover {
    background: var(--gray-50);
}

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

.card .table th:first-child,
.card .table td:first-child {
    padding-left: 1.25rem;
}
.card .table th:last-child,
.card .table td:last-child {
    padding-right: 1.25rem;
}

/* ============================
   BUTTONS (Refined)
   ============================ */
.btn {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius-xs);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.4;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}
.btn-success:hover {
    background: var(--success-dark);
    border-color: var(--success-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.btn-warning {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}
.btn-warning:hover {
    background: var(--warning-dark);
    border-color: var(--warning-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    color: #fff;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
    transform: translateY(-1px);
}

.btn-info {
    background: var(--info);
    border-color: var(--info);
    color: #fff;
}
.btn-info:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-600);
}
.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--gray-800);
    transform: translateY(-1px);
}

.btn-outline-danger {
    border-color: var(--gray-200);
    color: var(--gray-600);
    background: transparent;
}
.btn-outline-danger:hover {
    border-color: var(--danger);
    background: var(--danger-light);
    color: var(--danger);
    transform: translateY(-1px);
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.3125rem 0.625rem;
}
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
}

/* ============================
   BADGES
   ============================ */
.badge {
    font-weight: 500;
    padding: 0.3em 0.75em;
    border-radius: 20px;
    font-size: 0.6875rem;
    letter-spacing: 0.01em;
}

.bg-success { background: var(--success-light) !important; color: #065f46 !important; border: 1px solid rgba(16,185,129,0.15); }
.bg-danger { background: var(--danger-light) !important; color: #991b1b !important; border: 1px solid rgba(239,68,68,0.15); }
.bg-warning { background: var(--warning-light) !important; color: #92400e !important; border: 1px solid rgba(245,158,11,0.15); }
.bg-primary { background: var(--primary-light) !important; color: #4338ca !important; border: 1px solid rgba(99,102,241,0.15); }
.bg-info { background: var(--info-light) !important; color: #1e40af !important; border: 1px solid rgba(59,130,246,0.15); }
.bg-secondary { background: var(--gray-100) !important; color: var(--gray-600) !important; border: 1px solid var(--gray-200); }

/* ============================
   FORMS (Refined)
   ============================ */
.form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

.form-control, .form-select {
    font-size: 0.875rem;
    padding: 0.5625rem 0.8125rem;
    border-radius: var(--radius-xs);
    border: 1.5px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
}

.form-control-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

textarea.form-control {
    font-size: 0.8125rem;
}

.input-group-text {
    border: 1.5px solid var(--gray-200);
    background: var(--gray-50);
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ============================
   ALERTS
   ============================ */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    position: relative;
}

.alert-success { background: var(--success-light); color: #065f46; border: 1px solid rgba(16,185,129,0.15); }
.alert-danger { background: var(--danger-light); color: #991b1b; border: 1px solid rgba(239,68,68,0.15); }
.alert-info { background: var(--info-light); color: #1e40af; border: 1px solid rgba(59,130,246,0.15); }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid rgba(245,158,11,0.15); }

/* ============================
   DATATABLES
   ============================ */
.dataTables_wrapper { padding: 0; }

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
    text-align: right;
}
.dataTables_wrapper .dataTables_filter label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.dataTables_wrapper .dataTables_filter input {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xs);
    padding: 0.4375rem 0.8125rem;
    font-size: 0.8125rem;
    margin-left: 0;
    width: 220px;
    transition: all 0.2s ease;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 1rem;
}
.dataTables_wrapper .dataTables_length label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.dataTables_wrapper .dataTables_length select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-xs);
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.75rem;
    color: var(--gray-500);
    padding-top: 1rem;
}
.dataTables_wrapper .dataTables_paginate {
    padding-top: 1rem;
}

.page-link {
    border: 1px solid var(--gray-200) !important;
    color: var(--gray-600) !important;
    border-radius: var(--radius-xs) !important;
    margin: 0 2px;
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    transition: all 0.15s ease;
}
.page-link:hover {
    background: var(--gray-100) !important;
    border-color: var(--gray-300) !important;
}
.page-item.active .page-link {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

/* ============================
   AUTH
   ============================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 30%, #f0fdf4 70%, #eef2ff 100%);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}
.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(99,102,241,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.auth-wrapper::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(16,185,129,0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-card {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid rgba(226,232,240,0.6);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem 2.5rem 2rem;
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #a78bfa);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.625rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(99,102,241,0.25);
}

.auth-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--dark);
    text-align: center;
    margin-bottom: 0.25rem;
    letter-spacing: -0.025em;
}

.auth-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 1.75rem;
}

/* ============================
   NAV TABS
   ============================ */
.nav-tabs {
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.25rem;
    gap: 0;
}
.nav-tabs .nav-link {
    border: none;
    color: var(--gray-500);
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.75rem 1.125rem;
    margin-bottom: -1px;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}
.nav-tabs .nav-link:hover {
    color: var(--gray-700);
    border: none;
    background: transparent;
}
.nav-tabs .nav-link.active {
    color: var(--primary);
    border: none;
    background: transparent;
}
.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.125rem;
    right: 1.125rem;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

/* ============================
   PERMISSION CHECKBOXES
   ============================ */
.permission-group {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.permission-group:hover {
    box-shadow: var(--shadow-md);
}
.permission-group-header {
    background: linear-gradient(135deg, var(--gray-50), #fff);
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
}
.permission-group-header .form-check {
    border: none;
    padding: 0;
    gap: 0.5rem;
    background: transparent;
}
.permission-group-header .form-check:hover {
    background: transparent;
}
.permission-group-header .form-check-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: capitalize;
}
.permission-group-body {
    padding: 0.75rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.permission-group-body .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    margin: 0;
    min-height: auto;
    background: #fff;
}
.permission-group-body .form-check:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}
.permission-group-body .form-check:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.form-check-input {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.form-check-label {
    font-size: 0.75rem;
    cursor: pointer;
    color: var(--gray-700);
    white-space: nowrap;
}

/* ============================
   UTILITIES
   ============================ */
.text-muted { color: var(--gray-500) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-primary { color: var(--primary) !important; }
.text-warning { color: var(--warning) !important; }
.bg-light { background: var(--gray-50) !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }

code {
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--gray-700);
}

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

.card, .stat-card, .alert {
    animation: fadeInUp 0.35s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.stat-card:nth-child(2) { animation-delay: 0.04s; }
.stat-card:nth-child(3) { animation-delay: 0.08s; }
.stat-card:nth-child(4) { animation-delay: 0.12s; }

/* ============================
   BLUETOOTH PRINTER STATUS
   ============================ */
.bt-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: all 0.2s ease;
    font-size: 0.75rem;
    color: var(--gray-500);
    border: 1px solid var(--gray-200);
    background: transparent;
}
.bt-status:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}
.bt-status.connected {
    color: var(--success);
    border-color: rgba(16,185,129,0.3);
    background: rgba(16,185,129,0.06);
}
.bt-status.connected:hover {
    border-color: var(--success);
    background: var(--success-light);
}
.bt-status .bt-icon {
    font-size: 1rem;
}
.bt-status .bt-name {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.bt-status.connected .bt-name {
    color: var(--success-dark);
}

/* ============================
   SIDEBAR TOGGLE (Mobile)
   ============================ */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.15s ease;
}
.sidebar-toggle:hover { color: var(--gray-800); }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 768px) {
    :root { --sidebar-width: 0px; }
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
        background: rgba(255,255,255,0.95);
        backdrop-filter: blur(24px);
    }
    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0,0,0,0.08);
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.2);
        z-index: 99;
        animation: fadeIn 0.2s ease;
    }
    .sidebar.open ~ .sidebar-overlay {
        display: block;
    }
    .main-content {
        margin-left: 0;
    }
    .page-content {
        padding: 1rem 1rem 2rem;
    }
    .stat-row {
        grid-template-columns: 1fr 1fr;
    }
    .topbar {
        padding: 0.625rem 1rem;
    }
    .dataTables_wrapper .dataTables_filter input {
        width: 140px;
    }
    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .stat-row {
        grid-template-columns: 1fr;
    }
    .card-body {
        padding: 1rem;
    }
    .stat-card-value {
        font-size: 1.25rem;
    }
    .auth-card {
        padding: 1.75rem;
    }
}

/* ============================
   TOUR OVERLAY
   ============================ */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}
.tour-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tour-highlight {
    position: relative;
    z-index: 10000 !important;
    box-shadow: 0 0 0 4px var(--primary), 0 0 32px rgba(99,102,241,0.35) !important;
    border-radius: var(--radius-xs);
    transition: box-shadow 0.3s ease;
}

.tour-tooltip {
    position: fixed;
    z-index: 10001;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.06);
    width: 380px;
    max-width: calc(100vw - 2rem);
    animation: fadeInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.tour-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    transform: rotate(45deg);
    box-shadow: -2px 2px 4px rgba(0,0,0,0.04);
    z-index: -1;
}

.tour-tooltip-content {
    padding: 1.25rem 1.5rem 1rem;
}

.tour-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tour-tooltip-step {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-400);
    letter-spacing: 0.04em;
}

.tour-tooltip-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
}
.tour-tooltip-close:hover { color: var(--gray-600); }

.tour-tooltip-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.tour-tooltip-desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.tour-tooltip-desc p { margin-bottom: 0.5rem; }
.tour-tooltip-desc ul { margin-top: 0.25rem; }
.tour-tooltip-desc li { margin-bottom: 0.25rem; }
.tour-tooltip-desc strong { color: var(--gray-800); }

.tour-tooltip-progress {
    height: 3px;
    background: var(--gray-100);
    border-radius: 4px;
    margin-bottom: 0.875rem;
    overflow: hidden;
}

.tour-tooltip-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #a78bfa);
    border-radius: 4px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.tour-tooltip-footer .btn {
    min-width: 110px;
    justify-content: center;
}

.tour-fade-out {
    animation: fadeOut 0.25s ease forwards !important;
}

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

/* ============================
   PRINT
   ============================ */
@media print {
    .sidebar, .topbar, .btn, .dataTables_filter, .dataTables_length,
    .dataTables_info, .dataTables_paginate, .sidebar-toggle, .sidebar-overlay,
    .topbar-right, .topbar-user, .card-header .btn, nav, .no-print { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; break-inside: avoid; border-radius: 0 !important; }
    .card-header { border-bottom: 1px solid #dee2e6 !important; }
    body { background: #fff !important; font-size: 10pt !important; color: #000 !important; }
    .page-content { padding: 0 !important; }
    .table td, .table th { padding: 4px 6px !important; font-size: 9pt !important; }
    .stat-row { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .stat-card { box-shadow: none !important; border: 1px solid #dee2e6 !important; break-inside: avoid; border-radius: 0 !important; }
    .stat-card-value { font-size: 14pt !important; }
    .badge { border: 1px solid #dee2e6 !important; }
    a[href]:after { content: none !important; }
    .table-responsive { overflow: visible !important; }
    .nav-tabs { display: none !important; }
    .tab-pane { display: block !important; opacity: 1 !important; }
}
