/* ============================================================
   Sthan.io Design System — Electric Blue
   Tokens + Reset + Typography + Utilities
   ============================================================ */

/* ----------------------------------------------------------
   1. DESIGN TOKENS (CSS Custom Properties)
   ---------------------------------------------------------- */
:root {
    /* Brand / Accent — Electric Blue */
    --color-brand-900: #001d3d;
    --color-brand-800: #003566;
    --color-brand-700: #005f8a;
    --color-brand-600: #0077b6;
    --color-brand-500: #0096d6;
    --color-brand-400: #00b4d8;
    --color-brand-300: #48cae4;
    --color-brand-200: #90e0ef;
    --color-brand-100: #e0f2fe;
    --color-brand-50:  #f0f7ff;

    /* Neutrals — Blue-tinted (aligned with Electric Blue theme) */
    --color-gray-950: #001229;
    --color-gray-900: #001d3d;
    --color-gray-700: #334e68;
    --color-gray-500: #829ab1;
    --color-gray-400: #a3bdd0;
    --color-gray-300: #c5d5e4;
    --color-gray-200: #d4e3f0;
    --color-gray-100: #e8f0f7;
    --color-gray-50:  #f0f7ff;
    --color-white:    #ffffff;

    /* Semantic */
    --color-success:       #16a34a;
    --color-success-dark:  #15803d;
    --color-success-light: #f0fdf4;
    --color-success-muted: #dcfce7;
    --color-success-accent:#86efac;
    --color-warning:       #d97706;
    --color-warning-dark:  #92400e;
    --color-warning-light: #fffbeb;
    --color-warning-muted: #fef3c7;
    --color-warning-accent:#fbbf24;
    --color-danger:        #dc2626;
    --color-danger-light:  #fef2f2;
    --color-danger-accent: #fca5a5;
    --color-info:          #0077b6;
    --color-info-dark:     #1d4ed8;
    --color-info-light:    #dbeafe;
    --color-info-secondary:#0284c7;
    --color-purple:        #7c3aed;
    --color-purple-light:  #f3e8ff;

    /* Typography */
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

    --text-display: 2.75rem;
    --text-h1:      2rem;
    --text-h2:      1.5rem;
    --text-h3:      1.25rem;
    --text-h4:      1.0625rem;
    --text-lg:      1.125rem;
    --text-body:    0.9375rem;
    --text-sm:      0.8125rem;
    --text-xs:      0.75rem;
    --text-code:    0.8125rem;

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

    /* Borders, Radius, Shadows */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-full: 9999px;

    --shadow-xs:  0 1px 2px rgba(0, 29, 61, 0.03);
    --shadow-sm:  0 1px 2px rgba(0, 29, 61, 0.05);
    --shadow-md:  0 4px 8px rgba(0, 29, 61, 0.06);
    --shadow-lg:  0 10px 22px rgba(0, 29, 61, 0.1);
    --shadow-xl:  0 20px 40px rgba(0, 29, 61, 0.12);

    --border-default: 1px solid var(--color-gray-200);
    --border-accent:  2px solid var(--color-brand-600);

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

    /* ==========================================================
       SEMANTIC SECTION TOKENS
       Change these to re-theme every page at once.
       ========================================================== */

    /* Page body */
    --page-bg:              var(--color-white);

    /* Hero sections (dark navy gradient — matches Electric Blue theme) */
    --hero-bg-start:        var(--color-brand-900);
    --hero-bg-mid:          var(--color-brand-800);
    --hero-bg-end:          var(--color-brand-800);
    --hero-text:            var(--color-white);
    --hero-text-muted:      rgba(255, 255, 255, 0.75);
    --hero-badge-bg:        rgba(255, 255, 255, 0.1);
    --hero-badge-border:    rgba(255, 255, 255, 0.18);

    /* Alternating content sections — white / light-blue / white */
    --section-bg-white:     var(--color-white);
    --section-bg-light:     var(--color-gray-50);
    --section-bg-accent:    var(--color-brand-50);

    /* Dark sections (features, banners) */
    --section-bg-dark:      var(--color-brand-900);
    --section-dark-text:    var(--color-white);
    --section-dark-muted:   rgba(255, 255, 255, 0.65);
    --section-dark-card-bg: rgba(255, 255, 255, 0.06);
    --section-dark-card-border: rgba(255, 255, 255, 0.1);

    /* Navbar & Footer (darkest) */
    --nav-bg:               var(--color-brand-900);
    --footer-bg:            var(--color-brand-900);

    /* Stat counters / trust bar */
    --stats-bg:             var(--color-white);
    --stats-icon-bg:        var(--color-brand-50);
    --stats-icon-color:     var(--color-brand-600);
    --stats-number-color:   var(--color-brand-900);

    /* CTA sections */
    --cta-bg:               var(--color-brand-50);
    --cta-heading-color:    var(--color-brand-900);
    --cta-text-color:       var(--color-gray-500);

    /* ==========================================================
       DASHBOARD TOKENS
       All dashboard colors flow through these variables.
       Override these in a theme class to re-skin the dashboard.
       ========================================================== */

    /* Dashboard page */
    --dash-page-bg:            var(--color-gray-50);

    /* KPI Cards */
    --dash-card-bg:            var(--color-white);
    --dash-card-border:        var(--color-gray-200);
    --dash-card-shadow:        var(--shadow-sm);
    --dash-card-shadow-hover:  var(--shadow-lg);
    --dash-card-radius:        var(--radius-lg);

    /* KPI Accent Borders */
    --dash-accent-primary:     var(--color-brand-600);
    --dash-accent-success:     var(--color-success);
    --dash-accent-danger:      var(--color-danger);
    --dash-accent-warning:     var(--color-warning);
    --dash-accent-info:        #0ea5e9;
    --dash-accent-neutral:     var(--color-gray-400);

    /* KPI Icon Gradients */
    --dash-icon-shadow:        rgba(0, 29, 61, 0.1);
    --dash-icon-primary-from:  var(--color-brand-600);
    --dash-icon-primary-to:    var(--color-brand-800);
    --dash-icon-success-from:  #11998e;
    --dash-icon-success-to:    #38ef7d;
    --dash-icon-danger-from:   #ee0979;
    --dash-icon-danger-to:     #ff6a00;
    --dash-icon-warning-from:  #f093fb;
    --dash-icon-warning-to:    #f5576c;
    --dash-icon-info-from:     var(--color-brand-500);
    --dash-icon-info-to:       #00c6ff;
    --dash-icon-neutral-from:  var(--color-gray-500);
    --dash-icon-neutral-to:    var(--color-gray-700);

    /* Dashboard Cards (chart panels) */
    --dash-panel-bg:           var(--color-white);
    --dash-panel-border:       var(--color-gray-200);
    --dash-panel-shadow:       var(--shadow-xs);
    --dash-panel-header-bg:    var(--color-gray-50);
    --dash-panel-radius:       var(--radius-md);

    /* Dashboard Pill Buttons */
    --dash-pill-bg:            transparent;
    --dash-pill-border:        var(--color-gray-900);
    --dash-pill-text:          var(--color-gray-900);
    --dash-pill-hover-bg:      var(--color-gray-900);
    --dash-pill-hover-text:    var(--color-white);
    --dash-pill-active-bg:     var(--color-gray-950);
    --dash-pill-active-text:   var(--color-white);
    --dash-pill-focus-ring:    rgba(0, 119, 182, 0.25);

    /* No Data / Empty State */
    --dash-nodata-bg:          rgba(255, 255, 255, 0.95);

    /* Trend Indicators */
    --dash-trend-up:           var(--color-success);
    --dash-trend-down:         var(--color-danger);
    --dash-trend-stable:       var(--color-gray-400);

    /* ── Chart Color Tokens ── */

    /* Volume / Requests (Blue family) */
    --chart-volume:            #0066CC;
    --chart-volume-1:          #003D7A;
    --chart-volume-2:          #0052A3;
    --chart-volume-3:          #0066CC;
    --chart-volume-4:          #1A7FE0;
    --chart-volume-5:          #3399FF;
    --chart-volume-6:          #66B3FF;
    --chart-volume-7:          #99CCFF;

    /* Success (Green family) */
    --chart-success:           #00B894;
    --chart-success-1:         #008E72;
    --chart-success-2:         #00A383;
    --chart-success-3:         #00B894;
    --chart-success-4:         #2DCE9E;
    --chart-success-5:         #5AD9AC;
    --chart-success-6:         #87E4BA;
    --chart-success-7:         #B4EFC8;

    /* Error / Critical (Semantic) */
    --chart-error-critical:    #E74C3C;
    --chart-error-warning:     #F39C12;
    --chart-error-safe:        #27AE60;

    /* Performance / Latency (Purple family) */
    --chart-perf:              #9B59B6;
    --chart-perf-1:            #6C3483;
    --chart-perf-2:            #7D3C98;
    --chart-perf-3:            #9B59B6;
    --chart-perf-4:            #AF7AC5;
    --chart-perf-5:            #C39BD3;
    --chart-perf-6:            #D7BDE2;
    --chart-perf-7:            #EBDEF0;

    /* Secondary / Teal family */
    --chart-secondary:         #16A085;
    --chart-secondary-1:       #0E6251;
    --chart-secondary-2:       #117A65;
    --chart-secondary-3:       #16A085;
    --chart-secondary-4:       #1ABC9C;
    --chart-secondary-5:       #48C9B0;
    --chart-secondary-6:       #76D7C4;
    --chart-secondary-7:       #A3E4D7;

    /* Categorical palette (multi-series charts) */
    --chart-cat-1:             #3498DB;
    --chart-cat-2:             #E74C3C;
    --chart-cat-3:             #F39C12;
    --chart-cat-4:             #27AE60;
    --chart-cat-5:             #9B59B6;
    --chart-cat-6:             #1ABC9C;
    --chart-cat-7:             #E67E22;
    --chart-cat-8:             #34495E;
    --chart-cat-9:             #16A085;
    --chart-cat-10:            #C0392B;

    /* Status code colors */
    --chart-status-2xx:        #52c41a;
    --chart-status-3xx:        #1890ff;
    --chart-status-4xx:        #faad14;
    --chart-status-5xx:        #ff4d4f;
    --chart-status-other:      #8c8c8c;

    /* Status code shade palettes (lightest variants) */
    --chart-status-2xx-s2:     #73d13d;
    --chart-status-2xx-s3:     #95de64;
    --chart-status-2xx-s4:     #b7eb8f;
    --chart-status-2xx-s5:     #d9f7be;
    --chart-status-3xx-s2:     #40a9ff;
    --chart-status-3xx-s3:     #69c0ff;
    --chart-status-3xx-s4:     #91d5ff;
    --chart-status-3xx-s5:     #bae7ff;
    --chart-status-4xx-s2:     #ffc53d;
    --chart-status-4xx-s3:     #ffd666;
    --chart-status-4xx-s4:     #ffe58f;
    --chart-status-4xx-s5:     #fff1b8;
    --chart-status-5xx-s2:     #ff7875;
    --chart-status-5xx-s3:     #ffa39e;
    --chart-status-5xx-s4:     #ffccc7;
    --chart-status-5xx-s5:     #fff1f0;
    --chart-status-other-s2:   #a6a6a6;
    --chart-status-other-s3:   #bfbfbf;
    --chart-status-other-s4:   #d9d9d9;
    --chart-status-other-s5:   #f0f0f0;

    /* Chart axes / grid */
    --chart-axis-color:        #495057;
    --chart-grid-color:        rgba(0, 0, 0, 0.05);
    --chart-tick-color:        #6c757d;
    --chart-legend-active:     #212529;
    --chart-legend-hidden:     #adb5bd;
    --chart-point-border:      #ffffff;
    --chart-segment-border:    #ffffff;
}


