/* ===================================================
   Y3Data Unified Design System v2.0
   Single source of truth for all UI components
   Brand: Royal Blue (#0d6efd) / Navy (#011633)
   =================================================== */

/* --- Google Fonts (Inter Only) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ==========================================
   1. DESIGN TOKENS
   ========================================== */
:root {
    /* — Brand Colors — */
    --y3-primary: #0d6efd;
    --y3-primary-hover: #0b5ed7;
    --y3-primary-soft: rgba(13, 110, 253, 0.08);
    --y3-primary-glow: rgba(13, 110, 253, 0.15);
    --y3-primary-rgb: 13, 110, 253;
    --y3-secondary: #0f172a;
    --y3-accent: #8b5cf6;

    /* — Semantic Colors — */
    --y3-success: #198754;
    --y3-success-soft: rgba(25, 135, 84, 0.1);
    --y3-danger: #dc3545;
    --y3-danger-soft: rgba(220, 53, 69, 0.1);
    --y3-warning: #ffc107;
    --y3-warning-soft: rgba(255, 193, 7, 0.1);
    --y3-info: #0dcaf0;
    --y3-info-soft: rgba(13, 202, 240, 0.1);

    /* — Neutral Palette — */
    --y3-bg: #F9FAFB;
    --y3-bg-alt: #F3F4F6;
    --y3-surface: #FFFFFF;
    --y3-surface-elevated: #FFFFFF;
    --y3-border: #E5E7EB;
    --y3-border-light: #F1F5F9;
    --y3-divider: #E2E8F0;
    --y3-text: #111827;
    --y3-text-secondary: #374151;
    --y3-text-muted: #6B7280;

    /* — Spacing (8pt grid) — */
    --y3-space-2: 2px;
    --y3-space-4: 4px;
    --y3-space-8: 8px;
    --y3-space-12: 12px;
    --y3-space-16: 16px;
    --y3-space-20: 20px;
    --y3-space-24: 24px;
    --y3-space-32: 32px;
    --y3-space-40: 40px;
    --y3-space-48: 48px;
    --y3-space-56: 56px;
    --y3-space-64: 64px;
    --y3-space-80: 80px;

    /* — Typography — */
    --y3-font: 'Inter', system-ui, -apple-system, sans-serif;
    --y3-font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    --y3-font-weight-bold: 700;
    --y3-font-weight-semibold: 600;
    --y3-font-weight-medium: 500;
    --y3-font-weight-regular: 400;

    --y3-text-display: clamp(2rem, 5vw, 3.5rem);
    --y3-text-h1: 2.25rem;
    --y3-text-h2: 1.5rem;
    --y3-text-h3: 1.25rem;
    --y3-text-h4: 1.125rem;
    --y3-text-body: 1rem;
    --y3-text-small: 0.875rem;
    --y3-text-caption: 0.75rem;
    --y3-text-micro: 0.625rem;

    --y3-line-height: 1.5;
    --y3-letter-spacing: -0.01em;

    /* — Border Radius — */
    --y3-radius-xs: 4px;
    --y3-radius-sm: 8px;
    --y3-radius-md: 12px;
    --y3-radius-lg: 20px;
    --y3-radius-xl: 32px;
    --y3-radius-2xl: 40px;
    --y3-radius-3xl: 48px;
    --y3-radius-full: 9999px;

    /* — Shadows — */
    --y3-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --y3-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
    --y3-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --y3-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --y3-shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.12);
    --y3-shadow-primary: 0 4px 14px rgba(13, 110, 253, 0.25);

    /* — Transitions — */
    --y3-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --y3-transition-fast: all 0.15s ease;

    /* — Layout — */
    --y3-sidebar-width: 280px;
    --y3-topbar-height: 72px;
    --y3-container-max: 1280px;

    /* — Gradient — */
    --y3-gradient-brand: linear-gradient(135deg, #0d6efd 0%, #011633 100%);
    --y3-gradient-glow: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
}

/* ==========================================
   2. DARK MODE TOKENS
   ========================================== */
