/* ============================================================================
   AdVixo Design System
   Version: 1.0.0
   
   A comprehensive design system for the AdVixo publisher monetization platform.
   Claude.ai-inspired: warm, editorial, restrained. Premium and trustworthy.
   
   Shared across: advixo.click | publisher.advixo.click | admin.advixo.click
   ============================================================================ */

/* ---------------------------------------------------------------------------
   0. FONT IMPORTS
   --------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400&display=swap');

/* ---------------------------------------------------------------------------
   1. CSS RESET / NORMALIZE
   --------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.5;
    tab-size: 4;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    line-height: 1.3;
    font-weight: 600;
    color: var(--text-primary);
}

p {
    overflow-wrap: break-word;
}

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

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

img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

img {
    border-style: none;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
    letter-spacing: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
}

input,
textarea {
    appearance: none;
    -webkit-appearance: none;
}

textarea {
    resize: vertical;
}

select {
    appearance: none;
    -webkit-appearance: none;
}

ul,
ol {
    list-style: none;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

th {
    text-align: left;
    font-weight: 600;
}

fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

legend {
    padding: 0;
}

summary {
    cursor: pointer;
    display: list-item;
}

[hidden] {
    display: none !important;
}

hr {
    border: none;
    border-top: 1px solid var(--border-default);
    margin: 24px 0;
}

code,
kbd,
samp,
pre {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    font-size: 0.9em;
}

pre {
    overflow-x: auto;
    background-color: var(--bg-inset);
    border-radius: var(--radius-md);
    padding: 16px;
}

code {
    background-color: var(--bg-inset);
    border-radius: var(--radius-sm);
    padding: 2px 6px;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

blockquote {
    border-left: 3px solid var(--accent);
    padding-left: 16px;
    margin-left: 0;
    color: var(--text-secondary);
    font-style: italic;
}

abbr[title] {
    text-decoration: underline dotted;
    cursor: help;
}

mark {
    background-color: var(--warning-subtle);
    color: inherit;
    padding: 1px 4px;
    border-radius: 2px;
}

small {
    font-size: 0.85em;
}

sub,
sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

sub {
    bottom: -0.25em;
}

sup {
    top: -0.5em;
}

::selection {
    background-color: var(--accent-subtle);
    color: var(--text-primary);
}

::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

/* ---------------------------------------------------------------------------
   2. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   --------------------------------------------------------------------------- */

:root {
    /* ---- Color Palette: Light Theme (default) ---- */
    --bg-primary: #FAF9F5;
    --bg-secondary: #F3F1EA;
    --bg-surface: #FFFFFF;
    --bg-surface-hover: #F7F6F1;
    --bg-inset: #EDEAE2;

    --text-primary: #141413;
    --text-secondary: #5C5B57;
    --text-muted: #9B9A95;

    --border-default: #E5E3DB;
    --border-strong: #D1CFC6;

    --accent: #D97757;
    --accent-hover: #C4684A;
    --accent-subtle: rgba(217, 119, 87, 0.08);
    --accent-text: #FFFFFF;

    --success: #3D8B5E;
    --success-hover: #347A51;
    --success-subtle: rgba(61, 139, 94, 0.08);

    --warning: #C68A0A;
    --warning-hover: #B07A09;
    --warning-subtle: rgba(198, 138, 10, 0.08);

    --danger: #C53030;
    --danger-hover: #B02929;
    --danger-subtle: rgba(197, 48, 48, 0.08);

    --info: #5B8DB8;
    --info-hover: #4F7FA6;
    --info-subtle: rgba(91, 141, 184, 0.08);

    /* ---- Shadows ---- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.12);

    /* ---- Border Radii ---- */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 9999px;

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

    /* ---- Z-Index Scale ---- */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-sidebar: 400;
    --z-modal-backdrop: 900;
    --z-modal: 1000;
    --z-tooltip: 1100;
    --z-toast: 9999;

    /* ---- Spacing Scale ---- */
    --space-0: 0;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 48px;

    /* ---- Font Families ---- */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;

    /* ---- Container ---- */
    --container-max: 1200px;
    --container-px: 20px;
}

/* ---- Dark Theme ---- */
[data-theme="dark"] {
    --bg-primary: #141413;
    --bg-secondary: #1C1C1A;
    --bg-surface: #242422;
    --bg-surface-hover: #2C2C2A;
    --bg-inset: #1A1A18;

    --text-primary: #E8E6DE;
    --text-secondary: #9B9A95;
    --text-muted: #6B6A66;

    --border-default: #30302E;
    --border-strong: #3D3D3A;

    --accent: #E08A6C;
    --accent-hover: #D97757;
    --accent-subtle: rgba(224, 138, 108, 0.12);
    --accent-text: #FFFFFF;

    --success: #4FA872;
    --success-hover: #3D8B5E;
    --success-subtle: rgba(79, 168, 114, 0.12);

    --warning: #D9A01D;
    --warning-hover: #C68A0A;
    --warning-subtle: rgba(217, 160, 29, 0.12);

    --danger: #E04848;
    --danger-hover: #C53030;
    --danger-subtle: rgba(224, 72, 72, 0.12);

    --info: #6A9BCC;
    --info-hover: #5B8DB8;
    --info-subtle: rgba(106, 155, 204, 0.12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.24);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.32);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.40);
}

