/* ============================================================================
   CMA stylesheet — derived from Accadema design manual sections:
     §04 Color · §05 Typography · §07 Radii · §11 Buttons · §12 Badges
     §13 Cards · §14 Lists · §22 Status & feedback · §24 Footer
     §31 Responsive · §34 Design tokens · §38 Product navbar
   Single source of truth: docs/Accadema-Lab/design/accadema-design-manual.html
   ============================================================================ */

:root {
  /* §34 Design tokens — neutrals */
  --primary:   #0f172a;
  --text:      #1e293b;
  --text-muted:#64748b;
  --border:    #e2e8f0;
  --bg:        #ffffff;
  --bg-alt:    #f8fafc;

  /* §34 Accent (reserved — links, Athena) */
  --accent:    #3b82f6;

  /* §34 Status (functional only — never decoration) */
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --info:      #3b82f6;

  /* §04 Hero gradient (single dark surface) */
  --hero-from: #0a0e1a;
  --hero-to:   #1a1f35;

  /* §31 Page inset — same horizontal breathing on nav/hero/body/footer */
  --page-inset: clamp(1.25rem, 3vw, 3rem);

  /* §07 Radius — only 2px (sharp) or 999px (pill, dots only) */
  --radius-sharp: 2px;
}

/* ===== Base ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

/* §31 Scrollbar gutter — layout stability (hard rule) */
html { scrollbar-gutter: stable; }
@supports not (scrollbar-gutter: stable) { html { overflow-y: scroll; } }
html, body { max-width: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--bg);
}

