/* ==========================================================================
   AURA DESIGN SYSTEM — PRESENSI YANG LEBIH BERMAKNA
   Vanilla CSS Lokal — Tanpa Dependensi Eksternal / CDN
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. ROOT VARIABLES & MULTI-THEME PALETTES
   -------------------------------------------------------------------------- */
:root, [data-theme="indigo"] {
    /* Primary & Brand Accent: Indigo (Professional - Default) */
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-active: #3730a3;
    --color-primary-light: #eef2ff;
    --color-primary-border: #c7d2fe;
    --color-primary-focus: rgba(79, 70, 229, 0.25);
    
    --color-accent: #06b6d4;
    --color-accent-hover: #0891b2;
    --color-accent-subtle: #ecfeff;
    --color-secondary: #6366f1;

    --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #eef2ff 0%, #ecfeff 100%);
    --brand-glow: 0 10px 25px -5px rgba(79, 70, 229, 0.35);

    /* Sidebar Variables (Default Indigo) */
    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(79, 70, 229, 0.18);
    --sidebar-active-text: #818cf8;
    --sidebar-active-border: #6366f1;
}

[data-theme="emerald"] {
    /* Emerald — Fresh */
    --color-primary: #059669;
    --color-primary-hover: #047857;
    --color-primary-active: #065f46;
    --color-primary-light: #ecfdf5;
    --color-primary-border: #a7f3d0;
    --color-primary-focus: rgba(5, 150, 105, 0.25);
    
    --color-accent: #10b981;
    --color-accent-hover: #059669;
    --color-accent-subtle: #f0fdf4;
    --color-secondary: #0d9488;

    --brand-gradient: linear-gradient(135deg, #059669 0%, #14b8a6 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
    --brand-glow: 0 10px 25px -5px rgba(5, 150, 105, 0.35);

    --sidebar-bg: #062e24;
    --sidebar-border: #0b4637;
    --sidebar-text: #a7f3d0;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(5, 150, 105, 0.22);
    --sidebar-active-text: #34d399;
    --sidebar-active-border: #10b981;
}

[data-theme="ocean"] {
    /* Ocean — Technology */
    --color-primary: #0284c7;
    --color-primary-hover: #0369a1;
    --color-primary-active: #075985;
    --color-primary-light: #f0f9ff;
    --color-primary-border: #bae6fd;
    --color-primary-focus: rgba(2, 132, 199, 0.25);
    
    --color-accent: #38bdf8;
    --color-accent-hover: #0284c7;
    --color-accent-subtle: #e0f2fe;
    --color-secondary: #2563eb;

    --brand-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #f0f9ff 0%, #eff6ff 100%);
    --brand-glow: 0 10px 25px -5px rgba(2, 132, 199, 0.35);

    --sidebar-bg: #082f49;
    --sidebar-border: #0c4a6e;
    --sidebar-text: #bae6fd;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(2, 132, 199, 0.22);
    --sidebar-active-text: #38bdf8;
    --sidebar-active-border: #0284c7;
}

[data-theme="violet"] {
    /* Violet — Creative */
    --color-primary: #7c3aed;
    --color-primary-hover: #6d28d9;
    --color-primary-active: #5b21b6;
    --color-primary-light: #f5f3ff;
    --color-primary-border: #ddd6fe;
    --color-primary-focus: rgba(124, 58, 237, 0.25);
    
    --color-accent: #a855f7;
    --color-accent-hover: #9333ea;
    --color-accent-subtle: #faf5ff;
    --color-secondary: #8b5cf6;

    --brand-gradient: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #f5f3ff 0%, #fdf2f8 100%);
    --brand-glow: 0 10px 25px -5px rgba(124, 58, 237, 0.35);

    --sidebar-bg: #1e1136;
    --sidebar-border: #331d5c;
    --sidebar-text: #ddd6fe;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(124, 58, 237, 0.22);
    --sidebar-active-text: #c084fc;
    --sidebar-active-border: #a855f7;
}

[data-theme="rose"] {
    /* Rose — Modern */
    --color-primary: #e11d48;
    --color-primary-hover: #be123c;
    --color-primary-active: #9f1239;
    --color-primary-light: #fff1f2;
    --color-primary-border: #fecdd3;
    --color-primary-focus: rgba(225, 29, 72, 0.25);
    
    --color-accent: #fb7185;
    --color-accent-hover: #f43f5e;
    --color-accent-subtle: #ffe4e6;
    --color-secondary: #f43f5e;

    --brand-gradient: linear-gradient(135deg, #e11d48 0%, #f97316 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #fff1f2 0%, #fff7ed 100%);
    --brand-glow: 0 10px 25px -5px rgba(225, 29, 72, 0.35);

    --sidebar-bg: #2a0b16;
    --sidebar-border: #461426;
    --sidebar-text: #fecdd3;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(225, 29, 72, 0.22);
    --sidebar-active-text: #fda4af;
    --sidebar-active-border: #f43f5e;
}

[data-theme="slate"] {
    /* Slate — Minimal */
    --color-primary: #334155;
    --color-primary-hover: #1e293b;
    --color-primary-active: #0f172a;
    --color-primary-light: #f1f5f9;
    --color-primary-border: #cbd5e1;
    --color-primary-focus: rgba(51, 65, 85, 0.25);
    
    --color-accent: #64748b;
    --color-accent-hover: #475569;
    --color-accent-subtle: #f8fafc;
    --color-secondary: #475569;

    --brand-gradient: linear-gradient(135deg, #334155 0%, #0f172a 100%);
    --brand-gradient-subtle: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    --brand-glow: 0 10px 25px -5px rgba(51, 65, 85, 0.35);

    --sidebar-bg: #0f172a;
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8;
    --sidebar-text-hover: #ffffff;
    --sidebar-active-bg: rgba(148, 163, 184, 0.18);
    --sidebar-active-text: #f1f5f9;
    --sidebar-active-border: #94a3b8;
}

/* Base System Tokens across all themes */
:root {
    /* Neutral Surfaces */
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-subtle: #f1f5f9;
    --color-surface-elevated: #ffffff;
    --color-surface-muted: #e2e8f0;

    /* Text */
    --color-text-main: #0f172a;
    --color-text-secondary: #334155;
    --color-text-muted: #64748b;
    --color-text-subtle: #94a3b8;
    --color-text-inverse: #ffffff;

    /* Semantic Token Aliases */
    --color-background: var(--color-bg);
    --color-sidebar: var(--sidebar-bg);
    --color-text: var(--color-text-main);
    --color-muted: var(--color-text-muted);

    /* Generic Aura Theme Tokens (Auto-adapts to active user theme) */
    --aura-primary: var(--color-primary);
    --aura-primary-hover: var(--color-primary-hover);
    --aura-primary-soft: var(--color-primary-light);
    --aura-accent: var(--color-accent);
    --aura-success: var(--color-success);
    --aura-warning: var(--color-warning);
    --aura-danger: var(--color-danger);
    --aura-info: var(--color-info);
    --aura-surface: var(--color-surface);
    --aura-surface-muted: var(--color-surface-subtle);
    --aura-border: var(--color-border);
    --aura-text: var(--color-text-main);
    --aura-text-muted: var(--color-text-muted);
    --aura-focus: var(--color-primary-focus);

    /* Aura Sidebar Theme Tokens (Auto-adapts to active user theme) */
    --aura-sidebar-bg: var(--sidebar-bg);
    --aura-sidebar-border: var(--sidebar-border);
    --aura-sidebar-text: var(--sidebar-text);
    --aura-sidebar-text-hover: var(--sidebar-text-hover);
    --aura-sidebar-active-bg: var(--sidebar-active-bg);
    --aura-sidebar-active-text: var(--sidebar-active-text);
    --aura-sidebar-active-border: var(--sidebar-active-border);
    --aura-sidebar-indicator: var(--sidebar-active-border);
    --aura-sidebar-hover-bg: rgba(255, 255, 255, 0.06);

    /* Borders */
    --color-border: #e2e8f0;
    --color-border-hover: #cbd5e1;
    --color-border-strong: #94a3b8;

    /* Functional States */
    --color-success: #10b981;
    --color-success-hover: #059669;
    --color-success-bg: #ecfdf5;
    --color-success-border: #a7f3d0;
    --color-success-text: #065f46;

    --color-danger: #ef4444;
    --color-danger-hover: #dc2626;
    --color-danger-bg: #fef2f2;
    --color-danger-border: #fecaca;
    --color-danger-text: #991b1b;

    --color-warning: #f59e0b;
    --color-warning-hover: #d97706;
    --color-warning-bg: #fffbeb;
    --color-warning-border: #fde68a;
    --color-warning-text: #92400e;

    --color-info: #0ea5e9;
    --color-info-hover: #0284c7;
    --color-info-bg: #f0f9ff;
    --color-info-border: #bae6fd;
    --color-info-text: #075985;

    /* Typography Stack (Clean, Modern, 100% Local) */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, -apple-system, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.07), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 10px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode / System Appearance support */
@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --color-bg: #090d16;
        --color-surface: #0f172a;
        --color-surface-subtle: #1e293b;
        --color-surface-elevated: #1e293b;
        --color-surface-muted: #334155;
        --color-text-main: #f8fafc;
        --color-text-secondary: #cbd5e1;
        --color-text-muted: #94a3b8;
        --color-border: #1e293b;
        --color-border-hover: #334155;
    }
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.25;
    letter-spacing: -0.02em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

/* --------------------------------------------------------------------------
   3. AURA BRANDING & LOGO ELEMENTS
   -------------------------------------------------------------------------- */
.aura-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.03em;
    color: var(--color-text-main);
    text-decoration: none;
}

.aura-mark-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--brand-gradient);
    box-shadow: var(--brand-glow);
    color: #ffffff;
    flex-shrink: 0;
}