/* Auto dark theme via system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #141413;
        --bg-secondary: #1C1C1A;
        --bg-surface: #242422;
        --bg-surface-hover: #2C2C2A;
        --bg-inset: #1A1A18;

        --text-primary: #E8E6DE;
        --text-secondary: #9B9A95;
        --text-muted: #6B6A66;

        --border-default: #30302E;
        --border-strong: #3D3D3A;

        --accent: #E08A6C;
        --accent-hover: #D97757;
        --accent-subtle: rgba(224, 138, 108, 0.12);
        --accent-text: #FFFFFF;

        --success: #4FA872;
        --success-hover: #3D8B5E;
        --success-subtle: rgba(79, 168, 114, 0.12);

        --warning: #D9A01D;
        --warning-hover: #C68A0A;
        --warning-subtle: rgba(217, 160, 29, 0.12);

        --danger: #E04848;
        --danger-hover: #C53030;
        --danger-subtle: rgba(224, 72, 72, 0.12);

        --info: #6A9BCC;
        --info-hover: #5B8DB8;
        --info-subtle: rgba(106, 155, 204, 0.12);

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.16);
        --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.24);
        --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.32);
        --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.40);
    }
}

/* ---------------------------------------------------------------------------
   3. TYPOGRAPHY
   --------------------------------------------------------------------------- */

/* ---- Type Scale ---- */
.text-xs   { font-size: 12px; line-height: 1.5; }
.text-sm   { font-size: 13px; line-height: 1.5; }
.text-base { font-size: 14px; line-height: 1.5; }
.text-md   { font-size: 15px; line-height: 1.5; }
.text-lg   { font-size: 16px; line-height: 1.5; }
.text-xl   { font-size: 18px; line-height: 1.4; }
.text-2xl  { font-size: 20px; line-height: 1.4; }
.text-3xl  { font-size: 24px; line-height: 1.3; }
.text-4xl  { font-size: 32px; line-height: 1.2; }
.text-5xl  { font-size: 40px; line-height: 1.1; }
.text-6xl  { font-size: 48px; line-height: 1.1; }

/* ---- Font Weights ---- */
.font-normal   { font-weight: 400; }
.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

/* ---- Line Heights ---- */
.leading-tight   { line-height: 1.3; }
.leading-normal  { line-height: 1.5; }
.leading-relaxed { line-height: 1.7; }

/* ---- Text Colors ---- */
.text-primary   { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted     { color: var(--text-muted); }
.text-accent    { color: var(--accent); }
.text-success   { color: var(--success); }
.text-warning   { color: var(--warning); }
.text-danger    { color: var(--danger); }
.text-info      { color: var(--info); }
.text-white     { color: #FFFFFF; }

/* ---- Font Family ---- */
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); }

