/* ==========================================================================
   Bill Tracker — JARVIS Theme
   Dark HUD aesthetic inspired by status.freaklabs.dev
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts — Orbitron (display), Rajdhani (body), Share Tech Mono (data)
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700&family=Rajdhani:wght@400;500;600;700&family=Share+Tech+Mono&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */
:root {
    /* Jarvis palette */
    --color-base: #0a0e17;
    --color-surface: #0d1117;
    --color-surface-raised: #151b28;
    --color-surface-overlay: #1c2333;

    /* Accent — cyan / electric blue */
    --color-primary: #00d4ff;
    --color-primary-hover: #33ddff;
    --color-primary-light: #00d4ff;
    --color-primary-glow: rgba(0, 212, 255, 0.15);
    --color-primary-dim: #0ea5e9;

    /* Semantic colors */
    --color-success: #22c55e;
    --color-success-bg: rgba(34, 197, 94, 0.10);
    --color-warning: #f59e0b;
    --color-warning-bg: rgba(245, 158, 11, 0.10);
    --color-danger: #ef4444;
    --color-danger-bg: rgba(239, 68, 68, 0.10);
    --color-info: #0ea5e9;
    --color-info-bg: rgba(14, 165, 233, 0.10);

    /* Text */
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-inverse: #0a0e17;

    /* Borders — cyan-tinted */
    --border-subtle: rgba(0, 212, 255, 0.08);
    --border-default: rgba(0, 212, 255, 0.15);
    --border-strong: rgba(0, 212, 255, 0.25);

    /* Glass / card */
    --glass-bg: rgba(14, 165, 233, 0.04);
    --glass-bg-heavy: rgba(13, 17, 23, 0.85);
    --glass-blur: 12px;
    --glass-border: 1px solid rgba(0, 212, 255, 0.12);
    --glass-shadow: 0 0 15px rgba(0, 212, 255, 0.08), 0 0 30px rgba(0, 212, 255, 0.03);

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 28px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-family: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-xs: 0.75rem;
    --font-sm: 0.8125rem;
    --font-base: 0.875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.25rem;
    --font-2xl: 1.5rem;
    --font-3xl: 1.875rem;
    --font-4xl: 2.25rem;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --radius-2xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;

    /* Layout */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --topbar-height: 52px;
    --content-max-width: 1400px;

    /* Z-index */
    --z-sidebar: 100;
    --z-topbar: 110;
    --z-overlay: 200;
    --z-modal: 300;
    --z-toast: 400;
    --z-tooltip: 500;
}

/* --------------------------------------------------------------------------
   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;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-base);
    font-weight: 400;
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--color-base);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --------------------------------------------------------------------------
   Scanline Overlay — CRT / holographic effect
   -------------------------------------------------------------------------- */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 212, 255, 0.015) 2px,
        rgba(0, 212, 255, 0.015) 4px
    );
    pointer-events: none;
    z-index: 9999;
}

/* --------------------------------------------------------------------------
   Grid Background — blueprint / HUD coordinates
   -------------------------------------------------------------------------- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

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

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

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

ul, ol {
    list-style: none;
}

::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Scrollbar — thin cyan
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-base);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.25);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.4);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.25) var(--color-base);
}

/* --------------------------------------------------------------------------
   HUD Corner Decorations
   -------------------------------------------------------------------------- */
.hud-corners {
    position: relative;
}

.hud-corners::before,
.hud-corners::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-style: solid;
    border-width: 0;
    border-color: var(--color-primary);
    pointer-events: none;
    z-index: 2;
}

.hud-corners::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.hud-corners::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

/* --------------------------------------------------------------------------
   Glow Effect
   -------------------------------------------------------------------------- */
.glow-blue {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.12), 0 0 30px rgba(0, 212, 255, 0.04);
}

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: var(--line-height-tight);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary);
}

h1 { font-size: var(--font-3xl); }
h2 { font-size: var(--font-2xl); }
h3 { font-size: var(--font-xl); }
h4 { font-size: var(--font-lg); }
h5 { font-size: var(--font-md); }
h6 { font-size: var(--font-base); }