.aura-mark-icon svg {
    width: 22px;
    height: 22px;
}

.aura-tagline {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   4. TWO-COLUMN AURA LOGIN INTERFACE
   -------------------------------------------------------------------------- */
.auth-split-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background-color: var(--color-bg);
}

@media (max-width: 960px) {
    .auth-split-layout {
        grid-template-columns: 1fr;
    }
}

/* Left Showcase Panel */
.auth-showcase-panel {
    background: linear-gradient(145deg, #090d16 0%, #0f172a 50%, #1e1b4b 100%);
    color: #ffffff;
    padding: 3.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-showcase-panel::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -20%;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 70, 229, 0.25) 0%, rgba(6, 182, 212, 0.1) 60%, transparent 80%);
    filter: blur(40px);
    pointer-events: none;
}

.auth-showcase-panel::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: -15%;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.2) 0%, rgba(79, 70, 229, 0.05) 70%, transparent 80%);
    filter: blur(50px);
    pointer-events: none;
}

.showcase-header {
    position: relative;
    z-index: 2;
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.showcase-brand h1 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.showcase-brand p {
    color: #94a3b8;
    font-size: 0.95rem;
    margin-bottom: 0;
}

.showcase-body {
    position: relative;
    z-index: 2;
    margin: 2.5rem 0;
}

.showcase-headline {
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 40%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.showcase-subtext {
    font-size: 1.05rem;
    color: #cbd5e1;
    line-height: 1.6;
    max-width: 480px;
    margin-bottom: 2rem;
}

/* Feature Showcase Grid */
.feature-showcase-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 540px) {
    .feature-showcase-grid {
        grid-template-columns: 1fr;
    }
}

.feature-pill-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.feature-pill-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

.feature-icon-bubble {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: #38bdf8;
}

.feature-pill-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.feature-pill-desc {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
    margin-bottom: 0;
}

.showcase-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    color: #64748b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1.5rem;
}

