/* ============================================================
   BIHARI SMM ADMIN PANEL — MAIN STYLESHEET
   Version: 7.0.6 (Medium Professional)
   Theme: Dark Premium
   ============================================================ */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; display: block; }

a { color: var(--primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--primary-hover); }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, select, textarea { font-family: inherit; font-size: inherit; }

/* ============================================================
   2. DESIGN TOKENS
   ============================================================ */
:root {
    --bg-base:       #0a0a0f;
    --bg-card:       #12121a;
    --bg-elevated:   #1a1a24;
    --bg-hover:      #252530;
    --bg-active:     #2d2d3a;
    --bg-input:      #16161f;

    --border-color:  #2d2d3a;
    --border-light:  #1f1f2a;
    --border-hover:  #3d3d4a;

    --text-primary:   #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted:     #6b7280;
    --text-disabled:  #3f3f46;

    --primary:        #ff6b00;
    --primary-hover:  #ff8533;
    --primary-active: #e55a00;
    --primary-light:  rgba(255, 107, 0, 0.15);
    --primary-glow:   rgba(255, 107, 0, 0.4);

    --accent:         #a855f7;
    --accent-hover:   #b975f8;
    --accent-light:   rgba(168, 85, 247, 0.15);

    --success:        #10b981;
    --success-light:  rgba(16, 185, 129, 0.15);
    --success-hover:  #34d399;

    --warning:        #f59e0b;
    --warning-light:  rgba(245, 158, 11, 0.15);
    --warning-hover:  #fbbf24;

    --danger:         #ef4444;
    --danger-light:   rgba(239, 68, 68, 0.15);
    --danger-hover:   #f87171;

    --info:           #3b82f6;
    --info-light:     rgba(59, 130, 246, 0.15);
    --info-hover:     #60a5fa;

    --gold:           #fbbf24;
    --gold-light:     rgba(251, 191, 36, 0.15);

    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 9999px;

    --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-xl:  0 20px 60px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px var(--primary-glow);

    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s ease;

    --z-sidebar:   100;
    --z-header:    200;
    --z-dropdown:  500;
    --z-modal:     1000;
    --z-toast:     2000;
    --z-loader:    3000;

    --sidebar-width:  240px;
    --header-height:  60px;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: 28px; }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; }
h4 { font-size: 16px; font-weight: 600; }
h5 { font-size: 14px; font-weight: 600; }
h6 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center    { text-align: center; }
.text-right     { text-align: right; }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-info      { color: var(--info); }
.text-primary-color { color: var(--primary); }

code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
    background: var(--bg-input);
    color: var(--primary);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    border: 1px solid var(--border-light);
}

/* ============================================================
   4. SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================================
   5. LOGIN PAGE
   ============================================================ */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 107, 0, 0.08), transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.08), transparent 50%),
        var(--bg-base);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: loginCardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-card::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: var(--radius-xl);
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(255, 107, 0, 0.5),
        transparent 30%,
        transparent 70%,
        rgba(168, 85, 247, 0.5));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: -1;
}

@keyframes loginCardEnter {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo { text-align: center; margin-bottom: var(--space-xl); }

.login-logo-icon {
    font-size: 56px;
    margin-bottom: var(--space-sm);
    display: block;
    filter: drop-shadow(0 4px 20px var(--primary-glow));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.login-logo p { color: var(--text-muted); font-size: 13px; }

.login-step { display: none; animation: stepSlideIn 0.35s ease; }
.login-step.active { display: block; }

@keyframes stepSlideIn {
    from { opacity: 0; transform: translateX(15px); }
    to   { opacity: 1; transform: translateX(0); }
}

.login-step-title { font-size: 18px; font-weight: 600; margin-bottom: var(--space-xs); }
.login-step-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: var(--space-lg); }

.login-footer {
    text-align: center;
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
    font-size: 12px;
}

.login-footer a { color: var(--text-secondary); }
.login-footer a:hover { color: var(--primary); }

.otp-inputs { display: flex; gap: 10px; justify-content: center; margin: var(--space-lg) 0; }

.otp-input {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, monospace;
    background: var(--bg-input);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
}

.otp-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    transform: translateY(-2px);
}

.otp-input.filled { border-color: var(--primary); background: var(--primary-light); }

.otp-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-light);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-8px); }
    75%      { transform: translateX(8px); }
}

.otp-timer { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: var(--space-md); }
.otp-timer strong { color: var(--primary); font-family: 'SF Mono', Monaco, monospace; }
.otp-timer.expired strong { color: var(--danger); }

