/* ═══════════════════════════════════════════════════════════
   TAKUMI44 Admin — Design System
   Shared theme tokens from TAKUMI44.Web
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════ */
:root {
    /* Color Primitives */
    --gold-light: #c1a97c;
    --gold-mid: #D9AB59;
    --gold-bright: #FBB040;
    /* RGB channels for rgba() usage — updated by theme.js applyColorScheme */
    --gold-rgb: 251, 176, 64;
    --gold-secondary-rgb: 217, 171, 89;
    --gold-50: #FDF8F0;
    --gold-100: #F9EFDC;
    --gold-200: #F2E0BE;
    --gold-300: #E8D3AC;
    --gold-400: #D9AB59;
    --gold-500: #FBB040;
    --gold-600: #D9AB59;
    --gold-700: #B8923D;
    --gold-800: #96772E;
    --gold-900: #755C22;
    --blue-400: #60A5FA;
    --blue-500: #3B82F6;
    --blue-600: #2563EB;
    --cyan-400: #22D3EE;
    --cyan-500: #06B6D4;
    --cyan-600: #0891B2;
    --emerald-400: #34D399;
    --emerald-500: #10B981;
    --rose-500: #F43F5E;

    /* Semantic Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    --bg-elevated: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.72);
    --bg-glass-heavy: rgba(255, 255, 255, 0.88);

    --surface-1: #FFFFFF;
    --surface-2: #F8FAFC;
    --surface-3: #F1F5F9;
    --surface-hover: #F1F5F9;
    --surface-active: #E2E8F0;

    --border-primary: #E2E8F0;
    --border-secondary: #F1F5F9;
    --border-focus: var(--gold-500);
    --border-subtle: rgba(0, 0, 0, 0.06);

    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --text-inverse: #FFFFFF;
    --text-link: var(--gold-600);
    --text-link-hover: var(--gold-700);

    --accent-primary: var(--gold-500);
    --accent-primary-hover: var(--gold-600);
    --accent-gradient: linear-gradient(135deg, var(--gold-bright), var(--gold-mid), var(--gold-light));
    --accent-gradient-hover: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
    --accent-glow: rgba(251, 176, 64, 0.15);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.12);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.03);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.06);
    --shadow-glow: 0 0 40px rgba(251, 176, 64, 0.1);
    --shadow-glow-strong: 0 0 60px rgba(251, 176, 64, 0.15), 0 0 100px rgba(251, 176, 64, 0.08);

    --color-danger: #DC2626;
    --color-danger-hover: #B91C1C;
    --color-danger-bg: #FEF2F2;
    --color-danger-border: #FECACA;
    --color-success: #16A34A;
    --color-success-bg: #F0FDF4;
    --color-success-border: #BBF7D0;
    --color-warning: #D97706;
    --color-warning-bg: #FFFBEB;
    --color-warning-border: #FDE68A;
    --color-info: #0284C7;
    --color-info-bg: #F0F9FF;
    --color-info-border: #BAE6FD;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;

    /* Spacing */
    --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;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════
   DARK THEME
   ═══════════════════════════════════════ */
[data-theme="dark"] {
    --bg-primary: #07090F;
    --bg-secondary: #0D1117;
    --bg-tertiary: #151B27;
    --bg-elevated: #141A26;
    --bg-glass: rgba(13, 17, 23, 0.78);
    --bg-glass-heavy: rgba(13, 17, 23, 0.92);

    --surface-1: #111827;
    --surface-2: #151B27;
    --surface-3: #1E293B;
    --surface-hover: #1E293B;
    --surface-active: #334155;

    --border-primary: #1E293B;
    --border-secondary: #151B27;
    --border-focus: var(--gold-400);
    --border-subtle: rgba(255, 255, 255, 0.06);

    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-tertiary: #64748B;
    --text-inverse: #0F172A;
    --text-link: var(--gold-400);
    --text-link-hover: var(--gold-300);

    --accent-primary: var(--gold-500);
    --accent-primary-hover: var(--gold-400);
    --accent-gradient: linear-gradient(135deg, var(--gold-bright), var(--gold-mid), var(--gold-light));
    --accent-gradient-hover: linear-gradient(135deg, var(--gold-mid), var(--gold-bright));
    --accent-glow: rgba(251, 176, 64, 0.2);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 40px rgba(251, 176, 64, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(251, 176, 64, 0.2), 0 0 100px rgba(251, 176, 64, 0.12);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 1px 3px rgba(0,0,0,0.2), 0 4px 12px rgba(0,0,0,0.15);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 40px rgba(251, 176, 64, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(251, 176, 64, 0.2), 0 0 100px rgba(251, 176, 64, 0.12);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);

    --color-danger-bg: #2D1515;
    --color-danger-border: #5C1F1F;
    --color-success-bg: #14291B;
    --color-success-border: #1E5128;
    --color-warning-bg: #2D2415;
    --color-warning-border: #5C4A1F;
    --color-info-bg: #0A1E2D;
    --color-info-border: #1A3C5C;
}

/* ═══════════════════════════════════════
   COMPACT MODE (20% Reduction)
   ═══════════════════════════════════════ */
.compact-mode {
    /* Reduce spacing */
    --space-1: 0.2rem;   /* 0.25 * 0.8 */
    --space-2: 0.4rem;   /* 0.5 * 0.8 */
    --space-3: 0.6rem;   /* 0.75 * 0.8 */
    --space-4: 0.8rem;   /* 1 * 0.8 */
    --space-5: 1rem;     /* 1.25 * 0.8 */
    --space-6: 1.2rem;   /* 1.5 * 0.8 */
    --space-8: 1.6rem;   /* 2 * 0.8 */
}

/* Compact mode specific adjustments */
.compact-mode .auth-card__header {
    padding: 1.2rem 1.6rem 0.8rem !important;
}

.compact-mode .auth-card__body,
.compact-mode .manage-card__body {
    padding: 1rem !important;
}

.compact-mode .auth-form__group,
.compact-mode .manage-form__group {
    margin-bottom: 0.8rem !important;
}

.compact-mode .auth-form__input,
.compact-mode .manage-form__input {
    padding: 0.6rem 0.8rem !important;
}

.compact-mode .auth-form__submit,
.compact-mode .manage-form__button {
    padding: 0.6rem 1rem !important;
}

.compact-mode .manage-card__header {
    padding: 1rem !important;
}

.compact-mode .manage-card {
    margin-bottom: 1.2rem !important;
}

.compact-mode .manage-layout__header {
    padding: 1rem 1.2rem !important;
}

.compact-mode .manage-layout__sidebar {
    padding: 1.2rem !important;
}

.compact-mode .nav-link {
    padding: 0.4rem 0.8rem !important;
}

.compact-mode .user-profile-menu__dropdown {
    padding: 0.4rem !important;
}

.compact-mode .user-profile-menu__item {
    padding: 0.6rem 0.8rem !important;
}

.compact-mode .error-card__content {
    padding: 1.6rem !important;
}

.compact-mode .error-card__icon-wrapper {
    padding: 2.4rem 1.6rem 1.6rem !important;
}

/* ═══════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

html, body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

a, .btn-link {
    color: var(--text-link);
    text-decoration: none;
}

a:hover, .btn-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

h1 { font-size: 2rem; letter-spacing: -0.025em; }
h2 { font-size: 1.5rem; letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.125rem; font-weight: 600; }

p { margin-bottom: 1rem; color: var(--text-secondary); }

hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 1rem 0;
}

kbd {
    font-family: var(--font-mono);
    background: var(--bg-tertiary);
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid var(--border-primary);
}

code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--color-danger);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

ol.list {
    list-style: decimal;
    padding-left: 1.5rem;
}

ol.list li {
    margin-bottom: 1rem;
}

::selection {
    background: var(--gold-200);
    color: var(--gold-900);
}

:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

h1:focus {
    outline: none;
}

.content {
    padding-top: 0.75rem;
}

/* ═══════════════════════════════════════
   GRID LAYOUT
   ═══════════════════════════════════════ */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.row > [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.col-12    { flex: 0 0 100%;    max-width: 100%; min-width: 0; }
.col-md-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-md-6  { flex: 0 0 50%;     max-width: 50%; }
.col-md-12 { flex: 0 0 100%;    max-width: 100%; }
.col-lg-3  { flex: 0 0 25%;     max-width: 25%; }
.col-lg-4  { flex: 0 0 33.333%; max-width: 33.333%; }
.col-lg-6  { flex: 0 0 50%;     max-width: 50%; }
.col-lg-9  { flex: 0 0 75%;     max-width: 75%; }
.col-xl-6  { flex: 0 0 50%;     max-width: 50%; }
.col-lg-offset-2 { margin-left: 16.667%; }

@media (max-width: 767.98px) {
    .col-md-4, .col-md-6, .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 991.98px) {
    .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-9 { flex: 0 0 100%; max-width: 100%; }
    .col-lg-offset-2 { margin-left: 0; }
}

@media (max-width: 1199.98px) {
    .col-xl-6 { flex: 0 0 100%; max-width: 100%; }
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-family);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.5;
}

.btn:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transform: translateY(-2px) scale(1.02);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm);
}