/* ---- Text Alignment ---- */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ---- Text Decoration ---- */
.underline   { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }
.uppercase   { text-transform: uppercase; }
.lowercase   { text-transform: lowercase; }
.capitalize  { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* ---- Text Wrapping & Overflow ---- */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.break-words {
    overflow-wrap: break-word;
    word-break: break-word;
}

.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre    { white-space: pre; }

/* ---- Letter Spacing ---- */
.tracking-tight  { letter-spacing: -0.02em; }
.tracking-normal { letter-spacing: 0; }
.tracking-wide   { letter-spacing: 0.02em; }
.tracking-wider  { letter-spacing: 0.05em; }

/* ---- Headings ---- */
h1, .h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

h2, .h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

h3, .h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

h4, .h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

h5, .h5 {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 4px;
}

h6, .h6 {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

@media (min-width: 768px) {
    h1, .h1 { font-size: 40px; }
    h2, .h2 { font-size: 28px; }
    h3, .h3 { font-size: 22px; }
}

@media (min-width: 1200px) {
    h1, .h1 { font-size: 48px; margin-bottom: 20px; }
    h2, .h2 { font-size: 32px; margin-bottom: 16px; }
    h3, .h3 { font-size: 24px; margin-bottom: 12px; }
}

/* ---------------------------------------------------------------------------
   4. LAYOUT UTILITIES
   --------------------------------------------------------------------------- */

/* ---- Container ---- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-px);
    padding-right: var(--container-px);
}

.container-sm  { max-width: 640px; }
.container-md  { max-width: 768px; }
.container-lg  { max-width: 1024px; }
.container-xl  { max-width: 1200px; }
.container-2xl { max-width: 1440px; }

/* ---- Display ---- */
.block        { display: block; }
.inline       { display: inline; }
.inline-block { display: inline-block; }
.hidden       { display: none; }
.flex         { display: flex; }
.inline-flex  { display: inline-flex; }
.grid         { display: grid; }

/* ---- Flexbox ---- */
.flex-col     { flex-direction: column; }
.flex-row     { flex-direction: row; }
.flex-wrap    { flex-wrap: wrap; }
.flex-nowrap  { flex-wrap: nowrap; }

.items-start    { align-items: flex-start; }
.items-center   { align-items: center; }
.items-end      { align-items: flex-end; }
.items-stretch  { align-items: stretch; }
.items-baseline { align-items: baseline; }

.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around  { justify-content: space-around; }
.justify-evenly  { justify-content: space-evenly; }

.self-start  { align-self: flex-start; }
.self-center { align-self: center; }
.self-end    { align-self: flex-end; }

.flex-1    { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-none { flex: none; }
.shrink-0  { flex-shrink: 0; }
.grow-0    { flex-grow: 0; }

/* ---- Gap ---- */
.gap-0    { gap: 0; }
.gap-xs   { gap: 4px; }
.gap-sm   { gap: 8px; }
.gap-md   { gap: 12px; }
.gap-base { gap: 16px; }
.gap-lg   { gap: 20px; }
.gap-xl   { gap: 24px; }
.gap-2xl  { gap: 32px; }
.gap-3xl  { gap: 48px; }

/* ---- Grid ---- */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }

.grid-cols-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-cols-auto-fill {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }
.col-span-full { grid-column: 1 / -1; }

/* ---- Width ---- */
.w-full  { width: 100%; }
.w-auto  { width: auto; }
.w-half  { width: 50%; }
.w-third { width: 33.333%; }

.max-w-xs  { max-width: 320px; }
.max-w-sm  { max-width: 480px; }
.max-w-md  { max-width: 640px; }
.max-w-lg  { max-width: 768px; }
.max-w-xl  { max-width: 1024px; }
.max-w-2xl { max-width: 1280px; }
.max-w-full { max-width: 100%; }
.max-w-none { max-width: none; }

.min-w-0 { min-width: 0; }

/* ---- Height ---- */
.h-full   { height: 100%; }
.h-screen { height: 100vh; }
.h-auto   { height: auto; }
.min-h-screen { min-height: 100vh; }

/* ---- Overflow ---- */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-scroll  { overflow: scroll; }
.overflow-x-auto  { overflow-x: auto; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-visible { overflow: visible; }

/* ---- Position ---- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; top: 0; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0   { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0  { left: 0; }

/* ---- Spacing (Margin) ---- */
.m-0  { margin: 0; }
.m-1  { margin: 4px; }
.m-2  { margin: 8px; }
.m-3  { margin: 12px; }
.m-4  { margin: 16px; }
.m-5  { margin: 20px; }
.m-6  { margin: 24px; }
.m-7  { margin: 32px; }
.m-8  { margin: 48px; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mx-0 { margin-left: 0; margin-right: 0; }
.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-3 { margin-left: 12px; margin-right: 12px; }
.mx-4 { margin-left: 16px; margin-right: 16px; }
.mx-5 { margin-left: 20px; margin-right: 20px; }
.mx-6 { margin-left: 24px; margin-right: 24px; }
.mx-7 { margin-left: 32px; margin-right: 32px; }
.mx-8 { margin-left: 48px; margin-right: 48px; }

.my-0 { margin-top: 0; margin-bottom: 0; }
.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-3 { margin-top: 12px; margin-bottom: 12px; }
.my-4 { margin-top: 16px; margin-bottom: 16px; }
.my-5 { margin-top: 20px; margin-bottom: 20px; }
.my-6 { margin-top: 24px; margin-bottom: 24px; }
.my-7 { margin-top: 32px; margin-bottom: 32px; }
.my-8 { margin-top: 48px; margin-bottom: 48px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mt-7 { margin-top: 32px; }
.mt-8 { margin-top: 48px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.mb-7 { margin-bottom: 32px; }
.mb-8 { margin-bottom: 48px; }

.ml-0 { margin-left: 0; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.ml-3 { margin-left: 12px; }
.ml-4 { margin-left: 16px; }
.ml-5 { margin-left: 20px; }
.ml-6 { margin-left: 24px; }
.ml-7 { margin-left: 32px; }
.ml-8 { margin-left: 48px; }

.mr-0 { margin-right: 0; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }
.mr-3 { margin-right: 12px; }
.mr-4 { margin-right: 16px; }
.mr-5 { margin-right: 20px; }
.mr-6 { margin-right: 24px; }
.mr-7 { margin-right: 32px; }
.mr-8 { margin-right: 48px; }

.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }

/* ---- Spacing (Padding) ---- */
.p-0  { padding: 0; }
.p-1  { padding: 4px; }
.p-2  { padding: 8px; }
.p-3  { padding: 12px; }
.p-4  { padding: 16px; }
.p-5  { padding: 20px; }
.p-6  { padding: 24px; }
.p-7  { padding: 32px; }
.p-8  { padding: 48px; }

.px-0 { padding-left: 0; padding-right: 0; }
.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.px-7 { padding-left: 32px; padding-right: 32px; }
.px-8 { padding-left: 48px; padding-right: 48px; }

.py-0 { padding-top: 0; padding-bottom: 0; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }
.py-5 { padding-top: 20px; padding-bottom: 20px; }
.py-6 { padding-top: 24px; padding-bottom: 24px; }
.py-7 { padding-top: 32px; padding-bottom: 32px; }
.py-8 { padding-top: 48px; padding-bottom: 48px; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 4px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pt-5 { padding-top: 20px; }
.pt-6 { padding-top: 24px; }
.pt-7 { padding-top: 32px; }
.pt-8 { padding-top: 48px; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 4px; }
.pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 12px; }
.pb-4 { padding-bottom: 16px; }
.pb-5 { padding-bottom: 20px; }
.pb-6 { padding-bottom: 24px; }
.pb-7 { padding-bottom: 32px; }
.pb-8 { padding-bottom: 48px; }

.pl-0 { padding-left: 0; }
.pl-1 { padding-left: 4px; }
.pl-2 { padding-left: 8px; }
.pl-3 { padding-left: 12px; }
.pl-4 { padding-left: 16px; }
.pl-5 { padding-left: 20px; }
.pl-6 { padding-left: 24px; }
.pl-7 { padding-left: 32px; }
.pl-8 { padding-left: 48px; }

.pr-0 { padding-right: 0; }
.pr-1 { padding-right: 4px; }
.pr-2 { padding-right: 8px; }
.pr-3 { padding-right: 12px; }
.pr-4 { padding-right: 16px; }
.pr-5 { padding-right: 20px; }
.pr-6 { padding-right: 24px; }
.pr-7 { padding-right: 32px; }
.pr-8 { padding-right: 48px; }

/* ---- Border ---- */
.border     { border: 1px solid var(--border-default); }
.border-0   { border: 0; }
.border-t   { border-top: 1px solid var(--border-default); }
.border-b   { border-bottom: 1px solid var(--border-default); }
.border-l   { border-left: 1px solid var(--border-default); }
.border-r   { border-right: 1px solid var(--border-default); }
.border-strong { border-color: var(--border-strong); }

.rounded-none { border-radius: 0; }
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded      { border-radius: var(--radius-md); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-xl   { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 50%; }
.rounded-pill { border-radius: var(--radius-pill); }

/* ---- Background ---- */
.bg-primary      { background-color: var(--bg-primary); }
.bg-secondary    { background-color: var(--bg-secondary); }
.bg-surface      { background-color: var(--bg-surface); }
.bg-surface-hover { background-color: var(--bg-surface-hover); }
.bg-inset        { background-color: var(--bg-inset); }
.bg-accent       { background-color: var(--accent); }
.bg-accent-subtle { background-color: var(--accent-subtle); }
.bg-success      { background-color: var(--success); }
.bg-success-subtle { background-color: var(--success-subtle); }
.bg-warning      { background-color: var(--warning); }
.bg-warning-subtle { background-color: var(--warning-subtle); }
.bg-danger       { background-color: var(--danger); }
.bg-danger-subtle { background-color: var(--danger-subtle); }
.bg-info         { background-color: var(--info); }
.bg-info-subtle  { background-color: var(--info-subtle); }
.bg-transparent  { background-color: transparent; }

/* ---- Shadow ---- */
.shadow-none { box-shadow: none; }
.shadow-sm   { box-shadow: var(--shadow-sm); }
.shadow      { box-shadow: var(--shadow-md); }
.shadow-md   { box-shadow: var(--shadow-md); }
.shadow-lg   { box-shadow: var(--shadow-lg); }
.shadow-xl   { box-shadow: var(--shadow-xl); }

/* ---- Opacity ---- */
.opacity-0   { opacity: 0; }
.opacity-25  { opacity: 0.25; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* ---- Cursor ---- */
.cursor-pointer  { cursor: pointer; }
.cursor-default  { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-grab     { cursor: grab; }

/* ---- Pointer Events ---- */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ---- User Select ---- */
.select-none { user-select: none; }
.select-all  { user-select: all; }
.select-text { user-select: text; }

/* ---------------------------------------------------------------------------
   5. COMPONENT BASE STYLES
   --------------------------------------------------------------------------- */

/* ========== BUTTONS ========== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Primary */
.btn-primary {
    background-color: var(--accent);
    color: var(--accent-text);
    border-color: var(--accent);
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    border-color: var(--accent-hover);
    color: var(--accent-text);
}

.btn-primary:active {
    transform: translateY(1px);
}

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

.btn-secondary:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.btn-secondary:active {
    background-color: var(--bg-inset);
}

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

.btn-ghost:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-ghost:active {
    background-color: var(--bg-inset);
}

/* Danger */
.btn-danger {
    background-color: var(--danger);
    color: #FFFFFF;
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    border-color: var(--danger-hover);
    color: #FFFFFF;
}

/* Success */
.btn-success {
    background-color: var(--success);
    color: #FFFFFF;
    border-color: var(--success);
}

.btn-success:hover {
    background-color: var(--success-hover);
    border-color: var(--success-hover);
    color: #FFFFFF;
}

/* Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
    border-radius: var(--radius-lg);
}

.btn-lg svg {
    width: 18px;
    height: 18px;
}

/* Icon button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    flex-shrink: 0;
}

.btn-icon.btn-sm {
    width: 28px;
    height: 28px;
}

.btn-icon.btn-lg {
    width: 44px;
    height: 44px;
}

/* Pill shape */
.btn-pill {
    border-radius: var(--radius-pill);
}

/* Disabled */
.btn:disabled,
.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* Loading */
.btn-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 600ms linear infinite;
    opacity: 1;
}

.btn-primary.btn-loading::after {
    border-color: var(--accent-text);
    border-right-color: transparent;
}

/* Button Group */
.btn-group {
    display: inline-flex;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.btn-group .btn + .btn {
    margin-left: -1px;
}

/* ========== FORM ELEMENTS ========== */

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.4;
}

.form-label-required::after {
    content: ' *';
    color: var(--danger);
}

.form-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:hover {
    border-color: var(--border-strong);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.form-input.is-error {
    border-color: var(--danger);
}

.form-input.is-error:focus {
    box-shadow: 0 0 0 3px var(--danger-subtle);
}

.form-input.is-success {
    border-color: var(--success);
}

.form-input:disabled,
.form-input.is-disabled {
    background-color: var(--bg-inset);
    color: var(--text-muted);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-input-sm {
    padding: 7px 10px;
    font-size: 13px;
}

.form-input-lg {
    padding: 14px 18px;
    font-size: 15px;
}

/* Select */
.form-select {
    display: block;
    width: 100%;
    padding: 10px 38px 10px 14px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235C5B57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-select:hover {
    border-color: var(--border-strong);
}

.form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Textarea */
.form-textarea {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-textarea:hover {
    border-color: var(--border-strong);
}

.form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Checkbox */
.form-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 4px;
    background-color: var(--bg-surface);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    position: relative;
}

.form-checkbox input[type="checkbox"]:hover {
    border-color: var(--accent);
}

.form-checkbox input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

.form-checkbox input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #FFFFFF;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Radio */
.form-radio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.form-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    background-color: var(--bg-surface);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    position: relative;
}

.form-radio input[type="radio"]:hover {
    border-color: var(--accent);
}

.form-radio input[type="radio"]:checked {
    border-color: var(--accent);
    background-color: var(--bg-surface);
}

.form-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background-color: var(--accent);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.form-radio input[type="radio"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Toggle / Switch */
.form-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    user-select: none;
}

.form-toggle input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 40px;
    height: 22px;
    border-radius: var(--radius-pill);
    background-color: var(--border-strong);
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
    position: relative;
}

.form-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background-color: #FFFFFF;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.form-toggle input[type="checkbox"]:checked {
    background-color: var(--accent);
}

.form-toggle input[type="checkbox"]:checked::after {
    transform: translateX(18px);
}

.form-toggle input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hint & Error text */
.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.4;
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 6px;
    line-height: 1.4;
}

/* Input group with icon or prefix */
.form-input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.form-input-group .form-input {
    flex: 1;
}

.form-input-icon {
    position: relative;
}

.form-input-icon .form-input {
    padding-left: 40px;
}

.form-input-icon svg,
.form-input-icon .input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.form-input-icon-right .form-input {
    padding-right: 40px;
    padding-left: 14px;
}

.form-input-icon-right svg,
.form-input-icon-right .input-icon {
    left: auto;
    right: 14px;
}

/* ========== CARDS ========== */

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
}

.card-compact {
    padding: 16px;
}

.card-flush {
    padding: 0;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-default);
    gap: 12px;
}

.card-flush .card-header {
    padding: 20px 24px;
    margin-bottom: 0;
}

.card-header-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.card-header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-body {
    /* Default body area */
}

.card-flush .card-body {
    padding: 20px 24px;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-default);
}

.card-flush .card-footer {
    padding: 16px 24px;
    margin-top: 0;
}

.card-hoverable {
    transition: box-shadow var(--transition-base), transform var(--transition-base);
    cursor: pointer;
}

.card-hoverable:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-accent {
    border-top: 3px solid var(--accent);
}

/* ========== TABLES ========== */

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.data-table thead {
    background-color: var(--bg-inset);
}

.data-table th {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-default);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-default);
    color: var(--text-primary);
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

.data-table .td-actions {
    text-align: right;
    white-space: nowrap;
}

.data-table .td-number {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-size: 13px;
}

.data-table .td-status {
    width: 120px;
}

.data-table .td-checkbox {
    width: 40px;
    padding-right: 0;
}

/* Responsive card layout for tables on mobile */
@media (max-width: 767px) {
    .table-responsive-cards .table-wrapper {
        border: none;
        border-radius: 0;
        overflow: visible;
    }

    .table-responsive-cards thead {
        display: none;
    }

    .table-responsive-cards tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .table-responsive-cards tr {
        display: flex;
        flex-direction: column;
        background-color: var(--bg-surface);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-lg);
        padding: 16px;
    }

    .table-responsive-cards td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border-bottom: none;
    }

    .table-responsive-cards td::before {
        content: attr(data-label);
        font-size: 13px;
        font-weight: 500;
        color: var(--text-secondary);
        flex-shrink: 0;
        margin-right: 16px;
    }

    .table-responsive-cards td:not(:last-child) {
        border-bottom: 1px solid var(--border-default);
        padding-bottom: 10px;
        margin-bottom: 4px;
    }
}

/* ========== BADGES ========== */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    vertical-align: middle;
}