/* Section labels — small uppercase HUD labels */
.section-label,
.nav-section-label {
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-primary-color { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger, .text-error { color: var(--color-danger); }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: var(--font-sm); }
.text-xs { font-size: var(--font-xs); }
.text-lg { font-size: var(--font-lg); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   Layout Utilities
   -------------------------------------------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.mt-auto { margin-top: auto; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */
.login-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-4);
    background: var(--color-base);
}

/* Grid background on login */
.login-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, black 20%, transparent 70%);
}

.login-card {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: var(--space-10);
    background: var(--color-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    text-align: center;
}

/* Arc reactor logo */
.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: var(--space-6);
    position: relative;
}

.login-logo::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid transparent;
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: arc-spin 3s linear infinite;
}

.login-logo::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(0, 212, 255, 0.3);
    border-radius: 50%;
    animation: arc-pulse 2s ease-in-out infinite;
}

.login-logo i,
.login-logo svg {
    color: var(--color-primary);
    font-size: 1.5rem;
    z-index: 1;
}

@keyframes arc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes arc-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

.login-title {
    font-family: var(--font-display);
    font-size: var(--font-2xl);
    font-weight: 700;
    margin-bottom: var(--space-2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.login-subtitle {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    margin-bottom: var(--space-8);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.login-form .form-group {
    margin-bottom: var(--space-5);
    text-align: left;
}

.login-form .btn {
    margin-top: var(--space-4);
}

.login-error {
    color: var(--color-danger);
    font-size: var(--font-sm);
    margin-top: var(--space-3);
    min-height: 20px;
}

/* ==========================================================================
   APP SHELL & LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(13, 17, 23, 0.9);
    border-right: 1px solid var(--border-default);
    z-index: var(--z-sidebar);
    transition: width var(--transition-slow), transform var(--transition-slow);
    overflow: hidden;
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.sidebar-logo i,
.sidebar-logo svg {
    color: var(--color-primary);
    font-size: 1.125rem;
}

.sidebar-logo span {
    font-family: var(--font-display);
    font-size: var(--font-md);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
    background: rgba(0, 212, 255, 0.08);
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.sidebar-nav {
    flex: 1;
    padding: var(--space-3);
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section-label {
    display: block;
    padding: var(--space-4) var(--space-3) var(--space-2);
    font-size: var(--font-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    opacity: 0.7;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    margin-bottom: 2px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-base);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    position: relative;
    text-decoration: none;
    border: 1px solid transparent;
    min-height: 40px;
    letter-spacing: 0.03em;
}

.nav-link i,
.nav-link svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.nav-link span {
    opacity: 1;
    transition: opacity var(--transition-base);
}

.nav-link:hover {
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.1);
}

.nav-link.active {
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.08), inset 0 0 10px rgba(0, 212, 255, 0.04);
}

.nav-link.active i,
.nav-link.active svg {
    color: var(--color-primary);
}

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

.btn-logout {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-size: var(--font-base);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-logout:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Collapsed sidebar */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-logo span,
.sidebar-collapsed .nav-section-label,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .btn-logout span {
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: var(--space-4) var(--space-2);
}

.sidebar-collapsed .sidebar-toggle {
    display: none;
}

.sidebar-collapsed .sidebar-nav {
    padding: var(--space-3) var(--space-2);
}

.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: var(--space-2);
    gap: 0;
}

.sidebar-collapsed .btn-logout {
    justify-content: center;
}

.sidebar-collapsed .sidebar-footer {
    padding: var(--space-4) var(--space-2);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* --------------------------------------------------------------------------
   Mobile Top Bar
   -------------------------------------------------------------------------- */
.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid var(--border-default);
    z-index: var(--z-topbar);
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--space-4);
}

.mobile-menu-btn,
.btn-logout-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.08);
}

.btn-logout-mobile:hover {
    color: var(--color-danger);
    background: var(--color-danger-bg);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-family: var(--font-display);
    font-size: var(--font-md);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.mobile-logo i {
    font-size: 1rem;
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: calc(var(--z-sidebar) - 1);
    opacity: 0;
    transition: opacity var(--transition-slow);
}

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

/* --------------------------------------------------------------------------
   Main Content Area
   -------------------------------------------------------------------------- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: var(--space-6);
    transition: margin-left var(--transition-slow);
    position: relative;
    z-index: 1;
}

.view-container {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* Page header */
.page-header,
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.page-header h1,
.view-header h1 {
    font-family: var(--font-display);
    font-size: var(--font-2xl);
    letter-spacing: 0.08em;
    color: var(--color-primary);
}

.page-header h1 i,
.view-header h1 i {
    margin-right: var(--space-2);
    opacity: 0.7;
}

/* ==========================================================================
   VIEW TRANSITIONS
   ========================================================================== */
.view-enter {
    animation: viewEnter 0.35s ease forwards;
}

.view-exit {
    animation: viewExit 0.25s ease forwards;
}

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

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

/* ==========================================================================
   GLASS CARD — with HUD corners and glow
   ========================================================================== */
.glass-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    padding: var(--space-6);
    position: relative;
    overflow: visible;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    margin-bottom: var(--space-5);
}

