/* ==========================================================================
   Coaching Client Portal - design system
   ========================================================================== */

/* Brand: black and hot pink. */
:root {
  --bg: #07070a;
  --bg-elev: #0e0e13;
  --surface: #121218;
  --surface-2: #191921;
  --surface-3: #22222c;
  --border: #2e2e3a;
  --border-soft: #23232d;

  --text: #f2eef1;
  --text-dim: #b6adb5;
  --text-mute: #837b86;

  /* Hot pink. --ink is the text colour that sits on a filled pink surface;
     near-black keeps it above 6:1 contrast where white would fail. */
  --accent: #ff2d95;
  --accent-hover: #ff57ab;
  --ink: #14000b;
  --accent-soft: rgba(255, 45, 149, 0.15);
  --accent-line: rgba(255, 45, 149, 0.38);

  /* Secondary pink, used where two tones need to be told apart. */
  --blue: #ff7ab8;
  --blue-soft: rgba(255, 122, 184, 0.15);

  /* Money in and money out keep their own colours - the meaning matters more
     than the palette here. */
  --pos: #3ddc97;
  --pos-soft: rgba(61, 220, 151, 0.13);
  --neg: #ff5470;
  --neg-soft: rgba(255, 84, 112, 0.14);
  --warn: #ffb84d;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.32);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --sidebar-w: 244px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

p {
  margin: 0;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft);
}

/* --------------------------------------------------------------- boot --- */

.app-loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
}

.boot {
  text-align: center;
  color: var(--text-mute);
}

.boot-mark {
  width: 42px;
  height: 42px;
  margin: 0 auto 16px;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--accent), #b8005e);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* --------------------------------------------------------------- auth --- */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(255, 45, 149, 0.11), transparent 62%),
    radial-gradient(900px 520px at 100% 110%, rgba(255, 122, 184, 0.10), transparent 60%),
    var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 424px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 34px 32px 30px;
  box-shadow: var(--shadow-lg);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent), #c2006b);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.brand-name {
  font-weight: 650;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 12.5px;
  color: var(--text-mute);
}

.auth-card h1 {
  font-size: 23px;
  margin-bottom: 7px;
}

.auth-card .lede {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

/* -------------------------------------------------------------- forms --- */

.field {
  margin-bottom: 15px;
}

.field label,
.label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
  letter-spacing: 0.005em;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-mute);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select {
  appearance: none;
  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 1.5 6 6.5l5-5' stroke='%23837b86' stroke-width='1.7' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 14px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 5px 0;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
  flex: none;
}

.hint {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 6px;
  line-height: 1.5;
}

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.06s, opacity 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: #3a3a48;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--ink);
  font-weight: 650;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  color: var(--neg);
  border-color: rgba(255, 84, 112, 0.34);
  background: var(--neg-soft);
}

.btn-danger:hover:not(:disabled) {
  background: rgba(255, 84, 112, 0.22);
  border-color: rgba(255, 84, 112, 0.5);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12.5px;
  border-radius: 7px;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}

/* ------------------------------------------------------------- alerts --- */

.alert {
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.alert-error {
  background: var(--neg-soft);
  border-color: rgba(255, 84, 112, 0.32);
  color: #ffc2cc;
}

.alert-info {
  background: var(--blue-soft);
  border-color: rgba(255, 122, 184, 0.32);
  color: #c3ddff;
}

.alert-success {
  background: var(--pos-soft);
  border-color: rgba(61, 220, 151, 0.3);
  color: #b6f2d8;
}

.alert-warn {
  background: rgba(255, 184, 77, 0.12);
  border-color: rgba(255, 184, 77, 0.3);
  color: #ffdca6;
}

/* -------------------------------------------------------------- shell --- */

.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--bg-elev);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-head {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-nav {
  padding: 12px 10px;
  flex: 1;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 14px 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background 0.13s, color 0.13s;
}

.nav-item:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  flex: none;
  opacity: 0.85;
  display: grid;
  place-items: center;
}

.sidebar-foot {
  padding: 12px 10px 16px;
  border-top: 1px solid var(--border-soft);
}

.who {
  padding: 8px 10px 10px;
}

.who-name {
  font-size: 13.5px;
  font-weight: 600;
}

