/*!
 * CCA UI Kit — v1.1.1 (2026-10-04)
 * Central Children Academy, Jhunjhunu · ccaschool.in
 *
 * One shared stylesheet that turns ccaschool.in/brand-guidelines into code.
 * Source of truth: /brand-guidelines (Brand v1.0). If this file and that page
 * ever disagree, the page wins — fix this file and bump the version.
 *
 * How to use on a page:
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
 *   <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
 *   <link rel="stylesheet" href="/assets/cca-ui/cca-ui.css?v=1.1.1">
 *
 * Safe to add to an old page: nothing here styles bare elements unless the
 * element (or an ancestor) carries class "cca". Every component is prefixed
 * "cca-", so it never collides with a page's own .btn / .card / .modal.
 * The bare-element rules (a, h1–h4, p, focus) sit inside :where(.cca), so they
 * carry almost no weight: any class on the element wins. v1.1.1 fix — with
 * <body class="cca"> the shared desktop sidebar's links had turned blue on blue.
 *
 * NO GRADIENTS anywhere in the CCA brand (owner, 2026-10-04). Every surface
 * is a solid palette colour. The --cca-grad-* token names stay only so older
 * code keeps working; they now hold solid colours. Never add a gradient.
 */

/* ─────────────────────────────────────────────────────────────
   1. Tokens
   ───────────────────────────────────────────────────────────── */
:root {
  /* Palette — names exactly as on /brand-guidelines */
  --primary-blue:   #0C67AF;
  --primary-orange: #E7561F;
  --primary-yellow: #FFC000;
  --bright-blue:    #1E7BC8;
  --bright-orange:  #FF6B35;
  --bright-yellow:  #FFD23F;
  --white:          #FFFFFF;
  --light-gray:     #F8F9FA;
  --cream:          #FBF9F5;
  --dark-gray:      #2C3E50;
  --text-dark:      #1A1A1A;
  --text-light:     #6C757D;
  --line:           #E9E6DF;
  --success-green:  #28a745;
  --info-blue:      #17a2b8;

  /* Kit aliases (use these in new code) */
  --cca-blue:        var(--primary-blue);
  --cca-blue-2:      var(--bright-blue);
  --cca-orange:      var(--primary-orange);
  --cca-orange-2:    var(--bright-orange);
  --cca-yellow:      var(--primary-yellow);
  --cca-ink:         var(--text-dark);
  --cca-muted:       var(--text-light);
  --cca-line:        var(--line);
  --cca-surface:     var(--white);
  --cca-page:        var(--cream);
  --cca-section:     var(--light-gray);
  --cca-success:     var(--success-green);
  --cca-info:        var(--info-blue);
  --cca-warn:        var(--primary-yellow);
  --cca-warn-ink:    #8a5b00;            /* from guideline badge-warn */
  --cca-danger:      #DC3545;            /* owner OK 2026-10-04 (not on the guideline page) */

  /* Dark text on tinted backgrounds (AA contrast) */
  --cca-info-ink:    #0a4f87;
  --cca-success-ink: #1e7e34;
  --cca-danger-ink:  #a71d2a;

  /* Tints (all derived from palette colours) */
  --cca-blue-soft:   rgba(12,103,175,.10);
  --cca-blue-softer: rgba(12,103,175,.06);
  --cca-blue-edge:   rgba(12,103,175,.15);
  --cca-orange-soft: rgba(231,86,31,.10);
  --cca-yellow-soft: rgba(255,192,0,.18);
  --cca-green-soft:  rgba(40,167,69,.12);
  --cca-danger-soft: rgba(220,53,69,.10);

  /* Solid surfaces. Gradients are not used in the CCA brand (owner 2026-10-04).
     Legacy names kept so older code keeps working. */
  --cca-surface-brand:   var(--primary-blue);
  --cca-surface-cta:     var(--primary-orange);
  --cca-surface-success: var(--success-green);
  --cca-grad-brand:   var(--primary-blue);
  --cca-grad-cta:     var(--primary-orange);
  --cca-grad-bar:     var(--primary-orange);
  --cca-grad-success: var(--success-green);

  /* Type */
  --cca-font-display: 'Poppins', 'Inter', system-ui, sans-serif;
  --cca-font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cca-font-mono:    ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Radii */
  --cca-r-sm:   8px;
  --cca-r:      10px;
  --cca-r-card: 14px;
  --cca-r-lg:   18px;
  --cca-r-xl:   20px;
  --cca-r-pill: 999px;

  /* Shadows */
  --cca-sh-subtle: 0 1px 2px #14141414;
  --cca-sh-soft:   0 6px 18px #00000010;
  --cca-sh-lift:   0 15px 40px #0C67AF1A;
  --cca-sh-deep:   0 30px 80px #0000004D;
  --cca-ring:      0 0 0 3px rgba(12,103,175,.15);

  /* Spacing (multiples of 4) */
  --cca-s1: 4px;  --cca-s2: 8px;  --cca-s3: 12px; --cca-s4: 16px;
  --cca-s5: 24px; --cca-s6: 32px; --cca-s7: 40px; --cca-s8: 60px;

  /* Motion */
  --cca-ease: all .3s ease;
  --cca-ease-fast: all .2s ease;

  /* Layout */
  --cca-bottom-nav: 76px;   /* staff/parent app fixed bottom nav clearance */
}