.badge svg {
    width: 12px;
    height: 12px;
}

.badge-success {
    background-color: var(--success-subtle);
    color: var(--success);
}

.badge-warning {
    background-color: var(--warning-subtle);
    color: var(--warning);
}

.badge-danger {
    background-color: var(--danger-subtle);
    color: var(--danger);
}

.badge-info {
    background-color: var(--info-subtle);
    color: var(--info);
}

.badge-neutral {
    background-color: var(--bg-inset);
    color: var(--text-secondary);
}

.badge-accent {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

.badge-dot {
    padding-left: 6px;
}

.badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    flex-shrink: 0;
}

.badge-pill {
    border-radius: var(--radius-pill);
    padding: 2px 10px;
}

.badge-lg {
    padding: 4px 12px;
    font-size: 13px;
}

/* ========== MODALS ========== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: var(--z-modal-backdrop);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--bg-surface);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: var(--z-modal);
    transform: translateY(10px) scale(0.98);
    transition: transform var(--transition-base);
}

.modal-overlay.is-active .modal {
    transform: translateY(0) scale(1);
}

.modal-sm { max-width: 400px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-default);
    gap: 16px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

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

.modal-close:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-default);
}

/* ========== TOASTS ========== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    pointer-events: auto;
    animation: slideInRight var(--transition-slow) ease forwards;
    position: relative;
    overflow: hidden;
}

.toast-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin-top: 1px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 0 var(--radius-lg);
    transition: width linear;
}

.toast-success { border-left: 3px solid var(--success); }
.toast-success .toast-icon { color: var(--success); }
.toast-success .toast-progress { background-color: var(--success); }

.toast-error { border-left: 3px solid var(--danger); }
.toast-error .toast-icon { color: var(--danger); }
.toast-error .toast-progress { background-color: var(--danger); }

.toast-warning { border-left: 3px solid var(--warning); }
.toast-warning .toast-icon { color: var(--warning); }
.toast-warning .toast-progress { background-color: var(--warning); }

.toast-info { border-left: 3px solid var(--info); }
.toast-info .toast-icon { color: var(--info); }
.toast-info .toast-progress { background-color: var(--info); }

.toast.is-exiting {
    animation: slideOutRight var(--transition-base) ease forwards;
}

/* ========== SKELETON LOADING ========== */