/* ----------------------------------------------------------
   2. CSS RESET (minimal modern reset)
   ---------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

* {
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

input, button, textarea, select {
    font: inherit;
}

p, h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

table {
    border-collapse: collapse;
}


/* ----------------------------------------------------------
   3. TYPOGRAPHY
   ---------------------------------------------------------- */
body {
    font-family: var(--font-sans);
    font-size: var(--text-body);
    font-weight: 400;
    color: var(--color-gray-900);
    background-color: var(--page-bg);
    padding-top: 56px; /* offset for fixed navbar */
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-gray-900);
    font-weight: 700;
    line-height: 1.3;
}

h1 {
    font-size: var(--text-h1);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

h2 {
    font-size: var(--text-h2);
    line-height: 1.3;
}

h3 {
    font-size: var(--text-h3);
    line-height: 1.35;
}

h4 {
    font-size: var(--text-h4);
    font-weight: 600;
    line-height: 1.4;
}

h5 {
    font-size: var(--text-body);
    font-weight: 600;
}

h6 {
    font-size: var(--text-sm);
    font-weight: 600;
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-gray-700);
    line-height: 1.6;
}

small {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

code, kbd, samp, pre {
    font-family: var(--font-mono);
    font-size: var(--text-code);
}

code {
    background-color: var(--color-gray-100);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-brand-600);
}