.password-wrapper { position: relative; }

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 16px;
    line-height: 1;
}

.password-toggle:hover { color: var(--primary); background: var(--primary-light); }

.login-alert {
    display: none;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-size: 13px;
    border-left: 3px solid;
    animation: alertSlide 0.3s ease;
}

.login-alert.show { display: block; }
.login-alert.error   { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger-hover); }
.login-alert.success { background: var(--success-light); border-color: var(--success); color: var(--success-hover); }
.login-alert.info    { background: var(--info-light);    border-color: var(--info);    color: var(--info-hover); }
.login-alert.warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning-hover); }

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

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: var(--space-md) 0;
    cursor: pointer;
    user-select: none;
    font-size: 13px;
    color: var(--text-secondary);
    min-height: 44px;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-wrapper:hover { color: var(--text-primary); }

/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    height: 42px;
    min-height: 42px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.btn:not(:disabled):hover { transform: translateY(-1px); }
.btn:not(:disabled):active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 14px rgba(255, 107, 0, 0.3);
}
.btn-primary:not(:disabled):hover {
    background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.5);
}

.btn-secondary { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:not(:disabled):hover { background: var(--bg-hover); border-color: var(--border-hover); }

.btn-success {
    background: linear-gradient(135deg, var(--success), var(--success-hover));
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}
.btn-success:not(:disabled):hover { box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), var(--danger-hover));
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}
.btn-danger:not(:disabled):hover { box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--warning-hover));
    color: #000;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:not(:disabled):hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:not(:disabled):hover { background: var(--primary-light); }

.btn-sm { height: 34px; min-height: 34px; padding: 6px 14px; font-size: 13px; }
.btn-lg { height: 52px; min-height: 52px; padding: 14px 28px; font-size: 15px; }

.btn-block { width: 100%; }

.btn-icon { width: 42px; height: 42px; padding: 0; border-radius: var(--radius-md); }
.btn-icon.btn-sm { width: 34px; height: 34px; }

.btn.loading { color: transparent; pointer-events: none; }

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================================
   7. FORM CONTROLS
   ============================================================ */
.form-group { margin-bottom: var(--space-md); }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-label.required::after { content: ' *'; color: var(--danger); }

.form-control,
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 42px;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-textarea {
    height: auto;
    min-height: 100px;
    resize: vertical;
    padding: 12px 14px;
    line-height: 1.6;
}

.form-control:hover, .form-input:hover, .form-select:hover, .form-textarea:hover {
    border-color: var(--border-hover);
}

.form-control:focus, .form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
    background: var(--bg-card);
}

.form-control::placeholder, .form-input::placeholder, .form-textarea::placeholder {
    color: var(--text-disabled);
}

.form-control:disabled, .form-input:disabled, .form-select:disabled, .form-textarea:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--bg-base);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.form-help { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }

.form-group.has-error .form-control,
.form-group.has-error .form-input,
.form-group.has-error .form-select { border-color: var(--danger); }

.form-group.has-error .form-error { display: block; }

.input-group { position: relative; }

.input-group .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 16px;
}

.input-group .form-control,
.input-group .form-input { padding-left: 42px; }