/* Right Form Panel */
.auth-form-panel {
    background-color: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
}

.tenant-identity-badge {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    margin-bottom: 1.75rem;
}

.tenant-logo-box {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.tenant-logo-box img, .tenant-logo-box svg {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tenant-identity-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-main);
    line-height: 1.2;
}

.tenant-identity-caption {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.login-heading {
    margin-bottom: 1.75rem;
}

.login-heading h2 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
}

.login-heading p {
    font-size: 0.92rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   5. FORM CONTROLS & INPUT TOKENS
   -------------------------------------------------------------------------- */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.45rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--color-text-main);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

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

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-focus);
    background-color: var(--color-surface);
}

.form-control::placeholder {
    color: var(--color-text-subtle);
    font-size: 0.9rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.35rem;
}

/* Error States */
.is-invalid {
    border-color: var(--color-danger) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
}

.invalid-feedback {
    display: block;
    font-size: 0.82rem;
    color: var(--color-danger);
    margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   6. BUTTONS & INTERACTIVE ELEMENTS
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.25;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

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

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--color-primary-focus);
}

.btn-secondary {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-main);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-surface-muted);
    border-color: var(--color-border-hover);
}

.btn-outline {
    background-color: transparent;
    border-color: var(--color-border);
    color: var(--color-text-secondary);
}

