/* =========================================================
   MQ 5-Star — Global Stylesheet
   =========================================================

   Sections:
   1. Variables & Reset
   2. Shared Components (logo, toast, error)
   3. Form Page (index / external)
   4. Login Page
   5. Dashboard Page
   6. Admin Page
   7. Responsive

   ========================================================= */

:root {
  --bg:        #111111;
  --bg2:       #1a1a1a;
  --bg3:       #222222;
  --bg4:       #2a2a2a;
  --teal:      #1876a2;
  --teal-h:    #1a8fc0;
  --teal-dark: #125f82;
  --mq-red:    #cc1111;
  --mq-yellow: #ffd700;
  --star-on:   #f5c518;
  --star-off:  #484848;
  --text:      #ffffff;
  --text2:     #c0c0c0;
  --text3:     #888888;
  --border:    #2e2e2e;
  --green:     #27ae60;
  --amber:     #f39c12;
  --red-alert: #e74c3c;
  --submit-bg: #d5d5d5;
  --submit-fg: #111111;
  --shadow:    0 4px 24px rgba(0,0,0,0.55);
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* =========================================================
   SHARED — MQ Logo Badge
   ========================================================= */
.mq-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.mq-square {
  background: var(--mq-red);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 38px;
}
.mq-square span {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: -1px;
  line-height: 1;
}
.mq-square.sm { width: 34px; height: 28px; }
.mq-square.sm span { font-size: 14px; }
.mq-sub {
  font-size: 7px;
  color: var(--text3);
  letter-spacing: 1.5px;
  font-weight: 700;
  text-transform: uppercase;
}


/* ── Logo images ─────────────────────────────────────────── */
.header-logo {
  height: 52px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo {
  height: 46px;
  width: auto;
  object-fit: contain;
  margin-bottom: 8px;
}
.brand-name-row {
  margin-bottom: 4px;
}

/* =========================================================
   FORM PAGE
   ========================================================= */
.form-body {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 40px;
}

.form-wrapper {
  width: 100%;
  max-width: 500px;
}

/* Header */
.form-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.form-title-block {
  flex: 1;
  background: var(--bg4);
  border-radius: 7px;
  padding: 8px 20px;
}
.form-title {
  color: var(--mq-yellow);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: block;
}
.form-title-stars {
  color: var(--star-on);
  font-size: 18px;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* Tagline */
.tagline {
  text-align: center;
  color: var(--text2);
  font-size: 14px;
  font-style: italic;
  line-height: 1.55;
  padding: 20px 24px 10px;
}

/* Section heading */
.section-heading {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  padding: 12px 20px 18px;
}

/* Dept row */
.dept-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
  margin-bottom: 14px;
}
.sel-wrap {
  position: relative;
}
.sel-wrap select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: var(--teal);
  color: #fff;
  border: none;
  outline: none;
  border-radius: 8px;
  padding: 14px 36px 14px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.sel-wrap select:hover  { background: var(--teal-h); }
.sel-wrap select option { background: var(--bg3); color: #fff; }
.sel-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  pointer-events: none;
  font-size: 13px;
}

/* Anonymous */
.anon-row {
  padding: 0 16px 12px;
}
.anon-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 15px;
  color: var(--text);
}
.anon-label input[type="checkbox"] {
  width: 19px;
  height: 19px;
  accent-color: var(--teal);
  cursor: pointer;
}

/* Names */
.names-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px 18px;
}
.name-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: var(--teal);
  color: #fff;
  border: none;
  outline: none;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  font-style: italic;
  font-weight: 600;
}
.name-input::placeholder { color: rgba(255,255,255,0.88); font-style: italic; }
.name-input:focus { background: var(--teal-h); font-style: normal; }
.name-input:disabled { opacity: 0.35; cursor: not-allowed; }

/* Question label */
.handoff-q {
  padding: 0 16px 12px;
  font-size: 16px;
  font-weight: 500;
}

/* Rating Card */
.rating-card {
  margin: 0 12px 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg2);
}

/* Rating Header */
.rating-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px 6px;
}
.rating-num-lbl {
  font-size: 15px;
  font-weight: 900;
  color: var(--text);
}
.rating-desc {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
}

/* Stars */
.stars-row {
  display: flex;
  gap: 6px;
  padding: 6px 16px 18px;
}
.star-btn {
  background: none;
  border: none;
  font-size: 46px;
  color: var(--star-off);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.1s, transform 0.1s;
  -webkit-text-stroke: 0px;
}
.star-btn.lit {
  color: var(--star-on);
  -webkit-text-stroke: 1px #d4a200;
}
.star-btn:hover { transform: scale(1.18); }

/* Reasons */
.reasons-block {
  background: var(--bg3);
  border-top: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  padding: 14px 16px;
}
.reasons-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.reasons-title { font-weight: 900; font-size: 14px; }
.reasons-hint  { font-size: 12px; color: var(--text3); }