/* ============================================================
   8. CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.card:hover { border-color: var(--border-hover); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: var(--space-md);
    margin-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.card-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 10px; }

.card-body { padding: var(--space-md) 0; }

.card-footer {
    padding-top: var(--space-md);
    margin-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity var(--transition-base);
}

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

.stat-card:hover::before { opacity: 1; }

.stat-icon { font-size: 28px; margin-bottom: var(--space-xs); }

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    word-break: break-word;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    margin-top: var(--space-xs);
    width: fit-content;
}

.stat-trend.up   { background: var(--success-light); color: var(--success); }
.stat-trend.down { background: var(--danger-light);  color: var(--danger); }

/* ============================================================
   9. BADGES
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger  { background: var(--danger-light);  color: var(--danger); }
.badge-info    { background: var(--info-light);    color: var(--info); }
.badge-gold    { background: var(--gold-light);    color: var(--gold); }
.badge-muted   { background: var(--bg-elevated);   color: var(--text-muted); }

.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.badge-dot.pulse { animation: badgePulse 2s ease-in-out infinite; }

@keyframes badgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.3); }
}

/* ============================================================
   10. ALERTS
   ============================================================ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border-left: 3px solid;
    font-size: 13px;
    margin-bottom: var(--space-md);
    line-height: 1.5;
}

.alert-success { background: var(--success-light); border-color: var(--success); color: var(--success-hover); }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: var(--warning-hover); }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: var(--danger-hover); }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: var(--info-hover); }

.alert-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }

/* ============================================================
   11. TABLES
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    -webkit-overflow-scrolling: touch;
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table thead { background: var(--bg-elevated); position: sticky; top: 0; z-index: 1; }

.table th {
    text-align: left;
    padding: 14px 16px;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
    user-select: none;
}

.table th.sortable { cursor: pointer; }
.table th.sortable:hover { color: var(--primary); }

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr { transition: background var(--transition-fast); }
.table tbody tr:hover { background: var(--bg-hover); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.selected { background: var(--primary-light); }

.table-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.table-empty-icon { font-size: 48px; margin-bottom: var(--space-md); opacity: 0.4; }

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border-light);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.pagination-info { font-size: 13px; color: var(--text-muted); }
.pagination-controls { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

.pagination-btn {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

.pagination-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================================================
   12. MODALS
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(10px);
    transition: transform var(--transition-base);
}

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

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1100px; }

.modal-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.modal-title { font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 10px; }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: var(--space-lg); overflow-y: auto; flex: 1; }

.modal-footer {
    padding: var(--space-lg);
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

/* ============================================================
   13. TOASTS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    min-width: 280px;
    font-size: 13px;
}

.toast.removing { animation: toastSlideOut 0.3s ease forwards; }

.toast-icon { font-size: 18px; flex-shrink: 0; line-height: 1; }
.toast-content { flex: 1; color: var(--text-primary); line-height: 1.5; word-break: break-word; }

.toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.toast-close:hover { opacity: 1; }

.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info    { border-left-color: var(--info); }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

/* ============================================================
   14. LAYOUT
   ============================================================ */
.app-container { display: flex; min-height: 100vh; min-height: 100dvh; width: 100%; }

.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-base);
    min-width: 0;
}

.app-main {
    flex: 1;
    padding: var(--space-lg);
    padding-top: calc(var(--header-height) + var(--space-lg));
    max-width: 100%;
    overflow-x: hidden;
}

/* ============================================================
   15. SIDEBAR
   ============================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: var(--z-sidebar);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-base);
    overflow: hidden;
}

.sidebar-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-logo { font-size: 32px; filter: drop-shadow(0 2px 8px var(--primary-glow)); }

.sidebar-brand h2 {
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.sidebar-brand p { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-md) 0; -webkit-overflow-scrolling: touch; }

.sidebar-group { margin-bottom: var(--space-md); }

.sidebar-group-title {
    padding: var(--space-sm) var(--space-lg);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px var(--space-lg);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    border-left: 3px solid transparent;
    text-decoration: none;
    min-height: 44px;
}

.sidebar-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.sidebar-link.active { background: var(--primary-light); color: var(--primary); border-left-color: var(--primary); }

.sidebar-link-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.sidebar-link-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-link-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: var(--danger);
    color: #fff;
    min-width: 20px;
    text-align: center;
    line-height: 1.4;
}

.sidebar-link-badge.badge-warning { background: var(--warning); color: #000; }
.sidebar-link-badge.badge-info    { background: var(--info); }
.sidebar-link-badge.badge-success { background: var(--success); }

.sidebar-footer { padding: var(--space-md) var(--space-lg); border-top: 1px solid var(--border-light); flex-shrink: 0; }

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--danger-light);
    color: var(--danger);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    width: 100%;
    justify-content: center;
    min-height: 44px;
}

.sidebar-logout:hover { background: var(--danger); color: #fff; }

/* ============================================================
   16. HEADER
   ============================================================ */