.btn-outline:hover {
    background-color: var(--color-surface-subtle);
    border-color: var(--color-border-hover);
    color: var(--color-text-main);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-main);
}

.btn-danger {
    background-color: var(--color-danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: var(--color-danger-hover);
    color: #ffffff;
}

.btn-success {
    background-color: var(--color-success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: var(--color-success-hover);
    color: #ffffff;
}

.btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.95rem 1.75rem;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-icon {
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   7. BADGES & PILLS
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.28rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.025em;
    line-height: 1;
    white-space: nowrap;
}

.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-border);
}

.badge-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}

.badge-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
}

.badge-info {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
}

.badge-neutral {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

/* --------------------------------------------------------------------------
   8. ALERTS & NOTIFICATIONS
   -------------------------------------------------------------------------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.45;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.alert-primary {
    background-color: var(--color-primary-light);
    border-color: var(--color-primary-border);
    color: var(--color-primary);
}

.alert-danger {
    background-color: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger-text);
}

.alert-success {
    background-color: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success-text);
}

.alert-warning {
    background-color: var(--color-warning-bg);
    border-color: var(--color-warning-border);
    color: var(--color-warning-text);
}

.alert-info {
    background-color: var(--color-info-bg);
    border-color: var(--color-info-border);
    color: var(--color-info-text);
}

/* --------------------------------------------------------------------------
   9. CARDS & PLATFORM STATS
   -------------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

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

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Modern Stat Card */
.stat-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.stat-card-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1.1;
}