.reasons-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}
.reason-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.reason-item input[type="checkbox"] { display: none; }
.reason-box {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text3);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.reason-item input:checked + .reason-box {
  background: var(--teal);
  border-color: var(--teal);
}
.reason-item input:checked + .reason-box::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.reason-text { font-size: 13px; font-weight: 500; }

/* Comments */
.comments-block {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
.comments-lbl {
  display: block;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 8px;
}
.comments-block textarea {
  width: 100%;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  outline: none;
}
.comments-block textarea:focus { border-color: var(--teal); }

/* Submit Button */
.submit-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 0 12px 20px;
  padding: 17px;
  background: var(--submit-bg);
  color: var(--submit-fg);
  border: none;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: background 0.2s;
}
.submit-btn:hover  { background: #c4c4c4; }
.submit-btn:active { background: #b0b0b0; }

/* Dashboard link */
.dash-link {
  display: block;
  text-align: center;
  font-size: 13px;
  color: var(--text3);
  text-decoration: none;
  padding-bottom: 20px;
}
.dash-link:hover { color: var(--teal-h); }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--green);
  color: #fff;
  padding: 12px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  z-index: 999;
  box-shadow: var(--shadow);
  animation: toastIn .3s ease, toastOut .4s ease 2.6s forwards;
}
@keyframes toastIn  { from { opacity:0; transform:translateX(-50%) translateY(-16px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity:1; } to { opacity:0; pointer-events:none; } }

/* Error banner */
.error-banner {
  background: #4a1111;
  border: 1px solid var(--red-alert);
  color: #ffaaaa;
  padding: 10px 16px;
  margin: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
}


/* =========================================================
   DASHBOARD PAGE
   ========================================================= */
.dash-body {
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.dash-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 16px 14px 12px;
  border-bottom: 1px solid var(--border);
}
.brand-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.brand-name {
  font-size: 19px;
  font-weight: 900;
  color: var(--mq-yellow);
  letter-spacing: 0.3px;
}
.brand-stars { display: flex; gap: 2px; }
.brand-star  { color: var(--star-on); font-size: 18px; }

/* Nav Rail */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text3);
  text-decoration: none;
  font-size: 20px;
  transition: color 0.2s, background 0.2s;
  border-radius: 0;
}
.nav-item:hover, .nav-item.active {
  color: var(--text);
  background: var(--bg3);
}
.nav-item .nav-label {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}

/* KPI Section */
.kpi-section {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.kpi-label-top {
  font-size: 11px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 4px 2px;
}
.kpi-card {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.kpi-text { flex: 1; }
.kpi-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text2);
  line-height: 1.3;
  margin-bottom: 4px;
}
.kpi-big {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.kpi-big small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text3);
}

/* CSS ring chart */
.kpi-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-ring::after {
  content: '';
  position: absolute;
  inset: 9px;
  background: var(--bg4);
  border-radius: 50%;
  z-index: 1;
}
.kpi-ring-val {
  position: relative;
  z-index: 2;
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
}

/* ── Main Content ─────────────────────────────────── */
.dash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}

/* Top bar */
.dash-topbar {
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg2);
}
.journey-toggle {
  display: flex;
  gap: 10px;
}
.jbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.jbtn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.jbtn:hover:not(.active) { background: var(--bg4); }
.jtoggle-icon { font-size: 12px; }

/* Chart + Pain Points row */
.chart-pain-row {
  display: flex;
  flex: 1;
  min-height: 300px;
  border-bottom: 1px solid var(--border);
}
.chart-area {
  flex: 1;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chart-legend-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text2);
}
.leg-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.chart-canvas-wrap {
  flex: 1;
  position: relative;
  min-height: 240px;
}

/* Pain points panel */
.pain-panel {
  width: 230px;
  min-width: 230px;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}
.pain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 18px;
}
.pain-dots { color: var(--text3); font-size: 20px; cursor: pointer; }
.pain-list { display: flex; flex-direction: column; gap: 16px; }
.pain-name { font-size: 12px; color: var(--text2); margin-bottom: 5px; font-weight: 600; }
.pain-bar-bg {
  height: 7px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
}
.pain-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* Journey Map */
.journey-section {
  margin: 18px 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.journey-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 800;
}
.journey-head-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 10px;
}
.jleg-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.jleg-txt { font-size: 12px; color: var(--text2); margin-right: 10px; font-weight: 500; }
.journey-date-toggle {
  margin-left: auto;
  font-size: 12px;
  color: var(--text3);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
}
.journey-scroll { overflow-x: auto; padding: 16px 20px 20px; }
.journey-track {
  display: flex;
  align-items: center;
  min-width: max-content;
}
.jnode { display: flex; flex-direction: column; align-items: center; }
.jnode-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
  min-height: 52px;
  justify-content: flex-end;
}
.jnode-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  min-height: 36px;
}
.jbubble {
  min-width: 46px;
  height: 22px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  padding: 0 8px;
  white-space: nowrap;
}
.jnode-name {
  font-size: 10px;
  color: var(--text2);
  white-space: nowrap;
  max-width: 80px;
  text-align: center;
  line-height: 1.2;
  font-weight: 600;
}
.jconnect {
  display: flex;
  align-items: center;
  width: 100px;
  flex-shrink: 0;
}
.jdot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  flex-shrink: 0;
  z-index: 1;
}
.jline {
  flex: 1;
  height: 2px;
  background: var(--border);
}
.jarrow { color: var(--text3); font-size: 14px; margin-left: 4px; flex-shrink: 0; }