[data-theme="dark"] {
    --y3-bg: #0A0A0A;
    --y3-bg-alt: #111111;
    --y3-surface: #141414;
    --y3-surface-elevated: #1C1C1C;
    --y3-border: #262626;
    --y3-border-light: #1A1A1A;
    --y3-divider: #262626;
    --y3-text: #F9FAFB;
    --y3-text-secondary: #D1D5DB;
    --y3-text-muted: #9CA3AF;

    --y3-primary-soft: rgba(13, 110, 253, 0.15);
    --y3-success-soft: rgba(27, 185, 84, 0.15);
    --y3-danger-soft: rgba(239, 68, 68, 0.15);
    --y3-warning-soft: rgba(245, 158, 11, 0.15);
    --y3-info-soft: rgba(59, 130, 246, 0.15);

    --y3-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
    --y3-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --y3-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --y3-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --y3-shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ==========================================
   3. BACKWARD COMPATIBILITY ALIASES
   Maps legacy --p-* and --primary etc to --y3-*
   ========================================== */
:root {
    --p-blue: var(--y3-primary);
    --p-blue-soft: var(--y3-primary-soft);
    --p-blue-hover: var(--y3-primary-hover);
    --p-blue-rgb: var(--y3-primary-rgb);
    --p-primary: var(--y3-primary);
    --p-primary-glare: var(--y3-primary-soft);
    --p-secondary: var(--y3-secondary);
    --p-accent: var(--y3-accent);
    --p-success: var(--y3-success);
    --p-danger: var(--y3-danger);
    --p-warning: var(--y3-warning);
    --p-info: var(--y3-info);
    --p-bg: var(--y3-bg);
    --p-surface: var(--y3-surface);
    --p-surface-glare: var(--y3-surface);
    --p-border: var(--y3-border);
    --p-text-main: var(--y3-text);
    --p-text-sec: var(--y3-text-secondary);
    --p-text-muted: var(--y3-text-muted);
    --p-inverse: #FFFFFF;
    --p-transition: var(--y3-transition);
    --p-transition-fast: var(--y3-transition-fast);
    --p-shadow: var(--y3-shadow-lg);
    --p-gradient-blue: var(--y3-gradient-brand);
    --p-gradient-glow: var(--y3-gradient-glow);

    /* Legacy spacing */
    --s-4: var(--y3-space-4);
    --s-8: var(--y3-space-8);
    --s-12: var(--y3-space-12);
    --s-16: var(--y3-space-16);
    --s-20: var(--y3-space-20);
    --s-24: var(--y3-space-24);
    --s-32: var(--y3-space-32);
    --s-40: var(--y3-space-40);
    --s-48: var(--y3-space-48);
    --s-64: var(--y3-space-64);
    --s-80: 80px;

    /* Legacy radius */
    --r-sm: var(--y3-radius-sm);
    --r-md: var(--y3-radius-md);
    --r-lg: var(--y3-radius-lg);
    --r-xl: 32px;
    --r-full: var(--y3-radius-full);

    /* Legacy main.css aliases */
    --primary: var(--y3-primary);
    --primary-hover: var(--y3-primary-hover);
    --primary-light: var(--y3-primary-soft);
    --primary-rgb: var(--y3-primary-rgb);
    --primary-lighter: rgba(13, 110, 253, 0.04);
    --secondary: var(--y3-secondary);
    --secondary-light: rgba(1, 22, 51, 0.05);
    --accent: var(--y3-accent);
    --accent-light: rgba(59, 130, 246, 0.1);
    --bg-body: var(--y3-bg);
    --bg-surface: var(--y3-surface);
    --bg-elevated: var(--y3-surface-elevated);
    --text-main: var(--y3-text);
    --text-secondary: var(--y3-text-secondary);
    --text-muted: var(--y3-text-muted);
    --border: var(--y3-border);
    --border-light: var(--y3-border-light);
    --divider: var(--y3-divider);
    --success: var(--y3-success);
    --danger: var(--y3-danger);
    --warning: var(--y3-warning);
    --info: var(--y3-info);
    --success-light: var(--y3-success-soft);
    --danger-light: var(--y3-danger-soft);
    --warning-light: var(--y3-warning-soft);
    --info-light: var(--y3-info-soft);
    --radius-sm: var(--y3-radius-sm);
    --radius-md: var(--y3-radius-md);
    --radius-lg: var(--y3-radius-lg);
    --radius-xl: 16px;
    --radius-full: var(--y3-radius-full);
    --font-primary: var(--y3-font);
    --font-mono: var(--y3-font-mono);
    --shadow-xs: var(--y3-shadow-xs);
    --shadow-sm: var(--y3-shadow-sm);
    --shadow-md: var(--y3-shadow-md);
    --shadow-lg: var(--y3-shadow-lg);
    --shadow-xl: var(--y3-shadow-xl);
    --shadow-primary: var(--y3-shadow-primary);
    --shadow-premium: var(--y3-shadow-lg);
    --font-primary: var(--y3-font);
    --transition: var(--y3-transition);
    --transition-fast: var(--y3-transition-fast);
    --sidebar-width: var(--y3-sidebar-width);

    /* Legacy typography */
    --f-hero: var(--y3-text-display);
    --f-h1: var(--y3-text-h1);
    --f-h2: var(--y3-text-h2);
    --f-h3: var(--y3-text-h3);
    --f-body: var(--y3-text-body);
    --f-small: var(--y3-text-small);
    --f-hero-desktop: 2.5rem;
    --f-hero-mobile: 1.75rem;

    /* Glass tokens (legacy) */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-text-main: var(--y3-text);
    --glass-text-sec: var(--y3-text-secondary);
}

[data-theme="dark"] {
    --p-inverse: #000000;
    --secondary: #F1F5F9;
    --secondary-light: rgba(255, 255, 255, 0.05);
    --primary-lighter: rgba(13, 110, 253, 0.1);
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-text-main: #F9FAFB;
    --glass-text-sec: #D1D5DB;
}

/* ==========================================
   4. BASE RESET
   ========================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--y3-font);
    background-color: var(--y3-bg);
    color: var(--y3-text);
    line-height: 1.6;
    overflow-x: hidden;
    font-size: var(--y3-text-body);
}

body.y3-bg-alt {
    background-color: var(--y3-bg-alt);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--y3-transition-fast);
}

img { max-width: 100%; display: block; }
ul { list-style: none; }

input, select, textarea, button {
    font-family: var(--y3-font);
}

::selection {
    background: var(--y3-primary);
    color: white;
}

/* ==========================================
   5. TYPOGRAPHY
   ========================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--y3-text);
}

h1 { font-size: var(--y3-text-display); letter-spacing: -0.02em; }
h2 { font-size: var(--y3-text-h1); letter-spacing: -0.01em; }
h3 { font-size: var(--y3-text-h2); }
h4 { font-size: var(--y3-text-h3); }
h5 { font-size: var(--y3-text-body); }

.text-gradient {
    background: linear-gradient(135deg, var(--y3-primary) 0%, var(--y3-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-primary { color: var(--y3-primary); }
.text-success { color: var(--y3-success); }
.text-danger { color: var(--y3-danger); }
.text-warning { color: var(--y3-warning); }
.text-muted { color: var(--y3-text-muted); }

/* ==========================================
   6. LAYOUT
   ========================================== */
.container, .y3-container {
    width: 100%;
    max-width: var(--y3-container-max);
    margin: 0 auto;
    padding: 0 var(--y3-space-24);
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.gap-1 { gap: var(--y3-space-4); }
.gap-2 { gap: var(--y3-space-8); }
.gap-3 { gap: var(--y3-space-12); }
.gap-4 { gap: var(--y3-space-16); }
.gap-6 { gap: var(--y3-space-24); }
.gap-8 { gap: var(--y3-space-32); }

/* Spacing utilities */
.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--y3-space-4); }
.mt-2 { margin-top: var(--y3-space-8); }
.mt-4 { margin-top: var(--y3-space-16); }
.mt-6 { margin-top: var(--y3-space-24); }
.mt-8 { margin-top: var(--y3-space-32); }
.mb-2 { margin-bottom: var(--y3-space-8); }
.mb-4 { margin-bottom: var(--y3-space-16); }
.mb-6 { margin-bottom: var(--y3-space-24); }
.mb-8 { margin-bottom: var(--y3-space-32); }
.pt-4 { padding-top: var(--y3-space-16); }
.pb-4 { padding-bottom: var(--y3-space-16); }