.stat-card-subtext {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.35rem;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   10. TABLES & DATA LISTS
   -------------------------------------------------------------------------- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.data-table th {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 0.95rem 1.15rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
    color: var(--color-text-main);
}

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

.data-table tbody tr:hover {
    background-color: var(--color-surface-subtle);
}

.meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.meta-table tr td {
    padding: 0.65rem 0;
    vertical-align: middle;
}

.meta-table tr td:first-child {
    width: 40%;
    color: var(--color-text-muted);
}

.meta-table tr td:last-child {
    font-weight: 500;
}

/* --------------------------------------------------------------------------
   11. EMPTY, LOADING, & ERROR STATES
   -------------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--color-surface-subtle);
    color: var(--color-text-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    max-width: 420px;
    margin-bottom: 1.5rem;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinnerRotate 0.75s linear infinite;
    vertical-align: middle;
}

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

/* Skeleton Loading */
.skeleton-box {
    background: linear-gradient(90deg, var(--color-surface-subtle) 25%, var(--color-border) 50%, var(--color-surface-subtle) 75%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
   12. APP SHELL, PRIMARY SIDEBAR & TOPBAR ARCHITECTURE
   -------------------------------------------------------------------------- */
.app-shell {
    display: flex;
    min-height: 100vh;
    background-color: var(--color-bg);
    position: relative;
}

/* Sidebar Styles */
.app-sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-normal), transform var(--transition-normal);
}

.sidebar-header {
    height: 64px;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
}

.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-brand-text h2 {
    font-size: 1.15rem;
    color: #ffffff;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.sidebar-brand-text span {
    font-size: 0.7rem;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.sidebar-collapse-btn {
    background: transparent;
    border: none;
    color: var(--sidebar-text);
    cursor: pointer;
    padding: 0.35rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.sidebar-collapse-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-tenant-badge {
    margin: 0.75rem 1rem 0.25rem 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--sidebar-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.sidebar-tenant-badge svg {
    color: var(--color-accent);
    flex-shrink: 0;
}

.sidebar-tenant-info {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-tenant-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-tenant-status {
    font-size: 0.7rem;
    color: var(--sidebar-text);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: var(--aura-sidebar-indicator) var(--aura-sidebar-bg);
}

/* Custom Theme-Aware Scrollbar for Sidebar Navigation */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: var(--aura-sidebar-bg);
    border-radius: var(--radius-full);
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--aura-sidebar-indicator);
    border-radius: var(--radius-full);
    border: 1px solid var(--aura-sidebar-bg);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--aura-sidebar-active-text);
}

.sidebar-nav-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-text);
    padding: 0.85rem 0.65rem 0.35rem 0.65rem;
    white-space: nowrap;
    opacity: 0.8;
}

.sidebar-nav-item,
.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--aura-sidebar-text);
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
}

.sidebar-nav-item svg,
.sidebar-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
    color: currentColor;
    transition: color var(--transition-fast), stroke var(--transition-fast);
}

.sidebar-nav-item:hover,
.sidebar-menu-item:hover {
    color: var(--aura-sidebar-text-hover);
    background-color: var(--aura-sidebar-hover-bg);
}

.sidebar-nav-item:hover svg,
.sidebar-menu-item:hover svg {
    color: var(--aura-sidebar-active-text);
}

.sidebar-nav-item.active,
.sidebar-menu-item.active {
    color: var(--aura-sidebar-active-text);
    background-color: var(--aura-sidebar-active-bg);
    font-weight: 600;
}

.sidebar-nav-item.active svg,
.sidebar-menu-item.active svg {
    color: var(--aura-sidebar-active-text);
    stroke: currentColor;
}

.sidebar-nav-item.active::before,
.sidebar-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 3.5px;
    border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
    background-color: var(--aura-sidebar-active-border);
    box-shadow: 0 0 10px var(--aura-sidebar-active-border);
}

.sidebar-nav-item.active:hover,
.sidebar-menu-item.active:hover {
    color: var(--aura-sidebar-active-text);
    background-color: var(--aura-sidebar-active-bg);
}

.sidebar-footer {
    padding: 0.85rem 1rem;
    border-top: 1px solid var(--sidebar-border);
    background: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--brand-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.72rem;
    color: var(--sidebar-text);
}

.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Collapsed Desktop State */
.app-shell.sidebar-collapsed .app-sidebar {
    width: 72px;
    min-width: 72px;
}

.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .sidebar-nav-group-title,
.app-shell.sidebar-collapsed .nav-text,
.app-shell.sidebar-collapsed .sidebar-tenant-badge,
.app-shell.sidebar-collapsed .sidebar-user-info {
    display: none !important;
}

.app-shell.sidebar-collapsed .sidebar-nav-item,
.app-shell.sidebar-collapsed .sidebar-menu-item {
    justify-content: center;
    padding: 0.7rem 0;
}

.app-shell.sidebar-collapsed .sidebar-user-card {
    justify-content: center;
}

/* Mobile Drawer Behavior */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 992px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 270px;
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .app-shell.sidebar-mobile-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.6);
        backdrop-filter: blur(2px);
        z-index: 95;
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--transition-fast);
    }

    .app-shell.sidebar-mobile-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Main Layout & Topbar */
