/* ============================================================
   vm_typography_pro.css — Typography polish (Förslag A)
   ============================================================
   Laddas EFTER vm_studio.css i base.html (rad 38).
   Ändrar BARA typografi: weights, spacing, opticality, anti-blur.
   Inga färgändringar utöver de specifika "label-grå" (--vm-text-muted).

   v20260510-2300 SHARPEN-PASS (Per: "suddig text" felrapport)
   - KPI-värden tvingade till 1.75rem 900 weight, tabular-nums, ingen shadow
   - Eyebrows/labels fast 800-weight 0.14em letter-spacing
   - text-shadow:none på rubriker, KPI, knappar (utom decorative status)
   - -webkit-font-smoothing: antialiased + text-rendering: geometricPrecision
   ============================================================ */

/* ═══════════════════════════════════════════════════════════════
   0. GLOBAL ANTI-BLUR — skarp text-rendering i Webkit/Gecko
   ═══════════════════════════════════════════════════════════════ */
html, body, .vm-admin-title, .access-page-title,
h1, h2, h3, h4, h5, h6,
.access-stat-value, .access-stat-label,
.vm-eyebrow, .vm-admin-eyebrow,
.vm-section-title, .vm-panel-title,
.vm-btn, .access-btn, button {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

/* ═══════════════════════════════════════════════════════════════
   1. RUBRIKER — tyngre, skarpare, INGEN text-shadow
   ═══════════════════════════════════════════════════════════════ */
h1, .h1, .vm-admin-title, .at-hero-title,
.access-page-title, .access-section-title {
    font-weight: 800 !important;
    letter-spacing: -0.012em !important;
    line-height: 1.15 !important;
    text-shadow: none !important;
    color: var(--vm-text) !important;
}

h2, .h2, .vm-section-title, .at-panel-titles,
.access-panel-header h2, .access-panel-header h3 {
    font-weight: 800 !important;
    letter-spacing: -0.008em !important;
    line-height: 1.2 !important;
    text-shadow: none !important;
    color: var(--vm-text) !important;
}

h3, .h3, .access-panel-header h4,
.lux-panel-head, .at-panel-head, .vm-panel-title {
    font-weight: 700 !important;
    letter-spacing: -0.005em !important;
    line-height: 1.25 !important;
    text-shadow: none !important;
    color: var(--vm-text) !important;
}

h4, h5, h6, .h4, .h5, .h6 {
    font-weight: 700 !important;
    letter-spacing: 0 !important;
    text-shadow: none !important;
}

/* Admin-specifika rubriker — explicit text-shadow OFF (admin_command_center.css glow) */
body[data-path^="/admin"] .module-hero h1,
body[data-path^="/admin"] .module-hero-copy h1,
body[data-path^="/admin"] h1,
body[data-path^="/admin"] h2,
body[data-path^="/admin"] h3 {
    text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   2. KPI-SIFFROR — extremt skarpa, 900 weight, tabular-nums
   ═══════════════════════════════════════════════════════════════ */
.at-kpi-value, .lux-kpi-value,
.access-stat-value, .vm-kpi-value, .vm-stat-value,
.ap-kpi-val,
.kpi-value, [class*="kpi"][class*="value"],
[class*="kpi-val"],
.access-stat strong,
.access-grid-4 .access-stat strong,
.access-grid-3 .access-stat strong,
.access-grid-2 .access-stat strong {
    font-weight: 900 !important;
    color: var(--vm-text) !important;
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: "tnum" 1, "lnum" 1 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.05 !important;
    text-shadow: none !important;
    /* Font-size UTAN !important: inline style="font-size:.88rem" (verktyg-kort
       i access/index.html) ska få vinna. Andra access-stat-value ärver 1.75rem
       från base_access.html-overrride nedan. */
    font-size: 1.75rem;
}

/* Override base_access.html inline-<style> som sätter font-size:1rem.
   OBS: inline style="" på elementet (verktyg-kort) vinner ändå — det är OK. */
.access-stat-value {
    font-size: 1.75rem;
}

/* KPI-värden ALLTID guld (2026-05-13 utökat enligt Webb-Claude runda 3).
   Tidigare facit-mode-gated men det matchade inte alla admin-templates som
   använder base_enterprise. Nu unconditional — KPI är info/data, inte status. */
.at-kpi-value,
.lux-kpi-value,
.access-stat-value,
.vm-kpi-value,
.vm-stat-value,
.ap-kpi-val,
.kpi-value,
.central-summary-value,
.lab-kpi-num,
[class*="kpi"][class*="value"],
[class*="kpi-val"],
.access-stat strong,
.access-grid-4 .access-stat strong,
.access-grid-3 .access-stat strong,
.access-grid-2 .access-stat strong {
    color: var(--vm-accent) !important;
}
/* Critical-undantag — kritiska siffror behåller röd för säkerhets-semantik */
.lab-kpi-cell-critical .lab-kpi-num,
.kpi-critical [class*="value"],
.access-stat--critical strong {
    color: var(--vm-danger) !important;
}

/* KPI on ops-shell (driftpanel) — neutralize gradient text-shadow */
.ops-kpi-value, .ops-shell .ops-kpi-value {
    text-shadow: none !important;
    font-variant-numeric: tabular-nums !important;
    font-feature-settings: "tnum" 1, "lnum" 1 !important;
    letter-spacing: -0.02em !important;
    font-weight: 900 !important;
}

/* ═══════════════════════════════════════════════════════════════
   3. UPPERCASE LABELS — 800 weight, ljusare grå, INGEN blur
   ═══════════════════════════════════════════════════════════════ */
.at-hero-eyebrow,
.at-panel-eyebrow,
.access-stat-label,
.access-section-label,
.ap-section-label,
.ap-kpi-lbl,
.vm-admin-eyebrow,
.vm-eyebrow,
.section-label,
.subsection-label,
[class*="eyebrow"],
[class*="-label"]:not(input):not(textarea):not(select):not(.access-label),
.at-kpi-label,
.lux-kpi-label,
.ops-kpi-label {
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
    color: var(--vm-text-muted) !important;
    font-size: var(--vm-text-xs) !important;  /* E5: 0.68rem=10.2px → 12px-golv */
    line-height: 1.2 !important;
    text-shadow: none !important;
}

/* Sidebar-section-rubriker (PERSONER, BEHÖRIGHET, TIDSTYRNING, LOGG) */
.sidebar-section-title,
.nav-section-title,
.menu-section-title,
[class*="sidebar"] [class*="section-title"] {
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.14em !important;
    color: var(--vm-text-muted) !important;
    font-size: var(--vm-text-xs) !important;  /* E5: 0.68rem=10.2px → 12px-golv */
    text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   4. TABELLHUVUDEN — uppercase 800 weight, skarp
   ═══════════════════════════════════════════════════════════════ */
table thead th,
.access-table thead th,
.vm-table thead th,
[class*="table"] thead th {
    font-weight: 800 !important;
    color: var(--vm-text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    font-size: var(--vm-text-xs) !important;  /* E5: 0.72rem=10.8px → 12px-golv */
    text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   5. BODY TEXT — 1.55 line-height, ljusare färg, weight 400+
   ═══════════════════════════════════════════════════════════════ */
body, p, .body-text, .at-hero-sub,
.access-canvas-body, .access-panel p,
.vm-prose p {
    line-height: 1.55 !important;
}

/* :not(.vm-login__tagline) (login-redesign 2026-06-01): tagline ligger på den
   fasta navy brand-panelen och behöver sin egen ljusblå färg — det globala
   text-soft-!important gjorde den mörk/osynlig på navy (theme-aware). */
p:not(.vm-login__tagline), .access-panel p, .at-hero-sub {
    color: var(--vm-text-soft) !important;
    font-weight: 400 !important;
}

/* Texter i statistik-kort, varningar etc. */
.access-empty,
.access-list-item span,
.access-legacy-body-note {
    color: var(--vm-text-soft) !important;
    line-height: 1.5 !important;
    font-weight: 400 !important;
}

/* Form labels — inte för tunna */
.access-label, .vm-label, label {
    font-weight: 700 !important;
    color: var(--vm-text-soft) !important;
}

/* ═══════════════════════════════════════════════════════════════
   6. KNAPPAR — 700-800 weight, INGEN text-shadow blur
   ═══════════════════════════════════════════════════════════════ */
button, .btn, .access-btn, .vm-btn,
input[type="button"], input[type="submit"],
[class*="-btn"]:not(.dp-btn) {
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    text-shadow: none !important;
}

button.primary, .btn-primary, .vm-btn-primary,
button[class*="primary"], button[class*="--primary"],
.access-btn--primary, .access-btn.primary,
.access-btn-primary {
    font-weight: 800 !important;
    text-shadow: none !important;
}

/* Admin primary buttons — kill the blue text-shadow blur */
body[data-path^="/admin"] .btn-primary,
body[data-path^="/admin"] .access-btn-primary,
body[data-path^="/admin"] .access-tab-link.active,
body[data-path^="/admin"] .users-tab.active,
body[data-path^="/admin"] .tab-link.active {
    text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   7. ACTIVE SIDEBAR-LINKS — 700 weight, ljusare guld
   ═══════════════════════════════════════════════════════════════ */
.sidebar a.active,
.sidebar-link.active,
.nav-link.active,
.menu-item.active,
[class*="sidebar"] a.active,
[class*="sidebar"] [class*="link"][aria-current],
[class*="sidebar"] [class*="link"].active,
.access-tab-link.active,
.access-tab-link[aria-current] {
    font-weight: 700 !important;
    color: var(--vm-accent-hover) !important;
    text-shadow: none !important;
}

/* Inactive sidebar-links: lite mer subtila.
   2026-05-29 tema-grund-r5: tokeniserat + exkludera sidebar-system-entry
   (har egen brand-gradient + vit text — ska inte tona ner). */
.sidebar a:not(.active):not(.sidebar-system-entry),
.sidebar-link:not(.active):not(.sidebar-system-entry),
.nav-link:not(.active):not(.sidebar-system-entry),
[class*="sidebar"] a:not(.active):not(.sidebar-section-title):not(.sidebar-system-entry) {
    font-weight: 600 !important;
    color: var(--vm-text-secondary) !important;
}

/* ═══════════════════════════════════════════════════════════════
   8. STATUS-PILLS / BADGES — 700 weight
   ═══════════════════════════════════════════════════════════════ */
.access-pill, .access-status-badge, .access-legacy-count,
.badge, .pill, .vm-badge, .vm-pill,
[class*="badge"], [class*="pill"],
[class*="-status-"][class*="-badge"] {
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    text-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   9. MODAL/POPUP-TITLAR — skarpa, ingen blå glow
   ═══════════════════════════════════════════════════════════════ */
.cc-modal-title,
.ops-popup-title,
.vm-modal-title,
.modal-title,
[class*="modal-title"],
[class*="popup-title"] {
    text-shadow: none !important;
    font-weight: 800 !important;
    color: var(--vm-text) !important;
}
