/* =========================================================
   SLV COS - Grey Base Theme (Header.php Compatible)
   File: /assets/theme.css
   - Grey background base
   - Blue frame + blue accents (SLV)
   - Works with header.php: .page/.shell/.topbar/.content
   - Keeps ERP layout classes (.app/.sidebar/.main) optional
   ========================================================= */

/* ---------- Variables ---------- */
:root{
  /* SLV Blue */
  --primary: #3A78FF;
  --primary-2: #1B59E6;
  --primary-soft: rgba(58,120,255,0.14);

  /* Grey base */
  --bg: #EEF2F6;             /* page background */
  --bg-2: #E6EBF2;           /* subtle alt background */
  --panel: rgba(255,255,255,0.78);
  --card: #FFFFFF;
  --card-2: #F6F8FB;

  --text: #0E1A2B;           /* deep navy */
  --muted: rgba(14,26,43,0.62);

  --border: rgba(14,26,43,0.10);
  --border-2: rgba(58,120,255,0.22);
  --border-3: rgba(58,120,255,0.35);

  --shadow: 0 18px 40px rgba(12,18,28,0.10);
  --shadow-soft: 0 10px 24px rgba(12,18,28,0.08);

  --radius: 16px;
  --radius-sm: 12px;

  --success: #16A34A;
  --warn: #F59E0B;
  --danger: #DC2626;
  --info: #2563EB;

  --focus: rgba(58,120,255,0.22);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
}

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(900px 520px at 15% 5%, rgba(58,120,255,0.08), transparent 60%),
    radial-gradient(700px 520px at 85% 15%, rgba(58,120,255,0.06), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  line-height:1.55;
}

/* Typography */
h1{ font-size: 28px; line-height:1.15; margin:0 0 10px; font-weight: 950; letter-spacing: .2px; }
h2{ font-size: 18px; line-height:1.2; margin:0 0 10px; font-weight: 900; }
h3{ font-size: 15px; line-height:1.25; margin:0 0 10px; font-weight: 900; }
p{ margin: 8px 0; color: rgba(14,26,43,0.92); }
ul{ margin: 10px 0; padding-left: 18px; }
li{ margin: 6px 0; color: rgba(14,26,43,0.90); }