pre {
    background-color: var(--color-gray-100);
    padding: var(--space-4);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

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

a:not([class]) {
    color: var(--color-brand-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:not([class]):hover {
    color: var(--color-brand-700);
    text-decoration: underline;
}

hr {
    border: none;
    border-top: 1px solid var(--color-gray-200);
    margin: var(--space-6) 0;
}

strong, b {
    font-weight: 600;
}

::selection {
    background-color: var(--color-brand-100);
    color: var(--color-brand-900);
}


/* ----------------------------------------------------------
   4. UTILITY CLASSES
   ---------------------------------------------------------- */

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

/* --- Flex --- */
.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.items-end     { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-end   { justify-content: flex-end; }

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

/* --- Text Size --- */
.text-display { font-size: var(--text-display); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.text-sm      { font-size: var(--text-sm); }
.text-xs      { font-size: var(--text-xs); }
.text-body    { font-size: var(--text-body); }

/* --- Text Color --- */
.text-muted   { color: var(--color-gray-500); }
.text-white   { color: var(--color-white); }
.text-brand   { color: var(--color-brand-600); }
.text-danger  { color: var(--color-danger); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }

/* --- Font Weight --- */
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

/* --- Width --- */
.w-100 { width: 100%; }

/* --- Min-height --- */
.min-vh-100 { min-height: 100vh; }

/* --- Spacing: Margin Top --- */
.mt-0  { margin-top: 0; }
.mt-1  { margin-top: var(--space-1); }
.mt-2  { margin-top: var(--space-2); }
.mt-3  { margin-top: var(--space-3); }
.mt-4  { margin-top: var(--space-4); }
.mt-5  { margin-top: var(--space-5); }
.mt-6  { margin-top: var(--space-6); }
.mt-8  { margin-top: var(--space-8); }
.mt-10 { margin-top: var(--space-10); }
.mt-12 { margin-top: var(--space-12); }
.mt-16 { margin-top: var(--space-16); }
.mt-20 { margin-top: var(--space-20); }

/* --- Spacing: Margin Bottom --- */
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: var(--space-1); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-3  { margin-bottom: var(--space-3); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-5  { margin-bottom: var(--space-5); }
.mb-6  { margin-bottom: var(--space-6); }
.mb-8  { margin-bottom: var(--space-8); }
.mb-10 { margin-bottom: var(--space-10); }
.mb-12 { margin-bottom: var(--space-12); }
.mb-16 { margin-bottom: var(--space-16); }
.mb-20 { margin-bottom: var(--space-20); }

/* --- Spacing: Margin Inline --- */
.ms-1 { margin-inline-start: var(--space-1); }
.ms-2 { margin-inline-start: var(--space-2); }
.ms-3 { margin-inline-start: var(--space-3); }
.ms-4 { margin-inline-start: var(--space-4); }
.me-1 { margin-inline-end: var(--space-1); }
.me-2 { margin-inline-end: var(--space-2); }
.me-3 { margin-inline-end: var(--space-3); }
.me-4 { margin-inline-end: var(--space-4); }

/* --- Spacing: Padding --- */
.p-0  { padding: 0; }
.p-1  { padding: var(--space-1); }
.p-2  { padding: var(--space-2); }
.p-3  { padding: var(--space-3); }
.p-4  { padding: var(--space-4); }
.p-5  { padding: var(--space-5); }
.p-6  { padding: var(--space-6); }
.p-8  { padding: var(--space-8); }

.px-0  { padding-left: 0; padding-right: 0; }
.px-2  { padding-left: var(--space-2); padding-right: var(--space-2); }
.px-3  { padding-left: var(--space-3); padding-right: var(--space-3); }
.px-4  { padding-left: var(--space-4); padding-right: var(--space-4); }
.px-5  { padding-left: var(--space-5); padding-right: var(--space-5); }
.px-6  { padding-left: var(--space-6); padding-right: var(--space-6); }
.px-8  { padding-left: var(--space-8); padding-right: var(--space-8); }

.py-0  { padding-top: 0; padding-bottom: 0; }
.py-2  { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.py-3  { padding-top: var(--space-3); padding-bottom: var(--space-3); }
.py-4  { padding-top: var(--space-4); padding-bottom: var(--space-4); }
.py-5  { padding-top: var(--space-5); padding-bottom: var(--space-5); }
.py-6  { padding-top: var(--space-6); padding-bottom: var(--space-6); }
.py-8  { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.py-10 { padding-top: var(--space-10); padding-bottom: var(--space-10); }
.py-12 { padding-top: var(--space-12); padding-bottom: var(--space-12); }
.py-16 { padding-top: var(--space-16); padding-bottom: var(--space-16); }
.py-20 { padding-top: var(--space-20); padding-bottom: var(--space-20); }

.pt-4  { padding-top: var(--space-4); }
.pt-6  { padding-top: var(--space-6); }
.pt-8  { padding-top: var(--space-8); }
.pb-4  { padding-bottom: var(--space-4); }
.pb-6  { padding-bottom: var(--space-6); }
.pb-8  { padding-bottom: var(--space-8); }

/* --- Gap --- */
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --- Position --- */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky   { position: sticky; }
.sticky-top { position: sticky; top: 0; z-index: 5; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-auto   { overflow: auto; }

/* --- Border Radius --- */
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }

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

/* ==================================================================
   Bootstrap-Compatible Utilities
   These aliases let existing HTML work without Bootstrap CSS.
   ================================================================== */

/* --- Display (Bootstrap names) --- */
.d-flex        { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block       { display: block; }
.d-inline-block { display: inline-block; }
.d-inline      { display: inline; }
.d-none        { display: none; }
.d-grid        { display: grid; }

/* --- Flex (Bootstrap names) --- */
.justify-content-start   { justify-content: flex-start; }
.justify-content-end     { justify-content: flex-end; }
.justify-content-center  { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around  { justify-content: space-around; }
.align-items-start   { align-items: flex-start; }
.align-items-end     { align-items: flex-end; }
.align-items-center  { align-items: center; }
.align-items-stretch { align-items: stretch; }
.align-self-start    { align-self: flex-start; }
.align-self-end      { align-self: flex-end; }
.align-self-center   { align-self: center; }
.flex-grow-0 { flex-grow: 0; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-column  { flex-direction: column; }
.flex-row     { flex-direction: row; }

/* --- Text (Bootstrap names) --- */
.text-secondary { color: var(--color-gray-400); }
.text-primary   { color: var(--color-brand-600); }
.text-info      { color: var(--color-info); }
.text-dark      { color: var(--color-gray-900); }
.text-light     { color: var(--color-gray-300); }
.text-body      { color: var(--color-gray-700); }
.text-decoration-none { text-decoration: none; }
.text-decoration-underline { text-decoration: underline; }
.text-nowrap { white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.lh-1  { line-height: 1; }
.lh-sm { line-height: 1.25; }
.lh-base { line-height: 1.5; }

/* --- Font (Bootstrap names) --- */
.small      { font-size: 0.875rem; }
.fw-bold    { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal  { font-weight: 400; }
.fw-light   { font-weight: 300; }
.fst-italic { font-style: italic; }
.font-monospace { font-family: 'JetBrains Mono', monospace; }

/* --- Dimensions (Bootstrap names) --- */
.h-100   { height: 100%; }
.w-25    { width: 25%; }
.w-50    { width: 50%; }
.w-75    { width: 75%; }
.w-auto  { width: auto; }
.mw-100  { max-width: 100%; }
.img-fluid { max-width: 100%; height: auto; }

/* --- Background (Bootstrap names) --- */
.bg-white       { background-color: var(--color-white); }
.bg-light       { background-color: var(--color-gray-50); }
.bg-dark        { background-color: var(--color-gray-900); }
.bg-transparent { background-color: transparent; }
.bg-body        { background-color: var(--color-gray-50); }
.bg-primary-subtle { background-color: color-mix(in srgb, var(--color-brand-600) 12%, white); }
.bg-success-subtle { background-color: color-mix(in srgb, var(--color-success) 12%, white); }
.bg-danger-subtle  { background-color: color-mix(in srgb, var(--color-danger) 12%, white); }
.bg-warning-subtle { background-color: color-mix(in srgb, var(--color-warning) 12%, white); }
.bg-info-subtle    { background-color: color-mix(in srgb, var(--color-info) 12%, white); }
.bg-secondary-subtle { background-color: color-mix(in srgb, var(--color-gray-500) 12%, white); }

/* --- Border (Bootstrap names) --- */
.border        { border: 1px solid var(--color-gray-200); }
.border-0      { border: 0; }
.border-top    { border-top: 1px solid var(--color-gray-200); }
.border-bottom { border-bottom: 1px solid var(--color-gray-200); }
.border-start  { border-left: 1px solid var(--color-gray-200); }
.border-end    { border-right: 1px solid var(--color-gray-200); }
.rounded       { border-radius: var(--radius-md); }
.rounded-0     { border-radius: 0; }
.rounded-circle { border-radius: 50%; }
.rounded-pill  { border-radius: 50rem; }

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

/* --- Visibility --- */
.visible   { visibility: visible; }
.invisible { visibility: hidden; }

/* --- Position helpers --- */
.top-0    { top: 0; }
.bottom-0 { bottom: 0; }
.start-0  { left: 0; }
.end-0    { right: 0; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed    { position: fixed; }
.position-sticky   { position: sticky; }

/* --- Auto margins --- */
.mx-auto { margin-left: auto; margin-right: auto; }
.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }

/* --- Responsive display --- */
@media (min-width: 576px) {
    .d-sm-flex  { display: flex; }
    .d-sm-block { display: block; }
    .d-sm-none  { display: none; }
}
@media (min-width: 768px) {
    .d-md-flex  { display: flex; }
    .d-md-block { display: block; }
    .d-md-none  { display: none; }
}
@media (min-width: 992px) {
    .d-lg-flex  { display: flex; }
    .d-lg-block { display: block; }
    .d-lg-none  { display: none; }
}
@media (min-width: 1200px) {
    .d-xl-flex  { display: flex; }
    .d-xl-block { display: block; }
    .d-xl-none  { display: none; }
}

/* --- Bootstrap Row/Col Grid --- */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}
.row.g-0 { margin-right: 0; margin-left: 0; }
.row.g-0 > * { padding-right: 0; padding-left: 0; }
.row.g-2 { --_gx: 0.5rem; margin-right: calc(var(--_gx) * -0.5); margin-left: calc(var(--_gx) * -0.5); }
.row.g-2 > * { padding-right: calc(var(--_gx) * 0.5); padding-left: calc(var(--_gx) * 0.5); margin-top: var(--_gx); }
.row.g-3 { --_gx: 1rem; margin-right: calc(var(--_gx) * -0.5); margin-left: calc(var(--_gx) * -0.5); }
.row.g-3 > * { padding-right: calc(var(--_gx) * 0.5); padding-left: calc(var(--_gx) * 0.5); margin-top: var(--_gx); }
.row.g-4 { --_gx: 1.5rem; margin-right: calc(var(--_gx) * -0.5); margin-left: calc(var(--_gx) * -0.5); }
.row.g-4 > * { padding-right: calc(var(--_gx) * 0.5); padding-left: calc(var(--_gx) * 0.5); margin-top: var(--_gx); }

.col      { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1  { width: 8.333333%; }
.col-2  { width: 16.666667%; }
.col-3  { width: 25%; }
.col-4  { width: 33.333333%; }
.col-5  { width: 41.666667%; }
.col-6  { width: 50%; }
.col-7  { width: 58.333333%; }
.col-8  { width: 66.666667%; }
.col-9  { width: 75%; }
.col-10 { width: 83.333333%; }
.col-11 { width: 91.666667%; }
.col-12 { width: 100%; }

@media (min-width: 576px) {
    .col-sm-3  { width: 25%; }
    .col-sm-4  { width: 33.333333%; }
    .col-sm-6  { width: 50%; }
    .col-sm-8  { width: 66.666667%; }
    .col-sm-9  { width: 75%; }
    .col-sm-12 { width: 100%; }
}
@media (min-width: 768px) {
    .col-md-2  { width: 16.666667%; }
    .col-md-3  { width: 25%; }
    .col-md-4  { width: 33.333333%; }
    .col-md-5  { width: 41.666667%; }
    .col-md-6  { width: 50%; }
    .col-md-7  { width: 58.333333%; }
    .col-md-8  { width: 66.666667%; }
    .col-md-9  { width: 75%; }
    .col-md-10 { width: 83.333333%; }
    .col-md-12 { width: 100%; }
}
@media (min-width: 992px) {
    .col-lg-2  { width: 16.666667%; }
    .col-lg-3  { width: 25%; }
    .col-lg-4  { width: 33.333333%; }
    .col-lg-5  { width: 41.666667%; }
    .col-lg-6  { width: 50%; }
    .col-lg-8  { width: 66.666667%; }
    .col-lg-9  { width: 75%; }
    .col-lg-10 { width: 83.333333%; }
    .col-lg-12 { width: 100%; }
}
@media (min-width: 1200px) {
    .col-xl-2  { width: 16.666667%; }
    .col-xl-3  { width: 25%; }
    .col-xl-4  { width: 33.333333%; }
    .col-xl-5  { width: 41.666667%; }
    .col-xl-6  { width: 50%; }
    .col-xl-8  { width: 66.666667%; }
    .col-xl-9  { width: 75%; }
    .col-xl-10 { width: 83.333333%; }
    .col-xl-12 { width: 100%; }
}

@media (min-width: 1400px) {
    .col-xxl-2  { width: 16.666667%; }
    .col-xxl-3  { width: 25%; }
    .col-xxl-4  { width: 33.333333%; }
    .col-xxl-5  { width: 41.666667%; }
    .col-xxl-6  { width: 50%; }
    .col-xxl-8  { width: 66.666667%; }
    .col-xxl-10 { width: 83.333333%; }
    .col-xxl-12 { width: 100%; }
}

/* --- Bootstrap Card Aliases --- */
.card-body   { padding: var(--space-5); }
.card-header {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--color-gray-200);
    background-color: var(--color-white);
}
.card-footer {
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-gray-200);
}
.card-title  { font-weight: 600; margin-bottom: var(--space-2); }
.card-text   { color: var(--color-gray-600); }

/* --- Bootstrap Button Group --- */
.btn-group {
    display: inline-flex;
    vertical-align: middle;
}
.btn-group > .btn,
.btn-group > .btn-check + .btn {
    border-radius: 0;
}
.btn-group > .btn:first-child,
.btn-group > .btn-check:first-child + .btn {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}
.btn-group > .btn:last-child,
.btn-group > .btn-check:last-of-type + .btn {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}
.btn-group > .btn + .btn {
    margin-left: -1px;
}
.btn-group-sm > .btn,
.btn-group.btn-group-sm > label.btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
}

/* Bootstrap toggle: hidden radio + styled label */
.btn-check {
    position: absolute;
    clip: rect(0, 0, 0, 0);
    pointer-events: none;
}
.btn-check:checked + .btn-outline-dark {
    background-color: var(--color-brand-600);
    border-color: var(--color-brand-600);
    color: var(--color-white);
}
.btn-check:checked + .btn-outline-primary {
    background-color: var(--color-brand-600);
    border-color: var(--color-brand-600);
    color: var(--color-white);
}

/* --- Bootstrap Outline Button Aliases --- */
.btn-outline-primary {
    background-color: transparent;
    color: var(--color-brand-600);
    border-color: var(--color-brand-600);
}
.btn-outline-primary:hover {
    background-color: var(--color-brand-600);
    color: var(--color-white);
}
.btn-outline-secondary {
    background-color: transparent;
    color: var(--color-gray-500);
    border-color: var(--color-gray-400);
}
.btn-outline-secondary:hover {
    background-color: var(--color-gray-500);
    color: var(--color-white);
}
.btn-outline-dark {
    background-color: transparent;
    color: var(--color-gray-900);
    border-color: var(--color-gray-900);
}
.btn-outline-dark:hover {
    background-color: var(--color-gray-900);
    color: var(--color-white);
}
.btn-outline-danger {
    background-color: transparent;
    color: var(--color-danger);
    border-color: var(--color-danger);
}
.btn-outline-danger:hover {
    background-color: var(--color-danger);
    color: var(--color-white);
}

/* --- Lead text (Bootstrap name) --- */
.lead {
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--color-gray-700);
    line-height: 1.6;
}

/* --- Form Floating Labels (Bootstrap compat) --- */
.form-floating {
    position: relative;
}
.form-floating > .form-control {
    height: 52px;
    padding: 1.625rem 0.75rem 0.375rem;
}
.form-floating > .form-select {
    height: 52px;
    padding-top: 1.625rem;
    padding-bottom: 0.375rem;
}
.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 0.875rem 0.75rem;
    pointer-events: none;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    font-size: var(--text-body);
    color: var(--color-gray-500);
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 0.65;
    transform: scale(0.8) translateY(-0.375rem);
}
.form-floating > .form-control::placeholder {
    color: transparent;
}

/* --- Responsive padding helpers (Bootstrap compat) --- */
@media (min-width: 576px) {
    .p-sm-4 { padding: var(--space-4); }
    .p-sm-5 { padding: var(--space-5); }
}

/* --- Misc Bootstrap compat --- */
.pb-3 { padding-bottom: var(--space-3); }
.pt-3 { padding-top: var(--space-3); }
.ms-0 { margin-inline-start: 0; }
.me-0 { margin-inline-end: 0; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.order-first { order: -1; }
.order-last  { order: 9999; }
.col-sm-10 { }
@media (min-width: 576px) {
    .col-sm-10 { width: 83.333333%; }
}

/* --- Pagination (Bootstrap compat) --- */
.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: var(--space-1);
}
.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-gray-700);
    background-color: var(--color-white);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.page-link:hover {
    background-color: var(--color-gray-50);
    color: var(--color-brand-600);
    text-decoration: none;
}
.page-item.active .page-link {
    background-color: var(--color-brand-600);
    border-color: var(--color-brand-600);
    color: var(--color-white);
}
.page-item.disabled .page-link {
    color: var(--color-gray-300);
    pointer-events: none;
    background-color: var(--color-white);
}