.header {
    height: var(--header-height);
    background: rgba(18, 18, 26, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    z-index: var(--z-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-lg);
    gap: var(--space-md);
    transition: left var(--transition-base);
}

.header-left { display: flex; align-items: center; gap: var(--space-md); flex: 1; min-width: 0; }

.header-menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-radius: var(--radius-md);
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.header-menu-toggle:hover { background: var(--bg-hover); color: var(--text-primary); }

.header-title { font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-subtitle { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-search { flex: 1; max-width: 400px; position: relative; }

.header-search input {
    width: 100%;
    height: 40px;
    padding: 8px 14px 8px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
}

.header-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

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

.header-right { display: flex; align-items: center; gap: var(--space-sm); flex-shrink: 0; }

.header-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.header-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.header-icon-btn-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    min-height: 44px;
}

.header-user:hover { border-color: var(--border-hover); }

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.header-user-info { display: flex; flex-direction: column; line-height: 1.2; }
.header-user-name { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.header-user-role { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   17. PAGE HEADER
   ============================================================ */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.page-header-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }

.page-title { font-size: 24px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.page-description { font-size: 13px; color: var(--text-muted); }

.page-header-actions { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }

/* ============================================================
   18. GRID UTILITIES
   ============================================================ */
.grid { display: grid; gap: var(--space-md); }

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.flex-wrap  { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end    { justify-content: flex-end; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* ============================================================
   19. LOADER
   ============================================================ */
.loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: var(--z-loader);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

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

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

.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 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; }
}

/* ============================================================
   20. SIDEBAR OVERLAY
   ============================================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    -webkit-tap-highlight-color: transparent;
}

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

/* ============================================================
   21. CHART CONTAINER
   ============================================================ */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
}

.card-body canvas {
    max-height: 320px;
    width: 100% !important;
    height: auto !important;
}

/* ============================================================
   22. RESPONSIVE — TABLET
   ============================================================ */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 992px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   23. RESPONSIVE — MOBILE (MEDIUM PROFESSIONAL)
   ============================================================ */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --header-height: 56px;
    }

    /* ============================================
       BODY
       ============================================ */
    body {
        font-size: 14px;
        line-height: 1.55;
    }

    /* ============================================
       SIDEBAR — Medium
       ============================================ */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active { transform: translateX(0); }

    .sidebar-header { padding: 16px 20px; gap: 10px; }
    .sidebar-logo { font-size: 28px; }
    .sidebar-brand h2 { font-size: 15px; }
    .sidebar-brand p { font-size: 11px; }

    .sidebar-group { margin-bottom: 8px; }
    .sidebar-group-title { padding: 8px 20px; font-size: 10px; }

    .sidebar-link {
        padding: 12px 20px;
        font-size: 14px;
        gap: 12px;
        min-height: 44px;
    }

    .sidebar-link-icon { font-size: 17px; width: 20px; }
    .sidebar-link-badge { font-size: 10px; padding: 2px 7px; }

    .sidebar-footer { padding: 12px 20px; }
    .sidebar-logout { padding: 12px 16px; font-size: 13px; min-height: 44px; }

    /* ============================================
       LAYOUT
       ============================================ */
    .app-content { margin-left: 0; }

    .app-main {
        padding: 14px;
        padding-top: calc(var(--header-height) + 14px);
    }

    /* ============================================
       HEADER — Medium
       ============================================ */
    .header {
        left: 0;
        padding: 0 14px;
        gap: 8px;
    }

    .header-menu-toggle {
        display: flex;
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .header-search { display: none; }

    .header-title { font-size: 16px; }
    .header-subtitle { font-size: 11px; }

    .header-icon-btn {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    .header-icon-btn-badge {
        top: 4px;
        right: 4px;
        min-width: 17px;
        height: 17px;
        font-size: 9px;
    }

    .header-user {
        padding: 3px 10px 3px 3px;
        min-height: 40px;
        gap: 8px;
    }

    .header-user-avatar { width: 30px; height: 30px; font-size: 12px; }
    .header-user-name { font-size: 12px; }
    .header-user-role { font-size: 10px; }

    /* ============================================
       PAGE HEADER — Medium
       ============================================ */
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-bottom: 14px;
    }

    .page-title { font-size: 20px; gap: 8px; }
    .page-description { font-size: 12px; }

    .page-header-actions {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .page-header-actions .btn {
        width: 100%;
        justify-content: center;
        height: 42px;
        min-height: 42px;
        font-size: 13px;
        padding: 8px 12px;
    }

    /* ============================================
       STAT CARDS — 2 per row, MEDIUM
       ============================================ */
    #statCards {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        margin-bottom: 14px !important;
    }

    .stat-card {
        padding: 14px !important;
        border-radius: 12px !important;
        gap: 6px !important;
        min-height: auto !important;
    }

    .stat-card:hover { transform: none; }

    .stat-icon {
        font-size: 22px !important;
        margin-bottom: 4px !important;
        line-height: 1 !important;
    }

    .stat-value {
        font-size: 20px !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
    }

    .stat-label {
        font-size: 10px !important;
        letter-spacing: 0.03em !important;
        line-height: 1.2 !important;
    }

    .stat-trend {
        font-size: 10px !important;
        padding: 2px 7px !important;
        margin-top: 4px !important;
    }

    /* ============================================
       GRID COLLAPSE
       ============================================ */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

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

    /* ============================================
       CARDS — Medium
       ============================================ */
    .card {
        padding: 14px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }

    .card:hover { transform: none; }

    .card-header {
        padding-bottom: 10px !important;
        margin-bottom: 10px !important;
        gap: 8px !important;
    }

    .card-title {
        font-size: 15px !important;
        gap: 8px !important;
    }

    .card-body { padding: 8px 0 !important; }

    .card-footer {
        padding-top: 10px !important;
        margin-top: 10px !important;
    }

    /* ============================================
       MODALS — Bottom Sheet
       ============================================ */
    .modal {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 18px 18px 0 0;
        margin-top: auto;
    }

    .modal-overlay { padding: 0; align-items: flex-end; }

    .modal-header,
    .modal-body,
    .modal-footer { padding: 16px !important; }

    .modal-title { font-size: 17px; }

    .modal-footer { flex-direction: column-reverse; gap: 8px; }
    .modal-footer .btn { width: 100%; }

    .modal-close { width: 36px; height: 36px; font-size: 20px; }

    /* ============================================
       TOASTS — Top
       ============================================ */
    .toast-container {
        top: calc(var(--header-height) + 12px);
        bottom: auto;
        left: 14px;
        right: 14px;
        max-width: none;
        gap: 10px;
    }

    .toast {
        min-width: 0;
        width: 100%;
        font-size: 13px;
        padding: 12px 14px;
        animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .toast.removing {
        animation: toastSlideUp 0.25s ease forwards;
    }

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

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

    /* ============================================
       LOGIN — Medium
       ============================================ */
    .login-card {
        padding: 28px 22px;
        border-radius: 18px;
    }

    .login-logo { margin-bottom: 20px; }
    .login-logo-icon { font-size: 52px; margin-bottom: 8px; }
    .login-logo h1 { font-size: 22px; }
    .login-logo p { font-size: 12px; }

    .login-step-title { font-size: 17px; }
    .login-step-subtitle { font-size: 13px; margin-bottom: 16px; }

    .login-footer {
        margin-top: 16px;
        padding-top: 16px;
        font-size: 11px;
    }

    .otp-inputs { gap: 8px; margin: 16px 0; }
    .otp-input {
        width: 46px;
        height: 52px;
        font-size: 20px;
        border-radius: 10px;
    }

    .otp-timer { font-size: 12px; margin-top: 10px; }

    .checkbox-wrapper {
        font-size: 13px;
        margin: 12px 0;
        min-height: 36px;
    }

    /* ============================================
       TYPOGRAPHY — Medium
       ============================================ */
    h1 { font-size: 20px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }

    /* ============================================
       TABLES — Medium
       ============================================ */
    .table-wrapper {
        background-image: linear-gradient(to right, transparent 0%, transparent 95%, rgba(255, 107, 0, 0.08) 100%);
        background-repeat: no-repeat;
        background-size: 40px 100%;
        background-position: right;
        border-radius: 12px;
    }

    .table {
        font-size: 12px;
        min-width: 540px;
    }

    .table th {
        padding: 10px 12px !important;
        font-size: 10px;
    }

    .table td { padding: 10px 12px !important; }

    /* ============================================
       PAGINATION — Medium
       ============================================ */
    .pagination {
        padding: 10px 14px;
        gap: 8px;
    }

    .pagination-info { font-size: 12px; }

    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
    }

    /* ============================================
       FORMS (iOS zoom fix)
       ============================================ */
    input,
    textarea,
    select,
    .form-control,
    .form-input,
    .form-select,
    .form-textarea,
    .header-search input {
        font-size: 16px !important;
    }

    .form-group { margin-bottom: 14px; }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-control,
    .form-input,
    .form-select {
        height: 46px;
        padding: 10px 14px;
        border-radius: 10px;
    }

    .form-textarea {
        min-height: 100px;
        padding: 12px 14px;
    }

    /* ============================================
       BUTTONS — Medium
       ============================================ */
    .btn {
        height: 44px;
        min-height: 44px;
        padding: 10px 18px;
        font-size: 14px;
        gap: 6px;
    }

    .btn-sm {
        height: 38px;
        min-height: 38px;
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-lg {
        height: 52px;
        min-height: 52px;
        font-size: 15px;
    }

    .btn-icon {
        width: 44px;
        height: 44px;
    }

    .btn-icon.btn-sm {
        width: 38px;
        height: 38px;
    }

    /* ============================================
       BADGES — Medium
       ============================================ */
    .badge {
        font-size: 10px;
        padding: 3px 8px;
        gap: 4px;
    }

    /* ============================================
       CHART — Medium
       ============================================ */
    .chart-container {
        min-height: 240px;
    }

    .card-body canvas {
        max-height: 260px !important;
    }

    /* ============================================
       SPACING — Medium
       ============================================ */
    .mb-lg { margin-bottom: 12px !important; }
    .mt-lg { margin-top: 12px !important; }
    .gap-md { gap: 10px; }
    .gap-lg { gap: 12px; }

    /* ============================================
       FLEX WRAP
       ============================================ */
    .flex.justify-between {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* ============================================
       CODE
       ============================================ */
    code {
        font-size: 12px;
        padding: 2px 6px;
    }
}

/* ============================================================
   24. RESPONSIVE — SMALL MOBILE (480px) — MEDIUM
   ============================================================ */
@media (max-width: 480px) {
    .header-user-info { display: none; }
    .header-user { padding: 3px; min-height: 40px; }
    .header-title { font-size: 15px; }
    .header-subtitle { display: none; }
    .header-icon-btn { width: 38px; height: 38px; font-size: 16px; }
    .header-menu-toggle { width: 38px; height: 38px; font-size: 20px; }

    .page-header-actions { grid-template-columns: 1fr; }
    .page-title { font-size: 19px; }

    #statCards {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .stat-card { padding: 12px !important; }
    .stat-value { font-size: 18px !important; }
    .stat-icon { font-size: 20px !important; }
    .stat-label { font-size: 10px !important; }
    .stat-trend { font-size: 10px !important; padding: 2px 6px !important; }

    .otp-input {
        width: 42px;
        height: 48px;
        font-size: 18px;
    }

    .otp-inputs { gap: 6px; }

    .pagination {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .pagination-controls { justify-content: center; }

    .login-card {
        padding: 24px 18px;
        border-radius: 16px;
    }

    .login-logo-icon { font-size: 44px; }
    .login-logo h1 { font-size: 20px; }
    .login-logo p { font-size: 11px; }
    .login-step-title { font-size: 16px; }
    .login-step-subtitle { font-size: 12px; }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }

    .card { padding: 12px !important; }

    .table {
        min-width: 500px;
        font-size: 12px;
    }

    .table th,
    .table td { padding: 9px 10px !important; }

    .btn {
        height: 42px;
        min-height: 42px;
        font-size: 13px;
    }

    .btn-sm {
        height: 36px;
        min-height: 36px;
        font-size: 12px;
    }

    .btn-icon { width: 42px; height: 42px; }

    h1 { font-size: 19px; }
    h2 { font-size: 17px; }
    h3 { font-size: 15px; }
}

/* ============================================================
   25. RESPONSIVE — VERY SMALL (360px)
   ============================================================ */
@media (max-width: 360px) {
    .otp-input {
        width: 38px;
        height: 44px;
        font-size: 16px;
    }

    .otp-inputs { gap: 5px; }

    .stat-card { padding: 10px !important; }
    .stat-value { font-size: 16px !important; }
    .stat-label { font-size: 9px !important; }

    .btn {
        padding: 10px 14px;
        font-size: 13px;
    }

    .page-title { font-size: 17px; }
}

/* ============================================================
   26. UTILITY
   ============================================================ */
.hidden    { display: none !important; }
.visible   { display: block !important; }
.no-scroll { overflow: hidden !important; }
.pointer   { cursor: pointer; }
.w-100     { width: 100%; }
.h-100     { height: 100%; }

.divider {
    height: 1px;
    background: var(--border-light);
    margin: var(--space-md) 0;
}

/* ============================================================
   27. ANIMATIONS
   ============================================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.animate-fade-in    { animation: fadeIn 0.3s ease; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease; }
.animate-slide-in   { animation: slideInRight 0.3s ease; }

/* ============================================================
   28. TOUCH DEVICE OPTIMIZATIONS
   ============================================================ */
@media (hover: none) and (pointer: coarse) {
    .btn:not(:disabled):hover { transform: none; }
    .stat-card:hover { transform: none; }

    .btn:not(:disabled):active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .sidebar-link:active { background: var(--bg-active); }
}

/* ============================================================
   29. ACCESSIBILITY — REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}