.skeleton {
    background-color: var(--bg-inset);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.15) 50%,
        transparent 100%
    );
    animation: shimmer 1.8s ease-in-out infinite;
}

[data-theme="dark"] .skeleton::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
}

.skeleton-text {
    height: 14px;
    margin-bottom: 10px;
    width: 100%;
}

.skeleton-text:last-child {
    width: 70%;
    margin-bottom: 0;
}

.skeleton-heading {
    height: 24px;
    width: 50%;
    margin-bottom: 16px;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-card {
    padding: 24px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
}

.skeleton-btn {
    height: 36px;
    width: 100px;
    border-radius: var(--radius-md);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md);
}

/* ========== EMPTY STATE ========== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 24px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-inset);
    border-radius: 50%;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* ========== BREADCRUMBS ========== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.breadcrumb-item a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    color: var(--text-muted);
    font-size: 11px;
    user-select: none;
}

.breadcrumb-active {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========== DROPDOWNS ========== */

.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    padding: 4px;
}

.dropdown-menu.is-open,
.dropdown.is-open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu-right {
    left: auto;
    right: 0;
}

.dropdown-menu-up {
    top: auto;
    bottom: calc(100% + 4px);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

.dropdown-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.dropdown-item.is-active {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

.dropdown-item.is-danger {
    color: var(--danger);
}

.dropdown-item.is-danger:hover {
    background-color: var(--danger-subtle);
}

.dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.dropdown-item.is-active svg {
    color: var(--accent);
}

.dropdown-item.is-danger svg {
    color: var(--danger);
}

.dropdown-item:disabled,
.dropdown-item.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-default);
    margin: 4px 0;
}