.app-main-layout {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    height: 64px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 80;
    box-shadow: var(--shadow-xs);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.topbar-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all var(--transition-fast);
}

.topbar-btn:hover {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-main);
    border-color: var(--color-border-hover);
}

.topbar-breadcrumb {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.topbar-breadcrumb .subpath {
    color: var(--color-text-muted);
    font-weight: 500;
}

.app-content-body {
    flex: 1;
    padding: 2rem 1.75rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Theme Swatches Picker Modal */
.theme-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin: 1.25rem 0;
}

.theme-swatch-card {
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.85rem;
    background: var(--color-surface);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    position: relative;
}

.theme-swatch-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.theme-swatch-card.active {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-focus);
    background: var(--color-primary-light);
}

.swatch-color-bar {
    height: 38px;
    border-radius: var(--radius-md);
    margin-bottom: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: var(--shadow-xs);
}

.swatch-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 0.15rem;
}

.swatch-sub {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   14. MODAL DIALOG
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-dialog-lg {
    max-width: 800px;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.15rem;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.35rem;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--color-surface-subtle);
}

/* --------------------------------------------------------------------------
   15. BACKWARD-COMPATIBLE UTILITIES & COMPONENTS
   -------------------------------------------------------------------------- */
.d-none { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

.pill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-item {
    font-size: 0.8rem;
    background: var(--color-surface-subtle);
    border: 1px solid var(--color-border);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
}

.photo-thumbnail {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--color-border);
    background-color: var(--color-surface-subtle);
}

.photo-preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-surface-subtle);
    text-align: center;
    margin-bottom: 1rem;
}

.photo-preview-img {
    width: 110px;
    height: 110px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 2px solid #cbd5e1;
    background-color: #ffffff;
}

.nav-tabs {
    display: flex;
    border-bottom: 1px solid var(--color-border);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--color-text-main);
}

.tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   18. STANDARDIZED DATATABLE COMPONENT & ACTION BUTTONS
   -------------------------------------------------------------------------- */
.datatable-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid var(--aura-border);
    border-radius: var(--radius-lg);
    background-color: var(--aura-surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.datatable-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    background-color: var(--aura-surface);
    border-bottom: 1px solid var(--aura-border);
}

.datatable-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.datatable-toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.datatable-page-size {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--aura-text-muted);
}

.datatable-page-size select {
    height: 36px;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--aura-border);
    background-color: var(--aura-surface);
    color: var(--aura-text);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.datatable-page-size select:focus {
    border-color: var(--aura-primary);
    box-shadow: 0 0 0 3px var(--aura-focus);
}

.datatable-filter-select {
    height: 36px;
    min-width: 140px;
    max-width: 200px;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--aura-border);
    background-color: var(--aura-surface);
    color: var(--aura-text);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.datatable-filter-select:focus {
    border-color: var(--aura-primary);
    box-shadow: 0 0 0 3px var(--aura-focus);
}

.datatable-search-wrapper {
    position: relative;
    width: 260px;
    max-width: 100%;
}

.datatable-search-input {
    height: 36px;
    width: 100%;
    padding: 0.25rem 0.75rem 0.25rem 2.35rem;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--aura-border);
    background-color: var(--aura-surface);
    color: var(--aura-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.datatable-search-input:focus {
    border-color: var(--aura-primary);
    box-shadow: 0 0 0 3px var(--aura-focus);
    outline: none;
}

.datatable-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--aura-text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

/* Table Visuals within DataTable */
.datatable-wrapper .data-table,
.card .data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.data-table thead th {
    background-color: var(--aura-surface-muted);
    color: var(--aura-text);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--aura-border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--aura-border);
    vertical-align: middle;
    transition: background-color var(--transition-fast);
}

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

.data-table tbody tr:hover td {
    background-color: var(--aura-primary-soft);
}