a{ color: rgba(14,26,43,0.92); text-decoration:none; }
a:hover{ color: #0B3EC9; text-decoration: underline; }
::selection{ background: rgba(58,120,255,0.22); color:#081425; }

/* ---------- Header.php layout compatibility ---------- */
.page{
  min-height: 100vh;
  padding: 22px 18px 34px;
}
.shell{
  max-width: 1120px;
  margin: 0 auto;
}
.content{
  margin-top: 16px;
}

/* Topbar (header.php) */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(58,120,255,0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}
.topbar-right{
  display:flex;
  align-items:center;
  gap: 10px;
}

/* Brand (header.php) */
.brand{
  display:flex;
  align-items:center;
  gap: 10px;
}
.brand-title{
  font-weight: 950;
  letter-spacing: .2px;
}

/* Logo */
.brand-dot{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background:
    url("/assets/logo.png") center/contain no-repeat,
    radial-gradient(circle at 30% 30%, rgba(58,120,255,.25), rgba(58,120,255,.10));
  border: 1px solid rgba(58,120,255,0.35);
  box-shadow: 0 8px 18px rgba(58,120,255,0.12);
}

/* Pills */
.pill{
  display:inline-flex;
  align-items:center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(58,120,255,0.08);
  border: 1px solid rgba(58,120,255,0.18);
  color: rgba(14,26,43,0.88);
  font-size: 12px;
  font-weight: 850;
}

/* Notices (flash) */
.notice{
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(14,26,43,0.10);
  background: rgba(255,255,255,0.72);
  font-weight: 800;
}
.notice-success{ border-color: rgba(22,163,74,0.25); background: rgba(22,163,74,0.10); }
.notice-warning{ border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.10); }
.notice-danger{ border-color: rgba(220,38,38,0.25); background: rgba(220,38,38,0.10); }

/* ---------- Cards ---------- */
.card{
  background: var(--card);
  border: 1px solid rgba(14,26,43,0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}
.stack{ display:flex; flex-direction:column; gap: 14px; }
.muted{ color: var(--muted); }
.small{ font-size: 12px; color: var(--muted); }
.hr{ height:1px; background: rgba(14,26,43,0.08); margin: 14px 0; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(14,26,43,0.12);
  background: rgba(255,255,255,0.85);
  color: rgba(14,26,43,0.92);
  cursor: pointer;
  font-weight: 850;
  user-select:none;
  transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover{
  background: #fff;
  border-color: rgba(58,120,255,0.25);
  box-shadow: 0 10px 20px rgba(12,18,28,0.08);
  text-decoration: none;
}
.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: linear-gradient(180deg, rgba(58,120,255,1), rgba(27,89,230,1));
  border-color: rgba(58,120,255,0.55);
  color:#ffffff;
  box-shadow: 0 12px 22px rgba(58,120,255,0.18);
}
.btn-primary:hover{
  background: linear-gradient(180deg, rgba(76,135,255,1), rgba(27,89,230,1));
}
.btn-ghost{
  background: transparent;
  border-color: rgba(14,26,43,0.12);
}

/* ---------- Forms ---------- */
label{
  display:block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 800;
}
input, select, textarea{
  width: 100%;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(14,26,43,0.12);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea{ min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus{
  border-color: rgba(58,120,255,0.55);
  box-shadow: 0 0 0 4px var(--focus);
  background: #fff;
}
::placeholder{ color: rgba(14,26,43,0.40); }

/* Checkbox */
input[type="checkbox"]{
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px){
  .page{ padding: 14px 12px 24px; }
  h1{ font-size: 22px; }
  .topbar{ flex-direction: column; align-items:flex-start; }
  .topbar-right{ width:100%; justify-content:flex-end; }
}

/* =========================================================
   OPTIONAL: ERP layout (future)
   ========================================================= */
.app{
  display:grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}
.sidebar{
  background: rgba(255,255,255,0.75);
  border-right: 1px solid rgba(58,120,255,0.16);
  padding: 18px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  box-shadow: 12px 0 30px rgba(12,18,28,0.06);
}
.main{ padding: 22px 22px 34px; }

/* Sidebar nav */
.nav{
  display:flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
}
.nav a{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 10px;
  border-radius: 12px;
  color: rgba(14,26,43,0.86);
  border: 1px solid transparent;
}
.nav a:hover{
  background: rgba(58,120,255,0.08);
  border-color: rgba(58,120,255,0.18);
  text-decoration:none;
}
.nav a.active{
  background: rgba(58,120,255,0.12);
  border-color: rgba(58,120,255,0.35);
  color: rgba(14,26,43,0.95);
}
/* ---------- Brand text (header) ---------- */
.brand-text{
  display:flex;
  flex-direction: column;
  line-height:1.1;
}

.brand-sub{
  font-size:11px;
  font-weight:700;
  letter-spacing:.3px;
  color: rgba(14,26,43,0.55);
}

/* =========================
   Light theme text fix
   ========================= */

/* common text helpers used across pages */
.muted,
.helptext,
.small,
.card p,
label,
.details,
details,
summary{
  color: var(--muted) !important;
}

/* headings */
h1,h2,h3,.section-title,.q-no,.q-title,.brand-title{
  color: var(--text) !important;
}

/* pills / chips */
.pill,
.dim-chip,
.explain-hint{
  color: var(--muted2) !important;
  border-color: var(--border) !important;
  background: rgba(15,23,42,.03) !important;
}

/* option label text (your radio goal cards) */
label.opt .txt{
  color: var(--text) !important;
}
label.opt{
  background: rgba(15,23,42,.02) !important;
  border-color: var(--border) !important;
}
label.opt:hover{
  border-color: var(--primary-border) !important;
}
label.opt:has(input:checked){
  background: var(--primary-weak) !important;
  border-color: var(--primary-border) !important;
}

/* inputs */
input, select, textarea{
  color: var(--text) !important;
  background: #fff !important;
  border-color: var(--border) !important;
}

/* details explain box */
details.explain{
  background: rgba(15,23,42,.02) !important;
  border-color: var(--border) !important;
}
details.explain .body{
  color: var(--muted) !important;
}

/* risk box */
.riskline{
  background: rgba(15,23,42,.02) !important;
  border-color: var(--border) !important;
}
.riskline .txt{ color: var(--muted) !important; }

/* score pills */
.score-pill{
  background: rgba(15,23,42,.02) !important;
  border-color: var(--border) !important;
}
.score-pill .label{ color: var(--text) !important; }
.score-pill .sub{ color: var(--muted2) !important; }
.score-pill:has(input:checked){
  border-color: var(--primary-border) !important;
  background: var(--primary-weak) !important;
}
.score-pill:has(input:checked) .dot{
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(58,160,255,.18) !important;
}

/* =========================
   FIX: index.php faint text
   ========================= */

/* these are used by index.php inline styles */
.score-hint,
.section-title,
.q-title,
.q-no,
.dim-chip,
.explain-hint,
.riskline .txt{
  color: rgba(14,26,43,0.88) !important;
}

/* “Select one score:” label line sometimes inherits too light */
.score-hint{
  font-weight: 900 !important;
}

/* details summary should be dark */
details.explain summary{
  color: rgba(14,26,43,0.92) !important;
}

/* If any leftover text still looks washed out */
.card,
.card *{
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}