.dropdown-header {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== PAGINATION ========== */

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    border: none;
    background: none;
    padding: 0 8px;
}

.page-btn:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.page-btn.active {
    background-color: var(--accent);
    color: var(--accent-text);
}

.page-btn.active:hover {
    background-color: var(--accent-hover);
}

.page-btn:disabled,
.page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-btn svg {
    width: 16px;
    height: 16px;
}

.page-ellipsis {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    user-select: none;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
    margin-left: 16px;
}

/* ========== TABS ========== */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-default);
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color var(--transition-fast);
    border: none;
    background: none;
    text-decoration: none;
}

.tab::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: transparent;
    transition: background-color var(--transition-fast);
    border-radius: 2px 2px 0 0;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent);
}

.tab.active::after {
    background-color: var(--accent);
}

.tab svg {
    width: 16px;
    height: 16px;
}

.tab-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background-color: var(--bg-inset);
    color: var(--text-muted);
}

.tab.active .tab-badge {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

/* Pill Tabs variant */
.tabs-pills {
    border-bottom: none;
    gap: 4px;
    background-color: var(--bg-inset);
    padding: 4px;
    border-radius: var(--radius-md);
    width: fit-content;
}

.tabs-pills .tab {
    border-radius: var(--radius-sm);
    padding: 8px 16px;
}

.tabs-pills .tab::after {
    display: none;
}

.tabs-pills .tab.active {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

/* ========== STAT CARDS ========== */

.stat-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.stat-value-sm {
    font-size: 20px;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

.stat-trend svg {
    width: 14px;
    height: 14px;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

.stat-trend.neutral {
    color: var(--text-muted);
}

.stat-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon-accent {
    background-color: var(--accent-subtle);
    color: var(--accent);
}

.stat-icon-success {
    background-color: var(--success-subtle);
    color: var(--success);
}

.stat-icon-warning {
    background-color: var(--warning-subtle);
    color: var(--warning);
}

.stat-icon-info {
    background-color: var(--info-subtle);
    color: var(--info);
}

.stat-icon-danger {
    background-color: var(--danger-subtle);
    color: var(--danger);
}

/* ========== TOOLTIPS ========== */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background-color: var(--text-primary);
    color: var(--bg-primary);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: var(--z-tooltip);
}

.tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border: 4px solid transparent;
    border-top-color: var(--text-primary);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    z-index: var(--z-tooltip);
}

.tooltip:hover::after,
.tooltip:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip positions */
.tooltip-bottom::after {
    top: calc(100% + 6px);
    bottom: auto;
    transform: translateX(-50%) translateY(-4px);
}

.tooltip-bottom::before {
    top: calc(100% + 2px);
    bottom: auto;
    transform: translateX(-50%) translateY(-4px);
    border-top-color: transparent;
    border-bottom-color: var(--text-primary);
}

.tooltip-bottom:hover::after,
.tooltip-bottom:hover::before {
    transform: translateX(-50%) translateY(0);
}

.tooltip-left::after {
    bottom: auto;
    left: auto;
    right: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
}

.tooltip-left::before {
    bottom: auto;
    left: auto;
    right: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%) translateX(4px);
    border-top-color: transparent;
    border-left-color: var(--text-primary);
}

.tooltip-left:hover::after,
.tooltip-left:hover::before {
    transform: translateY(-50%) translateX(0);
}

.tooltip-right::after {
    bottom: auto;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
}

.tooltip-right::before {
    bottom: auto;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%) translateX(-4px);
    border-top-color: transparent;
    border-right-color: var(--text-primary);
}

.tooltip-right:hover::after,
.tooltip-right:hover::before {
    transform: translateY(-50%) translateX(0);
}

/* ========== ALERTS ========== */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border-left: 3px solid transparent;
    font-size: 14px;
    line-height: 1.5;
}

.alert svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert-info {
    background-color: var(--info-subtle);
    border-left-color: var(--info);
    color: var(--text-primary);
}

.alert-info svg {
    color: var(--info);
}

.alert-success {
    background-color: var(--success-subtle);
    border-left-color: var(--success);
    color: var(--text-primary);
}

.alert-success svg {
    color: var(--success);
}

.alert-warning {
    background-color: var(--warning-subtle);
    border-left-color: var(--warning);
    color: var(--text-primary);
}

.alert-warning svg {
    color: var(--warning);
}

.alert-danger {
    background-color: var(--danger-subtle);
    border-left-color: var(--danger);
    color: var(--text-primary);
}

.alert-danger svg {
    color: var(--danger);
}

.alert-dismissible {
    padding-right: 40px;
    position: relative;
}

.alert-dismiss-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.alert-dismiss-btn:hover {
    background-color: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

.alert-dismiss-btn svg {
    width: 14px;
    height: 14px;
}

/* ========== AVATAR ========== */

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-subtle);
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl { width: 64px; height: 64px; font-size: 24px; }

.avatar-group {
    display: flex;
}

.avatar-group .avatar {
    border: 2px solid var(--bg-surface);
    margin-left: -8px;
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

/* ========== DIVIDER ========== */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-default);
}

.divider:empty::after {
    display: none;
}