/* Footer & Pagination */
.datatable-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--aura-border);
    background-color: var(--aura-surface);
}

.datatable-info {
    font-size: 0.85rem;
    color: var(--aura-text-muted);
    font-weight: 500;
}

.datatable-pagination {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.datatable-page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid var(--aura-border);
    background-color: var(--aura-surface);
    color: var(--aura-text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.datatable-page-btn:hover:not(:disabled) {
    background-color: var(--aura-primary-soft);
    color: var(--aura-primary);
    border-color: var(--aura-primary);
}

.datatable-page-btn.active {
    background-color: var(--aura-primary);
    color: #ffffff;
    border-color: var(--aura-primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.datatable-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.datatable-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--aura-text-muted);
    font-weight: 600;
}

/* Icon-Only Action Buttons with Semantic Hierarchy */
.action-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    justify-content: flex-end;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    position: relative;
    outline: none;
}

.btn-action-icon svg {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    pointer-events: none;
}

.btn-action-icon:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-action-icon:active {
    transform: scale(0.95);
}

.btn-action-icon:focus-visible {
    box-shadow: 0 0 0 2px var(--aura-focus);
}

/* View: Primary Theme Color */
.btn-action-icon.btn-action-view {
    background-color: var(--aura-primary-soft);
    color: var(--aura-primary);
    border-color: var(--color-primary-border);
}

.btn-action-icon.btn-action-view:hover {
    background-color: var(--aura-primary);
    color: #ffffff;
    border-color: var(--aura-primary);
}

/* Edit: Info / Accent Color */
.btn-action-icon.btn-action-edit {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border-color: var(--color-info-border);
}

.btn-action-icon.btn-action-edit:hover {
    background-color: var(--color-info);
    color: #ffffff;
    border-color: var(--color-info);
}

/* Key / Kredensial / Reset: Warning / Amber Color */
.btn-action-icon.btn-action-key {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
    border-color: var(--color-warning-border);
}

.btn-action-icon.btn-action-key:hover {
    background-color: var(--color-warning);
    color: #ffffff;
    border-color: var(--color-warning);
}

/* Toggle / Status: Success / Emerald Color */
.btn-action-icon.btn-action-toggle {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border-color: var(--color-success-border);
}

.btn-action-icon.btn-action-toggle:hover {
    background-color: var(--color-success);
    color: #ffffff;
    border-color: var(--color-success);
}

/* Delete: Danger / Red Color */
.btn-action-icon.btn-action-delete {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
    border-color: var(--color-danger-border);
}

.btn-action-icon.btn-action-delete:hover {
    background-color: var(--color-danger);
    color: #ffffff;
    border-color: var(--color-danger);
}

/* Card / Cetak Kartu: Secondary / Accent Color */
.btn-action-icon.btn-action-card {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border-color: var(--color-primary-border);
}

.btn-action-icon.btn-action-card:hover {
    background-color: var(--color-primary);
    color: #ffffff;
    border-color: var(--color-primary);
}

/* Responsive Toolbar for Mobile */
@media (max-width: 768px) {
    .datatable-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .datatable-toolbar-left,
    .datatable-toolbar-right {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .datatable-search-wrapper {
        width: 100%;
    }

    .datatable-filter-select {
        flex: 1;
        max-width: 100%;
    }

    .datatable-footer {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        text-align: center;
    }
}

/* ==========================================================================
   19. PREMIUM SAAS POLISH & INTERACTION SYSTEM
   Konsistensi Visual, Hierarki, Aksesibilitas & Responsivitas
   ========================================================================== */

/* Typography & Visual Hierarchy */
h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.text-muted {
    color: var(--color-text-muted) !important;
}

/* Form Controls & Inputs */
.form-control, .form-select {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-surface);
    color: var(--color-text-main);
    font-size: 0.88rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:focus, .form-select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-focus);
    outline: none;
}

.form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.35rem;
    display: inline-block;
}

.form-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
}

/* Badges Standardization */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: var(--radius-full);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.badge-primary {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-border);
}

