/* =========================================================
   NEW STRENGTH CRM — UI (Light default + optional Dark)
   Based on demo design system (Black/Gold) but LIGHT as default.
   Fonts: Montserrat (headings), Inter (body)
========================================================= */

/* ---------- Theme Tokens ---------- */
:root{
  /* Light */
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F0F1F6;
  --border: #E3E5EE;

  --text: #101114;
  --muted: #6B6E76;

  --gold: #F5C542;
  --gold-hover: #E0B737;

  --success: #2ECC71;
  --warning: #F39C12;
  --danger: #E74C3C;
  --info: #3DA5FF;

  --shadow: 0 10px 30px rgba(16,17,20,.10);
  --shadow-soft: 0 8px 18px rgba(16,17,20,.08);

  --radius: 14px;
  --radius-sm: 10px;

  --sidebar-w: 280px;
  --topbar-h: 64px;

  --focus: 0 0 0 4px rgba(245,197,66,.25);
}

/* Dark theme overrides */
html[data-theme="dark"]{
  --bg: #0E0E10;
  --surface: #1A1A1D;
  --surface-2: #151518;
  --border: #2A2A2D;

  --text: #F5F5F5;
  --muted: #9A9A9A;

  --shadow: 0 10px 30px rgba(0,0,0,.45);
  --shadow-soft: 0 8px 18px rgba(0,0,0,.35);
  --focus: 0 0 0 4px rgba(245,197,66,.20);
}

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

h1,h2,h3{
  font-family: Montserrat, Inter, system-ui, sans-serif;
  letter-spacing: .2px;
  margin:0 0 10px 0;
}
h1{ font-size: 22px; }
h2{ font-size: 18px; }
p{ margin: 0 0 10px 0; color: var(--muted); }
a{ color: inherit; text-decoration: none; }
small{ color: var(--muted); }

:focus-visible{ outline:none; box-shadow: var(--focus); border-radius: 10px; }

/* ---------- Layout Shell ---------- */
.shell{
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}
.sidebar{
  position: sticky;
  top:0;
  height: 100vh;
  padding: 18px 14px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.topbar{
  height: var(--topbar-h);
  display:flex;
  align-items:center;
  gap:12px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top:0;
  z-index: 5;
}
.content{
  min-height: calc(100vh - var(--topbar-h));
}
.page-inner{
  padding: 18px;
  max-width: 1300px;
  margin: 0 auto;
}


.main-area{
  min-width: 0;
  display:flex;
  flex-direction: column;
}

.content{
  flex: 1;
  min-height: 0;
}

/* Desktop: hide hamburger */
.topbar #sidebarToggle{ display:none; }

/* Auth pages */
body.is-auth .shell{
  grid-template-columns: 1fr;
}
body.is-auth .main-area{
  min-height: 100vh;
}
body.is-auth .page-inner{
  max-width: 520px;
  padding-top: 28px;
  padding-bottom: 28px;
}

/* Mobile / tablet: off-canvas sidebar + hamburger */
@media (max-width: 980px){
  .topbar #sidebarToggle{ display:inline-flex; }
  .shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed;
    left: 0;
    top: 0;
    width: min(var(--sidebar-w), 86vw);
    transform: translateX(-110%);
    transition: transform .18s ease;
    z-index: 60;
    box-shadow: 0 18px 50px rgba(0,0,0,.22);
  }
  body.sidebar-open .sidebar{ transform: translateX(0); }

  body.sidebar-open::before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 55;
  }
}
/* When not logged in */
body.is-auth .content{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 20px;
}
body.is-auth .page-inner{ width:100%; max-width: 520px; }

/* ---------- Brand / Nav ---------- */
.brand{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 10px 10px 14px 10px;
}
.logo{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: linear-gradient(135deg, var(--gold), rgba(245,197,66,.55));
  color: #141417;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: var(--shadow-soft);
}
.logo.big{ width: 56px; height: 56px; border-radius: 18px; font-size: 18px; }

.brand-title{ font-weight: 800; line-height:1.05; }
.brand-sub{ font-size: 12px; color: var(--muted); margin-top: 2px; }

