/**
 * LIPSLAY UNIFIED BRAND DESIGN SYSTEM (v1.0)
 * Future-proof global design tokens, typography scale, automatic contrast guards,
 * card/button/badge geometry, and Core Web Vitals (CLS + GPU animation) foundations.
 * Automatically loaded across Storefront, Partner/Reception Portal, Admin Console & Sub-Portals.
 */

:root {
    /* 1. Typography Tokens (LOCK-49 Google/Kommo Compact Standard) */
    --ls-font-sans: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ls-text-page-title: 18px;
    --ls-text-card-title: 14px;
    --ls-text-body: 13px;
    --ls-text-muted: 12px;
    --ls-text-h1: 18px;
    --ls-text-h2: 16px;
    --ls-text-h3: 14px;
    --ls-text-table: 13px;
    --ls-text-micro-badge: 11.5px;

    /* 2. Unified Google Material-3 / Kommo Compact Palette (LOCK-49) */
    --ls-primary: #1a73e8;
    --ls-primary-hover: #1557b0;
    --ls-primary-fg: #ffffff;

    --ls-success: #137333;
    --ls-success-bg: #e6f4ea;
    --ls-warning: #b06000;
    --ls-warning-bg: #fef7e0;
    --ls-danger: #c5221f;
    --ls-danger-bg: #fce8e6;

    --ls-heading-color: #202124;
    --ls-body-color: #3c4043;
    --ls-muted-color: #5f6368;

    --ls-slate-900: #202124;
    --ls-slate-800: #3c4043;
    --ls-slate-700: #3c4043;
    --ls-slate-600: #5f6368;
    --ls-slate-100: #f1f3f4;
    --ls-slate-50: #f8f9fa;

    --ls-bg-canvas: #f8f9fa;
    --ls-bg-card: #ffffff;
    --ls-border: #dadce0;

    /* 3. Compact Geometry & Elevation (LOCK-49 Anti-Giant-Block Law) */
    --ls-radius-card: 8px;
    --ls-radius-btn: 6px;
    --ls-radius-pill: 9999px;
    --ls-shadow-card: 0 1px 2px rgba(60, 64, 67, 0.06);
    --ls-shadow-elevated: 0 4px 12px rgba(60, 64, 67, 0.12);
}

/* Global Typography & Font Rendering */
body {
    font-family: var(--ls-font-sans);
    background-color: var(--ls-bg-canvas);
    color: var(--ls-body-color);
    font-size: var(--ls-text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* LOCK-49 LAW A & B: Compact Buttons, Cards & KPI Strips */
.ls-btn-compact,
.btn-compact {
    height: 32px;
    min-height: 32px;
    max-height: 36px;
    padding: 6px 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    border-radius: 6px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.2;
}

.ls-card-compact {
    background: #ffffff !important;
    border: 1px solid #dadce0 !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06) !important;
}

.ls-kpi-compact {
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 10px 14px;
    max-height: 84px;
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.06);
}

.ls-page-title-compact {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #202124 !important;
    line-height: 1.3;
    margin: 0;
}

.ls-section-title-compact {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #202124 !important;
    line-height: 1.35;
    margin: 0;
}

.ls-meta-text-compact {
    font-size: 12px !important;
    color: #5f6368 !important;
}

/* Crisp Micro-Badges & Pills */
.ls-badge-pill,
.ls-pipeline-stage-pill,
.ls-micro-badge {
    font-size: var(--ls-text-micro-badge);
    font-weight: 600;
    white-space: nowrap;
    border-radius: var(--ls-radius-pill);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.25;
}

/* Compact Table Cells & Responsive Table Anti-Clipping Guard */
.ls-table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ls-table-compact th,
.ls-table-compact td {
    font-size: var(--ls-text-table);
    vertical-align: middle;
}

/* =========================================================================
   GLOBAL AUTO-CONTRAST & ANTI-REGRESSION GUARDS (EXISTING + FUTURE PAGES)
   ========================================================================= */

/* 1. Dark & Primary Royal-Blue Surfaces ALWAYS pair with crisp light/white text */
.bg-dark,
.bg-primary,
.bg-slate-900,
.btn-dark,
.btn-primary,
.badge-primary,
.badge-dark,
[style*="background:#0f172a"],
[style*="background: #0f172a"],
[style*="background-color:#0f172a"],
[style*="background-color: #0f172a"],
[style*="background:#2563eb"],
[style*="background: #2563eb"],
[style*="background-color:#2563eb"],
[style*="background-color: #2563eb"],
[style*="background:#1d4ed8"],
[style*="background: #1d4ed8"],
[style*="background-color:#1d4ed8"],
[style*="background-color: #1d4ed8"] {
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-dark:hover,
.btn-dark:focus,
.btn-dark:active,
select.form-select.text-white,
select[style*="background:#2563eb"],
select[style*="background: #2563eb"],
select[style*="background-color:#2563eb"],
select[style*="background-color: #2563eb"],
.badge.bg-primary.text-primary {
    color: #ffffff !important;
}

/* 2. Native <select> and <option> Contrast Guard (Windows Chrome / Edge / Safari) */
select option,
select optgroup {
    background-color: #ffffff !important;
    color: #0f172a !important;
    font-weight: 500;
}

select.ls-select-primary-solid,
select[style*="#2563eb"],
select[style*="#1d4ed8"],
select[style*="#0f172a"] {
    color: #ffffff !important;
    font-weight: 700 !important;
}

/* 3. Core Web Vitals & GPU-Composited Animations (Zero Layout Thrashing) */
.ls-gpu-transition,
.btn,
.nav-link,
.dropdown-item,
.card {
    transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 4. Storefront CLS Prevention Reservations */
.ls-header-cls-guard {
    min-height: 72px;
}

.ls-hero-cls-guard {
    min-height: 520px;
}

.ls-cat-rail-cls-guard {
    min-height: 56px;
}

.ls-nearby-rail-cls-guard {
    min-height: 360px;
}

/* 5. Sticky Full-Height SaaS Sidebars (Partner & Admin) */
.ls-sticky-partner-sidebar {
    position: sticky !important;
    top: 16px !important;
    height: calc(100vh - 32px) !important;
    overflow-y: auto !important;
}

.ls-sticky-admin-sidebar {
    position: sticky !important;
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    overflow-y: auto !important;
}