.block { display: block; }
.inline-block { display: inline-block; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); border: 0;
}

.divider {
    height: 1px;
    background: var(--y3-border);
    margin: var(--y3-space-20) 0;
}

/* ==========================================
   7. BUTTONS — Y3Data Standard System
   ========================================== */
.btn, .y3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--y3-radius-md);
    font-weight: 600;
    font-size: var(--y3-text-small);
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--y3-transition);
    gap: var(--y3-space-8);
    line-height: 1.4;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-family: var(--y3-font);
}

/* — Primary — */
.btn-primary, .y3-btn-primary {
    background: linear-gradient(135deg, var(--y3-primary) 0%, var(--y3-primary-hover) 100%);
    color: white;
    border-color: transparent;
    box-shadow: var(--y3-shadow-primary);
}
.btn-primary:hover, .y3-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.35);
}
.btn-primary:active, .y3-btn-primary:active {
    transform: translateY(0);
}

/* — Secondary — */
.btn-secondary, .y3-btn-secondary {
    background: var(--y3-secondary);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(1, 22, 51, 0.2);
}
.btn-secondary:hover, .y3-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(1, 22, 51, 0.3);
}

/* — Ghost / Outline — */
.btn-outline, .btn-ghost, .y3-btn-ghost, .y3-btn-outline {
    background: transparent;
    border-color: var(--y3-border);
    color: var(--y3-text);
}
.btn-outline:hover, .btn-ghost:hover, .y3-btn-ghost:hover, .y3-btn-outline:hover {
    background: var(--y3-primary-soft);
    border-color: var(--y3-primary);
    color: var(--y3-primary);
}