.nav{ display:flex; flex-direction:column; gap: 6px; padding: 8px; }
.nav-item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  border: 1px solid transparent;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.nav-item i{ width: 18px; text-align:center; }
.nav-item:hover{
  background: rgba(245,197,66,.10);
  border-color: rgba(245,197,66,.25);
  color: var(--text);
}
.nav-item.active{
  background: rgba(245,197,66,.16);
  border-color: rgba(245,197,66,.35);
  color: var(--text);
}
.sidebar-footer{
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

/* ---------- Topbar ---------- */
.topbar-spacer{ flex: 1; }
.user-pill{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.user-text{ line-height: 1.1; }
.user-name{ font-weight: 700; font-size: 13px; }
.user-role{ font-size: 12px; color: var(--muted); text-transform: capitalize; }

/* ---------- Components ---------- */
.card{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 16px;
}
.card-header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-title{ font-weight: 800; }

.grid{ display:grid; gap: 14px; }
.grid.cols-2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px){
  .grid.cols-3{ grid-template-columns: 1fr; }
}
@media (max-width: 900px){
  .grid.cols-2{ grid-template-columns: 1fr; }
}

/* Buttons */
.btn{
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  display:inline-flex;
  align-items:center;
  gap: 8px;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); }
.btn:active{ transform: translateY(0px); }

.btn.primary{
  background: var(--gold);
  border-color: rgba(0,0,0,.08);
  color: #141417;
}
html[data-theme="dark"] .btn.primary{
  border-color: rgba(255,255,255,.10);
}
.btn.primary:hover{ background: var(--gold-hover); }

.btn.subtle{
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.subtle:hover{
  background: rgba(245,197,66,.12);
  border-color: rgba(245,197,66,.20);
  color: var(--text);
}
.btn.icon{ padding: 10px; border-radius: 12px; }
.btn.full{ width:100%; justify-content:center; }

/* Inputs */
.field{ display:flex; flex-direction:column; gap: 6px; margin-bottom: 12px; }
.label{ font-weight: 700; font-size: 13px; }
.input, select, textarea{
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  outline: none;
}
.input::placeholder{ color: rgba(107,110,118,.85); }
html[data-theme="dark"] .input::placeholder{ color: rgba(154,154,154,.85); }

.help{ font-size: 12px; color: var(--muted); }

/* ---------- Forms (Premium) ---------- */
.form-card{ padding: 0; }
.card-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(245,197,66,.10), transparent 68%);
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}
.form{ padding: 14px 16px 16px 16px; }
.form-section{ padding: 14px 0; border-bottom: 1px dashed var(--border); }
.form-section:last-of-type{ border-bottom: none; }
.section-head{ display:flex; align-items:flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-title{ font-weight: 900; letter-spacing: .2px; }
.section-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }
.req{ color: var(--danger); font-weight: 900; margin-left: 4px; }

.form-actions{ display:flex; gap: 10px; align-items:center; padding-top: 14px; }