/* .cca-flat was the gradient-free switch in v1.0; everything is flat now, so it does nothing. */

/* ─────────────────────────────────────────────────────────────
   2. Opt-in base (only inside .cca)
   ───────────────────────────────────────────────────────────── */
.cca, :where(.cca) *, :where(.cca) *::before, :where(.cca) *::after { box-sizing: border-box; }
.cca {
  font-family: var(--cca-font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--cca-ink);
  -webkit-font-smoothing: antialiased;
}
body.cca { margin: 0; background: var(--cca-page); }
:where(.cca) a { color: var(--cca-blue); text-decoration: none; }
:where(.cca) a:hover { text-decoration: underline; }
:where(.cca) :focus-visible { outline: none; box-shadow: var(--cca-ring); }
:where(.cca) h1, :where(.cca) h2, :where(.cca) h3, :where(.cca) h4 { font-family: var(--cca-font-display); color: var(--cca-blue); margin: 0 0 .4em; line-height: 1.25; }
:where(.cca) h1 { font-size: 32px; font-weight: 800; letter-spacing: -.01em; line-height: 1.12; }
:where(.cca) h2 { font-size: 26px; font-weight: 700; }
:where(.cca) h3 { font-size: 20px; font-weight: 700; }
:where(.cca) h4 { font-size: 17px; font-weight: 700; }
:where(.cca) p  { margin: 0 0 1em; }

/* ─────────────────────────────────────────────────────────────
   3. Type helpers
   ───────────────────────────────────────────────────────────── */
.cca-display { font-family: var(--cca-font-display); font-weight: 800; font-size: 48px; line-height: 1.12; letter-spacing: -.01em; color: var(--cca-blue); }
.cca-h2      { font-family: var(--cca-font-display); font-weight: 700; font-size: 26px; line-height: 1.25; color: var(--cca-blue); }
.cca-h3      { font-family: var(--cca-font-display); font-weight: 700; font-size: 18px; line-height: 1.3;  color: var(--cca-blue); }
.cca-eyebrow { font-family: var(--cca-font-body); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--cca-orange); }
.cca-body    { font-size: 16px; line-height: 1.75; }
.cca-meta    { font-size: 13px; color: var(--cca-muted); }
.cca-num     { font-variant-numeric: tabular-nums; }
.cca-muted   { color: var(--cca-muted); }

/* ─────────────────────────────────────────────────────────────
   4. Page header
   ───────────────────────────────────────────────────────────── */