/* — Danger — */
.btn-danger, .y3-btn-danger {
    background: var(--y3-danger);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover, .y3-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

/* — Sizes — */
.btn-sm, .y3-btn-sm {
    padding: 8px 16px;
    font-size: var(--y3-text-caption);
    border-radius: var(--y3-radius-sm);
}
.btn-lg, .y3-btn-lg {
    padding: 16px 32px;
    font-size: var(--y3-text-body);
    font-weight: 700;
}

/* — States — */
.btn:disabled, .y3-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn.loading, .y3-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* — Full width — */
.y3-btn-full {
    width: 100%;
    padding: 16px;
    font-size: var(--y3-text-body);
    font-weight: 700;
    border-radius: var(--y3-radius-md);
}
.btn.loading::after, .y3-btn.loading::after {
    content: '';
    width: 16px; height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: y3-spin 0.6s linear infinite;
    margin-left: var(--y3-space-8);
}

/* — Legacy premium buttons (backward compat) — */
.btn-premium { 
    display: inline-flex; align-items: center; justify-content: center;
    padding: var(--y3-space-16) var(--y3-space-32);
    border-radius: var(--y3-radius-md); font-weight: 700;
    font-size: var(--y3-text-body); transition: var(--y3-transition-fast);
    cursor: pointer; text-decoration: none; border: 2px solid transparent;
    gap: var(--y3-space-8); position: relative; overflow: hidden;
}
.btn-premium-primary {
    background: var(--y3-primary); color: white;
    box-shadow: var(--y3-shadow-primary);
}
.btn-premium-primary:hover {
    background: var(--y3-primary-hover); transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.35);
}
.btn-premium-outline {
    background: transparent; border-color: var(--y3-border);
    color: var(--y3-text);
}
.btn-premium-outline:hover {
    border-color: var(--y3-primary); color: var(--y3-primary);
    background: var(--y3-primary-soft);
}

/* ==========================================
   8. FORMS — Unified Input System
   ========================================== */