/* Switch component */
.switch{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
}
.switch .meta{ min-width: 0; }
.switch .meta .label{ margin: 0; }
.switch input[type="checkbox"]{
  appearance: none;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .14s ease, border-color .14s ease;
}
.switch input[type="checkbox"]::after{
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 4px 10px rgba(16,17,20,.18);
  transition: transform .14s ease;
}
html[data-theme="dark"] .switch input[type="checkbox"]::after{
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.switch input[type="checkbox"]:checked{
  background: rgba(245,197,66,.85);
  border-color: rgba(245,197,66,.55);
}
.switch input[type="checkbox"]:checked::after{ transform: translateX(20px); }

/* Inputs: subtle focus + icons spacing */
select, textarea{ font-family: inherit; }
.input, select, textarea{ transition: border-color .12s ease, box-shadow .12s ease; }
.input:focus, select:focus, textarea:focus{ border-color: rgba(245,197,66,.55); box-shadow: var(--focus); }

/* Badges */
.badge{
  display:inline-flex;
  align-items:center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.badge.good{ border-color: rgba(46,204,113,.35); background: rgba(46,204,113,.10); color: var(--success); }
.badge.warn{ border-color: rgba(243,156,18,.35); background: rgba(243,156,18,.10); color: var(--warning); }
.badge.bad{ border-color: rgba(231,76,60,.35); background: rgba(231,76,60,.10); color: var(--danger); }
.badge.info{ border-color: rgba(61,165,255,.35); background: rgba(61,165,255,.10); color: var(--info); }

/* Table */
.table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.table th, .table td{
  padding: 12px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}
.table th{
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  background: var(--surface-2);
}
.table tr:last-child td{ border-bottom: none; }
.table tr:hover td{ background: rgba(245,197,66,.06); }

/* Flash */
.flash{
  border-radius: var(--radius);
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  margin-bottom: 12px;
  display:flex;
  gap: 10px;
  align-items:flex-start;
}
.flash.success{ border-color: rgba(46,204,113,.35); background: rgba(46,204,113,.08); }
.flash.warning{ border-color: rgba(243,156,18,.35); background: rgba(243,156,18,.08); }
.flash.danger{ border-color: rgba(231,76,60,.35); background: rgba(231,76,60,.08); }
.flash.info{ border-color: rgba(61,165,255,.35); background: rgba(61,165,255,.08); }

/* Auth */
body.is-auth{
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(61,165,255,.10), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(245,197,66,.14), transparent 55%),
    var(--bg);
}
body.is-auth .content{
  min-height: 100vh;
  display:flex;
  align-items:center;
  justify-content:center;
}
body.is-auth .page-inner{
  max-width: 560px;
  width: 100%;
  padding: 28px 18px;
}
.auth-wrap{ width:100%; display:flex; flex-direction:column; gap: 14px; }
.auth-card{ padding: 18px; }
.auth-head{ align-items:flex-start; }
.auth-brand{ display:flex; gap: 12px; align-items:center; }
.logo.big{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  font-size: 18px;
}
.auth-actions{ margin-top: 14px; }
.auth-footer{ font-size: 13px; text-align:center; }

.input-wrap{
  position: relative;
}
.input-wrap > i{
  position:absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  pointer-events:none;
}
.input.has-icon{
  padding-left: 38px;
}
.icon-btn{
  position:absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.icon-btn:hover{
  background: rgba(16,17,20,.04);
  border-color: var(--border);
  color: var(--text);
}


/* Mobile sidebar overlay */
@media (max-width: 980px){
  .shell{ grid-template-columns: 1fr; }
  .sidebar{
    position: fixed;
    left: -320px;
    width: min(320px, 86vw);
    z-index: 20;
    transition: left .18s ease;
    box-shadow: var(--shadow);
  }
  body.sidebar-open .sidebar{ left: 0; }
  .topbar{ position: sticky; top:0; z-index: 10; }
  body.sidebar-open::before{
    content:"";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.35);
    z-index: 15;
  }
}


/* ---------- Page Header / Toolbars ---------- */
.muted{ color: var(--muted); }
.page-header{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.page-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

.toolbar{
  display:flex;
  align-items:flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.toolbar-left, .toolbar-right{ display:flex; gap: 10px; flex-wrap:wrap; align-items:flex-end; }
.field.inline{ margin:0; }
.field.inline .input{ min-width: 220px; }
@media (max-width: 520px){
  .field.inline .input{ min-width: 0; }
}

.right{ text-align:right; }

/* =========================================================
   Dashboard KPI Cards (dynamic + semantic colors)
========================================================= */

.kpi-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap:16px;
  margin: 14px 0 18px;
}

@media (max-width: 1100px){
  .kpi-grid{ grid-template-columns: repeat(2, minmax(220px, 1fr)); }
}

@media (max-width: 640px){
  .kpi-grid{ grid-template-columns: 1fr; }
}

.kpi-card{
  border-radius: 16px;
  padding: 16px 16px 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  position: relative;
  overflow: hidden;
}

/* --- Restricted KPI (e.g. reception role) --- */
.kpi-restricted{
  pointer-events: none;
}

.kpi-blur{
  filter: blur(6px);
  user-select: none;
}

.kpi-lock{
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.06);
  border: 1px solid var(--border);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

html[data-theme="dark"] .kpi-lock{
  background: rgba(255,255,255,.06);
}

.kpi-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-label{
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .2px;
}

.kpi-value{
  font-size: 34px;
  font-weight: 800;
  margin-top: 6px;
  line-height: 1.05;
  color: var(--text);
}

.kpi-sub{
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.kpi-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 10px;
}

.kpi-chip{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.04);
  border: 1px solid var(--border);
  color: var(--muted);
}

html[data-theme="dark"] .kpi-chip{
  background: rgba(255,255,255,.06);
}

/* Revenue: bigger + bolder */
.kpi-revenue{
  grid-column: span 2;
  padding: 18px 18px 16px;
  border-color: rgba(61,165,255,.35);
  background: linear-gradient(180deg, rgba(61,165,255,.12), rgba(255,255,255,0));
}

html[data-theme="dark"] .kpi-revenue{
  background: linear-gradient(180deg, rgba(61,165,255,.14), rgba(0,0,0,0));
}

.kpi-revenue .kpi-value{
  font-size: 44px;
  font-weight: 900;
  letter-spacing: .2px;
}

@media (max-width: 640px){
  .kpi-revenue{ grid-column: span 1; }
}

/* Semantic status colors (light tints) */
.kpi-ok{
  border-color: rgba(46,204,113,.35);
  background: linear-gradient(180deg, rgba(46,204,113,.10), rgba(255,255,255,0));
}

.kpi-warn{
  border-color: rgba(243,156,18,.40);
  background: linear-gradient(180deg, rgba(243,156,18,.10), rgba(255,255,255,0));
}

.kpi-bad{
  border-color: rgba(231,76,60,.38);
  background: linear-gradient(180deg, rgba(231,76,60,.10), rgba(255,255,255,0));
}

html[data-theme="dark"] .kpi-ok,
html[data-theme="dark"] .kpi-warn,
html[data-theme="dark"] .kpi-bad{
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(0,0,0,0));
}