.cca-pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 24px; }
.cca-pagehead__title { font-family: var(--cca-font-display); font-weight: 700; font-size: 24px; color: var(--cca-blue); margin: 4px 0 0; line-height: 1.2; }
.cca-pagehead__sub   { font-size: 14px; color: var(--cca-muted); margin: 4px 0 0; }
.cca-pagehead__actions { display: flex; gap: 8px; flex-wrap: wrap; }

.cca-hero { background: var(--cca-grad-brand); color: #fff; border-radius: var(--cca-r-xl); padding: 28px; }
.cca-hero .cca-eyebrow { color: var(--bright-yellow); }
.cca-hero h1, .cca-hero h2, .cca-hero .cca-h2 { color: #fff; }

/* ─────────────────────────────────────────────────────────────
   5. Buttons
   ───────────────────────────────────────────────────────────── */
.cca-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--cca-font-body); font-weight: 600; font-size: 14px; line-height: 1.2;
  padding: 11px 22px; min-height: 44px;
  border: 1.5px solid transparent; border-radius: var(--cca-r);
  cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: var(--cca-ease-fast); -webkit-tap-highlight-color: transparent;
}
.cca-btn i { font-size: 14px; }
.cca-btn:hover { transform: translateY(-2px); filter: brightness(1.04); }
.cca-btn:active { transform: translateY(0); }
.cca-btn:focus-visible { outline: none; box-shadow: var(--cca-ring); }

.cca-btn--primary   { background: var(--cca-grad-cta);   color: #fff; box-shadow: 0 6px 18px rgba(231,86,31,.25); }
.cca-btn--primary:hover { box-shadow: 0 10px 24px rgba(231,86,31,.32); color: #fff; }
.cca-btn--secondary { background: var(--cca-grad-brand); color: #fff; box-shadow: 0 6px 18px rgba(12,103,175,.22); }
.cca-btn--secondary:hover { color: #fff; }
.cca-btn--ghost     { background: transparent; color: var(--cca-blue); border-color: rgba(12,103,175,.30); }
.cca-btn--ghost:hover { background: var(--cca-blue-softer); border-color: var(--cca-blue); transform: none; filter: none; }
.cca-btn--quiet     { background: transparent; color: var(--cca-muted); }
.cca-btn--quiet:hover { background: var(--light-gray); color: var(--cca-ink); transform: none; filter: none; }
.cca-btn--danger    { background: var(--cca-danger); color: #fff; }
.cca-btn--danger:hover { color: #fff; }
.cca-btn--success   { background: var(--cca-grad-success); color: #fff; }
.cca-btn--success:hover { color: #fff; }

.cca-btn--sm    { padding: 7px 14px; min-height: 34px; font-size: 13px; border-radius: var(--cca-r-sm); }
.cca-btn--lg    { padding: 14px 28px; min-height: 52px; font-size: 16px; }
.cca-btn--block { display: flex; width: 100%; }
.cca-btn--icon  { padding: 0; width: 44px; min-height: 44px; }
.cca-btn--icon.cca-btn--sm { width: 34px; min-height: 34px; }

.cca-btn:disabled, .cca-btn[aria-disabled="true"], .cca-btn.is-disabled {
  opacity: .5; cursor: not-allowed; transform: none; filter: none; box-shadow: none; pointer-events: none;
}
.cca-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.cca-btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55); border-top-color: #fff; animation: cca-spin .7s linear infinite;
}
.cca-btn--ghost.is-loading::after, .cca-btn--quiet.is-loading::after { border-color: var(--cca-blue-edge); border-top-color: var(--cca-blue); }
@keyframes cca-spin { to { transform: rotate(360deg); } }  /* loading indicator only — not decorative motion */

.cca-btnrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ─────────────────────────────────────────────────────────────
   6. Forms
   ───────────────────────────────────────────────────────────── */
.cca-field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 16px; }
.cca-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--cca-ink); }
.cca-label .cca-req { color: var(--cca-orange); margin-left: 2px; }
.cca-input, .cca-select, .cca-textarea {
  width: 100%; padding: 11px 14px; min-height: 44px;
  font-family: var(--cca-font-body); font-size: 15px; color: var(--cca-ink);
  background: #fff; border: 1.5px solid var(--cca-blue-edge); border-radius: var(--cca-r);
  transition: border-color .12s, box-shadow .12s; -webkit-appearance: none; appearance: none;
}
.cca-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.cca-select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%230C67AF' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.cca-input::placeholder, .cca-textarea::placeholder { color: var(--cca-muted); opacity: .7; }
.cca-input:focus, .cca-select:focus, .cca-textarea:focus { outline: none; border-color: var(--cca-blue); box-shadow: var(--cca-ring); }
.cca-input:disabled, .cca-select:disabled, .cca-textarea:disabled { background: var(--light-gray); color: var(--cca-muted); cursor: not-allowed; }
.cca-help  { font-size: 12.5px; color: var(--cca-muted); }
.cca-field.is-error .cca-input, .cca-field.is-error .cca-select, .cca-field.is-error .cca-textarea { border-color: var(--cca-danger); }
.cca-field.is-error .cca-help { color: var(--cca-danger); }

.cca-inputgroup { position: relative; }
.cca-inputgroup > i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--cca-muted); pointer-events: none; }
.cca-inputgroup > .cca-input { padding-left: 40px; }

.cca-check { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; min-height: 36px; }
.cca-check input { width: 18px; height: 18px; accent-color: var(--cca-blue); margin: 0; }

.cca-formgrid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 16px; }