.divider:empty {
    height: 1px;
    background-color: var(--border-default);
}

.divider:empty::before {
    display: none;
}

/* ========== TAG / CHIP ========== */

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-inset);
    border-radius: var(--radius-pill);
}

.tag svg {
    width: 14px;
    height: 14px;
}

.tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-muted);
}

.tag-remove:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.tag-remove svg {
    width: 10px;
    height: 10px;
}

/* ========== PROGRESS BAR ========== */

.progress {
    width: 100%;
    height: 6px;
    background-color: var(--bg-inset);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    background-color: var(--accent);
    transition: width var(--transition-slow);
}

.progress-bar-success { background-color: var(--success); }
.progress-bar-warning { background-color: var(--warning); }
.progress-bar-danger  { background-color: var(--danger); }
.progress-bar-info    { background-color: var(--info); }

.progress-sm { height: 4px; }
.progress-lg { height: 10px; }

/* ========== SPINNER ========== */

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-default);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
.spinner-xl { width: 48px; height: 48px; border-width: 3px; }

/* ========== SIDEBAR NAV ========== */

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    margin: 1px 8px;
}

.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--accent-subtle);
    color: var(--accent);
    font-weight: 500;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item .nav-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: var(--radius-pill);
    background-color: var(--bg-inset);
    color: var(--text-muted);
}

.nav-item.active .nav-badge {
    background-color: var(--accent);
    color: var(--accent-text);
}

/* ========== SEARCH BOX ========== */

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding: 9px 14px 9px 38px;
    font-size: 14px;
    color: var(--text-primary);
    background-color: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