.btn-danger {
    background: var(--color-danger);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: var(--color-danger-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-danger:active {
    transform: translateY(0);
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-link);
    font-weight: 500;
    box-shadow: none;
}

.btn-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.btn-lg {
    padding: 0.625rem 1.25rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--gold-400);
}

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-control {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--surface-1);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
}

.form-control:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-tertiary);
}

.form-control:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

.form-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Form floating */
.form-floating {
    position: relative;
}

.form-floating > .form-control {
    height: 3.5rem;
    padding: 1.625rem 0.875rem 0.625rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(0.8) translateY(-0.5rem) translateX(0.15rem);
    opacity: 0.75;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem 0.875rem;
    overflow: hidden;
    text-align: start;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
    transform-origin: 0 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    color: var(--text-tertiary);
    font-size: 0.9375rem;
    font-weight: 400;
    border: 1px solid transparent;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: transparent;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    color: transparent;
}

/* Checkbox */
.form-check-input {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.5rem;
    vertical-align: middle;
    accent-color: var(--gold-500);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.checkbox {
    display: flex;
    align-items: center;
}

.checkbox label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* Input group */
.input-group {
    display: flex;
    position: relative;
}

.input-group > .form-control {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-append {
    display: flex;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-secondary);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-left: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ═══════════════════════════════════════
   VALIDATION
   ═══════════════════════════════════════ */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-danger);
}

.validation-message {
    color: var(--color-danger);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

/* ═══════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════ */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.alert-success {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success);
}

.alert-danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger);
}

.alert-warning {
    background: var(--color-warning-bg);
    border-color: var(--color-warning-border);
    color: var(--color-warning);
}

.alert-info {
    background: var(--color-info-bg);
    border-color: var(--color-info-border);
    color: var(--color-info);
}

/* ═══════════════════════════════════════
   TABLE
   ═══════════════════════════════════════ */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
}

.table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-primary);
    background: var(--bg-secondary);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
    vertical-align: middle;
}

.table tbody tr:hover {
    background: var(--surface-hover);
}

/* ═══════════════════════════════════════
   NAVIGATION (pills / nav)
   ═══════════════════════════════════════ */
.nav {
    display: flex;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav.flex-column,
.nav-pills.flex-column {
    flex-direction: column;
}

.nav-pills .nav-item {
    margin-bottom: 0.25rem;
}

.nav-pills .nav-link {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.nav-pills .nav-link:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-pills .nav-link.active {
    background: var(--accent-gradient);
    color: white;
}

/* ═══════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════ */

/* Text colors */
.text-danger  { color: var(--color-danger) !important; }
.text-success { color: var(--color-success) !important; }
.text-info    { color: var(--color-info) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* Width */
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }

/* Flexbox */
.d-flex       { display: flex !important; }
.flex-column  { flex-direction: column !important; }
.mx-auto      { margin-left: auto !important; margin-right: auto !important; }
.mt-2         { margin-top: 0.5rem !important; }

/* Spacing */
.mb-2  { margin-bottom: 0.5rem !important; }
.mb-3  { margin-bottom: 1rem !important; }
.px-3  { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4  { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.ps-3  { padding-left: 1rem !important; }

/* Font weight */
.font-weight-bold { font-weight: 700 !important; }

/* ═══════════════════════════════════════
   NAVBAR (sidebar)
   ═══════════════════════════════════════ */
.navbar {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
}

.navbar-dark {
    color: white;
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    letter-spacing: -0.02em;
}

.navbar-brand:hover {
    color: white;
    text-decoration: none;
}

.container-fluid {
    width: 100%;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* ═══════════════════════════════════════
   MISC
   ═══════════════════════════════════════ */
.glyphicon {
    display: none;
}

.form-horizontal {
    display: block;
}

.control-label {
    display: block;
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.recovery-code {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    display: inline-block;
    margin-bottom: 0.25rem;
}

/* ═══════════════════════════════════════
   BLAZOR ERROR BOUNDARY
   ═══════════════════════════════════════ */
.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--color-danger);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ═══════════════════════════════════════
   THEME TOGGLE
   ═══════════════════════════════════════ */
.theme-toggle {
    display: flex;
    align-items: center;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--border-primary);
}

.theme-toggle__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full);
    color: var(--text-tertiary);
    transition: all var(--transition-fast);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.theme-toggle__btn:hover {
    color: var(--text-secondary);
}

.theme-toggle__btn.active {
    background: var(--bg-elevated);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.theme-toggle__btn svg {
    width: 16px;
    height: 16px;
}

/* ═══════════════════════════════════════
   USER PROFILE MENU
   ═══════════════════════════════════════ */
.user-profile-menu {
    position: relative;
}

.user-profile-menu__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-gradient);
    border: 2px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.user-profile-menu__avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--gold-400);
}

.user-profile-menu__avatar-text {
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.user-profile-menu__avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.user-profile-menu__online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background: #22c55e;
    border-radius: 50%;
    border: 2px solid var(--bg-elevated, #fff);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.3);
    pointer-events: none;
}

.user-profile-menu__dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    min-width: 240px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem;
    z-index: 1000;
    animation: slideDown 200ms ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-profile-menu__header {
    padding: 1rem;
    text-align: center;
    border-bottom: 1px solid var(--border-secondary);
    margin-bottom: 0.5rem;
}

.user-profile-menu__name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.user-profile-menu__email {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-style: italic;
}

.user-profile-menu__role-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.user-profile-menu__role-badge.role-badge--superadmin {
    background: var(--accent-gradient);
    color: #fff;
}

.user-profile-menu__role-badge.role-badge--admin {
    background: rgba(99, 102, 241, 0.12);
    color: #6366F1;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.user-profile-menu__role-badge.role-badge--employee {
    background: rgba(16, 185, 129, 0.12);
    color: #10B981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.user-profile-menu__role-badge.role-badge--user {
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
}

/* Organization row — role badge + organization name side by side */
.user-profile-menu__organization-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.user-profile-menu__organization-row .user-profile-menu__role-badge {
    margin-top: 0;
}

.user-profile-menu__organization-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* No-organization prompt */
.user-profile-menu__no-organization {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
    border: 1px solid rgba(245, 158, 11, 0.3);
    transition: all var(--transition-fast);
}

.user-profile-menu__no-organization:hover {
    background: rgba(245, 158, 11, 0.18);
    color: #B45309;
    border-color: rgba(245, 158, 11, 0.5);
}

:root[data-theme="dark"] .user-profile-menu__no-organization,
[data-bs-theme="dark"] .user-profile-menu__no-organization {
    background: rgba(245, 158, 11, 0.12);
    color: #FCD34D;
    border-color: rgba(245, 158, 11, 0.25);
}

:root[data-theme="dark"] .user-profile-menu__no-organization:hover,
[data-bs-theme="dark"] .user-profile-menu__no-organization:hover {
    background: rgba(245, 158, 11, 0.22);
    color: #FDE68A;
}

.user-profile-menu__divider {
    height: 1px;
    background: var(--border-secondary);
    margin: 0.5rem 0;
}

.user-profile-menu__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: var(--font-family);
}

.user-profile-menu__item:hover {
    background: var(--surface-hover);
}

.user-profile-menu__item svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.user-profile-menu__item--danger {
    color: var(--color-danger);
}

.user-profile-menu__item--danger svg {
    color: var(--color-danger);
}

.user-profile-menu__item--danger:hover {
    background: var(--color-danger-bg);
}

.user-profile-menu__logout-form {
    margin: 0;
}

@media (max-width: 640px) {
    .user-profile-menu__dropdown {
        right: -1rem;
        min-width: 220px;
    }
}

/* ═══════════════════════════════════════
   MODERN CARD SYSTEM
   ═══════════════════════════════════════ */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--shadow-card-hover);
}

.card--glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--border-subtle);
}

.card--gradient {
    background: linear-gradient(135deg, var(--surface-1) 0%, var(--surface-2) 100%);
    border: 1px solid var(--border-subtle);
}

.card--highlight {
    border-left: 4px solid var(--accent-primary);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-secondary);
    background: var(--surface-2);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-secondary);
    background: var(--surface-2);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ═══════════════════════════════════════
   STAT CARDS (Dashboard)
   ═══════════════════════════════════════ */
.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-slow);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover), var(--shadow-glow);
}

.stat-card__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    box-shadow: var(--shadow-sm);
}

.stat-card__icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.stat-card__label {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 0.5rem;
}

.stat-card__value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-card__change {
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-card__change--positive {
    color: var(--emerald-500);
}

.stat-card__change--negative {
    color: var(--rose-500);
}

/* ═══════════════════════════════════════
   PAGE HEADERS
   ═══════════════════════════════════════ */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-secondary);
}