/* ─────────────────────────────────────────────────────────────
   7. Cards
   ───────────────────────────────────────────────────────────── */
.cca-card {
  position: relative; overflow: hidden;
  background: var(--cca-surface); border: 1px solid var(--cca-line);
  border-radius: var(--cca-r-card); box-shadow: var(--cca-sh-soft); padding: 20px;
}
.cca-card__title { font-family: var(--cca-font-display); font-weight: 700; font-size: 17px; color: var(--cca-blue); margin: 0 0 4px; }
.cca-card__head  { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.cca-card__foot  { display: flex; gap: 8px; justify-content: flex-end; margin: 16px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--cca-line); background: var(--light-gray); }

/* Signature hover: lift + orange bar slides in from the left */
.cca-card--hover { border: 2px solid rgba(12,103,175,.10); transition: var(--cca-ease); cursor: pointer; }
.cca-card--hover::before {
  content: ""; position: absolute; top: 0; left: 0; height: 4px; width: 100%;
  background: var(--cca-grad-bar); transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.cca-card--hover:hover { transform: translateY(-5px); box-shadow: var(--cca-sh-lift); }
.cca-card--hover:hover::before { transform: scaleX(1); }

/* Stat tile */
.cca-stat { background: var(--cca-surface); border: 1px solid var(--cca-line); border-radius: var(--cca-r-card); padding: 16px 18px; box-shadow: var(--cca-sh-subtle); }
.cca-stat__label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--cca-muted); display: flex; align-items: center; gap: 8px; }
.cca-stat__label i { color: var(--cca-orange); }
.cca-stat__value { font-family: var(--cca-font-display); font-weight: 700; font-size: 26px; color: var(--cca-ink); margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.cca-stat__delta { font-size: 12.5px; color: var(--cca-muted); margin-top: 4px; }
.cca-stat__delta.is-up   { color: var(--cca-success); }
.cca-stat__delta.is-down { color: var(--cca-danger); }

.cca-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Icon tile (app home / quick links) */
.cca-tile { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 14px 8px; background: var(--cca-surface); border: 1px solid var(--cca-line); border-radius: var(--cca-r-card); color: var(--cca-ink) !important; text-decoration: none !important; font-size: 12.5px; font-weight: 600; transition: var(--cca-ease); }
.cca-tile i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--cca-orange-soft); color: var(--cca-orange); font-size: 18px; }
.cca-tile:hover { transform: translateY(-3px); box-shadow: var(--cca-sh-lift); }