.y3-input,
.form-input,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    min-height: 48px;
    border-radius: var(--y3-radius-md);
    border: 1.5px solid var(--y3-border);
    outline: none;
    font-size: var(--y3-text-small);
    font-family: var(--y3-font);
    color: var(--y3-text);
    background: var(--y3-surface);
    transition: var(--y3-transition);
    -webkit-appearance: none;
    appearance: none;
}

input:focus,
select:focus,
textarea:focus,
.y3-input:focus {
    border-color: var(--y3-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: var(--y3-text-muted);
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10L6 8z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

label, .y3-label {
    display: block;
    margin-bottom: var(--y3-space-8);
    font-weight: 600;
    font-size: var(--y3-text-small);
    line-height: 1.5;
    color: var(--y3-text-secondary);
    letter-spacing: 0.01em;
}

.y3-label-upper {
    font-size: var(--y3-text-caption);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--y3-text-muted);
    margin-bottom: var(--y3-space-12);
}

input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--y3-primary);
    cursor: pointer;
    min-height: auto;
}

.form-group {
    margin-bottom: var(--y3-space-24);
}

/* ==========================================
   9. CARDS — Surface & Elevated
   ========================================== */
.card, .y3-card {
    background: var(--y3-surface);
    border-radius: var(--y3-radius-lg);
    padding: var(--y3-space-24);
    border: 1px solid var(--y3-border);
    transition: var(--y3-transition);
    color: var(--y3-text);
}

.card-premium, .y3-card-elevated {
    background: var(--y3-surface);
    border-radius: var(--y3-radius-lg);
    padding: var(--y3-space-24);
    border: 1px solid var(--y3-border);
    box-shadow: var(--y3-shadow-md);
    transition: var(--y3-transition);
    text-decoration: none;
    color: var(--y3-text);
}

.card-premium:hover, .y3-card-elevated:hover {
    transform: translateY(-4px);
    border-color: var(--y3-primary);
    box-shadow: var(--y3-shadow-lg);
}

.y3-card-gradient {
    background: var(--y3-gradient-brand);
    color: white;
    border: none;
    padding: var(--y3-space-32);
    border-radius: var(--y3-radius-lg);
    box-shadow: var(--y3-shadow-xl);
    position: relative;
    overflow: hidden;
}

/* Dashboard-specific cards */
.y3-wallet-card {
    background: var(--y3-gradient-brand);
    color: white;
    border: none;
    padding: var(--y3-space-32);
    border-radius: var(--y3-radius-lg);
    position: relative;
    overflow: hidden;
}
.y3-wallet-card::before {
    content: '';
    position: absolute; right: -20px; top: -20px;
    width: 120px; height: 120px;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}

.y3-stat-card {
    background: var(--y3-surface);
    border: 1px solid var(--y3-border);
    border-radius: var(--y3-radius-lg);
    padding: var(--y3-space-32);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.y3-service-card {
    background: var(--y3-surface);
    border: 1px solid var(--y3-border);
    border-radius: var(--y3-radius-md);
    padding: var(--y3-space-24);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--y3-space-16);
    text-decoration: none;
    transition: var(--y3-transition);
    text-align: center;
    color: var(--y3-text);
}
.y3-service-card:hover {
    transform: translateY(-6px);
    border-color: var(--y3-primary);
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.1);
}
.y3-service-card h4 {
    font-size: var(--y3-text-small);
    font-weight: 700;
    margin: 0;
}

/* Legacy compat */
.service-hub-card {
    text-decoration: none;
    transition: var(--y3-transition);
}
.service-hub-card:hover {
    transform: translateY(-6px);
    border-color: var(--y3-primary) !important;
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.1);
}

/* ==========================================
   10. BADGES
   ========================================== */
.badge, .y3-badge {
    padding: 4px 12px;
    border-radius: var(--y3-radius-full);
    font-size: var(--y3-text-caption);
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
}

.badge-success, .y3-badge-success {
    background: var(--y3-success-soft);
    color: var(--y3-success);
}
.badge-danger, .y3-badge-danger {
    background: var(--y3-danger-soft);
    color: var(--y3-danger);
}
.badge-warning, .y3-badge-warning {
    background: var(--y3-warning-soft);
    color: var(--y3-warning);
}
.badge-info, .y3-badge-info {
    background: var(--y3-info-soft);
    color: var(--y3-info);
}
.badge-purple, .y3-badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