/* §05 Typography */
h1,h2,h3,h4,h5,h6 { font-weight: 600; color: var(--primary); line-height: 1.25; }
h1 { font-size: clamp(1.85rem, 4.5vw, 3.2rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p { color: var(--text); margin-bottom: 1rem; }
.lead { color: var(--text-muted); font-size: 1.05rem; max-width: 60ch; }
.eyebrow { display:inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .05em;
           text-transform: uppercase; color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.mono { font-family: Monaco, 'Courier New', monospace; font-variant-numeric: tabular-nums; }

/* §05 Forbidden in UI */
em, i.italic { font-style: normal; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--primary); }

/* ===== Layout containers — §31 container width matrix ===== */
.acc-container { width: 100%; padding-left: var(--page-inset); padding-right: var(--page-inset); margin-left: auto; margin-right: auto; }
@media (min-width: 1200px) { .acc-container { max-width: 1320px; } }
@media (min-width: 1440px) { .acc-container { max-width: 1440px; } }
@media (min-width: 1600px) { .acc-container { max-width: 1600px; } }
@media (min-width: 1920px) { .acc-container { max-width: 1680px; } }
@media (min-width: 2560px) { .acc-container { max-width: 1840px; } }

.acc-narrow { max-width: 680px; }
.acc-section { padding: 3rem 0; }
.acc-section-tight { padding: 2rem 0; }

/* ===== §11 Buttons — sharp, weight 600, inversion hover ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sharp); padding: .75rem 2rem;
  font-weight: 600; font-size: 1rem; line-height: 1.2;
  text-decoration: none; cursor: pointer;
  transition: background-color .18s, border-color .18s, color .18s, transform .18s;
  border: 1px solid transparent;
}
.btn-dark { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-dark:hover, .btn-dark:focus-visible { background: #fff; color: var(--primary); transform: translateY(-1px); outline: none; }
.btn-outline-dark { background: #fff; border-color: var(--border); color: var(--text); }
.btn-outline-dark:hover, .btn-outline-dark:focus-visible { background: var(--primary); border-color: var(--primary); color: #fff; transform: translateY(-1px); outline: none; }
.btn-sm { padding: .4rem 1rem; font-size: .875rem; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ===== §12 Badges ===== */
.b-badge {
  display: inline-block; padding: .2rem .5rem;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  border-radius: var(--radius-sharp);
}
.b-badge.dark { background: var(--primary); color: #fff; }
.b-badge.muted { background: var(--bg-alt); color: var(--primary); border: 1px solid var(--border); }
.b-badge.accent { background: rgba(59,130,246,.08); color: var(--accent); }
.b-badge.ok { background: rgba(34,197,94,.1); color: #15803d; }
.b-badge.warn { background: rgba(245,158,11,.1); color: #b45309; }
.b-badge.danger { background: rgba(239,68,68,.1); color: #b91c1c; }

/* ===== §13 Cards — hairline border, no shadow, 2px ===== */
.card-clean {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sharp); padding: 1.5rem;
  transition: border-color .2s;
}
.card-clean:hover { border-color: var(--text-muted); }

/* ===== §14 Lists ===== */
.list-clean { list-style: none; padding: 0; margin: 0; }
.list-clean li {
  padding: .85rem 0; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: .75rem;
}
.list-clean li:last-child { border-bottom: none; }
.list-clean li i { color: var(--text-muted); min-width: 1.1rem; }

.data-row { display: flex; justify-content: space-between; gap: 1rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
.data-row:last-child { border-bottom: none; }

/* ===== §22 Status line + pulsing dot ===== */
.status-line { display: flex; align-items: center; gap: .65rem; font-size: 1rem; padding: .55rem 0; }
.status-line .dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.status-line .dot.dot-ok   { background: var(--success); animation: pulseDot 1.8s ease-out infinite; }
.status-line .dot.dot-warn { background: var(--warning); }
.status-line .dot.dot-err  { background: var(--danger);  animation: pulseDot-err 1.4s ease-out infinite; }
.status-line .dot.dot-unknown { background: var(--text-muted); }
.status-line .name { font-weight: 600; color: var(--primary); }
.status-line .label { color: var(--text-muted); font-size: .85rem; margin-left: auto; }

@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
@keyframes pulseDot-err {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ===== §08 Icon block ===== */
.icon-simple {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  font-size: 1.1rem; border-radius: var(--radius-sharp);
}

/* ===== Logo / wordmark ===== */
.logo-mark {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 800; letter-spacing: -.5px; color: var(--primary);
  text-decoration: none;
}
.logo-mark.large { font-size: 2.4rem; }
.logo-mark.medium { font-size: 1.4rem; }
.logo-mark.small { font-size: 1rem; }
.logo-mark.inv { color: #fff; }
.logo-mark sup { font-size: 35%; font-weight: 600; }

/* ===== §38 Product navbar ===== */
.nav-acc {
  display: flex; align-items: center; gap: 1.75rem;
  padding: .95rem var(--page-inset);
  background: #fff; border-bottom: 1px solid var(--border);
  min-height: 64px; max-width: 100%;
}
.nav-acc .nav-brand {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 800; font-size: 1.05rem; color: var(--primary);
  text-decoration: none; letter-spacing: -.3px; flex-shrink: 0;
}
.nav-acc .nav-brand .module-mark {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-sharp); font-size: .85rem;
}
.nav-acc .nav-divider { width: 1px; height: 22px; background: var(--border); }
.nav-acc .nav-context { display: flex; flex-direction: column; line-height: 1.1; }
.nav-acc .nav-context .label { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.nav-acc .nav-context .name { font-size: .92rem; color: var(--primary); font-weight: 600; }
.nav-acc .nav-actions { display: flex; align-items: center; gap: .65rem; margin-left: auto; flex-shrink: 0; }
.nav-acc .nav-link {
  color: var(--text); text-decoration: none;
  font-size: .88rem; font-weight: 500;
  padding: .45rem .8rem; border-radius: var(--radius-sharp);
  transition: background .15s;
}
.nav-acc .nav-link:hover, .nav-acc .nav-link.active { background: var(--bg-alt); color: var(--primary); }
.nav-acc .nav-link.active { background: var(--bg-alt); }
.nav-acc .nav-user {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .25rem .25rem .25rem .65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sharp);
  text-decoration: none; color: var(--text);
  font-size: .88rem; font-weight: 500;
}
.nav-acc .nav-user:hover { border-color: var(--text-muted); color: var(--primary); }
.nav-acc .nav-user .avatar {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-sharp);
  font-size: .72rem; font-weight: 700;
}

/* ===== §35 Tables ===== */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sharp);
  overflow: hidden; font-size: .92rem; background: #fff;
}
.tbl th, .tbl td {
  padding: .7rem .9rem; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border);
}
.tbl thead th {
  background: var(--bg-alt);
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--bg-alt); }
.tbl .mono { font-variant-numeric: tabular-nums; }
.tbl-empty { padding: 3rem 1.5rem; text-align: center; color: var(--text-muted); }

/* ===== §21 Forms ===== */
.form-row { margin-bottom: 1rem; }
.form-label {
  display: block; font-size: .72rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: .35rem;
}
.form-control {
  width: 100%; padding: .55rem .65rem;
  border: 1px solid var(--border); border-radius: var(--radius-sharp);
  background: #fff; color: var(--text);
  font-family: inherit; font-size: 1rem; line-height: 1.4;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15,23,42,.06);
}

/* ===== §22 Callouts ===== */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
  padding: 1rem 1.25rem; border-radius: var(--radius-sharp);
  margin: 1rem 0;
}
.callout.do { border-left-color: var(--success); background: rgba(34,197,94,.05); }
.callout.dont { border-left-color: var(--danger); background: rgba(239,68,68,.05); }
.callout.tip { border-left-color: var(--accent); }
.callout-title { font-weight: 700; display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; color: var(--primary); }