/* ─────────────────────────────────────────────────────────────
   8. Badges & chips
   ───────────────────────────────────────────────────────────── */
.cca-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--cca-r-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; line-height: 1.3; white-space: nowrap;
  background: var(--light-gray); color: var(--cca-muted);
}
.cca-badge--success { background: var(--cca-grad-success); color: #fff; }
.cca-badge--info    { background: var(--cca-blue-soft);   color: var(--cca-blue); }
.cca-badge--warn    { background: var(--cca-yellow-soft); color: var(--cca-warn-ink); }
.cca-badge--danger  { background: var(--cca-danger-soft); color: var(--cca-danger); }
.cca-badge--orange  { background: var(--cca-orange-soft); color: var(--cca-orange); }
.cca-badge--soft-success { background: var(--cca-green-soft); color: var(--cca-success-ink); }

.cca-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; min-height: 32px;
  border-radius: var(--cca-r-pill); border: 1.5px solid transparent;
  font-family: var(--cca-font-body); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: var(--cca-orange-soft); color: var(--cca-orange); cursor: default; white-space: nowrap;
}
button.cca-chip, a.cca-chip, label.cca-chip { cursor: pointer; text-decoration: none !important; transition: var(--cca-ease-fast); }
.cca-chip--filter { background: #fff; color: var(--cca-muted); border-color: var(--cca-line); }
.cca-chip--filter:hover { border-color: var(--cca-blue); color: var(--cca-blue); }
.cca-chip--filter.is-active, .cca-chip--filter[aria-pressed="true"] { background: var(--cca-blue); border-color: var(--cca-blue); color: #fff; }
.cca-chip .cca-chip__count { background: rgba(0,0,0,.08); border-radius: var(--cca-r-pill); padding: 0 6px; font-size: 11px; }
.cca-chip--filter.is-active .cca-chip__count { background: rgba(255,255,255,.22); }
.cca-chiprow { display: flex; gap: 8px; flex-wrap: wrap; }
.cca-chiprow--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.cca-chiprow--scroll::-webkit-scrollbar { display: none; }

/* ─────────────────────────────────────────────────────────────
   9. Tabs
   ───────────────────────────────────────────────────────────── */
.cca-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--cca-line); overflow-x: auto; scrollbar-width: none; margin: 0 0 20px; }
.cca-tabs::-webkit-scrollbar { display: none; }
.cca-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px;
  font-family: var(--cca-font-body); font-size: 14px; font-weight: 600; color: var(--cca-muted);
  background: none; border: 0; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: color .2s ease;
}
.cca-tab:hover { color: var(--cca-blue); }
.cca-tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--cca-orange); transform: scaleX(0); transition: transform .3s ease; }
.cca-tab.is-active, .cca-tab[aria-selected="true"] { color: var(--cca-blue); }
.cca-tab.is-active::after, .cca-tab[aria-selected="true"]::after { transform: scaleX(1); }

/* Segmented control (2–4 options) */
.cca-seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--light-gray); border: 1px solid var(--cca-line); border-radius: var(--cca-r); }
.cca-seg__btn { padding: 8px 14px; border: 0; background: none; border-radius: var(--cca-r-sm); font: 600 13px var(--cca-font-body); color: var(--cca-muted); cursor: pointer; transition: var(--cca-ease-fast); }
.cca-seg__btn.is-active, .cca-seg__btn[aria-pressed="true"] { background: #fff; color: var(--cca-blue); box-shadow: var(--cca-sh-subtle); }

/* ─────────────────────────────────────────────────────────────
   10. Tables
   ───────────────────────────────────────────────────────────── */
.cca-tablewrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1px solid var(--cca-line); border-radius: var(--cca-r-card); }
.cca-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cca-table th {
  position: sticky; top: 0; z-index: 1; text-align: left; white-space: nowrap;
  background: var(--light-gray); color: var(--cca-muted);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: 11px 14px; border-bottom: 1px solid var(--cca-line);
}
.cca-table td { padding: 11px 14px; border-bottom: 1px solid var(--cca-line); vertical-align: middle; }
.cca-table tbody tr:last-child td { border-bottom: 0; }
.cca-table tbody tr:hover td { background: var(--cca-blue-softer); }
.cca-table .is-num, .cca-table td.num, .cca-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cca-table tfoot td { font-weight: 700; background: var(--light-gray); border-top: 1px solid var(--cca-line); }
.cca-table--compact th, .cca-table--compact td { padding: 7px 10px; }
.cca-table--striped tbody tr:nth-child(even) td { background: var(--light-gray); }

