/* ==========================================================================
   Areative Admin — Dark Violet Theme
   Self-contained CSS. No Tailwind CDN. Mobile-first. Hostinger-ready.
   Matches the dark violet login aesthetic across the full admin shell.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS Variables — Dark Violet Theme
   -------------------------------------------------------------------------- */
:root {
    /* Surfaces */
    --bg-deep: #0a0814;
    --bg-base: #0f0b1a;
    --bg-elevated: #15121f;
    --bg-panel: #1a1625;
    --bg-hover: #221c30;
    --bg-muted: #1e1830;

    /* Brand / Violet (primary accent) */
    --brand-50: rgba(124, 58, 237, 0.12);
    --brand-100: rgba(139, 92, 246, 0.18);
    --brand-200: rgba(139, 92, 246, 0.35);
    --brand-400: #a78bfa;
    --brand-500: #8b5cf6;
    --brand-600: #7c3aed;
    --brand-700: #6d28d9;
    --brand-800: #5b21b6;

    /* Slate remapped for dark UI (light text on dark surfaces) */
    --slate-50: #1a1625;
    --slate-100: #221c30;
    --slate-200: rgba(139, 92, 246, 0.18);
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #94a3b8;
    --slate-600: #cbd5e1;
    --slate-700: #e2e8f0;
    --slate-800: #f1f5f9;
    --slate-900: #ffffff;

    /* Semantic — emerald */
    --emerald-50: rgba(16, 185, 129, 0.12);
    --emerald-100: rgba(16, 185, 129, 0.18);
    --emerald-200: rgba(16, 185, 129, 0.35);
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #34d399;

    /* Semantic — red */
    --red-50: rgba(239, 68, 68, 0.12);
    --red-100: rgba(239, 68, 68, 0.18);
    --red-200: rgba(239, 68, 68, 0.35);
    --red-400: #f87171;
    --red-500: #ef4444;
    --red-600: #f87171;
    --red-700: #fca5a5;

    /* Violet accents */
    --violet-50: rgba(139, 92, 246, 0.12);
    --violet-100: rgba(139, 92, 246, 0.2);
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;
    --violet-700: #c4b5fd;
    --violet-800: #ddd6fe;

    /* Accent dots / status */
    --blue-500: #3b82f6;
    --amber-500: #f59e0b;
    --purple-500: #a855f7;

    /* Borders */
    --border-subtle: rgba(139, 92, 246, 0.12);
    --border-default: rgba(139, 92, 246, 0.2);
    --border-strong: rgba(139, 92, 246, 0.35);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-faint: #64748b;

    /* Layout */
    --sidebar-width: 256px;
    --header-height: 64px;
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.25rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.06);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(139, 92, 246, 0.08);
    --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(139, 92, 246, 0.1);
    --shadow-glow: 0 0 24px rgba(124, 58, 237, 0.35);
    --shadow-nav-active: 0 0 20px rgba(124, 58, 237, 0.35), inset 0 0 0 1px rgba(139, 92, 246, 0.35);

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    /* Transitions */
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Login violet theme */
    --login-bg: #08060f;
    --login-panel: #111118;
    --login-violet-900: #1e1b4b;
    --login-violet-800: #4c1d95;
    --login-violet-700: #6d28d9;
    --login-violet-600: #7c3aed;
    --login-violet-500: #8b5cf6;
    --login-violet-400: #a78bfa;
    --login-accent: #fbbf24;
}