.page-header__title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.2;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header__subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.page-header__actions {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ═══════════════════════════════════════
   BADGES & TAGS
   ═══════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.badge--primary {
    background: var(--gold-100);
    color: var(--gold-900);
    border: 1px solid var(--gold-300);
}

.badge--success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.badge--danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.badge--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
}

.badge--info {
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info-border);
}

.badge--gradient {
    background: var(--accent-gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .badge--primary {
    background: rgba(var(--gold-secondary-rgb), 0.2);
    color: var(--gold-300);
    border-color: rgba(var(--gold-secondary-rgb), 0.3);
}

/* ═══════════════════════════════════════
   LOADING & SKELETONS
   ═══════════════════════════════════════ */
.skeleton {
    background: linear-gradient(90deg, 
        var(--surface-2) 0%, 
        var(--surface-3) 50%, 
        var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 2rem;
    width: 60%;
    margin-bottom: 1rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

/* ═══════════════════════════════════════
   ENHANCED FORM CONTROLS
   ═══════════════════════════════════════ */
.form-control--enhanced {
    border: 2px solid var(--border-primary);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.form-control--enhanced:hover {
    border-color: var(--border-focus);
}

.form-control--enhanced:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md);
    transform: translateY(-2px);
}

.form-group--enhanced {
    margin-bottom: 1.5rem;
}

.form-group--enhanced .form-label {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ═══════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════ */
.search-bar {
    position: relative;
    max-width: 500px;
}

.search-bar__input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-full);
    font-size: 0.9375rem;
    background: var(--bg-elevated);
    transition: all var(--transition-base);
}

.search-bar__input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-lg);
    outline: none;
}

.search-bar__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    pointer-events: none;
}

.search-bar__icon svg {
    width: 20px;
    height: 20px;
}

/* ═══════════════════════════════════════
   DATA TABLES
   ═══════════════════════════════════════ */
.table-container {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.table--enhanced {
    width: 100%;
    border-collapse: collapse;
}

.table--enhanced thead {
    background: var(--surface-2);
    border-bottom: 2px solid var(--border-primary);
}

.table--enhanced th {
    padding: 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.table--enhanced td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-secondary);
    color: var(--text-primary);
}

.table--enhanced tbody tr {
    transition: background-color var(--transition-fast);
}

.table--enhanced tbody tr:hover {
    background: var(--surface-hover);
}

.table--enhanced tbody tr:last-child td {
    border-bottom: none;
}

/* ═══════════════════════════════════════
   TOOLTIPS
   ═══════════════════════════════════════ */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip__content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    white-space: nowrap;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-primary);
    z-index: 100;
    transition: all var(--transition-fast);
    pointer-events: none;
}

.tooltip__content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: var(--border-primary);
}

.tooltip:hover .tooltip__content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════
   PROGRESS BARS
   ═══════════════════════════════════════ */
.progress {
    height: 8px;
    background: var(--surface-3);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 95%;
   /* background: var(--accent-gradient);*/
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.3), 
        transparent);
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══════════════════════════════════════
   GLASS MORPHISM EFFECTS
   ═══════════════════════════════════════ */
.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-subtle);
}

.glass--heavy {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ═══════════════════════════════════════
   ANIMATIONS & MICRO-INTERACTIONS
   ═══════════════════════════════════════ */
@keyframes fadeIn {
    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);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

.animate-slide-in {
    animation: slideInRight 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.2s ease-out;
}

/* ═══════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════ */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.p-0 { padding: 0; }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-medium { font-weight: 500; }
.fw-normal { font-weight: 400; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-glow { box-shadow: var(--shadow-glow); }

/* ═══════════════════════════════════════
   RESPONSIVE UTILITIES
   ═══════════════════════════════════════ */
@media (max-width: 767.98px) {
    .page-header__title {
        font-size: 1.75rem;
    }

    .stat-card__value {
        font-size: 1.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table--enhanced th,
    .table--enhanced td {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
}
/* ---------------------------------------
   AUTHENTICATION PAGES LAYOUT
   --------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: clip;  /* clip instead of hidden — does NOT create stacking context,
                          so position:sticky children still work correctly */
}

/* Background */
.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    pointer-events: none;
}

.auth-background__pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, var(--border-subtle) 1px, transparent 0);
    background-size: 40px 40px;
    opacity: 0.5;
}

.auth-background__gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(var(--gold-rgb), 0.08) 0%, transparent 50%),
                radial-gradient(ellipse at bottom, rgba(var(--gold-secondary-rgb), 0.06) 0%, transparent 50%);
}

/* Header */
.auth-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem clamp(1rem, 5vw, 3rem);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.auth-header__logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.auth-header__logo:hover {
    transform: translateY(-2px);
}

.auth-header__logo svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 2px 8px rgba(var(--gold-rgb), 0.3));
}

.auth-header__logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}


/* Main Content */
.auth-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem clamp(1rem, 5vw, 2rem);
}

.auth-container {
    width: 100%;
    max-width: 480px;
    animation: authSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes authSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Auth Card */
.auth-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    transition: all 0.3s ease;
}

.auth-card:hover {
    box-shadow: var(--shadow-2xl), var(--shadow-glow);
}

.auth-card__header {
    padding: 2.5rem 2rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-secondary);
    background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
}

.auth-card__icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--accent-gradient);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: authIconPulse 2s ease-in-out infinite;
}

@keyframes authIconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: var(--shadow-lg), var(--shadow-glow);
    }
    50% {
        transform: scale(1.05);
        box-shadow: var(--shadow-xl), var(--shadow-glow-strong);
    }
}

.auth-card__icon svg {
    width: 32px;
    height: 32px;
    color: white;
}

.auth-card__title {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.auth-card__subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.auth-card__body {
    padding: 2rem;
}

.auth-card__footer {
    padding: 1.5rem 2rem;
    background: var(--surface-2);
    border-top: 1px solid var(--border-secondary);
    text-align: center;
    font-size: 0.9375rem;
}

.auth-card__footer-link {
    color: var(--text-link);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-card__footer-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

/* Auth Forms */
.auth-form__group {
    margin-bottom: 1.5rem;
}

.auth-form__label {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.auth-form__label--required::after {
    content: '*';
    color: var(--color-danger);
    margin-left: 0.25rem;
}

.auth-form__input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-family);
    color: var(--text-primary);
    background: var(--surface-1);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
}

.auth-form__input:hover {
    border-color: var(--border-focus);
}

.auth-form__input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md);
    outline: none;
    transform: translateY(-2px);
}

.auth-form__input::placeholder {
    color: var(--text-tertiary);
}

.auth-form__checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-form__checkbox input[type=checkbox] {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-primary);
    accent-color: var(--gold-500);
    cursor: pointer;
}

.auth-form__checkbox label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.auth-form__link {
    color: var(--text-link);
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-form__link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

.auth-form__submit {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 700;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.auth-form__submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.auth-form__submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.auth-form__submit:hover::before {
    left: 100%;
}

.auth-form__submit:active {
    transform: translateY(0);
}

.auth-form__submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Terms of Service */
.auth-form__terms {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-md);
}

.auth-form__terms p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.auth-form__terms-link {
    color: var(--text-link);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.auth-form__terms-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-primary), transparent);
}

/* Passkey Button */
.auth-external__button {
    width: 100%;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--surface-1);
    border: 2px solid var(--border-primary);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.auth-external__button:hover {
    border-color: var(--border-focus);
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Alert */
.auth-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: start;
    gap: 0.75rem;
    animation: authAlertSlideIn 0.3s ease;
}

@keyframes authAlertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert--success {
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: var(--color-success);
}

.auth-alert--danger {
    background: var(--color-danger-bg);
    border: 1px solid var(--color-danger-border);
    color: var(--color-danger);
}

.auth-alert--info {
    background: var(--color-info-bg);
    border: 1px solid var(--color-info-border);
    color: var(--color-info);
}

.auth-alert__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.auth-alert__content {
    flex: 1;
}

.auth-alert__title {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-alert__message {
    font-size: 0.9375rem;
}

/* Footer */
.auth-footer {
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    padding: 2rem clamp(1rem, 5vw, 3rem);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-subtle);
}

.auth-footer p {
    margin-bottom: 0.5rem;
}

.auth-footer__links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
}

.auth-footer__links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.auth-footer__links a:hover {
    color: var(--text-link);
}