/* Soft accent glow */
.kpi-revenue::after,
.kpi-ok::after,
.kpi-warn::after,
.kpi-bad::after{
  content:"";
  position:absolute;
  inset:-40px -40px auto auto;
  width:140px;
  height:140px;
  filter: blur(22px);
  opacity:.28;
  border-radius: 999px;
  pointer-events: none;
}

.kpi-revenue::after{ background: rgba(61,165,255,.65); }
.kpi-ok::after{ background: rgba(46,204,113,.65); }
.kpi-warn::after{ background: rgba(243,156,18,.65); }
.kpi-bad::after{ background: rgba(231,76,60,.65); }


/* ---- Member profile key/value rows ---- */
.kv{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(0,0,0,.08);
}
.kv:last-child{ border-bottom: none; }
.kv span:first-child{
  color: var(--muted);
  font-weight: 700;
  min-width: 92px;
}
.kv span:last-child{
  color: var(--text);
  font-weight: 800;
  text-align: right;
  word-break: break-word;
}

/* ---- Danger button ---- */
.btn.danger{
  border-color: rgba(231,76,60,.35);
  background: rgba(231,76,60,.10);
  color: #b42318;
}
.btn.danger:hover{ background: rgba(231,76,60,.16); border-color: rgba(231,76,60,.45); }



/* ---------- Pills ---------- */
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
}
.pill-muted{ color: var(--muted); }
.pill-success{ border-color: rgba(46,204,113,.35); background: rgba(46,204,113,.14); }
.pill-danger{ border-color: rgba(231,76,60,.35); background: rgba(231,76,60,.14); }
.pill-info{ border-color: rgba(61,165,255,.35); background: rgba(61,165,255,.14); }
button.pill{ cursor:pointer; }
button.pill:hover{ transform: translateY(-1px); }
button.pill:active{ transform: translateY(0px); }

/* ---------- Modal ---------- */
.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 80;
}
.modal-backdrop.show{ opacity: 1; pointer-events: auto; }

.modal{
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 90;
}
.modal.show{ opacity: 1; pointer-events: auto; }

.modal-card{
  width: min(920px, 100%);
  max-height: min(80vh, 720px);
  display:flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(6px);
}
.modal.show .modal-card{ transform: translateY(0); }

.modal-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(245,197,66,.12), transparent);
}
.modal-title{
  font-weight: 900;
  font-size: 16px;
}
.modal-body{
  padding: 14px 16px;
  overflow:auto;
}
.modal-foot{
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  display:flex;
  justify-content:flex-end;
  gap: 10px;
}