/* --------------------------------------------------------------------------
   2. Reset + Base Typography
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-secondary);
    background-color: var(--bg-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
    color: inherit;
}

table {
    border-collapse: collapse;
}

[x-cloak] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--brand-500);
    outline-offset: 2px;
}

@supports (padding: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* --------------------------------------------------------------------------
   3. Login Page — Dark Violet (preserved aesthetic)
   -------------------------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--login-bg);
    background-image:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(109, 40, 217, 0.18) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(76, 29, 149, 0.12) 0%, transparent 50%);
}

.login-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 960px;
    min-height: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, 0.15);
    box-shadow: var(--shadow-xl);
}

@media (min-width: 1024px) {
    .login-card {
        flex-direction: row;
        min-height: 560px;
    }
}

.login-brand-panel {
    flex: 1;
    background: linear-gradient(145deg, var(--login-violet-900) 0%, var(--login-violet-800) 35%, var(--login-violet-700) 65%, var(--login-violet-600) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-brand-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 50% at 20% 20%, rgba(167, 139, 250, 0.25) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 80%, rgba(91, 33, 182, 0.4) 0%, transparent 50%);
    pointer-events: none;
}

@media (max-width: 1023px) {
    .login-brand-panel {
        min-height: 280px;
    }
}

.login-brand-inner {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .login-brand-inner {
        padding: 2.5rem 3rem;
    }
}

.login-brand-top {
    flex: 1;
}

.login-logo-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}

.login-logo-img {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    object-fit: cover;
}

.login-logo-fallback {
    width: 3rem;
    height: 3rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.125rem;
}

.login-business-name {
    font-size: 1.125rem;
    font-weight: 600;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.025em;
}

.login-badge-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.login-headline {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

@media (min-width: 1024px) {
    .login-headline {
        font-size: 2.25rem;
    }
}

.login-brand-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2rem;
}

.login-form-panel {
    flex: 1;
    background: var(--login-panel);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-inner {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

@media (min-width: 640px) {
    .login-form-inner {
        padding: 2.5rem;
    }
}

.login-form-header {
    margin-bottom: 1.75rem;
}

.login-form-header h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}

.login-form-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #94a3b8;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-alert {
    margin-bottom: 0.25rem;
}

.login-input {
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.login-input::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

.login-input:focus {
    border-color: rgba(139, 92, 246, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.2) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.login-input:-webkit-autofill,
.login-input:-webkit-autofill:hover,
.login-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #1a1a24 inset !important;
    border-color: rgba(139, 92, 246, 0.4);
    transition: background-color 5000s ease-in-out 0s;
}

.input-icon-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    display: flex;
}

.input-icon-wrap .form-input,
.input-icon-wrap .login-input {
    padding-left: 2.75rem;
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color var(--transition);
}

.password-toggle:hover {
    color: #fff;
}

.btn-login,
.login-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, #5b21b6 0%, var(--login-violet-600) 50%, var(--login-violet-500) 100%);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(109, 40, 217, 0.4);
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-login:hover,
.login-submit-btn:hover {
    background: linear-gradient(135deg, var(--login-violet-700) 0%, var(--login-violet-500) 50%, var(--login-violet-400) 100%);
    box-shadow: 0 6px 28px rgba(109, 40, 217, 0.55);
    transform: translateY(-1px);
}

.btn-login:active,
.login-submit-btn:active {
    transform: translateY(0);
}

.login-secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin: 1.5rem 0 0;
    font-size: 0.6875rem;
    color: #64748b;
    text-align: center;
}

/* --------------------------------------------------------------------------
   4. Admin Shell
   -------------------------------------------------------------------------- */
.admin-body {
    min-height: 100vh;
    background-color: var(--bg-base);
    background-image:
        radial-gradient(ellipse 60% 40% at 0% 0%, rgba(109, 40, 217, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 40% 30% at 100% 100%, rgba(76, 29, 149, 0.06) 0%, transparent 45%);
    background-attachment: fixed;
}

.admin-body.menu-open {
    overflow: hidden;
}

/* Desktop sidebar — fixed 256px at 1024px+ */
.desktop-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    z-index: 40;
    flex-direction: column;
    background: linear-gradient(180deg, #0d0a16 0%, #120e1c 100%);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
}

@media (min-width: 1024px) {
    .desktop-sidebar {
        display: flex;
    }
}

.sidebar-brand-wrap {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.brand-logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
}

.brand-logo-fallback {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-glow);
}

.brand-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-footer {
    padding: 0.75rem 0.5rem 1rem;
    border-top: 1px solid var(--border-subtle);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: background-color var(--transition), color var(--transition), box-shadow var(--transition);
}

.nav-link:hover {
    background-color: rgba(139, 92, 246, 0.08);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.28) 0%, rgba(109, 40, 217, 0.18) 100%);
    color: #e9d5ff;
    box-shadow: var(--shadow-nav-active);
}

.nav-link.active .nav-icon {
    color: var(--brand-400);
    filter: drop-shadow(0 0 6px rgba(139, 92, 246, 0.6));
}