/* HUD corners on glass cards */
.glass-card::before,
.glass-card::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-style: solid;
    border-width: 0;
    border-color: var(--color-primary);
    pointer-events: none;
    z-index: 2;
}

.glass-card::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.glass-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.glass-card:hover {
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.12), 0 0 40px rgba(0, 212, 255, 0.05);
}

.glass-card h2 {
    font-family: var(--font-display);
    font-size: var(--font-lg);
    letter-spacing: 0.08em;
    color: var(--color-primary);
    margin-bottom: var(--space-4);
}

.glass-card h2 i {
    margin-right: var(--space-2);
    opacity: 0.7;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-header h2 {
    margin-bottom: 0;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    font-family: var(--font-mono);
    font-size: var(--font-sm);
    font-weight: 400;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    outline: none;
    min-height: 36px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.btn:focus-visible {
    box-shadow: 0 0 0 2px var(--color-base), 0 0 0 4px var(--color-primary);
}

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

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

.btn i,
.btn svg {
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* Primary — cyan glow */
.btn-primary {
    background: rgba(0, 212, 255, 0.12);
    color: var(--color-primary);
    border-color: rgba(0, 212, 255, 0.35);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.btn-primary:hover {
    background: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.2);
    color: #fff;
}

/* Danger */
.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.15);
}

/* Success */
.btn-success {
    background: rgba(34, 197, 94, 0.12);
    color: var(--color-success);
    border-color: rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.5);
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.15);
}

/* Ghost */
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-default);
}

.btn-ghost:hover {
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.06);
    border-color: rgba(0, 212, 255, 0.25);
}

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

.btn-outline:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background: rgba(0, 212, 255, 0.06);
}

/* Block */
.btn-block {
    display: flex;
    width: 100%;
}

/* Size variants */
.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-xs);
    min-height: 30px;
}

.btn-lg {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-base);
    min-height: 44px;
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-group label,
.form-label {
    display: block;
    font-family: var(--font-family);
    font-size: var(--font-sm);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
    letter-spacing: 0.03em;
}

.settings-form .form-group label {
    font-family: var(--font-display);
    font-size: var(--font-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
    opacity: 0.8;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i,
.input-wrapper svg {
    position: absolute;
    left: var(--space-3);
    width: 18px;
    height: 18px;
    font-size: 1rem;
    color: var(--text-tertiary);
    pointer-events: none;
    transition: color var(--transition-fast);
    z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
    padding-left: 40px;
}

.input-wrapper:focus-within i,
.input-wrapper:focus-within svg {
    color: var(--color-primary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
input[type="url"],
input[type="tel"],
select,
textarea,
.form-control {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--font-base);
    font-weight: 400;
    color: var(--text-primary);
    background: rgba(0, 212, 255, 0.04);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
    min-height: 40px;
    line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
    color: var(--text-tertiary);
    font-family: var(--font-family);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    background: rgba(0, 212, 255, 0.06);
    box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.1), 0 0 15px rgba(0, 212, 255, 0.05);
}

input:disabled,
select:disabled,
textarea:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 01.708 0L8 8.293l2.646-2.647a.5.5 0 01.708.708l-3 3a.5.5 0 01-.708 0l-3-3a.5.5 0 010-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-3) center;
    padding-right: var(--space-8);
    cursor: pointer;
}