.who-role {
  font-size: 12px;
  color: var(--text-mute);
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(11, 14, 20, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar h1 {
  font-size: 18px;
}

.topbar-sub {
  font-size: 12.5px;
  color: var(--text-mute);
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}

.menu-toggle {
  display: none;
}

.content {
  padding: 26px 28px 60px;
  max-width: 1280px;
  width: 100%;
}

/* --------------------------------------------------------------- grid --- */

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stack-sm {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* --------------------------------------------------------------- card --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h2,
.card-head h3 {
  font-size: 14.5px;
  letter-spacing: 0.005em;
}

.card-head .card-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.card-note {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: -6px;
  margin-bottom: 12px;
  line-height: 1.55;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 12px;
}

/* --------------------------------------------------------------- stat --- */

.stat {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 15px 17px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 550;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 680;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.stat-value.sm {
  font-size: 19px;
}

.stat-meta {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 4px;
}

.pos {
  color: var(--pos);
}

.neg {
  color: var(--neg);
}

.accent {
  color: var(--accent);
}

.dim {
  color: var(--text-mute);
}

/* --------------------------------------------------------------- bars --- */

.bar {
  height: 7px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 9px;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), #ff8ac4);
  transition: width 0.4s ease;
}

.bar.bar-pos > span {
  background: linear-gradient(90deg, #2fae7a, var(--pos));
}

.bar.bar-neg > span {
  background: linear-gradient(90deg, #c9304c, var(--neg));
}

.bar.bar-blue > span {
  background: linear-gradient(90deg, #d94f96, var(--blue));
}

/* -------------------------------------------------------------- table --- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 480px;
}

thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-mute);
  padding: 9px 12px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  color: var(--text-dim);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.017);
}

td.strong,
th.strong {
  color: var(--text);
  font-weight: 550;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tfoot td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-weight: 650;
  color: var(--text);
  background: var(--bg-elev);
}

.table-input {
  padding: 5px 8px;
  font-size: 13px;
  background: var(--bg-elev);
  min-width: 90px;
}

.table-input.wide {
  min-width: 180px;
}

td.actions {
  width: 1%;
  white-space: nowrap;
}

/* -------------------------------------------------------------- misc  --- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill-accent {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent-line);
}

.pill-blue {
  background: var(--blue-soft);
  color: var(--blue);
  border-color: rgba(255, 122, 184, 0.32);
}

.pill-pos {
  background: var(--pos-soft);
  color: var(--pos);
  border-color: rgba(61, 220, 151, 0.3);
}

.pill-neg {
  background: var(--neg-soft);
  color: var(--neg);
  border-color: rgba(255, 84, 112, 0.32);
}

.kv {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13.5px;
}

.kv:last-child {
  border-bottom: none;
}

.kv dt {
  color: var(--text-mute);
}

.kv dd {
  margin: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 550;
}

.list-check {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.list-check li {
  display: flex;
  gap: 10px;
  font-size: 13.8px;
  color: var(--text-dim);
  line-height: 1.55;
}

.list-check li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--accent);
  flex: none;
  margin-top: 8px;
}

.list-check.numbered {
  counter-reset: step;
}

.list-check.numbered li::before {
  counter-increment: step;
  content: counter(step);
  width: 19px;
  height: 19px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.empty {
  padding: 30px 20px;
  text-align: center;
  color: var(--text-mute);
  font-size: 13.5px;
}

.code-chip {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  letter-spacing: 0.02em;
  word-break: break-all;
}

/* ------------------------------------------------------- client cards --- */

.client-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.16s, transform 0.16s, background 0.16s;
  text-align: left;
  width: 100%;
  display: block;
  font: inherit;
  color: inherit;
}

.client-card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-2px);
  text-decoration: none;
}

.client-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(140deg, var(--surface-3), var(--surface-2));
  border: 1px solid var(--border);
  color: var(--accent);
  flex: none;
}

/* ------------------------------------------------------------- modal --- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 11, 0.72);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.14s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-head {
  padding: 20px 22px 0;
}

.modal-head h2 {
  font-size: 17px;
}

.modal-body {
  padding: 16px 22px;
}

.modal-foot {
  padding: 14px 22px 20px;
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------- toast --- */

.toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  max-width: 340px;
  animation: slide-in 0.2s ease;
}

.toast.ok {
  border-left-color: var(--pos);
}

.toast.err {
  border-left-color: var(--neg);
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(14px);
  }
}

/* ------------------------------------------------------------ charts --- */

.chart {
  width: 100%;
  display: block;
  overflow: visible;
}

.chart-axis {
  font-size: 10px;
  fill: var(--text-mute);
}

.chart-grid {
  stroke: var(--border-soft);
  stroke-width: 1;
}

.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 10px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: block;
}

/* ------------------------------------------------------ preview mode --- */

.preview-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  padding: 13px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  font-size: 13.5px;
}

.preview-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
  box-shadow: 0 0 0 4px var(--accent-soft);
  animation: preview-pulse 1.8s ease-in-out infinite;
}