.nav-link.logout-link {
    color: var(--text-faint);
}

.nav-link.logout-link:hover {
    background-color: var(--red-50);
    color: var(--red-400);
}

.nav-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Mobile overlay & drawer */
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(8, 6, 15, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 200ms ease;
}

.mobile-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    z-index: 50;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #0d0a16 0%, #120e1c 100%);
    border-right: 1px solid var(--border-subtle);
    transform: translateX(-100%);
    transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.mobile-drawer.open {
    transform: translateX(0);
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.menu-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}

.menu-close:hover {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
}

.mobile-nav {
    flex: 1;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.mobile-drawer-footer {
    padding: 0.75rem 0.5rem 1rem;
    border-top: 1px solid var(--border-subtle);
}

/* Main content area */
.admin-main {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .admin-main {
        margin-left: var(--sidebar-width);
    }
}

/* Sticky header — dark glass */
.admin-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-height);
    padding: 0 1rem;
    background: rgba(15, 11, 26, 0.82);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
}

@media (min-width: 1024px) {
    .admin-header {
        padding: 0 1.5rem;
    }
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}

.menu-toggle:hover {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

.page-title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.currency-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.25rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--brand-400);
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.currency-btn:hover {
    background-color: var(--brand-50);
    border-color: var(--border-strong);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.2);
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    display: none;
}

@media (min-width: 640px) {
    .user-name {
        display: inline;
    }
}

.flash-area {
    padding: 0 1rem;
}

.flash-area:empty {
    display: none;
}

.flash-area .alert {
    margin-top: 1rem;
}

.admin-content {
    flex: 1;
    padding: 1rem;
    padding-bottom: 6rem;
}

@media (min-width: 1024px) {
    .admin-content {
        padding: 1.5rem;
        padding-bottom: 2rem;
    }
}

/* --------------------------------------------------------------------------
   5. Components
   -------------------------------------------------------------------------- */

/* Cards */
.card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.card-header h2,
.card-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 1.25rem;
    border: 1px solid transparent;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.25;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-700) 0%, var(--brand-600) 50%, var(--brand-500) 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(109, 40, 217, 0.35);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-600) 0%, var(--brand-500) 50%, var(--brand-400) 100%);
    box-shadow: 0 6px 22px rgba(109, 40, 217, 0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-panel);
    border-color: var(--border-default);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background-color: var(--bg-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--bg-panel);
    border-color: var(--red-200);
    color: var(--red-400);
}

.btn-danger:hover {
    background-color: var(--red-50);
    color: var(--red-400);
}

.btn-success {
    background: linear-gradient(135deg, #047857 0%, var(--emerald-600) 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--emerald-600) 0%, var(--emerald-500) 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-label.light {
    color: rgba(255, 255, 255, 0.85);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-xl);
    background: var(--bg-panel);
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-faint);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
    background: var(--bg-hover);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.form-textarea {
    resize: vertical;
    min-height: 5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label.light {
    color: #94a3b8;
}

.checkbox-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--brand-500);
    cursor: pointer;
}

/* Tables */
.table-wrap {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    text-align: left;
}

.data-table thead {
    background-color: rgba(139, 92, 246, 0.06);
}

.data-table th {
    padding: 0.75rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle);
}

.data-table tbody tr:hover {
    background-color: rgba(139, 92, 246, 0.06);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.25;
    white-space: nowrap;
}

.badge-blue {
    background-color: rgba(59, 130, 246, 0.18);
    color: #93c5fd;
}

.badge-green {
    background-color: var(--emerald-100);
    color: var(--emerald-400);
}

.badge-red {
    background-color: var(--red-50);
    color: var(--red-400);
}

.badge-gray {
    background-color: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.badge-violet {
    background-color: var(--violet-100);
    color: var(--violet-400);
}

/* Alerts */
.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    font-weight: 500;
    animation: fadeIn 0.2s ease-out;
}

.alert-success {
    background-color: var(--emerald-50);
    border: 1px solid var(--emerald-200);
    color: var(--emerald-400);
}