select option {
    background: var(--color-surface);
    color: var(--text-primary);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* Form color input */
.form-control-color {
    width: 40px;
    height: 40px;
    padding: 2px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.form-control-color::-webkit-color-swatch-wrapper { padding: 0; }
.form-control-color::-webkit-color-swatch { border: none; border-radius: 2px; }
.form-control-color::-moz-color-swatch { border: none; border-radius: 2px; }

/* --------------------------------------------------------------------------
   Checkbox
   -------------------------------------------------------------------------- */
.checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    cursor: pointer;
    user-select: none;
    font-size: var(--font-base);
    color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.checkbox-label .checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    border: 2px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: rgba(0, 212, 255, 0.04);
    transition: all var(--transition-fast);
    position: relative;
}

.checkbox-label .checkmark::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: solid var(--color-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1);
    margin-top: -1px;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    transform: rotate(45deg) scale(1);
}

/* ==========================================================================
   BADGES
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 2px var(--space-2);
    font-family: var(--font-mono);
    font-size: var(--font-xs);
    font-weight: 400;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.badge-primary {
    background: rgba(0, 212, 255, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(0, 212, 255, 0.2);
}

.badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-category {
    gap: var(--space-2);
    padding: 3px var(--space-3);
    background: rgba(0, 212, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.badge-category .badge-dot,
.color-swatch {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    display: inline-block;
}

/* ==========================================================================
   TOASTS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    z-index: var(--z-toast);
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - var(--space-12));
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow);
    pointer-events: auto;
    animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    font-family: var(--font-mono);
    font-size: var(--font-sm);
}

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

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

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

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

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

.modal-content {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - var(--space-16));
    background: var(--color-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-default);
    flex-shrink: 0;
}

.modal-title {
    font-family: var(--font-display);
    font-size: var(--font-md);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.2);
}

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

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Confirm Dialog
   -------------------------------------------------------------------------- */
.confirm-dialog {
    max-width: 420px;
    padding: var(--space-8) var(--space-6);
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--glass-shadow);
}

.confirm-icon {
    font-size: 2rem;
    margin-bottom: var(--space-4);
    color: var(--color-warning);
}

.confirm-dialog h3 {
    font-size: var(--font-lg);
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.confirm-dialog p {
    color: var(--text-secondary);
    font-size: var(--font-base);
    margin-bottom: var(--space-5);
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
}

.confirm-overlay {
    z-index: calc(var(--z-modal) + 10);
}

/* ==========================================================================
   TABLES
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-base);
}

thead th {
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 500;
    text-align: left;
    color: var(--color-primary);
    background: rgba(0, 212, 255, 0.04);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    user-select: none;
    cursor: pointer;
}

thead th:hover {
    color: var(--color-primary-hover);
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}

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

tbody tr:hover {
    background: rgba(0, 212, 255, 0.04);
}

tbody td {
    padding: var(--space-3) var(--space-4);
    color: var(--text-primary);
    vertical-align: middle;
    font-family: var(--font-family);
}

/* ==========================================================================
   PROGRESS BAR
   ========================================================================== */
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(0, 212, 255, 0.08);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   LOADING SPINNER — Arc reactor style
   ========================================================================== */
.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 2px solid rgba(0, 212, 255, 0.1);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: arc-spin 1s linear infinite;
}

.loading-placeholder {
    text-align: center;
    padding: var(--space-8);
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
    overflow: visible;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

/* HUD corners on stat cards */
.stat-card::before,
.stat-card::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-style: solid;
    border-width: 0;
    border-color: var(--color-primary);
    pointer-events: none;
}

.stat-card::before {
    top: -1px;
    left: -1px;
    border-top-width: 2px;
    border-left-width: 2px;
}

.stat-card::after {
    bottom: -1px;
    right: -1px;
    border-bottom-width: 2px;
    border-right-width: 2px;
}

.stat-card:hover {
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.12);
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.stat-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
}

.stat-card-icon.blue   { background: rgba(0, 212, 255, 0.1); color: var(--color-primary); }
.stat-card-icon.teal   { background: rgba(0, 212, 255, 0.1); color: var(--color-primary); }
.stat-card-icon.green  { background: var(--color-success-bg); color: var(--color-success); }
.stat-card-icon.amber  { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card-icon.red    { background: var(--color-danger-bg); color: var(--color-danger); }

.stat-card-value {
    font-family: var(--font-mono);
    font-size: var(--font-2xl);
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
}

.stat-card-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-primary);
    opacity: 0.7;
}