@keyframes preview-pulse {
  50% {
    opacity: 0.35;
  }
}

/* --------------------------------------------------------------- tour -- */

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 7, 0.55);
  z-index: 160;
  pointer-events: none;
}

.tour-card {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  box-shadow: 0 10px 46px rgba(255, 45, 149, 0.2), var(--shadow-lg);
  z-index: 170;
  animation: tour-in 0.2s ease;
}

@keyframes tour-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(14px);
  }
}

.tour-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.tour-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tour-dots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tour-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--surface-3);
  display: block;
}

.tour-dots i.on {
  background: var(--accent);
}

.tour-title {
  font-size: 18px;
  margin-bottom: 7px;
}

.tour-body {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}

.tour-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* The sidebar link for the step being explained. */
.nav-item.tour-spot {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
  box-shadow: 0 0 0 2px var(--accent-line);
  position: relative;
  z-index: 165;
}

@media (max-width: 820px) {
  .tour-card {
    bottom: 14px;
    padding: 16px 16px 14px;
  }
}

/* --------------------------------------------------------------- TNT --- */

.tnt-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--accent-line);
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 150;
  box-shadow: 0 6px 26px rgba(255, 45, 149, 0.28), var(--shadow);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}

.tnt-launcher:hover {
  transform: translateY(-3px) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 10px 32px rgba(255, 45, 149, 0.42), var(--shadow);
}

.tnt-launcher.open {
  transform: scale(0.9);
  opacity: 0.75;
}

.tnt-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  width: 372px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 130px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 150;
  animation: tnt-in 0.18s ease;
}

@keyframes tnt-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.tnt-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(180deg, rgba(255, 45, 149, 0.1), transparent);
  flex: none;
}

.tnt-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex: none;
}

.tnt-name {
  font-weight: 700;
  font-size: 14.5px;
  letter-spacing: -0.01em;
}

.tnt-role {
  font-size: 11.5px;
  color: var(--text-mute);
}

.tnt-close {
  background: none;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 15px;
  padding: 4px 7px;
  border-radius: 7px;
  flex: none;
}

.tnt-close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.tnt-log {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.tnt-msg {
  display: flex;
  max-width: 100%;
}

.tnt-msg.tnt-me {
  justify-content: flex-end;
}

.tnt-bubble {
  padding: 9px 13px;
  border-radius: 15px;
  font-size: 13.5px;
  line-height: 1.55;
  max-width: 86%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tnt-bot .tnt-bubble {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-bottom-left-radius: 5px;
  color: var(--text-dim);
}

.tnt-me .tnt-bubble {
  background: var(--accent);
  color: var(--ink);
  font-weight: 550;
  border-bottom-right-radius: 5px;
}

.tnt-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 13px;
}

.tnt-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-mute);
  animation: tnt-blink 1.2s infinite;
}

.tnt-typing span:nth-child(2) {
  animation-delay: 0.18s;
}

.tnt-typing span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes tnt-blink {
  0%,
  60%,
  100% {
    opacity: 0.25;
  }
  30% {
    opacity: 1;
  }
}

.tnt-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 15px 10px;
  flex: none;
}

.tnt-chip {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: 99px;
  padding: 5px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.13s, color 0.13s, border-color 0.13s;
  text-align: left;
}

.tnt-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.tnt-foot {
  display: flex;
  gap: 8px;
  padding: 11px 13px;
  border-top: 1px solid var(--border-soft);
  flex: none;
}

.tnt-input {
  flex: 1;
  padding: 9px 12px;
  font-size: 13.5px;
  border-radius: 99px;
}

.tnt-send {
  background: var(--accent);
  color: var(--ink);
  border: none;
  border-radius: 99px;
  padding: 8px 16px;
  font-weight: 650;
  font-size: 13px;
  cursor: pointer;
  flex: none;
}

.tnt-send:hover {
  background: var(--accent-hover);
}

@media (max-width: 520px) {
  .tnt-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 86px;
  }
  .tnt-launcher {
    right: 14px;
    bottom: 14px;
    width: 54px;
    height: 54px;
  }
}

@media print {
  .tnt-launcher,
  .tnt-panel {
    display: none !important;
  }
}

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .scrim {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 11, 0.6);
    z-index: 50;
  }
  .content {
    padding: 20px 16px 60px;
  }
  .topbar {
    padding: 13px 16px;
  }
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .auth-card {
    padding: 26px 20px 24px;
  }
  .stat-value {
    font-size: 21px;
  }
}

@media print {
  .sidebar,
  .topbar-actions,
  .menu-toggle {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
  }
}