.badge-success {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
    border: 1px solid var(--color-success-border);
}

.badge-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-danger-text);
    border: 1px solid var(--color-danger-border);
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning-text);
    border: 1px solid var(--color-warning-border);
}

.badge-info {
    background-color: var(--color-info-bg);
    color: var(--color-info-text);
    border: 1px solid var(--color-info-border);
}

.badge-secondary {
    background-color: var(--color-surface-subtle);
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.badge-outline {
    background-color: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border-strong);
}

/* Button Micro-interactions */
.btn {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
}

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

/* CSS Tooltip Helper */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #0f172a;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-xs);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

/* Card Hierarchy & Elevation */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

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

/* Meta Table Styling */
.meta-table {
    width: 100%;
    border-collapse: collapse;
}

.meta-table td {
    padding: 0.65rem 0.25rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}

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

/* Modal Polish */
.modal-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    background-color: rgba(15, 23, 42, 0.45);
}

.modal-dialog {
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    animation: modalSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   TENANT PROFILE / PROFIL MADRASAH SAAS COMPONENTS
   ========================================================================== */

/* Profile Header Card */
.tenant-header-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.tenant-header-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-gradient);
}

.tenant-header-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tenant-header-logo-box {
    width: 76px;
    height: 76px;
    min-width: 76px;
    border-radius: var(--radius-md);
    background: var(--color-surface-subtle);
    border: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.tenant-header-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.tenant-header-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.tenant-header-subtitle {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.tenant-header-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    flex-wrap: wrap;
}

.tenant-header-meta-sep {
    color: var(--color-border-hover);
    font-size: 0.9rem;
}

/* Tab Navigation */
.tenant-tabs-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.tenant-tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.tenant-tabs-nav::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.tenant-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.15rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-top-left-radius: var(--radius-sm);
    border-top-right-radius: var(--radius-sm);
}

.tenant-tab-btn:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

.tenant-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-primary-light);
}

.tenant-tab-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Tab Panes */
.tenant-tab-pane {
    display: none;
    animation: fadeIn 0.25s ease-in-out;
}

.tenant-tab-pane.active {
    display: block;
}

/* Form Grids */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .tenant-header-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .tenant-header-main {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Upload Card Component */
.upload-card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.upload-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.upload-card:hover {
    border-color: var(--color-primary-border);
    box-shadow: var(--shadow-md);
}

.upload-card-preview-area {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    background: var(--color-surface-subtle);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.upload-card-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 6px;
    transition: transform 0.2s ease;
}

.upload-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--color-text-main);
}

.upload-card-desc {
    font-size: 0.775rem;
    color: var(--color-text-muted);
    margin: 0 0 1rem 0;
}

.upload-card-fileinfo {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    background: var(--color-surface-subtle);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    display: inline-block;
    margin-bottom: 1rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-card-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Branding Preview Letterhead Box */
.branding-preview-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-top: 1.5rem;
}

.branding-preview-kop {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.branding-preview-kop-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 3px double #334155;
}

.branding-preview-kop-logo {
    width: 64px;
    height: 64px;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.branding-preview-kop-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.branding-preview-kop-text {
    flex: 1;
    text-align: center;
}

.branding-preview-kop-dept {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #475569;
    margin-bottom: 0.2rem;
}

.branding-preview-kop-name {
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #0f172a;
    margin-bottom: 0.2rem;
    letter-spacing: 0.025em;
}

.branding-preview-kop-slogan {
    font-size: 0.8rem;
    font-style: italic;
    color: #64748b;
    margin-bottom: 0.25rem;
}

.branding-preview-kop-meta {
    font-size: 0.75rem;
    color: #64748b;
}

/* Password Eye Toggle & Strength */
.input-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-password-wrapper input {
    padding-right: 2.5rem;
}

.btn-toggle-password {
    position: absolute;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}

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

.password-strength-container {
    margin-top: 0.35rem;
}

.password-strength-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--color-border);
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.password-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
}