/* Chart containers */
.chart-container {
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    position: relative;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.chart-title {
    font-family: var(--font-display);
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.chart-wrapper {
    position: relative;
    width: 100%;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: auto !important;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
    margin-bottom: var(--space-6);
}

/* Upcoming list */
.upcoming-list-item {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
}

.upcoming-list-item:last-child {
    border-bottom: none;
}

.upcoming-status {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: var(--radius-full);
}

.upcoming-status.overdue  { background: var(--color-danger); box-shadow: 0 0 8px var(--color-danger); }
.upcoming-status.due-soon { background: var(--color-warning); box-shadow: 0 0 8px rgba(245, 158, 11, 0.5); }
.upcoming-status.upcoming { background: var(--color-success); }
.upcoming-status.paid     { background: var(--color-primary); }

/* Pulsing status dots */
@keyframes pulse-status {
    0%, 100% { box-shadow: 0 0 0 0 currentColor; }
    50% { box-shadow: 0 0 0 5px transparent; }
}

.upcoming-status.overdue,
.upcoming-status.due-soon {
    animation: pulse-status 2s infinite;
}

.upcoming-details { flex: 1; min-width: 0; }

.upcoming-name {
    font-size: var(--font-base);
    font-weight: 500;
}

.upcoming-date {
    font-family: var(--font-mono);
    font-size: var(--font-xs);
    color: var(--text-tertiary);
}

.upcoming-amount {
    font-family: var(--font-mono);
    font-size: var(--font-base);
    font-weight: 400;
    color: var(--color-primary);
}

/* ==========================================================================
   CHECKLIST
   ========================================================================== */
.checklist-summary {
    display: flex;
    align-items: center;
    gap: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}

.checklist-summary-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.checklist-summary-value {
    font-family: var(--font-mono);
    font-weight: 400;
    font-size: var(--font-lg);
    color: var(--color-primary);
}

.checklist-summary-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.checklist-summary-divider {
    width: 1px;
    height: 32px;
    background: var(--border-default);
}

.checklist-progress {
    flex: 1;
    min-width: 200px;
}

.checklist-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.checklist-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4) var(--space-5);
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    position: relative;
}

.checklist-card:hover {
    border-color: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.08);
}

.checklist-card.paid {
    opacity: 0.5;
}

.checklist-card.paid .checklist-card-name {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.checklist-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.checklist-card-main { flex: 1; min-width: 0; }

.checklist-card-name {
    font-size: var(--font-md);
    font-weight: 600;
    font-family: var(--font-family);
    text-transform: none;
    letter-spacing: normal;
    margin-bottom: 2px;
}

.checklist-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-family: var(--font-mono);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

.checklist-card-amount {
    font-family: var(--font-mono);
    font-size: var(--font-lg);
    color: var(--color-primary);
    white-space: nowrap;
}

.checklist-card-date {
    font-family: var(--font-mono);
    font-size: var(--font-sm);
    color: var(--text-secondary);
}

/* Status indicators */
.checklist-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: var(--radius-full);
}

.checklist-card.status-overdue::before  { background: var(--color-danger); }
.checklist-card.status-due-soon::before { background: var(--color-warning); }
.checklist-card.status-upcoming::before { background: var(--color-success); }
.checklist-card.status-paid::before     { background: var(--color-primary); }

.status-overdue  { color: var(--color-danger); }
.status-due-soon { color: var(--color-warning); }
.status-upcoming { color: var(--color-success); }
.status-paid     { color: var(--color-primary); }

/* Bulk Select Mode */
.bulk-select-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.bulk-select-checkbox input[type="checkbox"] {
    display: none;
}

.bulk-checkbox-box {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: transparent;
}

.bulk-select-checkbox:hover .bulk-checkbox-box {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}

.bulk-select-checkbox.checked .bulk-checkbox-box {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.bulk-select-checkbox.checked .bulk-checkbox-box::after {
    content: '\2713';
    color: var(--color-base);
    font-size: 14px;
    font-weight: bold;
}

.glass-card.bulk-selected {
    border-color: rgba(0, 212, 255, 0.4) !important;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.12), inset 0 0 20px rgba(0, 212, 255, 0.03);
}

.bulk-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0.75rem 1rem;
    background: rgba(10, 14, 23, 0.95);
    border-top: 1px solid rgba(0, 212, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.bulk-action-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.bulk-count {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: var(--color-primary);
    min-width: 80px;
    text-align: center;
}

#checklist-select-btn.active {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

@media (max-width: 768px) {
    .bulk-action-inner {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .bulk-action-bar {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0));
    }
}