/* Responsive */
@media (max-width: 640px) {
    .auth-header {
        padding: 1.5rem 1rem;
    }

    .auth-header__logo svg {
        width: 32px;
        height: 32px;
    }

    .auth-header__logo-text {
        font-size: 1.25rem;
    }

    .auth-card__header {
        padding: 2rem 1.5rem 1.25rem;
    }

    .auth-card__title {
        font-size: 1.5rem;
    }

    .auth-card__body {
        padding: 1.5rem;
    }

    .auth-card__footer {
        padding: 1.25rem 1.5rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   MANAGE PAGES (Account Settings)
   For authenticated pages using MainLayout
   ═══════════════════════════════════════════════════════════ */

.manage-page {
    max-width: 100%;
    margin: 0 auto;
}

.manage-header {
    margin-bottom: 2rem;
}

.manage-header__title {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid), var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.manage-header__subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.manage-card {
    background: var(--bg-elevated);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.manage-card:hover {
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
    border-color: var(--border-focus);
}

.manage-card__header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    background: linear-gradient(180deg, var(--surface-1) 0%, var(--surface-2) 100%);
}

.manage-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.manage-card__description {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin-top: 0.25rem;
}

.manage-card__body {
    padding: 1.25rem;
}

.manage-form__group {
    margin-bottom: 1rem;
}

.manage-form__group:last-child {
    margin-bottom: 0;
}

.manage-form__label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
    font-size: 0.875rem;
}

.manage-form__label--required::after {
    content: "*";
    color: var(--rose-500);
    margin-left: 0.25rem;
}

.manage-form__input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.manage-form__input:focus {
    outline: none;
    border-color: var(--gold-mid);
    box-shadow: 0 0 0 3px rgba(var(--gold-rgb), 0.1);
}

.manage-form__input:disabled {
    background: var(--surface-2);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.manage-form__input--verified {
    padding-right: 3rem;
}

.manage-form__input-wrapper {
    position: relative;
}

.manage-form__input-icon {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--emerald-500);
    font-size: 1.125rem;
    font-weight: 700;
}

.manage-form__help {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.manage-form__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #000;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-mid));
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.manage-form__button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--gold-rgb), 0.3);
}

.manage-form__button:active {
    transform: translateY(0);
}