/* ===== Light footer (canonical "by Accadema" pattern)
   Markup: <p class="light-footer">by <span class="logo-mark small">Accadema</span></p>
   Source: services/CAM/public/admin/assets/cam.css line 758
   No border-top, no bg fill, no copyright line — just attribution. */
.light-footer {
  text-align: center;
  margin: 1.5rem 0 0;
  padding: 1.5rem 0 2rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  opacity: .65;                /* whole line skimmed; wordmark itself stays --primary */
  letter-spacing: 0;
  text-transform: none;
}

/* ===== Hero (cosmic — derived from docs/Accadema-Lab/index28.html pattern) =====
   Outer .acc-hero-wrap = transparent (body shows through), horizontal page-inset.
   Inner .acc-hero-panel = dark gradient, animated glows, stars canvas, 2px radius. */
.acc-hero-wrap {
  position: relative;
  background: transparent;
  padding: 0 var(--page-inset) 2rem;
  overflow: hidden;
}
.acc-hero-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-sharp);
  padding: 1rem 3rem 3rem;
  color: #fff;
}
.acc-hero-panel h1 {
  color: #fff;
  font-size: clamp(1.9rem, 4.5vw, 3.4rem);
  font-weight: 700; line-height: 1.2; letter-spacing: -.02em;
  margin: 1.5rem 0 1.2rem;
}
.acc-hero-panel .lead {
  color: rgba(255,255,255,.82);
  font-size: 1.1rem; max-width: 72ch;
  margin: 0 auto 2rem;
}

/* Animated radial glows (z-index 0) */
.hero-glow {
  position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
  border-radius: 50%;
  top: -200px; right: -100px; z-index: 0;
  animation: pulseGlow 8s ease-in-out infinite;
}
.hero-glow-2 {
  position: absolute; width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(139,92,246,.12) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -150px; left: -80px; z-index: 0;
  animation: pulseGlow 10s ease-in-out infinite 2s;
}
@keyframes pulseGlow {
  0%, 100% { opacity: .5; transform: scale(1); }
  50%      { opacity: .8; transform: scale(1.1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-glow, .hero-glow-2 { animation: none; }
}

/* Stars canvas (z-index 1) */
#stars-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: .5; z-index: 1;
}

/* Hero content sits above glows + canvas (z-index 2) */
.hero-content { position: relative; z-index: 2; }

/* Hero badge — white pill with backdrop blur */
.hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .5rem 1rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-sharp);
  color: #fff;
  font-size: .875rem; font-weight: 600;
  backdrop-filter: blur(10px);
}

/* Hero status-line inside the panel */
.acc-hero-panel .status-line .name { color: #fff; }
.acc-hero-panel .status-line .label { color: rgba(255,255,255,.55); }

@media (max-width: 991.98px) {
  .acc-hero-panel { padding: .5rem 1.5rem 2rem; }
}
@media (max-width: 575.98px) {
  .acc-hero-wrap { padding: 0 var(--page-inset) 1.5rem; }
  .acc-hero-panel { padding: 1rem 1.25rem 1.75rem; }
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.d-flex { display: flex; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ===== §31 Responsive — navbar collapse ===== */
@media (max-width: 767.98px) {
  .nav-acc { gap: 1rem; padding: .8rem var(--page-inset); }
  .nav-acc .nav-context { display: none; }
  .nav-acc .nav-link { display: none; }
}
@media (max-width: 991.98px) {
  .acc-section { padding: 2rem 0; }
}