.search-box svg {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-box .search-shortcut {
    position: absolute;
    right: 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 2px 6px;
    background-color: var(--bg-inset);
    border-radius: 4px;
    border: 1px solid var(--border-default);
    pointer-events: none;
}

/* ---------------------------------------------------------------------------
   6. ANIMATIONS
   --------------------------------------------------------------------------- */

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

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

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

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

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

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

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation utility classes */
.animate-fadeIn {
    animation: fadeIn var(--transition-base) ease forwards;
}

.animate-fadeOut {
    animation: fadeOut var(--transition-base) ease forwards;
}

.animate-slideUp {
    animation: slideUp var(--transition-slow) ease forwards;
}

.animate-slideDown {
    animation: slideDown var(--transition-slow) ease forwards;
}

.animate-slideInRight {
    animation: slideInRight var(--transition-slow) ease forwards;
}

.animate-slideInLeft {
    animation: slideInLeft var(--transition-slow) ease forwards;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-spin {
    animation: spin 600ms linear infinite;
}

.animate-bounce {
    animation: bounce 1s ease-in-out infinite;
}

.animate-scaleIn {
    animation: scaleIn var(--transition-base) ease forwards;
}

/* Staggered animation delays for lists */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
.stagger-6 { animation-delay: 300ms; }
.stagger-7 { animation-delay: 350ms; }
.stagger-8 { animation-delay: 400ms; }

/* ---------------------------------------------------------------------------
   7. SCROLLBAR STYLING
   --------------------------------------------------------------------------- */

/* Webkit browsers (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border-strong);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

/* ---------------------------------------------------------------------------
   8. RESPONSIVE UTILITIES
   --------------------------------------------------------------------------- */

/* ---- Visibility ---- */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
    .show-desktop { display: none !important; }
}

@media (min-width: 768px) {
    .hide-desktop { display: none !important; }
    .show-mobile { display: none !important; }
}

/* ---- Responsive Grid ---- */
@media (min-width: 480px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .lg\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

@media (min-width: 1200px) {
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .xl\:grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

/* ---- Responsive Flex ---- */
@media (min-width: 768px) {
    .md\:flex       { display: flex; }
    .md\:flex-row   { flex-direction: row; }
    .md\:flex-col   { flex-direction: column; }
    .md\:items-center { align-items: center; }
    .md\:justify-between { justify-content: space-between; }
}

@media (min-width: 1024px) {
    .lg\:flex       { display: flex; }
    .lg\:flex-row   { flex-direction: row; }
}

/* ---- Responsive Text Alignment ---- */
@media (max-width: 767px) {
    .sm\:text-center { text-align: center; }
    .sm\:text-left   { text-align: left; }
}

@media (min-width: 768px) {
    .md\:text-left   { text-align: left; }
    .md\:text-center { text-align: center; }
    .md\:text-right  { text-align: right; }
}

/* ---- Responsive Display ---- */
@media (max-width: 767px) {
    .sm\:hidden { display: none !important; }
    .sm\:block  { display: block !important; }
    .sm\:flex   { display: flex !important; }
}

@media (min-width: 768px) {
    .md\:hidden { display: none !important; }
    .md\:block  { display: block !important; }
    .md\:flex   { display: flex !important; }
    .md\:inline-flex { display: inline-flex !important; }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: none !important; }
    .lg\:block  { display: block !important; }
    .lg\:flex   { display: flex !important; }
}

/* ---- Responsive Spacing ---- */
@media (max-width: 767px) {
    .sm\:p-3  { padding: 12px; }
    .sm\:p-4  { padding: 16px; }
    .sm\:px-3 { padding-left: 12px; padding-right: 12px; }
    .sm\:px-4 { padding-left: 16px; padding-right: 16px; }
    .sm\:py-4 { padding-top: 16px; padding-bottom: 16px; }
    .sm\:py-6 { padding-top: 24px; padding-bottom: 24px; }
    .sm\:mb-4 { margin-bottom: 16px; }
    .sm\:mb-6 { margin-bottom: 24px; }
    .sm\:gap-sm { gap: 8px; }
    .sm\:gap-md { gap: 12px; }
}

@media (min-width: 768px) {
    .md\:p-6 { padding: 24px; }
    .md\:p-7 { padding: 32px; }
    .md\:px-6 { padding-left: 24px; padding-right: 24px; }
    .md\:py-8 { padding-top: 48px; padding-bottom: 48px; }
    .md\:mb-0 { margin-bottom: 0; }
    .md\:ml-6 { margin-left: 24px; }
    .md\:gap-lg { gap: 20px; }
    .md\:gap-xl { gap: 24px; }
}

/* ---- Responsive Column Span ---- */
@media (max-width: 767px) {
    .sm\:col-span-full { grid-column: 1 / -1; }
}

/* ---- Responsive Width ---- */
@media (min-width: 768px) {
    .md\:w-auto { width: auto; }
    .md\:w-half { width: 50%; }
}

/* ---- Responsive Container Adjustments ---- */
@media (max-width: 480px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ---------------------------------------------------------------------------
   9. PRINT STYLES
   --------------------------------------------------------------------------- */

@media print {
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    a,
    a:visited {
        text-decoration: underline;
        color: #000 !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666 !important;
    }

    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    h1 { font-size: 24pt; }
    h2 { font-size: 18pt; }
    h3 { font-size: 14pt; }

    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }

    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    table {
        border-collapse: collapse !important;
    }

    table th,
    table td {
        border: 1px solid #ccc !important;
        padding: 8px !important;
    }

    .card {
        border: 1px solid #ccc !important;
        page-break-inside: avoid;
    }

    /* Hide interactive/navigational elements */
    .btn,
    .modal-overlay,
    .toast-container,
    .dropdown-menu,
    .tooltip::after,
    .tooltip::before,
    nav,
    .sidebar,
    .breadcrumb,
    .pagination,
    .tabs,
    .search-box,
    .form-toggle,
    .no-print {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    /* Full width for print */
    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }

    .grid {
        display: block !important;
    }

    .grid > * {
        margin-bottom: 16px;
    }
}

.no-print {
    /* Normal display */
}

.print-only {
    display: none;
}

/* ---------------------------------------------------------------------------
   10. ACCESSIBILITY
   --------------------------------------------------------------------------- */

/* ---- Focus Visible ---- */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 99999;
    padding: 12px 20px;
    background-color: var(--accent);
    color: var(--accent-text);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 16px;
}

/* ---- Screen Reader Only ---- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only-focusable:focus {
    position: static;
    width: auto;
    height: auto;
    padding: inherit;
    margin: inherit;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .skeleton::after {
        animation: none;
    }
}

/* ---- High Contrast Mode ---- */
@media (forced-colors: active) {
    .btn {
        border: 1px solid ButtonText;
    }

    .badge {
        border: 1px solid currentColor;
    }

    .form-input,
    .form-select,
    .form-textarea {
        border: 1px solid ButtonText;
    }

    .form-checkbox input[type="checkbox"],
    .form-radio input[type="radio"] {
        border: 2px solid ButtonText;
    }

    .card {
        border: 1px solid CanvasText;
    }
}

/* ---------------------------------------------------------------------------
   11. UTILITY HELPERS
   --------------------------------------------------------------------------- */

/* Clearfix */
.clearfix::after {
    content: '';
    display: table;
    clear: both;
}

/* Visually hide but keep in layout (for spacing) */
.invisible {
    visibility: hidden;
}

/* Full-bleed sections */
.full-bleed {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

/* Aspect ratio containers */
.aspect-square  { aspect-ratio: 1; }
.aspect-video   { aspect-ratio: 16 / 9; }
.aspect-photo   { aspect-ratio: 4 / 3; }

/* Object fit for images/video */
.object-cover   { object-fit: cover; }
.object-contain { object-fit: contain; }
.object-fill    { object-fit: fill; }
.object-center  { object-position: center; }

/* Centering helpers */
.center-flex {
    display: flex;
    align-items: center;
    justify-content: center;
}

.center-absolute {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Float clear */
.float-left  { float: left; }
.float-right { float: right; }
.float-none  { float: none; }

/* List reset with content lists */
.list-disc {
    list-style: disc;
    padding-left: 20px;
}

.list-decimal {
    list-style: decimal;
    padding-left: 20px;
}

.list-disc li,
.list-decimal li {
    margin-bottom: 4px;
}

/* Text monospace for numbers/code */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Clickable whole row/card */
.clickable-row {
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.clickable-row:hover {
    background-color: var(--bg-surface-hover);
}

/* Truncate with line clamping */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Scrollable areas */
.scroll-smooth { scroll-behavior: smooth; }
.scroll-snap-x { scroll-snap-type: x mandatory; overflow-x: auto; }
.scroll-snap-start { scroll-snap-align: start; }

/* Transition utilities */
.transition-none { transition: none !important; }
.transition-all  { transition: all var(--transition-base); }
.transition-colors { transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast); }

/* Backdrop blur for overlays */
.backdrop-blur {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Sticky header support */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

/* Notification dot */
.notification-dot {
    position: relative;
}

.notification-dot::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-surface);
}

/* Code inline and block */
.code-inline {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background-color: var(--bg-inset);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: var(--accent);
}

.code-block {
    font-family: var(--font-mono);
    font-size: 13px;
    background-color: var(--bg-inset);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    line-height: 1.6;
    border: 1px solid var(--border-default);
}

/* Revenue / Money display */
.money {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-weight: 600;
}

.money-lg {
    font-size: 28px;
    letter-spacing: -0.02em;
}

/* Separator utility (vertical line between inline items) */
.separator::before {
    content: '';
    width: 1px;
    height: 16px;
    background-color: var(--border-default);
    margin: 0 12px;
    display: inline-block;
    vertical-align: middle;
}

/* ============================================================================
   END OF ADVIXO DESIGN SYSTEM
   ============================================================================ */