/* ==========================================================================
   ANALYTICS
   ========================================================================== */
.analytics-filters {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    padding: var(--space-4) var(--space-5);
    background: var(--glass-bg);
    border: var(--glass-border);
    border-radius: var(--radius-lg);
}

.analytics-filters label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 0;
}

.analytics-filters select,
.analytics-filters input {
    width: auto;
    min-width: 140px;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-5);
}

.analytics-grid .chart-container {
    min-height: 300px;
}

.analytics-grid .chart-container.full-width {
    grid-column: 1 / -1;
}

/* ==========================================================================
   SETTINGS
   ========================================================================== */
.settings-form {
    max-width: 400px;
}

.color-picker-row,
.icon-input-row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.color-preview,
.icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-default);
}

.color-preview {
    border-radius: var(--radius-sm);
}

.icon-preview i {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

/* Category list */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: rgba(0, 212, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.category-item:hover {
    border-color: rgba(0, 212, 255, 0.2);
    background: rgba(0, 212, 255, 0.06);
}

.category-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.category-name {
    font-family: var(--font-family);
    font-weight: 500;
}

.category-icon {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.category-actions {
    display: flex;
    gap: var(--space-1);
}

/* Data management */
.data-management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
}

.data-section h3 {
    font-size: var(--font-md);
    margin-bottom: var(--space-2);
    color: var(--color-primary);
}

.file-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-8) var(--space-4);
    border: 2px dashed var(--border-default);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    cursor: pointer;
}

.file-drop-zone i {
    font-size: 2rem;
    margin-bottom: var(--space-3);
    color: var(--color-primary);
    opacity: 0.5;
}

.file-drop-zone:hover,
.file-drop-zone.drag-over {
    border-color: var(--color-primary);
    background: rgba(0, 212, 255, 0.04);
}

.file-drop-zone.drag-over i {
    opacity: 1;
}

.import-result-details {
    font-family: var(--font-mono);
    font-size: var(--font-sm);
}

.import-errors {
    list-style: disc;
    padding-left: var(--space-5);
    margin-top: var(--space-2);
    color: var(--color-warning);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1199px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .data-management-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .mobile-topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    }

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

    .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
        padding-top: calc(var(--topbar-height) + var(--space-4));
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }

    .sidebar-collapsed .main-content {
        margin-left: 0;
    }

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

    .page-header,
    .view-header {
        flex-direction: column;
        gap: var(--space-3);
    }

    .checklist-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    .checklist-summary-divider {
        width: 100%;
        height: 1px;
    }

    .checklist-card {
        flex-wrap: wrap;
    }

    .checklist-card-info {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-2);
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
        max-width: none;
        width: auto;
    }

    .modal-content {
        max-height: calc(100vh - var(--space-8));
    }

    .login-card {
        padding: var(--space-6);
    }

    .data-management-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */
@media print {
    body::before,
    body::after,
    .sidebar,
    .mobile-topbar,
    .toast-container,
    .modal-overlay,
    .confirm-overlay {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    body {
        background: white;
        color: black;
    }

    .glass-card {
        border: 1px solid #ccc;
        box-shadow: none;
        background: white;
    }

    .glass-card::before,
    .glass-card::after {
        display: none;
    }
}

/* Drag and drop reorder */
tr.dragging {
    opacity: 0.4;
}

tr.drag-over {
    border-top: 2px solid var(--primary, #00d4ff);
}

.drag-handle:hover {
    color: var(--primary, #00d4ff) !important;
}

/* Checklist card account number and notes */
.checklist-card-account {
    margin-top: 0.4rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #94a3b8;
}

.checklist-card-account .account-label {
    color: #64748b;
}

.checklist-card-notes {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    line-height: 1.4;
}

/* Inline pay form on checklist cards */
.inline-pay-form {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.25s ease, opacity 0.2s ease, padding 0.25s ease;
    border-top: 1px solid rgba(0, 212, 255, 0.15);
    padding: 0 1rem;
}

.inline-pay-form.open {
    max-height: 120px;
    opacity: 1;
    padding: 0.75rem 1rem;
}

.inline-pay-fields {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.inline-pay-field {
    flex: 1;
    min-width: 140px;
}

.inline-pay-field label {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.25rem;
}

.inline-pay-field .form-control {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.inline-pay-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 2px;
}