/* ─────────────────────────────────────────────────────────────
   11. Alerts & toasts
   ───────────────────────────────────────────────────────────── */
.cca-alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--cca-r); border: 1px solid; font-size: 14px; line-height: 1.5; }
.cca-alert > i { margin-top: 2px; }
.cca-alert--info    { background: var(--cca-blue-softer); border-color: var(--cca-blue-edge); color: var(--cca-info-ink); }
.cca-alert--info > i { color: var(--cca-blue); }
.cca-alert--success { background: var(--cca-green-soft); border-color: rgba(40,167,69,.25); color: var(--cca-success-ink); }
.cca-alert--warn    { background: var(--cca-yellow-soft); border-color: rgba(255,192,0,.45); color: var(--cca-warn-ink); }
.cca-alert--danger  { background: var(--cca-danger-soft); border-color: rgba(220,53,69,.25); color: var(--cca-danger-ink); }

.cca-toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 2147483647; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.cca-has-bottomnav .cca-toasts { bottom: calc(var(--cca-bottom-nav) + 12px + env(safe-area-inset-bottom)); }
.cca-toast { pointer-events: auto; display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--cca-r); background: var(--text-dark); color: #fff; font-size: 14px; box-shadow: var(--cca-sh-lift); animation: cca-up .3s ease-out; }
.cca-toast--success { background: var(--cca-grad-success); }
.cca-toast--danger  { background: var(--cca-danger); }

/* ─────────────────────────────────────────────────────────────
   12. Modal / bottom sheet
   ───────────────────────────────────────────────────────────── */
.cca-backdrop { position: fixed; inset: 0; z-index: 2147483000; background: rgba(26,26,26,.5); display: none; align-items: center; justify-content: center; padding: 16px; }
.cca-backdrop.is-open { display: flex; animation: cca-fade .2s ease; }
.cca-modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: #fff; border-radius: var(--cca-r-xl); box-shadow: var(--cca-sh-deep); overflow: hidden; animation: cca-up .3s ease-out; }
.cca-modal--wide { width: min(880px, 100%); }
.cca-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--cca-line); }
.cca-modal__title { font-family: var(--cca-font-display); font-weight: 700; font-size: 18px; color: var(--cca-blue); margin: 0; }
.cca-modal__body { padding: 20px; overflow-y: auto; }
.cca-modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--cca-line); background: var(--light-gray); }
.cca-modal__close { width: 36px; height: 36px; border-radius: var(--cca-r-sm); border: 0; background: transparent; color: var(--cca-muted); cursor: pointer; font-size: 16px; }
.cca-modal__close:hover { background: var(--light-gray); color: var(--cca-ink); }

@media (max-width: 640px) {
  /* On phones a modal becomes a bottom sheet that clears the app's bottom nav */
  .cca-backdrop { align-items: flex-end; padding: 0; }
  .cca-modal { width: 100%; max-height: 92dvh; border-radius: var(--cca-r-xl) var(--cca-r-xl) 0 0; }
  .cca-modal__foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .cca-has-bottomnav .cca-modal__body { padding-bottom: calc(var(--cca-bottom-nav) + 8px); }
  .cca-modal__foot .cca-btn { flex: 1; }
}

/* ─────────────────────────────────────────────────────────────
   13. Empty state, skeleton, list rows
   ───────────────────────────────────────────────────────────── */