/* ==========================================
   11. TABLES
   ========================================== */
.y3-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--y3-radius-lg);
    border: 1px solid var(--y3-border);
    background: var(--y3-surface);
}

table, .y3-table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    text-align: left;
    border-bottom: 2px solid var(--y3-border);
}

thead th {
    padding: var(--y3-space-16) var(--y3-space-12);
    font-size: var(--y3-text-caption);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--y3-text-muted);
    font-weight: 700;
    white-space: nowrap;
}

tbody tr {
    border-bottom: 1px solid var(--y3-border-light);
    transition: var(--y3-transition-fast);
}

tbody tr:hover {
    background: var(--y3-primary-soft);
}

tbody td {
    padding: var(--y3-space-16) var(--y3-space-12);
    font-size: var(--y3-text-small);
}

/* ==========================================
   12. ALERTS
   ========================================== */
.alert, .y3-alert {
    padding: 14px 20px;
    border-radius: var(--y3-radius-md);
    font-size: var(--y3-text-small);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--y3-space-20);
}

.alert-success {
    background: var(--y3-success-soft);
    color: var(--y3-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.alert-danger {
    background: var(--y3-danger-soft);
    color: var(--y3-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.alert-warning {
    background: var(--y3-warning-soft);
    color: var(--y3-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.alert-info {
    background: var(--y3-info-soft);
    color: var(--y3-info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* ==========================================
   13. ICON BOXES
   ========================================== */
.icon-box, .y3-icon-box {
    width: 48px; height: 48px;
    border-radius: var(--y3-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; flex-shrink: 0;
}
.icon-box-primary { background: var(--y3-primary-soft); color: var(--y3-primary); }
.icon-box-success { background: var(--y3-success-soft); color: var(--y3-success); }

.icon-box-premium, .y3-icon-box-lg {
    width: 56px; height: 56px;
    border-radius: var(--y3-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
    background: var(--y3-primary-soft);
    color: var(--y3-primary);
}

.sh-icon {
    width: 48px; height: 48px;
    border-radius: var(--y3-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}

.feature-icon {
    width: 56px; height: 56px;
    border-radius: var(--y3-radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; margin: 0 auto var(--y3-space-20);
    transition: transform 0.3s ease;
}
.feature-icon-blue { background: var(--y3-primary-glow); color: var(--y3-primary); }
.feature-icon-green { background: var(--y3-success-soft); color: var(--y3-success); }
.feature-icon-purple { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }
.feature-icon-gold { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }

/* ==========================================
   14. GLASSMORPHISM
   ========================================== */
.glass, .glass-surface {
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--glass-border);
}

/* ==========================================
   15. SIDEBAR
   ========================================== */
.y3-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--y3-transition);
}
.y3-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.y3-sidebar-section {
    padding: var(--y3-space-4) var(--y3-space-16);
    margin-top: var(--y3-space-16);
    margin-bottom: var(--y3-space-4);
    font-size: var(--y3-text-caption);
    font-weight: 700;
    color: var(--y3-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Admin sidebar section label (backward compat) */
.sidebar-section-label {
    padding: var(--y3-space-4) var(--y3-space-16);
    margin-top: var(--y3-space-20);
    margin-bottom: var(--y3-space-8);
    font-size: 10px;
    font-weight: 800;
    color: var(--y3-text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ==========================================
   16. SCROLLBAR
   ========================================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--y3-border); border-radius: 100px; }
::-webkit-scrollbar-thumb:hover { background: var(--y3-text-muted); }

/* ==========================================
   17. ANIMATIONS
   ========================================== */
@keyframes y3-spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-fadeIn { animation: fadeIn 0.4s ease forwards; }

.stagger-children > * {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================
   18. TOOLTIP
   ========================================== */
.tooltip { position: relative; }
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px);
    left: 50%; transform: translateX(-50%);
    background: var(--y3-text); color: white;
    padding: 6px 12px; border-radius: var(--y3-radius-sm);
    font-size: var(--y3-text-caption); white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: var(--y3-transition-fast);
}
.tooltip:hover::after { opacity: 1; }

/* ==========================================
   19. ACCESSIBILITY & FOCUS SYSTEMS
   ========================================== */
/* WCAG Compliant Keyboard Focus Indicator Styles */
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible,
.y3-btn:focus-visible,
.y3-input:focus-visible {
    outline: 3px solid var(--y3-primary);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.25);
}

/* Minimum Accessible Interactive Boundaries */
.y3-btn, .btn, .y3-input, input, select, textarea {
    min-height: 48px; /* Web content accessibility guidelines 44-48px target benchmark */
}

/* ==========================================
   20. RESPONSIVE — Mobile-First Breakpoints
   ========================================== */
.mobile-flex { display: none !important; }

/* Tablets and below */
@media (max-width: 1024px) {
    .mobile-flex { display: flex !important; }
    .container, .y3-container { padding: 0 var(--y3-space-20); }
    .btn-premium { width: 100%; padding: var(--y3-space-16) var(--y3-space-24); }
}

/* Small tablets */
@media (max-width: 768px) {
    .container, .y3-container { padding: 0 var(--y3-space-16); }

    h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
    h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

    .card, .y3-card { padding: var(--y3-space-20); }
    .card-premium, .y3-card-elevated { padding: var(--y3-space-20); }
    .btn, .y3-btn { padding: 10px 20px; font-size: var(--y3-text-small); }

    .grid-cols-2.md-grid-cols-1,
    .grid-cols-3.md-grid-cols-1,
    .grid-cols-4.md-grid-cols-1 {
        grid-template-columns: 1fr !important;
    }

    /* Tables become scrollable */
    .y3-table-wrap { margin: 0 calc(-1 * var(--y3-space-16)); border-radius: 0; border-left: none; border-right: none; }
}

/* Large phones */
@media (max-width: 480px) {
    body { font-size: 14px; }
    h1 { font-size: 1.5rem; }
    .container, .y3-container { padding: 0 var(--y3-space-12); }
}


/* Sidebar Component Specifics */
.y3-sidebar {
    width: var(--y3-sidebar-width);
    height: 100vh;
    background: var(--y3-surface);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1001;
    border-right: 1px solid var(--y3-border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--y3-shadow-md);
    transition: transform 0.3s ease;
}

.y3-sidebar-header {
    padding: var(--y3-space-32) var(--y3-space-24);
    border-bottom: 1px solid var(--y3-border);
    margin-bottom: var(--y3-space-16);
}

.y3-sidebar-menu {
    flex: 1;
    padding: 0 var(--y3-space-12) var(--y3-space-24);
    overflow-y: auto;
}

.y3-sidebar-link {
    display: flex;
    align-items: center;
    gap: var(--y3-space-12);
    padding: 12px 16px;
    border-radius: var(--y3-radius-md);
    color: var(--y3-text-secondary);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 4px;
    transition: var(--y3-transition-fast);
}

.y3-sidebar-link:hover {
    background: var(--y3-primary-soft);
    color: var(--y3-primary);
}

.y3-sidebar-link.active {
    background: var(--y3-primary);
    color: white;
    font-weight: 700;
    box-shadow: var(--y3-shadow-primary);
}

.y3-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
    opacity: 0.8;
}

/* Topbar Component Specifics */
.y3-topbar {
    height: var(--y3-topbar-height);
    padding: 0 var(--y3-space-24);
    background: var(--y3-surface);
    border-bottom: 1px solid var(--y3-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.y3-topbar-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--y3-text);
    margin: 0;
    letter-spacing: -0.5px;
}

.y3-wallet-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--y3-bg-alt);
    padding: 8px 16px;
    border-radius: var(--y3-radius-full);
    color: var(--y3-text);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid var(--y3-border);
    transition: var(--y3-transition-fast);
}

.y3-wallet-pill:hover {
    border-color: var(--y3-primary);
    background: var(--y3-primary-soft);
}

.y3-btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--y3-surface);
    border: 1px solid var(--y3-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--y3-text-secondary);
    cursor: pointer;
    transition: var(--y3-transition-fast);
}

.y3-btn-circle:hover {
    background: var(--y3-primary-soft);
    color: var(--y3-primary);
    border-color: var(--y3-primary);
}

/* Mobile Toggles */
@media (max-width: 1024px) {
    .y3-sidebar { transform: translateX(-100%); }
    .y3-sidebar.active { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
}
/* 
================================================================
AUTHENTICATION MODULE LAYOUTS
================================================================
Standardized layout for: login, register, forgot-password, etc.
*/

.y3-auth-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--y3-bg-alt);
}

/* Left Side - Showcase Branding */
.y3-auth-showcase {
    flex: 1.25;
    background: linear-gradient(135deg, var(--y3-primary) 0%, var(--y3-text) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: var(--y3-space-64);
    color: white;
    position: relative;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .y3-auth-showcase { display: none; }
}

.y3-auth-showcase::before {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    top: -100px;
    right: -100px;
}

.y3-showcase-content {
    position: relative;
    z-index: 2;
    max-width: 540px;
    text-align: center;
}

.y3-showcase-content h1 {
    font-size: clamp(3rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 1;
    margin-bottom: var(--y3-space-24);
    letter-spacing: -2px;
}

.y3-showcase-content p {
    font-size: 1.15rem;
    opacity: 0.85;
    margin-bottom: var(--y3-space-48);
    line-height: 1.6;
}

/* Right Side - Form Container */
.y3-auth-form-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--y3-space-40);
    overflow-y: auto;
}

.y3-auth-card {
    background: var(--y3-surface);
    width: 100%;
    max-width: 480px;
    padding: var(--y3-space-48);
    border-radius: var(--y3-radius-3xl);
    box-shadow: var(--y3-shadow-xl);
    position: relative;
    border: 1px solid var(--y3-border);
}

.y3-auth-logo-float {
    position: absolute;
    top: -45px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    background: var(--y3-surface);
    border-radius: var(--y3-radius-2xl);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--y3-shadow-lg);
    border: 4px solid var(--y3-bg-alt);
}

.y3-auth-logo-float img {
    width: 60%;
    height: auto;
}

.y3-auth-header {
    text-align: center;
    margin-top: var(--y3-space-20);
    margin-bottom: var(--y3-space-40);
}

.y3-auth-header h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: var(--y3-space-8);
}

.y3-auth-header p {
    color: var(--y3-text-secondary);
    font-size: 0.95rem;
}

.y3-auth-footer {
    text-align: center;
    margin-top: var(--y3-space-32);
    font-size: 0.95rem;
    color: var(--y3-text-muted);
}

.y3-auth-footer a {
    color: var(--y3-primary);
    font-weight: 800;
    text-decoration: none;
}

.y3-auth-footer a:hover {
    text-decoration: underline;
}

/* Shared Elements */
.y3-password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--y3-text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.y3-password-toggle:hover {
    color: var(--y3-primary);
}

.y3-auth-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--y3-space-32);
    font-size: 0.9rem;
}

/* Feature Grid for Showcase */
.y3-auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--y3-space-20);
    width: 100%;
}

.y3-auth-feature-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: var(--y3-space-20);
    border-radius: var(--y3-radius-xl);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s var(--y3-ease-out);
}

.y3-auth-feature-item:hover {
    transform: translateY(-5px);
}

.y3-auth-feature-item i {
    font-size: 1.5rem;
    margin-bottom: var(--y3-space-12);
    display: block;
}

.y3-auth-feature-item span {
    font-size: 0.85rem;
    font-weight: 700;
}

/* Responsive Overrides */
@media (max-width: 576px) {
    .y3-auth-card {
        padding: var(--y3-space-32) var(--y3-space-24);
        box-shadow: none;
        border: none;
        background: transparent;
    }
    .y3-auth-form-container {
        padding: var(--y3-space-16);
        background: var(--y3-surface);
        align-items: flex-start;
    }
    .y3-auth-logo-float {
        display: none;
    }
}
