/* ===== tokens.css — OKAMI CMS design tokens (V.104 CSS split) =====
   Split out of the former app.css (see DECISIONS.md #111 follow-up). This
   file holds ONLY the :root design-token custom properties and truly
   global resets/utilities used by BOTH the admin panel and the public
   frontend (box-sizing, body/a resets, .btn, .badge/.pill, a11y helpers).
   Load this FIRST, before every other stylesheet. */

/* Token values recorded from OKAMI Universal UI/UX Kit V5 Final Master — see DECISIONS.md #016.
   This bare foundation shell uses ONLY the token layer (color/radius/shadow/type), never the
   kit's component library — the real component build-out is Phase 02 (Universal Admin UI). */
:root {
  --bg: #f5f7f9;
  --surface: #fff;
  --ink: #11161b;
  --muted: #69747e;
  --line: #dce2e7;
  --accent: #285ff2;
  /* V.027 — Theme settings (DECISIONS.md #046). These two are new tokens;
     the frontend/shell.php <style> override (FrontendController::themeCss())
     re-declares all three from the admin's Settings > Theme tab per request,
     but the admin panel itself (this same app.css, no per-request override)
     needs sane hardcoded fallbacks too — kept identical to the shipped
     Settings defaults so admin and frontend never visibly disagree. */
  --accent-dark: #1a3fa8;
  --accent-2: #f0982a;
  --soft: #edf2ff;
  --dark: #10161c;
  --success: #17855e;
  --warning: #a86d00;
  --danger: #c23e46;
  --r: 20px;
  --rs: 14px;
  --shadow: 0 18px 40px -14px rgba(15, 22, 29, .16);
  /* Matches OKAMI Universal UI/UX Kit V5 Final Master's own `--max` token
     (1480px) — renamed --container here since it's used purely as a content
     max-width in this admin app, not a marketing hero. See DECISIONS.md #025. */
  --container: 1480px;
  /* V.112 — "Boxed" site layout mode (owner: "header tum boxed bhi bana do,
     boxed version 100% body footer header same width"). Deliberately
     narrower than --container: at --container itself (1480px) the boxed
     frame would be invisible on most laptop/desktop viewports (anything
     under ~1480px wide already fills edge-to-edge), so boxed mode needs its
     own, smaller width for the "framed card on a visible backdrop" look to
     actually read at common screen sizes. Only ever used by `.site-boxed`
     (assets/css/frontend-body.css) — --container itself is untouched, so
     every existing wide-mode measurement is byte-identical to before this
     token existed. */
  --container-boxed: 1180px;
  /* V.096 — decorative icon-chip tint set (DECISIONS.md #104). Used only for
     category/stat/feature icon backgrounds so those read as colorful-but-
     tasteful the way the approved reference mockup does — never a second
     brand palette; --accent/--soft/etc. are untouched and still the only
     colors any button, link or CTA uses. */
  --tint-a-bg: #eaf1ff; --tint-a-ink: #2f5fe0;
  --tint-b-bg: #e6f7f0; --tint-b-ink: #128a5c;
  --tint-c-bg: #fff2e0; --tint-c-ink: #b5680a;
  --tint-d-bg: #f5edff; --tint-d-ink: #7a3fd6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

/* --- .btn — shared button component (admin lists/forms/login AND
   frontend Get Quote/inquiry/nav buttons render this exact class). --- */
.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--rs);
  padding: 9px 14px;
  font-weight: 750;
  cursor: pointer;
  font-size: var(--fs-13);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { background: #fff; border-color: #edb3b3; color: var(--danger); }
.btn.danger:hover { background: #fff5f5; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.sm { padding: 6px 10px; font-size: var(--fs-12); }
.btn.block { width: 100%; justify-content: center; }

/* --- .badge/.pill — shared chip component (admin KPI/status chips AND
   frontend product-card spec pills, Featured badge). --- */
.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: var(--fs-11);
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: break-word;
}
.pill.muted { background: #f0f3f5; color: var(--muted); }
.pill.danger { background: #fff0f0; color: var(--danger); border-color: #f3c9c9; }
.pill.success { background: #edfaf4; color: var(--success); border-color: #bfe8d5; }
/* Phase 15 — the Error/Debug Center's new per-entry severity pill (Fatal
   stays .danger, Warning gets its own shade matching .notice.warning). */
.pill.warning { background: #fffaf0; color: var(--warning); border-color: #ecd09e; }

/* Ad-hoc V.017 — Fluid Responsive Typography. Real clamp()-based type scale,
   scoped to `.frontend-body` only (the public site) — the admin's own dense
   fixed-px UI is deliberately untouched. Before this, the frontend had
   exactly two ad-hoc clamp() rules (the hero carousel) and every other
   heading/body size came from raw browser UA defaults — inconsistent and
   uncontrolled between breakpoints. These custom properties scale smoothly
   between a phone-width minimum and a desktop-width maximum instead of
   jumping at fixed breakpoints. More specific rules (e.g. the hero's own
   larger `.builder-carousel__body h2`) still win via normal CSS specificity
   — this only sets the sitewide default. */
:root {
  --fs-h1: clamp(2rem, 1.55rem + 2.2vw, 3.4rem);
  --fs-h2: clamp(1.6rem, 1.35rem + 1.2vw, 2.4rem);
  --fs-h3: clamp(1.3rem, 1.15rem + 0.75vw, 1.75rem);
  --fs-h4: clamp(1.1rem, 1.02rem + 0.4vw, 1.35rem);
  --fs-h5: clamp(1.02rem, 0.97rem + 0.25vw, 1.15rem);
  --fs-h6: clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --fs-lead: clamp(1.05rem, 1rem + 0.4vw, 1.25rem);
  --fs-body: clamp(0.95rem, 0.92rem + 0.15vw, 1.05rem);
  --fs-small: clamp(0.8rem, 0.78rem + 0.1vw, 0.875rem);

  /* V.103 (DECISIONS.md #111) — sitewide fluid typography scale. The
     --fs-h1..h6/lead/body/small tokens above only ever applied inside
     `.frontend-body` (CMS rich-text content). Everywhere else — admin
     panel, every Builder block, nav, footer, cards, forms — every
     font-size was still a flat px value with zero scaling, which is why
     headings/stat numbers/brand text felt oversized on a phone even
     though the CMS content itself scaled fine. These --fs-<px> tokens
     are keyed by their original desktop pixel value (so `font-size:
     26px` becomes `font-size: var(--fs-26)` at the exact call site,
     everywhere), each a clamp() between a proportionally-reduced mobile
     minimum and that same original desktop value as the maximum — so
     desktop rendering is byte-for-byte unchanged, and the whole
     hierarchy (page titles, section headings, card titles, stat
     numbers, nav/footer brand text, quote text) scales down smoothly
     instead of any breakpoint jump. Small UI chrome under 16px (table
     cells, labels, buttons, meta text, badges) also gets a token, but
     with a much smaller mobile reduction — that text was already
     comfortable at phone width and only needed to stop being a
     scattered set of magic numbers, not shrink further. Decorative
     icon-sized glyphs (nav hamburger, dropdown toggles, close buttons,
     drag handles, the .builder-icon--* family) are deliberately left as
     plain px — those aren't reading text and don't belong in a type
     scale. */
  --fs-9: clamp(0.5175rem, 0.5175rem + 0.072vw, 0.5625rem);
  --fs-10: clamp(0.5704rem, 0.5704rem + 0.0874vw, 0.625rem);
  --fs-11: clamp(0.6224rem, 0.6224rem + 0.1042vw, 0.6875rem);
  --fs-11_5: clamp(0.648rem, 0.648rem + 0.1132vw, 0.7188rem);
  --fs-12: clamp(0.6734rem, 0.6734rem + 0.1225vw, 0.75rem);
  --fs-12_5: clamp(0.6986rem, 0.6986rem + 0.1322vw, 0.7812rem);
  --fs-13: clamp(0.7236rem, 0.7236rem + 0.1423vw, 0.8125rem);
  --fs-13_5: clamp(0.7483rem, 0.7483rem + 0.1528vw, 0.8438rem);
  --fs-14: clamp(0.7728rem, 0.7728rem + 0.1636vw, 0.875rem);
  --fs-15: clamp(0.8211rem, 0.8211rem + 0.1863vw, 0.9375rem);
  --fs-16: clamp(0.8684rem, 0.8684rem + 0.2105vw, 1rem);
  --fs-17: clamp(0.9149rem, 0.9149rem + 0.2362vw, 1.0625rem);
  --fs-18: clamp(0.9604rem, 0.9604rem + 0.2634vw, 1.125rem);
  --fs-19: clamp(1.005rem, 1.005rem + 0.292vw, 1.1875rem);
  --fs-20: clamp(1.0487rem, 1.0487rem + 0.3221vw, 1.25rem);
  --fs-21: clamp(1.0914rem, 1.0914rem + 0.3537vw, 1.3125rem);
  --fs-22: clamp(1.1333rem, 1.1333rem + 0.3867vw, 1.375rem);
  --fs-24: clamp(1.2142rem, 1.2142rem + 0.4573vw, 1.5rem);
  --fs-26: clamp(1.2914rem, 1.2914rem + 0.5337vw, 1.625rem);
  --fs-28: clamp(1.365rem, 1.365rem + 0.616vw, 1.75rem);
}

/* --- Phase 16 — accessibility utilities, usable from any screen. --- */
/* Phase 16 — accessibility utilities. .sr-only hides content visually
   while keeping it in the accessibility tree (aria-live announcements,
   skip links before focus). .skip-link is visible only once it receives
   keyboard focus, per the standard "skip to content" pattern. */
.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; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 1000; background: var(--accent, #3d6bff); color: #fff; padding: 10px 16px; border-radius: 0 0 6px 0; font-weight: 700; font-size: var(--fs-13); text-decoration: none; }
.skip-link:focus { left: 0; }

/* --- Breadcrumb — shared by admin (layouts/admin.php) AND the public
   frontend (App\Support\PageParts::breadcrumb(), Shop/Category/Product/
   Service trails). Lives here, not in admin-shell.css, so both surfaces
   get it (V.104 hotfix — it went unstyled on every frontend page when
   admin-shell.css and the frontend bundles were split apart). --- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: var(--fs-12); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb .sep { opacity: .5; }