.cca-empty { text-align: center; padding: 40px 20px; color: var(--cca-muted); }
.cca-empty__icon { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center; background: var(--cca-blue-softer); color: var(--cca-blue); font-size: 24px; }
.cca-empty__title { font-family: var(--cca-font-display); font-weight: 700; font-size: 17px; color: var(--cca-ink); margin: 0 0 4px; }
.cca-empty__text  { font-size: 14px; margin: 0 auto 16px; max-width: 360px; }

.cca-skel { background: var(--cca-line); border-radius: var(--cca-r-sm); min-height: 14px; animation: cca-pulse 1.2s ease-in-out infinite; }

.cca-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--cca-line); border-radius: var(--cca-r-card); overflow: hidden; }
.cca-list__row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--cca-line); min-height: 56px; }
.cca-list__row:last-child { border-bottom: 0; }
.cca-list__icon { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: grid; place-items: center; background: var(--cca-orange-soft); color: var(--cca-orange); }
.cca-list__main { flex: 1; min-width: 0; }
.cca-list__title { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cca-list__meta { font-size: 12.5px; color: var(--cca-muted); }
a.cca-list__row { color: inherit; text-decoration: none !important; }
a.cca-list__row:hover { background: var(--cca-blue-softer); }

/* ─────────────────────────────────────────────────────────────
   14. Icons
   ───────────────────────────────────────────────────────────── */
.cca-ico        { color: var(--cca-orange); }          /* orange on light */
.cca-on-blue .cca-ico, .cca-hero .cca-ico { color: #fff; }  /* white on blue */
.cca-ico-badge  { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: var(--cca-orange-soft); color: var(--cca-orange); font-size: 17px; }
.cca-ico-badge--blue { background: var(--cca-blue-soft); color: var(--cca-blue); }

/* ─────────────────────────────────────────────────────────────
   15. Layout helpers
   ───────────────────────────────────────────────────────────── */
.cca-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.cca-section   { padding: 60px 0; }
.cca-stack > * + * { margin-top: 16px; }
.cca-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.cca-spacer { flex: 1; }
.cca-divider { height: 1px; background: var(--cca-line); border: 0; margin: 20px 0; }

/* ─────────────────────────────────────────────────────────────
   16. Motion
   ───────────────────────────────────────────────────────────── */
@keyframes cca-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes cca-up      { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes cca-pulse   { 50% { opacity: .45; } }
.cca-reveal { animation: cca-up .6s ease-out both; }

@media (prefers-reduced-motion: reduce) {
  :where(.cca) *, .cca-btn, .cca-card--hover, .cca-tile, .cca-modal, .cca-toast, .cca-reveal { animation: none !important; transition: none !important; }
  .cca-btn:hover, .cca-card--hover:hover, .cca-tile:hover { transform: none; }
}

/* ─────────────────────────────────────────────────────────────
   17. Responsive
   ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .cca-display { font-size: 36px; }
  :where(.cca) h1 { font-size: 28px; }
  .cca-section { padding: 48px 0; }
}
@media (max-width: 640px) {
  .cca-display { font-size: 32px; }
  :where(.cca) h1 { font-size: 26px; }
  :where(.cca) h2, .cca-h2 { font-size: 21px; }
  :where(.cca) h3 { font-size: 17px; }
  .cca-body { font-size: 15px; }
  .cca-pagehead__title { font-size: 21px; }
  .cca-formgrid { grid-template-columns: 1fr; }
  .cca-container { padding: 0 16px; }
  .cca-section { padding: 36px 0; }
  .cca-card { padding: 16px; }
  .cca-card__foot { margin: 14px -16px -16px; padding: 12px 16px; }
  .cca-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  .cca-stat__value { font-size: 22px; }
  .cca-input, .cca-select, .cca-textarea { font-size: 16px; } /* stops iOS zoom on focus */
}

@media print {
  .cca-btn, .cca-tabs, .cca-toasts, .cca-backdrop { display: none !important; }
  .cca-card, .cca-tablewrap { box-shadow: none; border-color: var(--cca-line); }
}