.alert-error {
    background-color: var(--red-50);
    border: 1px solid var(--red-200);
    color: var(--red-400);
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

/* Stat grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 1024px) {
    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .stat-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), transparent);
    opacity: 0.6;
}

.stat-card .stat-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    margin-top: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card .stat-dot,
.stat-card .accent-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Page toolbar & filter bar */
.page-toolbar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .page-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pills a,
.filter-pills button,
.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.filter-pills a:hover,
.filter-pills button:hover,
.filter-pill:hover {
    color: var(--text-primary);
    border-color: var(--border-default);
    background: var(--bg-hover);
}

.filter-pills a.active,
.filter-pills button.active,
.filter-pill.active {
    color: #e9d5ff;
    background: rgba(124, 58, 237, 0.22);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.25);
}

/* Data list (mobile cards) */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 1024px) {
    .data-list {
        display: none;
    }
}

.data-list .data-list-item,
.data-list .list-item,
.list-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), background-color var(--transition);
}

.data-list .data-list-item:hover,
.data-list .list-item:hover,
.list-item:hover {
    border-color: var(--border-default);
    background: var(--bg-panel);
}

/* Empty state */
.empty-state {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
}

/* Icon button */
.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}

.icon-btn:hover {
    background-color: rgba(139, 92, 246, 0.12);
    color: var(--text-primary);
}

/* Typography helpers */
.section-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.muted {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--brand-400);
}

/* --------------------------------------------------------------------------
   6. Utility Classes — Layout
   -------------------------------------------------------------------------- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.inline { display: inline; }
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }

.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }

.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }

.overflow-hidden { overflow: hidden; }
.object-cover { object-fit: cover; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Space utilities */
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }

.divide-y > * + * { border-top-width: 1px; border-top-style: solid; }
.divide-slate-50 > * + * { border-top-color: var(--border-subtle); }
.divide-slate-100 > * + * { border-top-color: var(--border-subtle); }
.divide-slate-200 > * + * { border-top-color: var(--border-default); }

.last\:border-0:last-child { border-width: 0; }

/* --------------------------------------------------------------------------
   Utility Classes — Sizing
   -------------------------------------------------------------------------- */
.w-full { width: 100%; }
.w-2 { width: 0.5rem; }
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }

.h-2 { height: 0.5rem; }
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-8 { height: 2rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }

.max-w-xs { max-width: 20rem; }
.max-w-md { max-width: 28rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-5xl { max-width: 64rem; }

.min-h-\[38px\] { min-height: 38px; }
.min-h-\[44px\] { min-height: 44px; }
.min-h-\[48px\] { min-height: 48px; }
.min-w-\[140px\] { min-width: 140px; }

/* --------------------------------------------------------------------------
   Utility Classes — Spacing
   -------------------------------------------------------------------------- */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-2\.5 { padding-left: 0.625rem; padding-right: 0.625rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }

.pt-2 { padding-top: 0.5rem; }
.pt-3 { padding-top: 0.75rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-24 { padding-bottom: 6rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-1\.5 { margin-bottom: 0.375rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }

.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }

.-ml-2 { margin-left: -0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* --------------------------------------------------------------------------
   Utility Classes — Background Colors (dark-theme remapped)
   -------------------------------------------------------------------------- */
.bg-white { background-color: var(--bg-elevated); }
.bg-slate-50 { background-color: var(--bg-panel); }
.bg-slate-100 { background-color: var(--bg-hover); }
.bg-brand-50 { background-color: var(--brand-50); }
.bg-brand-100 { background-color: var(--brand-100); }
.bg-brand-500 { background-color: var(--brand-500); }
.bg-brand-600 { background-color: var(--brand-600); }
.bg-brand-700 { background-color: var(--brand-700); }
.bg-emerald-50 { background-color: var(--emerald-50); }
.bg-emerald-100 { background-color: var(--emerald-100); }
.bg-emerald-500 { background-color: var(--emerald-500); }
.bg-emerald-600 { background-color: var(--emerald-600); }
.bg-emerald-700 { background-color: var(--emerald-600); }
.bg-red-50 { background-color: var(--red-50); }
.bg-red-500 { background-color: var(--red-500); }
.bg-violet-50 { background-color: var(--violet-50); }
.bg-violet-100 { background-color: var(--violet-100); }
.bg-violet-500 { background-color: var(--violet-500); }
.bg-blue-500 { background-color: var(--blue-500); }
.bg-amber-500 { background-color: var(--amber-500); }
.bg-purple-500 { background-color: var(--purple-500); }

/* --------------------------------------------------------------------------
   Utility Classes — Text Colors (dark-theme remapped)
   -------------------------------------------------------------------------- */
.text-white { color: #fff; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #94a3b8; }
.text-slate-600 { color: #cbd5e1; }
.text-slate-700 { color: #e2e8f0; }
.text-slate-800 { color: #f8fafc; }
.text-brand-600 { color: var(--brand-400); }
.text-brand-700 { color: var(--brand-400); }
.text-red-500 { color: var(--red-400); }
.text-red-600 { color: var(--red-400); }
.text-red-700 { color: var(--red-700); }
.text-emerald-600 { color: var(--emerald-400); }
.text-emerald-700 { color: var(--emerald-400); }
.text-violet-600 { color: var(--violet-400); }
.text-violet-700 { color: var(--violet-700); }
.text-violet-800 { color: var(--violet-800); }

/* --------------------------------------------------------------------------
   Utility Classes — Typography
   -------------------------------------------------------------------------- */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --------------------------------------------------------------------------
   Utility Classes — Borders (dark-theme remapped)
   -------------------------------------------------------------------------- */
.border { border-width: 1px; border-style: solid; border-color: var(--border-default); }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-b-2 { border-bottom-width: 2px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }

.border-slate-50 { border-color: var(--border-subtle); }
.border-slate-100 { border-color: var(--border-subtle); }
.border-slate-200 { border-color: var(--border-default); }
.border-slate-300 { border-color: var(--border-strong); }
.border-brand-200 { border-color: var(--brand-200); }
.border-red-200 { border-color: var(--red-200); }
.border-violet-100 { border-color: var(--violet-100); }
.border-emerald-200 { border-color: var(--emerald-200); }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* --------------------------------------------------------------------------
   Utility Classes — Effects
   -------------------------------------------------------------------------- */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.ring-2 {
    box-shadow: 0 0 0 2px var(--ring-color, rgba(124, 58, 237, 0.35));
}

.ring-emerald-100 {
    --ring-color: var(--emerald-100);
    box-shadow: 0 0 0 2px var(--emerald-200);
}

.transition {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.outline-none:focus {
    outline: none;
}

/* Hover utilities (dark remapped) */
.hover\:bg-slate-50:hover { background-color: rgba(139, 92, 246, 0.08); }
.hover\:bg-slate-200:hover { background-color: var(--bg-hover); }
.hover\:bg-brand-50:hover { background-color: var(--brand-50); }
.hover\:bg-brand-700:hover { background-color: var(--brand-700); }
.hover\:bg-red-50:hover { background-color: var(--red-50); }
.hover\:bg-emerald-700:hover { background-color: var(--emerald-600); }
.hover\:underline:hover { text-decoration: underline; }

tr.hover\:bg-slate-50:hover { background-color: rgba(139, 92, 246, 0.06); }

/* Focus ring utilities (violet) */
.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
}

.focus\:ring-brand-500:focus {
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
    border-color: var(--brand-500);
}

/* Checkbox accent */
input[type="checkbox"].text-brand-600,
input[type="checkbox"].rounded {
    accent-color: var(--brand-600);
}

/* File input styling */
.file\:mr-4::file-selector-button { margin-right: 1rem; }
.file\:py-2::file-selector-button { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.file\:px-4::file-selector-button { padding-left: 1rem; padding-right: 1rem; }
.file\:rounded-xl::file-selector-button { border-radius: var(--radius-xl); }
.file\:border-0::file-selector-button { border: 0; }
.file\:bg-brand-50::file-selector-button { background-color: var(--brand-50); }
.file\:text-brand-700::file-selector-button { color: var(--brand-400); font-weight: 500; }

/* Bare inputs used in views without .form-input */
input[type="text"]:not(.form-input):not(.login-input),
input[type="password"]:not(.form-input):not(.login-input),
input[type="email"]:not(.form-input):not(.login-input),
input[type="number"]:not(.form-input):not(.login-input),
input[type="date"]:not(.form-input):not(.login-input),
input[type="search"]:not(.form-input):not(.login-input),
select:not(.form-select),
textarea:not(.form-textarea) {
    background-color: var(--bg-panel);
    border-color: var(--border-default);
    color: var(--text-primary);
}

input[type="text"]:not(.form-input):not(.login-input):focus,
input[type="password"]:not(.form-input):not(.login-input):focus,
input[type="email"]:not(.form-input):not(.login-input):focus,
input[type="number"]:not(.form-input):not(.login-input):focus,
input[type="date"]:not(.form-input):not(.login-input):focus,
input[type="search"]:not(.form-input):not(.login-input):focus,
select:not(.form-select):focus,
textarea:not(.form-textarea):focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25);
}

/* --------------------------------------------------------------------------
   Responsive Utilities — sm (640px+)
   -------------------------------------------------------------------------- */
@media (min-width: 640px) {
    .sm\:flex { display: flex; }
    .sm\:inline { display: inline; }
    .sm\:hidden { display: none; }
    .sm\:block { display: block; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:flex-col { flex-direction: column; }
    .sm\:items-center { align-items: center; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:gap-4 { gap: 1rem; }
    .sm\:gap-6 { gap: 1.5rem; }
    .sm\:p-10 { padding: 2.5rem; }
    .sm\:w-auto { width: auto; }
}

/* --------------------------------------------------------------------------
   Responsive Utilities — lg (1024px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1024px) {
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:flex { display: flex; }
    .lg\:inline-flex { display: inline-flex; }
    .lg\:flex-row { flex-direction: row; }
    .lg\:flex-col { flex-direction: column; }
    .lg\:items-center { align-items: center; }
    .lg\:justify-between { justify-content: space-between; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .lg\:pl-64 { padding-left: 16rem; }
    .lg\:p-5 { padding: 1.25rem; }
    .lg\:p-8 { padding: 2rem; }
    .lg\:p-12 { padding: 3rem; }
    .lg\:w-1\/2 { width: 50%; }
    .lg\:mx-0 { margin-left: 0; margin-right: 0; }
    .lg\:min-h-0 { min-height: 0; }
    .lg\:mt-0 { margin-top: 0; }
    .lg\:gap-6 { gap: 1.5rem; }
}

/* --------------------------------------------------------------------------
   Responsive Utilities — xl (1280px+)
   -------------------------------------------------------------------------- */
@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .xl\:flex { display: flex; }
    .xl\:hidden { display: none; }
}

/* --------------------------------------------------------------------------
   Animations & Misc
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.2s ease-out;
}

@media (min-width: 1024px) {
    .hover-lift:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(139, 92, 246, 0.12);
    }
}

/* Form input autofill (dark theme) */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 30px #1a1625 inset !important;
    caret-color: #fff;
}

/* Scrollbar (webkit) */
.desktop-sidebar::-webkit-scrollbar,
.mobile-drawer::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.desktop-sidebar::-webkit-scrollbar-thumb,
.mobile-drawer::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 3px;
}

.desktop-sidebar::-webkit-scrollbar-track,
.mobile-drawer::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track {
    background: transparent;
}

/* --------------------------------------------------------------------------
   7. Print Styles
   -------------------------------------------------------------------------- */
@media print {
    :root {
        --bg-deep: #fff;
        --bg-base: #fff;
        --bg-elevated: #fff;
        --bg-panel: #fff;
        --bg-hover: #f8fafc;
        --text-primary: #0f172a;
        --text-secondary: #1e293b;
        --text-muted: #64748b;
        --border-subtle: #e2e8f0;
        --border-default: #cbd5e1;
    }

    body {
        background: #fff !important;
        background-image: none !important;
        color: #000 !important;
        font-size: 12pt;
    }

    .no-print,
    .desktop-sidebar,
    .mobile-drawer,
    .mobile-overlay,
    .admin-header,
    .menu-toggle,
    .flash-area,
    aside,
    header,
    nav {
        display: none !important;
    }

    .admin-main {
        margin-left: 0 !important;
    }

    .admin-content {
        padding: 0 !important;
    }

    .lg\:pl-64 {
        padding-left: 0 !important;
    }

    .bg-white,
    .bg-slate-50,
    .bg-slate-100,
    .card,
    .table-wrap,
    .stat-card,
    .empty-state,
    #print-area {
        background: #fff !important;
        color: #0f172a !important;
        border-color: #e2e8f0 !important;
        box-shadow: none !important;
    }

    .text-slate-800,
    .text-slate-700,
    .text-slate-600 {
        color: #1e293b !important;
    }

    .text-slate-500,
    .text-slate-400 {
        color: #64748b !important;
    }

    .text-brand-600,
    .text-brand-700 {
        color: #6d28d9 !important;
    }

    .print\:shadow-none {
        box-shadow: none !important;
    }

    .print\:rounded-none {
        border-radius: 0 !important;
    }

    .shadow-sm,
    .shadow-lg,
    .shadow-xl {
        box-shadow: none !important;
    }

    a {
        text-decoration: none;
        color: inherit;
    }

    table {
        page-break-inside: avoid;
    }

    tr {
        page-break-inside: avoid;
    }
}

/* ===== Polished page components (v3) ===== */
.user-chip { display: flex; align-items: center; gap: 0.5rem; }
.user-avatar {
    width: 2rem; height: 2rem; border-radius: 9999px;
    background: linear-gradient(135deg, #6d28d9, #8b5cf6);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
}
.brand-sub { display: block; font-size: 0.7rem; color: #94a3b8; margin-top: 0.1rem; }
.nav-section-label {
    font-size: 0.65rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: #64748b; padding: 0.75rem 0.75rem 0.35rem;
}
.dash-grid { display: grid; gap: 1rem; }
@media (min-width: 1024px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1280px) { .dash-grid { grid-template-columns: repeat(4, 1fr); } }
.list-stack { display: flex; flex-direction: column; }
.list-row {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 0; border-bottom: 1px solid rgba(139,92,246,0.08); text-decoration: none; color: inherit;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { opacity: 0.9; }
.list-title { font-size: 0.9rem; font-weight: 600; color: #f1f5f9; margin: 0; }
.list-meta { font-size: 0.75rem; color: #94a3b8; margin: 0.2rem 0 0; }
.empty-inline { color: #64748b; font-size: 0.875rem; padding: 0.5rem 0; }
.link-muted { color: #a78bfa; font-size: 0.8rem; text-decoration: none; }
.link-muted:hover { text-decoration: underline; }
.link-danger { background: none; border: none; color: #f87171; cursor: pointer; font-size: inherit; padding: 0; }
.amount { font-weight: 600; color: #c4b5fd; white-space: nowrap; }
.amount-expense { color: #f9a8d4; }
.package-price { font-size: 1.25rem; color: #a78bfa; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.page-toolbar { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 768px) {
    .page-toolbar { flex-direction: row; align-items: flex-end; justify-content: space-between; }
}
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-bar, .search-bar { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; flex: 1; }
.filter-field { display: flex; flex-direction: column; gap: 0.35rem; }
.filter-field label { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
.filter-field .form-input, .filter-field .form-select { min-width: 140px; }
.search-bar .form-input { flex: 1; min-width: 200px; }
.filter-pills { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pill {
    display: inline-flex; align-items: center; padding: 0.4rem 0.85rem; border-radius: 9999px;
    font-size: 0.8rem; font-weight: 500; color: #94a3b8;
    background: rgba(255,255,255,0.04); border: 1px solid rgba(139,92,246,0.15); text-decoration: none;
}
.pill.active, .pill:hover { color: #fff; background: rgba(124,58,237,0.25); border-color: rgba(139,92,246,0.4); }
.summary-banner {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.25rem; border-radius: 1rem;
    background: linear-gradient(135deg, rgba(109,40,217,0.25), rgba(76,29,149,0.2));
    border: 1px solid rgba(139,92,246,0.25); color: #e2e8f0;
}
.summary-banner strong { font-size: 1.25rem; color: #c4b5fd; }
.card-grid { display: grid; gap: 1rem; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .card-grid { grid-template-columns: repeat(3, 1fr); } }
.feature-card { padding: 1.25rem; }
.feature-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.feature-card-top h3 { margin: 0; font-size: 1.05rem; color: #f1f5f9; }
.feature-card-actions { display: flex; gap: 0.5rem; margin-top: auto; }
.feature-card-actions form { flex: 1; }
.feature-card-actions .btn { width: 100%; justify-content: center; }
.form-page {
    max-width: 40rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}
.form-card .card-header h2 { margin: 0 0 0.25rem; font-size: 1.15rem; color: #f8fafc; }
.form-stack { display: flex; flex-direction: column; gap: 1.15rem; }
.form-grid-2 { display: grid; gap: 1rem; }
@media (min-width: 640px) { .form-grid-2 { grid-template-columns: 1fr 1fr; } }
.form-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; padding-top: 0.5rem; }
.label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.label-row .form-label { margin-bottom: 0; }
.req { color: #f87171; }
.section-title { margin: 0; font-size: 1.1rem; color: #f8fafc; }
.muted { color: #94a3b8; font-size: 0.875rem; margin: 0.25rem 0 0; }
.list-card {
    display: flex; flex-direction: column; gap: 0.85rem;
    padding: 1rem 1.15rem; border-radius: 1rem;
    background: #15121f; border: 1px solid rgba(139,92,246,0.12); margin-bottom: 0.75rem;
}
.list-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.list-card-top h3, .list-card-main h3 { margin: 0; font-size: 0.95rem; color: #f1f5f9; }
.list-card-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.data-list { display: block; }
.table-wrap { overflow-x: auto; border-radius: 1rem; border: 1px solid rgba(139,92,246,0.12); background: #15121f; }
.lg-hidden { display: block; }
.sm-hidden { display: none; }
@media (min-width: 1024px) {
    .lg-hidden { display: none; }
    .sm-hidden { display: block; }
}
.empty-cell { text-align: center; color: #64748b; padding: 2rem !important; }
.table-actions { white-space: nowrap; }
.table-actions a, .table-actions button { margin-left: 0.75rem; color: #a78bfa; }
.table-actions .link-danger { color: #f87171; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; min-height: 36px; }
.stat-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem;
}
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .stat-grid { grid-template-columns: repeat(6, 1fr); } }
.stat-card {
    background: #15121f; border: 1px solid rgba(139,92,246,0.12);
    border-radius: 1rem; padding: 1rem 1.1rem;
    display: flex; flex-direction: column; gap: 0.5rem;
}
.stat-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.stat-value { font-size: 1.25rem; font-weight: 700; color: #f8fafc; word-break: break-word; }
.stat-card.tone-blue { border-top: 2px solid #3b82f6; }
.stat-card.tone-amber { border-top: 2px solid #f59e0b; }
.stat-card.tone-violet { border-top: 2px solid #8b5cf6; }
.stat-card.tone-red { border-top: 2px solid #ef4444; }
.stat-card.tone-green { border-top: 2px solid #10b981; }
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 1.15rem; border-bottom: 1px solid rgba(139,92,246,0.1);
}
.card-header h2 { margin: 0; font-size: 0.95rem; color: #f1f5f9; }
.card-body { padding: 0.5rem 1.15rem 1rem; }
.empty-state {
    text-align: center; padding: 2.5rem 1.5rem; color: #64748b;
    background: #15121f; border: 1px dashed rgba(139,92,246,0.2); border-radius: 1rem;
}
.inline { display: inline; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.settings-grid { display: grid; gap: 1.25rem; }
@media (min-width: 1024px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.settings-logo-preview {
    width: 4rem; height: 4rem; border-radius: 0.85rem; object-fit: cover;
    margin-bottom: 0.75rem; border: 1px solid rgba(139,92,246,0.25);
}
.progress-block { margin-bottom: 1.1rem; }
.progress-label { display: flex; justify-content: space-between; font-size: 0.85rem; color: #cbd5e1; margin-bottom: 0.4rem; }
.progress-track { height: 0.45rem; background: rgba(255,255,255,0.06); border-radius: 9999px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #6d28d9, #8b5cf6); border-radius: 9999px; }
.progress-fill.green { background: linear-gradient(90deg, #059669, #10b981); }
.text-center { text-align: center; }
.gap-2 { gap: 0.5rem; }
.flex { display: flex; }
.items-center { align-items: center; }

.max-w-2xl {
    max-width: 42rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.login-brand-center {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    min-height: 220px;
    gap: 1rem;
    padding: 2rem;
}
.login-logo-lg {
    width: 5.5rem !important;
    height: 5.5rem !important;
    font-size: 1.75rem !important;
}
.login-brand-center .login-business-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.02em;
}
