/**
 * Base Styles - Design System Foundation
 * ~120 lines | Core variables, resets, and base element styles
 * 
 * TABLE OF CONTENTS (search "--- SECTION:"):
 * -------------------------------------------
 * VARIABLES    line 15     Color palette, spacing, typography tokens
 * RESETS       line 55     Universal box-sizing, margin/padding reset
 * SCROLLBAR    line 70     Custom scrollbar styling (webkit + firefox)
 * BASE         line 95     Body, links, buttons base styles
 */

/* --- SECTION: VARIABLES --- */
:root {
    /* Color Palette - Context Colors */
    --ctx-profile: #F7931A;  /* FrisiLogix Orange */
    --ctx-security: #fb923c;
    --ctx-access: #38bdf8;   /* Sky Blue for distinct accents */
    --ctx-admin: #94a3b8;

    /* Neutrals - Modern Deep Slate Theme */
    --bg-body: #0d1117;      /* Deepest Slate (Rich Dark) */
    --bg-surface: #161b22;   /* Slightly lighter surface */
    --bg-surface-hover: #21262d; /* Lighter interaction state */
    
    --text-primary: #f0f6fc; /* Off-white for less eye strain */
    --text-secondary: #8b949e; /* Muted slate text */
    
    --border-light: #30363d; /* Subtle separation border */
    
    --primary: #F7931A;
    --primary-hover: #e8860e;
    --primary-soft: rgba(247, 147, 26, 0.15); /* For subtle highlights */
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-light: #f87171;
    --danger-lighter: #fca5a5;

    --success: #22c55e;
    --success-hover: #16a34a;

    --accent-blue: #3b82f6;
    --accent-blue-light: #60a5fa;

    --border-hover: #444c56;
    --border-subtle: rgba(255, 255, 255, 0.08);

    --scrollbar-track: rgba(22, 27, 34, 0.35);
    --scrollbar-thumb: rgba(247, 147, 26, 0.65);
    --scrollbar-thumb-hover: rgba(247, 147, 26, 0.9);

    /* Spacing & Layout */
    --container-width: 1400px; /* Slightly wider for modern dashboards */
    --radius-lg: 12px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --header-height: 72px;
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- SECTION: RESETS --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    outline: none;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* --- SECTION: SCROLLBAR --- */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 999px;
    border: 2px solid var(--scrollbar-track);
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* --- SECTION: BASE --- */
body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { 
    text-decoration: none; 
    color: inherit; 
    transition: color 0.2s; 
}

button { 
    font-family: inherit; 
}

/* Mobile viewport height fix */
@media (max-width: 640px) {
    :root {
        --header-height: 60px;
    }

    body {
        min-height: 100dvh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        -webkit-text-size-adjust: 100%;
        touch-action: pan-y pinch-zoom;
    }

    input, select, textarea {
        font-size: 16px !important;
    }
}