.manage-form__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.manage-form__button--secondary {
    background: var(--surface-2);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.manage-form__button--secondary:hover {
    background: var(--surface-3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.manage-form__button--danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.manage-form__button--danger:hover {
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.manage-form__button-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.manage-alert {
    padding: 0.875rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: start;
    gap: 0.625rem;
    animation: authAlertSlideIn 0.3s ease;
}

.manage-alert__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 0.125rem;
}

.manage-alert__content {
    flex: 1;
}

/* ═══════════════════════════════════════
   SHARED HERO HEADER (s-hero*)
   ═══════════════════════════════════════ */

.s-hero {
    position: relative;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-primary);
    padding: 1.75rem 2rem 1.5rem;
    overflow: hidden;
}

.s-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(var(--gold-rgb), 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.s-hero__glow {
    position: absolute;
    top: -60px;
    left: -60px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(var(--gold-rgb), 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.s-hero__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.s-hero__left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.s-hero__icon-wrap {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 18px rgba(var(--gold-rgb), 0.35);
}

.s-hero__icon {
    width: 28px;
    height: 28px;
    color: white;
}

.s-hero__title {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.2rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.s-hero__sub {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.s-hero__right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.manage-alert__title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.manage-alert__message {
    font-size: 0.8125rem;
    line-height: 1.5;
}

.manage-alert--success {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.manage-alert--info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.manage-alert--danger {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.manage-alert--warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.manage-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.manage-list__item {
    padding: 0.875rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: background-color 0.2s ease;
}

.manage-list__item:hover {
    background: var(--surface-hover);
}

.manage-list__item:last-child {
    border-bottom: none;
}

.manage-list__item-info {
    flex: 1;
    min-width: 0;
}

.manage-list__item-title {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.manage-list__item-description {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.manage-list__item-action {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.manage-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.manage-badge--success {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.manage-badge--danger {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.manage-badge--warning {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.manage-code {
    font-family: var(--font-mono);
    background: var(--surface-2);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}

.manage-code-block {
    font-family: var(--font-mono);
    background: var(--surface-2);
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0.75rem 0;
    border: 1px solid var(--border-primary);
}

.manage-link {
    color: var(--text-link);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.manage-link:hover {
    color: var(--text-link-hover);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .manage-page {
        padding: 0;
    }

    .manage-header__title {
        font-size: 1.5rem;
    }

    .manage-card__body {
        padding: 1rem;
    }

    .manage-card__header {
        padding: 0.875rem 1rem;
    }

    .manage-form__button-group {
        flex-direction: column;
    }

    .manage-form__button {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════════════════
   STUNNING MANAGE LAYOUT - Two Column with Sticky Sidebar
   ═══════════════════════════════════════════════════════════ */
.manage-layout {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.manage-layout__header {
    background: linear-gradient(135deg, rgba(var(--gold-rgb), 0.08) 0%, rgba(var(--gold-secondary-rgb), 0.05) 100%);
    border-bottom: 1px solid var(--border-primary);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.manage-layout__header-content {
    padding: 1rem 1.5rem;
}

.manage-layout__title {
    font-size: 1.75rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0 0 0.25rem 0;
    letter-spacing: -0.02em;
}

.manage-layout__subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin: 0;
    font-weight: 500;
}

.manage-layout__container {
    flex: 1;
    width: 100%;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    align-items: start;
}

.manage-layout__sidebar {
    position: sticky;
    top: 100px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.manage-layout__sidebar:hover {
    box-shadow: var(--shadow-md);
}

.manage-layout__content {
    min-width: 0;
    animation: fadeSlideIn 0.4s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Navigation Pills for Sidebar */
.manage-layout__sidebar .nav-pills {
    gap: 0.25rem;
}

.manage-layout__sidebar .nav-pills .nav-link {
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.manage-layout__sidebar .nav-pills .nav-link:not(.active) {
    color: var(--text-secondary);
}

.manage-layout__sidebar .nav-pills .nav-link:hover:not(.active) {
    background: var(--surface-hover);
    color: var(--text-primary);
    transform: translateX(4px);
}

.manage-layout__sidebar .nav-pills .nav-link.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--gold-rgb), 0.3);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .manage-layout__container {
        grid-template-columns: 1fr;
        align-content: start;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .manage-layout__sidebar {
        position: relative;
        top: 0;
    }

    .manage-layout__sidebar .nav-pills {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}

@media (max-width: 768px) {
    .manage-layout__header-content {
        padding: 0.75rem 1rem;
    }

    .manage-layout__title {
        font-size: 1.375rem;
    }

    .manage-layout__subtitle {
        font-size: 0.875rem;
    }

    .manage-layout__container {
        padding: 0.5rem 0.75rem;
        gap: 0.5rem;
    }

    .manage-layout__sidebar {
        padding: 0.375rem;
    }

    .manage-layout__sidebar .nav-pills {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }

    .manage-layout__sidebar .nav-pills .nav-link {
        padding: 0.5rem 0.625rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .manage-layout__container {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .manage-layout__sidebar .nav-pills {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
    }

    .manage-layout__sidebar .nav-pills .nav-link {
        padding: 0.4rem 0.5rem;
        font-size: 0.8125rem;
        gap: 0.375rem;
    }
}

@media (max-width: 640px) {
    .manage-alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .manage-list__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .manage-list__item-action {
        width: 100%;
        justify-content: stretch;
    }

    .manage-list__item-action button,
    .manage-list__item-action a {
        flex: 1;
    }
}

/* ═══════════════════════════════════════
   PROFILE PAGE TWO-COLUMN LAYOUT
   ═══════════════════════════════════════ */
.profile-two-col {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: 2rem;
    align-items: start;
}

.profile-two-col__picture {
    display: flex;
    justify-content: center;
}

@media (max-width: 768px) {
    .profile-two-col {
        grid-template-columns: 1fr;
    }

    .profile-two-col__picture {
        order: -1;
        padding-bottom: 1rem;
        border-bottom: 1px solid var(--border-secondary);
        margin-bottom: 0.5rem;
    }
}

/* ═══════════════════════════════════════
   MODAL (Bootstrap-compatible)
   ═══════════════════════════════════════ */
.d-block { display: block !important; }

.modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1055;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 0.5rem;
    pointer-events: none;
}

@media (min-width: 576px) {
    .modal-dialog {
        max-width: 500px;
        margin: 1.75rem auto;
    }
}

.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 1rem);
}

@media (min-width: 576px) {
    .modal-dialog-centered {
        min-height: calc(100% - 3.5rem);
    }
}

.modal-dialog-scrollable {
    height: calc(100% - 1rem);
}

@media (min-width: 576px) {
    .modal-dialog-scrollable {
        height: calc(100% - 3.5rem);
    }
}

.modal-dialog-scrollable .modal-content {
    max-height: 100%;
    overflow: hidden;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

.modal-sm { max-width: 300px; }

.modal-lg {
    max-width: 800px;
}

@media (max-width: 575.98px) {
    .modal-lg,
    .modal-dialog {
        max-width: calc(100% - 1rem);
        margin: 0.5rem auto;
    }
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    outline: 0;
}

.modal-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-primary);
    border-top-left-radius: var(--radius-xl);
    border-top-right-radius: var(--radius-xl);
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 700;
    color: inherit;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-primary);
    border-bottom-left-radius: var(--radius-xl);
    border-bottom-right-radius: var(--radius-xl);
    gap: 0.5rem;
}

/* Close button */
.btn-close {
    box-sizing: content-box;
    width: 1em;
    height: 1em;
    padding: 0.25em;
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
    border: 0;
    border-radius: 0.375rem;
    opacity: 0.5;
    cursor: pointer;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════
   HELP CENTER PAGES
   ═══════════════════════════════════════════════════════════════════ */
.help-page {
    padding-bottom: 3rem;
}

/* ── Help Layout Header ─────────────────────────────────────────────
   Three-column header: branding | search | theme-toggle              */
.help-layout__header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-shrink: 0;               /* never shrink — always full header height */
    align-items: center;
    gap: 1rem;
    padding: 0.5rem clamp(1rem, 3vw, 2rem);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

.help-layout__logo { flex-shrink: 0; }

.help-layout__search-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
}

.help-layout__search-box {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 580px;
    background: var(--surface-1);
    border: 1.5px solid var(--border-primary);
    border-radius: var(--radius-full);
    padding: 0.3rem 0.3rem 0.3rem 1rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.help-layout__search-box:focus-within {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.help-layout__search-icon {
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.help-layout__search-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: var(--font-family);
    outline: none;
    padding: 0.3rem 0;
    min-width: 0;
}

.help-layout__search-input::placeholder { color: var(--text-tertiary); }

/* Hide browser's native ✕ on search inputs */
.help-layout__search-input::-webkit-search-cancel-button { display: none; }

.help-layout__search-btn {
    padding: 0.45rem 1.1rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font-family);
    flex-shrink: 0;
}

.help-layout__search-btn:hover:not(:disabled) {
    box-shadow: var(--shadow-md), var(--shadow-glow);
    transform: translateY(-1px);
}

.help-layout__search-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

.help-layout__actions { flex-shrink: 0; }

/* ── Ask AI button in search bar ────────────────────────────────────────── */
.help-layout__ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.9rem;
    background: var(--surface-1);
    color: var(--accent-primary);
    border: 1.5px solid var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: var(--font-family);
    flex-shrink: 0;
}
.help-layout__ai-btn:hover {
    background: var(--accent-primary);
    color: white;
    box-shadow: var(--shadow-glow);
}
.help-layout__search-kbd {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.4rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
    justify-content: center;
}
.help-layout__search-kbd kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    border: 1px solid var(--border-primary);
    background: var(--surface-2);
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════════════════
   HELP SIDEBAR — Mintlify-style left chapter navigation
   Inlined directly in HelpLayout.razor — no separate component dependency.
   ══════════════════════════════════════════════════════════════════════════ */

/* 2-column: fixed left nav | scrollable content */
.help-layout__body {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 1fr;
    position: relative;
    z-index: 1;
    /* Explicit height so child height:100% resolves to a definite value,
       creating a real overflow/scroll container in help-layout__main */
    height: calc(100vh - 4rem);
    width: 100%;
    overflow: hidden;
}

/* Hide the page footer inside help layout — body fills the remaining viewport */
.help-layout__body ~ .auth-footer {
    display: none;
}

/* ── Sidebar shell ────────────────────────────────────────────────────────── */
.help-sidebar {
    grid-column: 1;
    width: 240px;
    padding: 1.25rem 0.5rem 3rem;
    overflow-y: auto;
    height: calc(100vh - 4rem);
    position: sticky;
    top: 4rem;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-secondary);
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) transparent;
    z-index: 2;
}

/* ── Home / index link ────────────────────────────────────────────────────── */
.help-sidebar__home {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-md);
    font-size: 0.825rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.help-sidebar__home:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.help-sidebar__home--active {
    background: var(--surface-hover);
    color: var(--accent-primary);
}

/* ── Section divider ─────────────────────────────────────────────────────── */
.help-sidebar__divider {
    height: 1px;
    background: var(--border-secondary);
    margin: 0.5rem 0.75rem 1rem;
}

/* ── Section group ────────────────────────────────────────────────────────── */
.help-sidebar__section { margin-bottom: 1.25rem; }

.help-sidebar__section-label {
    display: block;
    padding: 0 0.75rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
}

/* ── Nav item ────────────────────────────────────────────────────────────── */
.help-sidebar__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
    margin: 1px 0;
    line-height: 1.35;
}
.help-sidebar__item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    text-decoration: none;
}
.help-sidebar__item--active {
    background: rgba(var(--gold-rgb), 0.12);
    color: var(--accent-primary);
    font-weight: 700;
    border-left: 2px solid var(--accent-primary);
    padding-left: calc(0.75rem - 2px);
    text-decoration: none;
}
.help-sidebar__item--active:hover {
    background: rgba(var(--gold-rgb), 0.18);
    color: var(--accent-primary);
    text-decoration: none;
}
.help-sidebar__icon {
    font-size: 0.9rem;
    flex-shrink: 0;
    width: 1.1rem;
    text-align: center;
    line-height: 1;
}
.help-sidebar__label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Responsive: collapse to single column on narrow viewports ───────────── */
@media (max-width: 900px) {
    .help-layout__body { grid-template-columns: 1fr; }
    .help-sidebar      { display: none; }
}

/* ── Help Layout Main ─────────────────────────────────────────────────────── */
.help-layout__main {
    grid-column: 2;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .help-layout__main { grid-column: 1; }
}

/* Responsive: collapse search bar on small screens */
@media (max-width: 600px) {
    .help-layout__search-btn { padding: 0.4rem 0.7rem; font-size: 0.8125rem; }
    .help-layout__ai-btn     { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
    .help-layout__search-kbd { display: none; }
    .auth-header__logo-text  { display: none; }
}

/* ── Mintlify-style heading anchor links ────────────────────────────────── */
.help-doc-content .md-heading-anchor {
    opacity: 0;
    margin-left: 0.35rem;
    color: var(--text-tertiary);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85em;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}
.help-doc-content .md-h2:hover .md-heading-anchor,
.help-doc-content .md-h3:hover .md-heading-anchor,
.help-doc-content .md-h4:hover .md-heading-anchor {
    opacity: 1;
}
.help-doc-content .md-heading-anchor:hover {
    color: var(--accent-primary);
    text-decoration: none;
}

/* ── Reading time badge ─────────────────────────────────────────────────── */
.help-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* When AuthLayout hosts a help page (fallback), remove narrow constraints */
.auth-main:has(.help-page) {
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1.5rem clamp(1rem, 3vw, 2rem);
}

.auth-container:has(.help-page) {
    max-width: 100%;
}

/* ── Markdown-rendered help doc content ──────────────────────────────────── */
.help-doc-content { line-height: 1.7; }

/* Headings */
.help-doc-content .md-h2 {
    font-size: 1.15rem; font-weight: 700; color: var(--text-primary);
    margin: 2rem 0 0.6rem; padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--border-secondary);
    scroll-margin-top: 30px;
}
.help-doc-content .md-h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin: 1.5rem 0 0.4rem; scroll-margin-top: 1.5rem; }
.help-doc-content .md-h4 { font-size: 0.9375rem; font-weight: 600; color: var(--text-secondary); margin: 1.25rem 0 0.35rem; scroll-margin-top: 1.5rem; }

/* Paragraphs / lists */
.help-doc-content .md-p  { color: var(--text-secondary); font-size: 0.9375rem; margin: 0 0 0.75rem; }
.help-doc-content .md-ul,
.help-doc-content .md-ol { color: var(--text-secondary); font-size: 0.875rem; padding-left: 1.5rem; margin: 0.4rem 0 0.75rem; }
.help-doc-content li      { margin-bottom: 0.3rem; }

/* Inline */
.help-doc-content .md-code {
    background: var(--surface-3); color: var(--color-info);
    padding: 1px 5px; border-radius: 3px; font-size: 0.8rem; font-family: var(--font-mono);
}
.help-doc-content .md-link { color: var(--color-info); text-decoration: none; font-weight: 500; }
.help-doc-content .md-link:hover { text-decoration: underline; }

/* Code block */
.help-doc-content .md-pre {
    background: var(--surface-3); border: 1px solid var(--border-primary);
    border-radius: var(--radius-md); padding: 1rem 1.25rem; overflow-x: auto; margin: 0.75rem 0;
}
.help-doc-content .md-code-block { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-primary); }

/* HR */
.help-doc-content .md-hr { border: none; border-top: 1px solid var(--border-primary); margin: 2rem 0; }

/* ── Step cards (matches HelpShared.Step visual) ───────────────────────── */
.help-doc-content .md-step {
    display: flex; align-items: flex-start; gap: 1rem;
    margin-bottom: 1rem; padding: 1.1rem 1.25rem;
    background: var(--surface-2); border: 1px solid var(--border-primary); border-radius: 12px;
}
.help-doc-content .md-step__num {
    min-width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg,#2563eb,#7c3aed); color: white;
    border-radius: 50%; font-weight: 700; font-size: 0.875rem; flex-shrink: 0; margin-top: 1px;
}
.help-doc-content .md-step__body { flex: 1; min-width: 0; }
.help-doc-content .md-step__title { font-weight: 600; color: var(--text-primary); margin-bottom: 0.3rem; font-size: 0.9375rem; }
.help-doc-content .md-step__content { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.6; }
.help-doc-content .md-step__content .md-p  { margin: 0 0 0.4rem; font-size: inherit; color: inherit; }
.help-doc-content .md-step__content .md-ul,
.help-doc-content .md-step__content .md-ol { margin: 0.25rem 0; }

/* ── Callout blocks ─────────────────────────────────────────────────────── */
.help-doc-content .md-callout {
    display: flex; gap: 0.6rem; align-items: flex-start;
    padding: 0.875rem 1.1rem; border-radius: 10px;
    border: 1px solid; margin-bottom: 1rem; font-size: 0.875rem;
}
.help-doc-content .md-callout__label { font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.help-doc-content .md-callout__body  { color: var(--text-secondary); line-height: 1.6; }
.help-doc-content .md-callout__body .md-p { margin: 0; font-size: inherit; color: inherit; }

.help-doc-content .md-callout--tip {
    background: var(--color-info-bg); border-color: var(--color-info-border);
}
.help-doc-content .md-callout--tip .md-callout__label { color: var(--color-info); }

.help-doc-content .md-callout--warning {
    background: var(--color-warning-bg); border-color: var(--color-warning-border);
}
.help-doc-content .md-callout--warning .md-callout__label { color: var(--color-warning); }

.help-doc-content .md-callout--danger {
    background: var(--color-danger-bg); border-color: var(--color-danger-border);
}
.help-doc-content .md-callout--danger .md-callout__label { color: var(--color-danger); }

.help-doc-content .md-callout--info {
    background: var(--surface-2); border-color: var(--border-primary);
}
.help-doc-content .md-callout--info .md-callout__label { color: var(--text-secondary); }

/* ── Accordion callout ──────────────────────────────────────────────────── */
.help-doc-content .md-callout--accordion {
    background: var(--surface-1); border-color: var(--border-primary); cursor: pointer;
}
.help-doc-content .md-callout--accordion .md-callout__label { color: var(--text-tertiary); transition: transform 200ms ease; }
.help-doc-content .md-callout--accordion:hover { border-color: var(--accent-primary); }

/* ── Card callout ───────────────────────────────────────────────────────── */
.help-doc-content .md-callout--card {
    background: var(--surface-1); border-color: var(--border-primary); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); transition: box-shadow 200ms ease, border-color 200ms ease;
}
.help-doc-content .md-callout--card:hover { border-color: var(--accent-primary); box-shadow: var(--shadow-md); }

/* ── Mintlify-grade code blocks with language label + copy button ─────── */
.help-doc-content .md-code-wrap {
    position: relative;
    margin: 0.75rem 0 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-primary);
    background: var(--surface-3);
    overflow: hidden;
}
.help-doc-content .md-code-wrap .md-pre {
    margin: 0;
    padding: 1rem 1.25rem;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow-x: auto;
}
.help-doc-content .md-code-wrap .md-code-block {
    font-family: var(--font-mono);
    font-size: 0.825rem;
    line-height: 1.65;
    color: var(--text-primary);
    tab-size: 4;
}
.help-doc-content .md-code-lang {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0.25rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    background: var(--surface-2);
    border-bottom: 1px solid var(--border-secondary);
    border-right: 1px solid var(--border-secondary);
    border-bottom-right-radius: var(--radius-md);
    user-select: none;
}
.help-doc-content .md-code-copy {
    position: absolute;
    top: 0.375rem;
    right: 0.5rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    background: var(--surface-1);
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    opacity: 0;
    transition: opacity 150ms ease, background 150ms ease, color 150ms ease;
}
.help-doc-content .md-code-wrap:hover .md-code-copy { opacity: 1; }
.help-doc-content .md-code-copy:hover {
    background: var(--accent-primary); color: white; border-color: var(--accent-primary);
}

/* ── Enhanced horizontal rule (Mintlify-style gradient) ─────────────────── */
.help-doc-content .md-hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-primary), transparent);
    margin: 2rem 0;
}

/* ── Enhanced inline code ───────────────────────────────────────────────── */
.help-doc-content code:not(.md-code-block) {
    padding: 0.15rem 0.4rem;
    border-radius: 5px;
    font-size: 0.85em;
    font-family: var(--font-mono);
    background: var(--surface-2);
    border: 1px solid var(--border-secondary);
    color: var(--accent-primary);
}

/* ── Help button in top bar ─────────────────────────────────────────────── */
.help-topbar-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1.5px solid var(--border-primary);
    background: var(--surface-2); color: var(--text-secondary);
    cursor: pointer; transition: all var(--transition-fast);
    font-size: 1rem; font-weight: 700; font-family: var(--font-family);
}
.help-topbar-btn:hover {
    background: var(--surface-hover); color: var(--text-primary);
    border-color: var(--accent-primary); box-shadow: var(--shadow-sm);
}

/* ── Loading skeleton for doc body ──────────────────────────────────────── */
.help-doc-loading {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 2rem; color: var(--text-secondary); font-size: 0.9rem;
}
.help-doc-loading__spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--border-primary); border-top-color: var(--accent-primary);
    animation: hlSpin 0.7s linear infinite; flex-shrink: 0;
}
@keyframes hlSpin { to { transform: rotate(360deg); } }

/* ── Help Layout Main ─────────────────────────────────────────────────────── */
.help-layout__main {
    grid-column: 2;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding: 1.5rem clamp(1rem, 3vw, 2rem);
    box-sizing: border-box;
}
@media (max-width: 900px) {
    .help-layout__body { grid-template-columns: 1fr; }
    .help-layout__main { grid-column: 1; }
    .help-sidebar      { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   PAGE-LEVEL CONTENT + "ON THIS PAGE" TOC  (Mintlify 3-panel effect)
   Lives inside .help-layout__main — no async timing dependency.
   ════════════════════════════════════════════════════════════════════════════ */
.help-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 2rem;
    align-items: start;
}
/* Only hide right column on mobile — show on all desktops */
@media (max-width: 768px) {
    .help-content-grid { grid-template-columns: 1fr; }
    .help-content-grid .help-toc-aside { display: none; }
}

/* Sticky wrapper — sticks inside the scrolling .help-layout__main container */
.help-toc-aside {
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 10rem);
    overflow-y: auto;
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border-primary) transparent;
}

/* ── "On this page" TOC panel ───────────────────────────────────────────── */
.doc-toc {
    display: block;
    padding: 0 0 1rem;
    border-left: 2px solid var(--border-secondary);
}
.doc-toc__label {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    padding: 0 0 0.75rem 0.75rem;
    display: block;
}
.doc-toc__link {
    display: block;
    padding: 0.28rem 0.75rem;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -2px;
    transition: color var(--transition-fast), border-color var(--transition-fast);
    line-height: 1.4;
    word-break: break-word;
    cursor: pointer;
}
.doc-toc__link:hover {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    text-decoration: none;
}
.doc-toc__link--active {
    color: var(--accent-primary);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}
.doc-toc__link--h3 { font-size: 0.76rem; }
.doc-toc__link--h4 { font-size: 0.73rem; color: var(--text-tertiary); }

/* Shared colour tokens used by HelpShared.cs callouts */
:root {
    --color-info:           #0891b2;
    --color-info-bg:        rgba(8, 145, 178, 0.08);
    --color-info-border:    rgba(8, 145, 178, 0.25);
    --color-warning:        #b45309;
    --color-warning-bg:     rgba(180, 83, 9, 0.08);
    --color-warning-border: rgba(180, 83, 9, 0.25);
    --color-danger:         #dc2626;
    --color-danger-bg:      rgba(220, 38, 38, 0.08);
    --color-danger-border:  rgba(220, 38, 38, 0.25);
    --text-tertiary:        var(--text-secondary);
}

:root[data-theme="dark"] {
    --color-info:           #38bdf8;
    --color-info-bg:        rgba(56, 189, 248, 0.1);
    --color-info-border:    rgba(56, 189, 248, 0.25);
    --color-warning:        #fbbf24;
    --color-warning-bg:     rgba(251, 191, 36, 0.1);
    --color-warning-border: rgba(251, 191, 36, 0.25);
    --color-danger:         #f87171;
    --color-danger-bg:      rgba(248, 113, 113, 0.1);
    --color-danger-border:  rgba(248, 113, 113, 0.25);
}

.btn-close:hover { opacity: 0.75; }
.btn-close:focus { opacity: 1; outline: 2px solid var(--border-focus); }
.btn-close-white { filter: invert(1) grayscale(100%) brightness(200%); }

/* Modal gradient headers */
.bg-gradient-primary  { background: linear-gradient(135deg, #4F46E5 0%, #6366F1 100%) !important; }
.bg-gradient-success  { background: linear-gradient(135deg, #16A34A 0%, #22C55E 100%) !important; }
.bg-gradient-danger   { background: linear-gradient(135deg, #DC2626 0%, #EF4444 100%) !important; }
.bg-gradient-warning  { background: linear-gradient(135deg, #D97706 0%, #F59E0B 100%) !important; }
.bg-gradient-info     { background: linear-gradient(135deg, #0284C7 0%, #38BDF8 100%) !important; }

/* Bootstrap utility classes used in modals */
.border-0  { border: 0 !important; }
.text-white { color: #ffffff !important; }
.text-dark  { color: var(--text-primary) !important; }
.text-body-secondary { color: var(--text-secondary) !important; }

.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.p-4  { padding: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }

.fs-5 { font-size: 1.25rem !important; }
.fs-6 { font-size: 1rem !important; }
.small { font-size: 0.875em; }

/* Bootstrap grid used in modals */
.row   { display: flex; flex-wrap: wrap; margin-left: -0.75rem; margin-right: -0.75rem; }
.g-3   { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; gap: 1rem; }
.col-md-6 { flex: 0 0 auto; width: 50%; padding-left: 0.75rem; padding-right: 0.75rem; }
@media (max-width: 767.98px) { .col-md-6 { width: 100%; } }

/* Bootstrap badges used in modals */
.badge { display: inline-block; padding: 0.35em 0.65em; font-size: 0.75em; font-weight: 700; line-height: 1; text-align: center; white-space: nowrap; vertical-align: baseline; border-radius: var(--radius-full); }
.bg-success { background-color: var(--color-success) !important; color: #fff; }
.bg-danger  { background-color: var(--color-danger)  !important; color: #fff; }
.bg-warning { background-color: var(--color-warning) !important; color: #fff; }
.bg-primary { background-color: var(--gold-500) !important; color: #fff; }
.bg-secondary { background-color: var(--text-tertiary) !important; color: #fff; }

/* Bootstrap alerts used in modals */
.alert-dismissible { padding-right: 3rem; position: relative; }
.alert-dismissible .btn-close { position: absolute; top: 0; right: 0; z-index: 2; padding: 1.25rem 1rem; }
.fade { transition: opacity 0.15s linear; }
.fade:not(.show) { opacity: 0; }
.show { opacity: 1; }

/* Form switch used in modals */
.form-check { display: flex; align-items: center; min-height: 1.5rem; padding-left: 1.5em; }
.form-check-input { width: 1em; height: 1em; margin-top: 0; margin-left: -1.5em; flex-shrink: 0; accent-color: var(--gold-500); }
.form-check-label { cursor: pointer; }
.form-switch .form-check-input { width: 2em; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='rgba%280,0,0,0.25%29'/%3e%3c/svg%3e"); background-position: left center; background-repeat: no-repeat; background-size: contain; border-radius: 2em; cursor: pointer; transition: background-position .15s ease-in-out; }
.form-switch .form-check-input:checked { background-position: right center; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e"); }

/* Password input wrapper */
.password-input-wrapper { position: relative; }
.password-input-wrapper .form-control { padding-right: 2.75rem; }
.password-toggle-btn { position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-tertiary); cursor: pointer; padding: 0; line-height: 1; }
.password-toggle-btn:hover { color: var(--text-secondary); }

/* Selected row highlight in QuickGrid */
tbody tr.selected-row { background-color: rgba(var(--gold-rgb), 0.1) !important; outline: 2px solid var(--accent-primary); outline-offset: -2px; }
[data-theme="dark"] tbody tr.selected-row { background-color: rgba(var(--gold-rgb), 0.15) !important; }

/* QuickGrid column header — accent-tinted background visible in both themes */
.quickgrid thead th,
table.quickgrid th,
.col-header {
    color: var(--text-primary) !important;
    background: rgba(var(--gold-rgb, 251, 176, 64), 0.15) !important;
    border-bottom: 2px solid var(--accent-primary) !important;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Sort indicator & header text — must be global to override QuickGrid bundled styles */
.quickgrid .sort-indicator,
table.quickgrid .sort-indicator,
.quickgrid thead .sort-indicator,
.quickgrid th .sort-indicator {
    color: var(--text-primary) !important;
}

.quickgrid .col-title-text,
table.quickgrid .col-title-text,
.quickgrid thead .col-title-text {
    color: var(--text-primary) !important;
}

/* QuickGrid body — zebra striping with theme tokens and visible row borders */
.quickgrid tbody tr:nth-child(even) td { background-color: var(--surface-2, var(--bg-secondary)); }
.quickgrid tbody tr:nth-child(odd) td  { background-color: var(--bg-elevated, var(--bg-primary)); }
.quickgrid tbody td                    { border-bottom: 1px solid var(--border-primary); }
.quickgrid tbody tr:hover td           { background-color: var(--surface-active) !important; }

/* ═══════════════════════════════════════
   BOOTSTRAP DROPDOWN POLYFILL
   Required: Bootstrap JS is not loaded
   ═══════════════════════════════════════ */
.dropdown { position: relative; }

.dropdown-menu {
    display: none;
    position: absolute;
    z-index: 1050;
    min-width: 10rem;
    padding: 0.5rem 0;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}

.dropdown-menu.show { display: block; }

/* Filter dropdown visual styling */
.quick-grid-filter-container .filter-dropdown {
    background-color: var(--bg-elevated) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-primary) !important;
}

.quick-grid-filter-container .filter-chip {
    background-color: var(--bg-secondary) !important;
    border-color: var(--border-primary) !important;
    color: var(--text-primary) !important;
}

.quick-grid-filter-container .filter-group {
    background-color: var(--bg-secondary) !important;
}

/* ═══════════════════════════════════════
   FORM SELECT (dropdown / <select>)
   ═══════════════════════════════════════ */
.form-select {
    display: block;
    width: 100%;
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    font-size: 0.9375rem;
    font-family: var(--font-family);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--surface-1);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    appearance: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
    outline: none;
}

.form-select:disabled {
    background-color: var(--bg-tertiary);
    color: var(--text-tertiary);
    cursor: not-allowed;
}

[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394A3B8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

/* Small form variants */
.form-control-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.form-select-sm {
    padding: 0.375rem 2rem 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

/* ═══════════════════════════════════════
   BUTTON VARIANTS (secondary, outline, sizes)
   ═══════════════════════════════════════ */
.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
    background-color: var(--surface-hover);
    border-color: var(--text-tertiary);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    background-color: var(--surface-active);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--accent-primary);
    border: 1.5px solid var(--accent-primary);
}

.btn-outline-primary:hover {
    background-color: rgba(var(--gold-rgb), 0.08);
    color: var(--accent-primary-hover);
    border-color: var(--accent-primary-hover);
}

.btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
}

.btn-outline-secondary {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border-primary);
}

.btn-outline-secondary:hover {
    background-color: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--text-tertiary);
}

/* Button sizes */
.btn-sm {
    padding: 0.3rem 0.625rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
}

/* Button group */
.btn-group {
    position: relative;
    display: inline-flex;
    vertical-align: middle;
}

.btn-group > .btn {
    position: relative;
    flex: 1 1 auto;
    border-radius: 0;
}

.btn-group > .btn:first-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

.btn-group > .btn:last-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.btn-group > .btn:not(:first-child) {
    margin-left: -1px;
}

.btn-group-sm > .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Radio / checkbox button toggle */
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}

.btn-check:checked + .btn {
    z-index: 1;
}

/* ============================================
   ENHANCED PAGINATION STYLES (QuickGrid Style)
   ============================================ */
.paginator {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 0;
}

.paginator button {
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #4094f5 0%, #2673d8 100%);
    color: white;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(64, 148, 245, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.paginator button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2673d8 0%, #1558a8 100%);
    box-shadow: 0 4px 12px rgba(64, 148, 245, 0.35);
    border-color: transparent;
}

.paginator button:active:not(:disabled) {
    box-shadow: 0 2px 6px rgba(64, 148, 245, 0.25);
}

.paginator button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #6c757d;
    box-shadow: none;
}

/* Current/Active Page Button */
.paginator button.current-page {
    background: linear-gradient(135deg, #1558a8 0%, #124a8f 100%);
    color: white;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 16px rgba(21, 88, 168, 0.4), 
                0 0 0 3px rgba(64, 148, 245, 0.2);
    font-weight: 700;
    transform: scale(1.05);
}

.paginator button.current-page:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, #1558a8 0%, #124a8f 100%);
}

/* Navigation Arrows - Make them highly visible INSIDE the button */
/* First page button */
.paginator button[aria-label*="Go to first page"]::before,
.paginator button[aria-label*="first"]::before {
    content: '◀◀ ';
    font-size: 10px;
    font-weight: 700;
    opacity: 0.95;
}

/* Previous page button */
.paginator button[aria-label*="Go to previous page"]::before,
.paginator button[aria-label*="previous"]::before {
    content: '◀ ';
    font-size: 11px;
    font-weight: 900;
}

/* Next page button - Arrow pointing RIGHT */
.paginator button[aria-label*="Go to next page"]::after,
.paginator button[aria-label*="next"]::after {
    content: ' ▶';
    font-size: 11px;
    font-weight: 900;
    transform: scaleX(1);
}

/* Last page button - Arrow pointing RIGHT */
.paginator button[aria-label*="Go to last page"]::after,
.paginator button[aria-label*="last"]::after {
    content: ' ▶▶';
    font-size: 10px;
    font-weight: 700;
    opacity: 0.95;
    transform: scaleX(1);
}

/* Make navigation buttons wider and show text with arrows */
.paginator button[aria-label*="Go to first page"],
.paginator button[aria-label*="first"],
.paginator button[aria-label*="Go to previous page"],
.paginator button[aria-label*="previous"],
.paginator button[aria-label*="Go to next page"],
.paginator button[aria-label*="next"],
.paginator button[aria-label*="Go to last page"],
.paginator button[aria-label*="last"] {
    min-width: auto;
    padding: 0.5rem 1rem;
    font-weight: 700;
    transform: scaleX(1);
}

/* Ensure button text is visible */
.paginator button[aria-label*="Go to first page"]::before,
.paginator button[aria-label*="first"]::before,
.paginator button[aria-label*="Go to previous page"]::before,
.paginator button[aria-label*="previous"]::before,
.paginator button[aria-label*="Go to next page"]::after,
.paginator button[aria-label*="next"]::after,
.paginator button[aria-label*="Go to last page"]::after,
.paginator button[aria-label*="last"]::after {
    display: inline;
    margin: 0;
}

/* Pagination Info Text */
.paginator .pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0 0.5rem;
    white-space: nowrap;
}

/* Dark Theme Adjustments */
[data-theme="dark"] .paginator button,
[data-bs-theme="dark"] .paginator button {
    background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.25);
}

[data-theme="dark"] .paginator button:hover:not(:disabled),
[data-bs-theme="dark"] .paginator button:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a8eef 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

[data-theme="dark"] .paginator button.current-page,
[data-bs-theme="dark"] .paginator button.current-page {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5), 0 0 0 3px rgba(74, 158, 255, 0.25);
}

[data-theme="dark"] .paginator button:disabled,
[data-bs-theme="dark"] .paginator button:disabled {
    background: #374151;
}

/* Light Theme Adjustments */
[data-theme="light"] .paginator button,
[data-bs-theme="light"] .paginator button {
    background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
    box-shadow: 0 2px 8px rgba(74, 158, 255, 0.25);
}

[data-theme="light"] .paginator button:hover:not(:disabled),
[data-bs-theme="light"] .paginator button:hover:not(:disabled) {
    background: linear-gradient(135deg, #3a8eef 0%, #2563eb 100%);
    box-shadow: 0 4px 12px rgba(74, 158, 255, 0.4);
}

[data-theme="light"] .paginator button.current-page,
[data-bs-theme="light"] .paginator button.current-page {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5), 0 0 0 3px rgba(74, 158, 255, 0.25);
}

[data-theme="light"] .paginator button:disabled,
[data-bs-theme="light"] .paginator button:disabled {
    background: #374151;
}

/* Responsive */
@media (max-width: 640px) {
    .paginator {
        gap: 0.375rem;
    }

    .paginator button {
        min-width: 2.25rem;
        height: 2.25rem;
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }
}

/* ═══════════════════════════════════════
   ADDITIONAL UTILITY CLASSES
   ═══════════════════════════════════════ */
.bg-info  { background-color: var(--color-info) !important; color: #fff; }
.bg-light { background-color: var(--bg-secondary) !important; }

.border { border: 1px solid var(--border-primary) !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.my-1 { margin-top: 0.25rem !important; margin-bottom: 0.25rem !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.d-none { display: none !important; }
.text-center { text-align: center !important; }



/* ═══════════════════════════════════════════════════════════════════════════
   AI ASSISTANT — Mintlify-style floating chat panel
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── FAB trigger ──────────────────────────────────────────────────────────── */
.ai-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 2000;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(var(--gold-rgb), 0.3);
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.ai-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(var(--gold-rgb), 0.15);
}

/* ── Panel container ──────────────────────────────────────────────────────── */
.ai-panel {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 1999;
    width: 420px;
    max-height: calc(100vh - 8rem);
    background: var(--bg-elevated);
    border: 1px solid var(--border-primary);
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aiSlideUp 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes aiSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

@media (max-width: 480px) {
    .ai-panel {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        bottom: 5rem;
        max-height: calc(100vh - 6rem);
    }
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.ai-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-secondary);
    background: var(--surface-2);
}

.ai-panel__header-left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.ai-panel__avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-panel__title {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ai-panel__badge {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius-full);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info-border);
    vertical-align: middle;
}

.ai-panel__header-actions {
    display: flex;
    gap: 0.25rem;
}

.ai-panel__header-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.ai-panel__header-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

/* ── Messages area ────────────────────────────────────────────────────────── */
.ai-panel__messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    min-height: 200px;
    max-height: 400px;
    scroll-behavior: smooth;
}

/* ── Welcome state ────────────────────────────────────────────────────────── */
.ai-welcome {
    text-align: center;
    padding: 0px;
}

.ai-welcome__icon { margin-bottom: 0.75rem; }
.ai-welcome__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.35rem;
}
.ai-welcome__sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

/* ── Suggestion chips ─────────────────────────────────────────────────────── */
.ai-suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-suggestion {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    background: var(--surface-1);
    color: var(--text-primary);
    font-size: 0.825rem;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.ai-suggestion:hover {
    border-color: var(--accent-primary);
    background: var(--surface-hover);
}

.ai-suggestion svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

/* ── Messages ─────────────────────────────────────────────────────────────── */
.ai-msg {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ai-msg--user { flex-direction: row-reverse; }

.ai-msg__avatar {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-msg__avatar--ai {
    background: var(--accent-gradient);
    color: white;
}

.ai-msg__bubble {
    max-width: 85%;
    border-radius: var(--radius-lg);
    padding: 0.75rem 0.875rem;
    font-size: 0.85rem;
    line-height: 1.6;
}

.ai-msg--user .ai-msg__bubble {
    background: var(--accent-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-msg--assistant .ai-msg__bubble {
    background: var(--surface-1);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.ai-msg__content { word-break: break-word; }

/* Compact markdown inside AI bubbles */
.ai-msg__bubble .help-doc-content .md-p { margin: 0 0 0.5rem; font-size: 0.85rem; }
.ai-msg__bubble .help-doc-content .md-h1,
.ai-msg__bubble .help-doc-content .md-h2,
.ai-msg__bubble .help-doc-content .md-h3 { font-size: 0.95rem; margin: 0.75rem 0 0.35rem; }
.ai-msg__bubble .help-doc-content .md-ul,
.ai-msg__bubble .help-doc-content .md-ol { font-size: 0.85rem; padding-left: 1.25rem; margin: 0.25rem 0; }

/* ── Sources ──────────────────────────────────────────────────────────────── */
.ai-msg__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-secondary);
}

.ai-msg__sources-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}

.ai-msg__source-link {
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    background: var(--color-info-bg);
    color: var(--color-info);
    border: 1px solid var(--color-info-border);
    text-decoration: none;
    font-weight: 600;
    transition: background var(--transition-fast);
}

.ai-msg__source-link:hover {
    background: var(--color-info);
    color: white;
    text-decoration: none;
}

/* ── Typing indicator ─────────────────────────────────────────────────────── */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 0.25rem 0;
}

.ai-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary);
    animation: aiDot 1.2s ease-in-out infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.15s; }
.ai-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes aiDot {
    0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
    30%           { opacity: 1;   transform: scale(1);    }
}

/* ── Input bar ────────────────────────────────────────────────────────────── */
.ai-panel__input-wrap {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-secondary);
    background: var(--surface-2);
}

.ai-panel__input-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ai-panel__input {
    flex: 1;
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-fast);
}

.ai-panel__input:focus {
    border-color: var(--border-focus);
}

.ai-panel__input::placeholder {
    color: var(--text-tertiary);
}

.ai-panel__send {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--accent-gradient);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.ai-panel__send:hover:not(:disabled) {
    transform: scale(1.05);
}

.ai-panel__send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ai-panel__input-hint {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    margin-top: 0.4rem;
    text-align: center;
}