/* Answers formatting */
.ans-section{
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 12px;
}
.ans-title{
  font-weight: 900;
  margin-bottom: 10px;
}
.ans-subtitle{
  font-weight: 800;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 8px 0;
}
.ans-row{
  display:grid;
  grid-template-columns: 220px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed var(--border);
}
.ans-row:first-of-type{ border-top: none; padding-top: 0; }
.ans-k{
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
}
.ans-v{
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
}
.chips{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip{
  display:inline-flex;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(245,197,66,.18);
  border: 1px solid rgba(245,197,66,.30);
  font-weight: 800;
  font-size: 12px;
}
@media (max-width: 720px){
  .ans-row{ grid-template-columns: 1fr; }
}



/* ----------------- KPI Pills (Dashboard) ----------------- */
.kpi-pills{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.kpi-pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
  background: rgba(16,17,20,.06);
  border: 1px solid rgba(16,17,20,.10);
  color: var(--text);
  user-select: none;
}

.kpi-pill i{
  opacity: .9;
}

.kpi-pill-up{
  background: rgba(46,204,113,.10);
  border-color: rgba(46,204,113,.22);
  color: #1E7E4A;
}

.kpi-pill-info{
  background: rgba(61,165,255,.10);
  border-color: rgba(61,165,255,.22);
  color: #1C6FB8;
}

/* Dark mode compatibility */
body.dark .kpi-pill{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.92);
}
body.dark .kpi-pill-up{ color: rgba(46,204,113,.95); }
body.dark .kpi-pill-info{ color: rgba(61,165,255,.95); }


/* SMS balance pill (topbar) */
.sms-balance-pill{
  display:flex; align-items:center; gap:.5rem;
  padding:.5rem .75rem;
  border:1px solid var(--border);
  background: var(--card);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  font-size: .9rem;
  color: var(--text);
}
.sms-balance-pill i{ opacity:.85; }

.sms-balance-pill.sms-ok{
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.22);
  color: rgba(22, 101, 52, 0.95);
}
.sms-balance-pill.sms-low{
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.22);
  color: rgba(153, 27, 27, 0.95);
}
body.dark .sms-balance-pill.sms-ok{
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.24);
  color: rgba(134, 239, 172, 0.95);
}
body.dark .sms-balance-pill.sms-low{
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
  color: rgba(254, 202, 202, 0.95);
}


/* SMS credits toast (manager/admin) */
.toast.sms-credit-toast{
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(420px, calc(100vw - 36px));
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.12);
  color: rgba(153, 27, 27, 0.95);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}
.toast.sms-credit-toast .toast-ico{
  width: 34px; height: 34px;
  border-radius: 10px;
  display:flex; align-items:center; justify-content:center;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.14);
  flex: 0 0 auto;
}
.toast.sms-credit-toast .toast-title{ font-weight: 800; letter-spacing: .2px; }
.toast.sms-credit-toast .toast-text{ margin-top: 4px; line-height: 1.25; font-weight: 600; }
.toast.sms-credit-toast .toast-close{
  margin-left: auto;
  border: 0;
  background: transparent;
  color: inherit;
  opacity: .8;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
}
.toast.sms-credit-toast .toast-close:hover{ opacity: 1; background: rgba(153, 27, 27, 0.08); }

body.dark .toast.sms-credit-toast{
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.14);
  color: rgba(254, 202, 202, 0.95);
}
body.dark .toast.sms-credit-toast .toast-ico{
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.16);
}


/* ----------------- Audit / Κινήσεις ----------------- */
.audit-legend{display:flex;flex-wrap:wrap;gap:10px;align-items:center;}
.audit-table td{vertical-align:top;}
.audit-time{font-weight:700;}
.audit-actor .audit-name{font-weight:700;}
.audit-msg{line-height:1.35;}
@media (max-width: 920px){
  .audit-table thead{display:none;}
  .audit-table, .audit-table tbody, .audit-table tr, .audit-table td{display:block;width:100%;}
  .audit-table tr{border:1px solid var(--border);border-radius:14px;overflow:hidden;margin-bottom:12px;}
  .audit-table td{border:none !important;padding:12px 14px;}
  .audit-table td + td{border-top:1px solid var(--border) !important;}
}