/* Feedback Table */
.table-section {
  margin: 0 20px 28px;
}
.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.table-head h3 { font-size: 16px; font-weight: 800; }
.btn-add {
  padding: 7px 16px;
  background: var(--teal);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-add:hover { background: var(--teal-h); }

.tbl-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  overflow-x: auto;
}
.feedback-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px;
}
.feedback-tbl th {
  background: var(--bg3);
  color: var(--text2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.feedback-tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.feedback-tbl tr:last-child td { border-bottom: none; }
.feedback-tbl tbody tr:hover td { background: var(--bg2); }

.td-date    { color: var(--text3); white-space: nowrap; font-size: 12px; }
.td-dept    { color: var(--text); font-weight: 600; }
.td-dept small { color: var(--text3); font-weight: 400; }
.td-stars   { color: var(--star-on); letter-spacing: 1px; }
.td-reasons { max-width: 180px; }
.td-comment { max-width: 200px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-contact { color: var(--text2); font-size: 12px; }
.td-empty   { text-align: center; color: var(--text3); padding: 28px; }
.td-empty a { color: var(--teal-h); }

.badge-reason {
  display: inline-block;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 11px;
  color: var(--text2);
  margin: 1px 2px 1px 0;
}


/* =========================================================
   LOGIN PAGE
   ========================================================= */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-img {
  height: 56px;
  width: auto;
  object-fit: contain;
  margin-bottom: 10px;
}
.login-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--mq-yellow);
  letter-spacing: 0.4px;
}
.login-subtitle {
  font-size: 13px;
  color: var(--text3);
  margin-top: 4px;
}
.login-stars {
  color: var(--star-on);
  font-size: 18px;
  letter-spacing: 2px;
  margin-top: 4px;
}
.login-form { display: flex; flex-direction: column; gap: 16px; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field label { font-size: 13px; font-weight: 700; color: var(--text2); }
.login-field input {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.login-field input:focus { border-color: var(--teal); }

/* =========================================================
   ADMIN PAGE
   ========================================================= */
.admin-page-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}
.admin-desc {
  color: var(--text2);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}
.admin-alert {
  padding: 10px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid;
}
.admin-alert.success { background: #1a3a26; border-color: #27ae60; color: #5ddb8e; }
.admin-alert.error   { background: #3a1a1a; border-color: #e74c3c; color: #f1948a; }

.admin-panel {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}
.admin-panel-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text2);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-form { display: flex; flex-direction: column; gap: 14px; }
.admin-form.inline-form { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
.afield { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.afield label { font-size: 12px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.4px; }
.afield-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text3); }
.afield input, .afield select, .afield textarea {
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.afield input:focus, .afield select:focus, .afield textarea:focus { border-color: var(--teal); }
.afield select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.afield-row { display: flex; gap: 14px; flex-wrap: wrap; }
.afield-row .afield { min-width: 180px; }

.abtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--bg4);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.abtn:hover   { background: var(--bg3); color: var(--text); }
.abtn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.abtn.primary:hover { background: var(--teal-h); }
.abtn.danger  { color: #e74c3c; border-color: #5a2222; background: #2a1111; }
.abtn.danger:hover { background: #3a1818; }
.abtn.sm { padding: 5px 12px; font-size: 12px; }

.admin-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: 24px;
}
.admin-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 400px;
}
.admin-tbl th {
  background: var(--bg3);
  color: var(--text2);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.admin-tbl td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.admin-tbl tr:last-child td { border-bottom: none; }
.admin-tbl tbody tr:hover td { background: var(--bg2); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .sidebar { width: 180px; min-width: 180px; }
  .pain-panel { width: 190px; min-width: 190px; }
}
@media (max-width: 700px) {
  .dash-shell { flex-direction: column; }
  .sidebar { width: 100%; min-width: unset; flex-direction: row; flex-wrap: wrap; }
  .sidebar-nav { flex-direction: row; }
  .pain-panel { width: 100%; min-width: unset; border-left: none; border-top: 1px solid var(--border); }
  .chart-pain-row { flex-direction: column; }
}
