/* Aurea XP Global Theme - Concept A (Institutional Luxury) */
:root {
    --background: #050609;
    --surface: #0B0E13;
    --surface-2: #11161E;
    --foreground: #F5F7FA;
    --muted: #A6AFBC;
    --border: #1F2734;
    --primary: #D6AA2D;
    --primary-hover: #F0C345;
    --primary-foreground: #080A0F;
    --success: #32C98A;
    --danger: #F15B67;
    --info: #6C9FFF;
    --input: #293241;
    --ring: #D6AA2D;
    --card: #0B0E13;
    --card-foreground: #F5F7FA;
    --secondary: #151B24;
    --secondary-foreground: #F5F7FA;
    --muted-foreground: #A6AFBC;
}

html { scroll-behavior: smooth; color-scheme: dark; background: var(--background); }
body { 
    letter-spacing: -.01em; 
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% -10%, rgba(214, 170, 45, .075), transparent 28rem),
        radial-gradient(circle at 100% 12%, rgba(42, 72, 110, .12), transparent 34rem),
        var(--background);
    color: var(--foreground);
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
::selection { background: rgba(214, 170, 45, .32); color: #fff; }
a { text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, [role="button"], a { -webkit-tap-highlight-color: transparent; }
button:not(:disabled), [role="button"], a[href] { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }

/* Semantic Tailwind fallbacks. Legacy screens define these colors through
   hsl(var(--token)); the shared theme stores final color values instead. */
.bg-background { background-color: var(--background) !important; }
.bg-card { background-color: var(--card) !important; }
.bg-muted { background-color: var(--secondary) !important; }
.bg-primary { background-color: var(--primary) !important; }
.text-foreground { color: var(--foreground) !important; }
.text-muted-foreground { color: var(--muted-foreground) !important; }
.text-primary { color: var(--primary) !important; }
.text-primary-foreground { color: var(--primary-foreground) !important; }
.border-border { border-color: var(--border) !important; }
.border-input { border-color: var(--input) !important; }

/* Ambient Effects */
.noise-overlay {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.02;
    pointer-events: none;
    z-index: 9999;
}

.ambient-glow {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(214, 170, 45, 0.03) 0%, rgba(5, 6, 9, 0) 70%);
    pointer-events: none;
    z-index: 0;
    filter: blur(90px);
}

/* Surfaces */
.surface {
    background: linear-gradient(145deg, rgba(17, 22, 30, .96), rgba(9, 12, 17, .98));
    border: 1px solid var(--border);
    box-shadow: 0 18px 48px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255,255,255,.035);
    border-radius: 16px;
    position: relative;
    z-index: 10;
}

.surface-soft {
    background: linear-gradient(145deg, rgba(22, 28, 38, .88), rgba(14, 18, 25, .92));
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.glass-panel {
    background: linear-gradient(145deg, rgba(17, 22, 30, .92), rgba(7, 9, 13, .96));
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255,255,255,0.05);
    border-radius: 16px;
    position: relative;
    z-index: 10;
}

/* Inputs */
.glass-input {
    min-height: 48px;
    background: rgba(3, 5, 8, .72);
    border: 1px solid var(--border);
    color: var(--foreground);
    transition: all 0.3s ease;
}
.glass-input:focus {
    outline: none;
    border-color: rgba(214, 170, 45, 0.5);
    box-shadow: 0 0 15px rgba(214, 170, 45, 0.1);
    background: rgba(0, 0, 0, 0.4);
}
.glass-input:hover:not(:disabled) { border-color: rgba(166, 175, 188, .4); }
.glass-input::placeholder { color: #727D8C; }
select.glass-input, select { color-scheme: dark; }
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--foreground);
    -webkit-box-shadow: 0 0 0 1000px #0a0d12 inset;
    caret-color: var(--foreground);
}

/* Typography Gradient */
.text-gradient {
    background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.text-gradient-neon {
    color: var(--foreground);
    text-shadow: 0 0 20px rgba(255,255,255,0.2);
}

/* Actions */
.action-button {
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    transition: all 0.3s ease;
}
.action-button:hover {
    border-color: rgba(214, 170, 45, 0.4);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(214, 170, 45, 0.1);
}
.action-button:active { transform: translateY(0) scale(.985); }

/* Sidebar */
.sidebar-link {
    color: var(--muted);
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.sidebar-link.active {
    color: var(--foreground);
    background: linear-gradient(90deg, rgba(214, 170, 45, 0.08) 0%, transparent 100%);
    border-left: 3px solid var(--primary);
}
.sidebar-link:hover {
    color: var(--foreground);
    background: rgba(255, 255, 255, 0.03);
}

aside {
    background-image: linear-gradient(180deg, rgba(17,22,30,.98), rgba(7,9,13,.99));
    box-shadow: 24px 0 70px -52px rgba(0,0,0,.95);
}
main { isolation: isolate; }
table { font-variant-numeric: tabular-nums; }
thead th { letter-spacing: .055em; }
tbody tr { transition: background-color .18s ease; }
tbody tr:hover { background-color: rgba(214,170,45,.028); }

* { scrollbar-width: thin; scrollbar-color: #2A3340 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2A3340; border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background-color: #3A4658; }

/* States & Utilities */
:focus-visible { outline: 2px solid var(--primary) !important; outline-offset: 2px; }
.border-primary { border-color: var(--primary); }
.text-info { color: var(--info); }
.bg-info { background-color: var(--info); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Dashboard Specific Helpers */
.status-badge {
    border: 1px solid rgba(214, 170, 45, 0.3);
    border-radius: 9999px;
    background: rgba(214, 170, 45, 0.05);
    color: var(--primary);
}
.metric-value {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}
.text-warning { color: var(--primary); }
.text-info { color: var(--foreground); }
.text-muted { color: var(--muted); }

@media (max-width: 767px) {
    .glass-panel { border-radius: 18px; }
    .surface { border-radius: 14px; }
    button, [role="button"], a.action-button { min-height: 44px; }
}
