/* ─── Google Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&display=swap');

/* ─── Design tokens ───────────────────────────────────────────────── */
:root {
  --sb-bg:           #eef3f9;
  --sb-surface:      #ffffff;
  --sb-surface-soft: #f6f9fc;
  --sb-border:       #dce5f0;
  --sb-border-soft:  #eaf0f8;

  --sb-text:         #0e1929;
  --sb-text-soft:    #526070;
  --sb-text-faint:   #8fa4bc;

  --sb-navy:         #0a1628;
  --sb-navy-2:       #101f38;
  --sb-navy-3:       #172844;

  --sb-blue:         #2563eb;
  --sb-blue-dark:    #1d4ed8;
  --sb-blue-mid:     #3b82f6;
  --sb-blue-light:   #93c5fd;
  --sb-blue-soft:    rgba(37, 99, 235, 0.10);
  --sb-blue-glow:    rgba(37, 99, 235, 0.20);

  --sb-success:      #16a34a;
  --sb-success-bg:   #dcfce7;
  --sb-warning:      #ca8a04;
  --sb-warning-bg:   #fef9c3;
  --sb-danger:       #dc2626;
  --sb-danger-bg:    #fee2e2;

  --r-xl:   22px;
  --r-lg:   16px;
  --r-md:   12px;
  --r-sm:    8px;
  --r-full: 999px;

  --shadow-card:  0 2px 8px rgba(10,22,40,0.06), 0 10px 30px rgba(10,22,40,0.07);
  --shadow-hover: 0 4px 14px rgba(10,22,40,0.08), 0 18px 40px rgba(10,22,40,0.10);
  --shadow-modal: 0 24px 64px rgba(10,22,40,0.22);
  --shadow-btn:   0 6px 20px rgba(37, 99, 235, 0.28);

  --transition: 0.18s ease;
}

/* ─── Base reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin-top: 0; }
button { font-family: inherit; }

/* ─── Scrollbar ───────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15,23,42,0.14); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15,23,42,0.22); }

/* ═══════════════════════════════════════════════════════════════════
   AUTH PAGES  (login, register, 2fa…)
═══════════════════════════════════════════════════════════════════ */

body.client-auth-body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--sb-text);
  background: var(--sb-navy);
  background:
    radial-gradient(ellipse 900px 600px at 20% 40%, rgba(37,99,235,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 600px 400px at 80% 70%, rgba(96,165,250,0.10) 0%, transparent 55%),
    linear-gradient(160deg, #071122 0%, #0d1d36 50%, #111e3b 100%);
  min-height: 100vh;
}

.client-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}

.client-auth-page__inner {
  width: 100%;
  max-width: 1060px;
}

/* Alert banners on auth pages */
.client-alert {
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.6;
  border: 1px solid transparent;
}
.client-alert--success {
  background: var(--sb-success-bg);
  color: #14532d;
  border-color: #bbf7d0;
}
.client-alert--error {
  background: var(--sb-danger-bg);
  color: #7f1d1d;
  border-color: #fecaca;
}

/* ── Login page split layout ─────────────────────────────────────── */
.login-shell {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.login-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 0;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow-modal);
}

/* Left panel — marketing */
.login-panel {
  position: relative;
  padding: 40px 36px;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(96,165,250,0.22), transparent 38%),
    linear-gradient(148deg, #0d1d36 0%, #142d5e 52%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.login-panel::before {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.login-panel::after {
  content: "";
  position: absolute;
  top: -60px;
  right: 50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  filter: blur(4px);
  pointer-events: none;
}

.login-panel__inner { position: relative; z-index: 1; }

.login-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.16);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 28px;
}

.login-panel h1 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #fff;
}

.login-panel > .login-panel__inner > p {
  margin: 0;
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  line-height: 1.8;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 32px;
  position: relative;
  z-index: 1;
}

.login-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(8px);
}

.login-feature__icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.login-feature strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.login-feature span {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.76);
  line-height: 1.6;
}

.login-panel-footer {
  margin-top: 28px;
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: rgba(255,255,255,0.50);
}

/* Right card — form */
.login-card {
  background: var(--sb-surface);
  padding: 40px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-card__header {
  margin-bottom: 32px;
}

.login-card__header h2 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--sb-navy);
}

.login-card__header p {
  margin: 0;
  color: var(--sb-text-soft);
  font-size: 15px;
  line-height: 1.7;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--sb-text);
}

.login-field input {
  width: 100%;
  height: 52px;
  border-radius: var(--r-lg);
  border: 1.5px solid var(--sb-border);
  background: var(--sb-surface-soft);
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  color: var(--sb-text);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.login-field input:focus {
  outline: none;
  border-color: var(--sb-blue);
  background: #fff;
  box-shadow: 0 0 0 4px var(--sb-blue-glow);
}

.login-field input::placeholder { color: var(--sb-text-faint); }

.login-field__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field__input-wrap input {
  padding-right: 48px;
}

.login-pwd-toggle {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--sb-text-faint);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color var(--transition);
}

.login-pwd-toggle:hover { color: var(--sb-text-soft); }

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--sb-text-soft);
  cursor: pointer;
}

.login-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--sb-blue);
  cursor: pointer;
}

.login-btn {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--sb-blue) 0%, var(--sb-blue-dark) 100%);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
  margin-top: 4px;
}

.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.36);
}

.login-btn:active { transform: translateY(0); }

.login-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
  color: var(--sb-text-soft);
}

.login-footer a {
  color: var(--sb-blue-dark);
  font-weight: 700;
}

.login-footer a:hover { text-decoration: underline; }

/* Legacy login-wrap (centered small card) fallback */
.login-wrap--single { max-width: 480px; }

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD LAYOUT
═══════════════════════════════════════════════════════════════════ */

body.client-dashboard-body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--sb-text);
  background: var(--sb-bg);
}

.client-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */
.client-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  background: linear-gradient(180deg, var(--sb-navy) 0%, var(--sb-navy-2) 55%, var(--sb-navy-3) 100%);
  color: #fff;
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid rgba(255,255,255,0.05);
}

.client-sidebar__top { display: flex; flex-direction: column; gap: 20px; }

/* Brand logo */
.client-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  padding: 4px 6px;
  border-radius: var(--r-md);
  transition: background var(--transition);
}
.client-brand:hover { background: rgba(255,255,255,0.05); }

.client-brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--sb-blue) 0%, #60a5fa 100%);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.client-brand__text strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.client-brand__text small {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}

/* User card */
.client-user-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.09);
}

.client-user-card__avatar {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}

.client-user-card__content { min-width: 0; }
.client-user-card__content strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.client-user-card__content span {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.56);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation */
.client-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.client-nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  position: relative;
}

.client-nav__link:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.95);
}

.client-nav__link.is-active {
  background: linear-gradient(90deg, rgba(37,99,235,0.32) 0%, rgba(37,99,235,0.14) 100%);
  color: #fff;
  border: 1px solid rgba(37,99,235,0.30);
}

.client-nav__link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--sb-blue-light);
  box-shadow: 0 0 8px var(--sb-blue-light);
}

.client-nav__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.75;
  transition: opacity var(--transition);
}

.client-nav__link:hover .client-nav__icon,
.client-nav__link.is-active .client-nav__icon { opacity: 1; }

/* Legacy dot (fallback) */
.client-nav__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.26);
  flex-shrink: 0;
  transition: background var(--transition);
}
.client-nav__link:hover .client-nav__dot,
.client-nav__link.is-active .client-nav__dot {
  background: var(--sb-blue-light);
}
.client-nav__badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.client-nav__badge--blue { background: #3b82f6; }
.client-nav__badge--red  { background: #ef4444; }

/* Sidebar section label */
.client-nav__section {
  padding: 0 12px;
  margin-top: 6px;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(255,255,255,0.32);
}

/* Sidebar bottom */
.client-sidebar__bottom { padding-top: 16px; }

.client-sidebar__help {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
}

.client-sidebar__help small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,0.45);
  margin-bottom: 5px;
}

.client-sidebar__help p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(255,255,255,0.78);
}

/* ── Main content ────────────────────────────────────────────────── */
.client-main {
  padding: 30px 32px;
  min-height: 100vh;
}

.client-main__inner { max-width: 1300px; }

/* ─── Alerts in main ─────────────────────────────────────────────── */
.alert {
  border-radius: var(--r-lg);
  padding: 14px 18px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.65;
  border: 1px solid transparent;
  display: flex;
  gap: 12px;
}

.alert-success { background: var(--sb-success-bg); color: #14532d; border-color: #bbf7d0; }
.alert-error   { background: var(--sb-danger-bg);  color: #7f1d1d; border-color: #fecaca; }
.alert--success { background: var(--sb-success-bg); color: #14532d; border-color: #bbf7d0; }
.alert--error   { background: var(--sb-danger-bg);  color: #7f1d1d; border-color: #fecaca; }

.alert__title { font-weight: 700; margin-bottom: 6px; }
.alert__list  { margin: 0; padding-left: 18px; }

/* ═══════════════════════════════════════════════════════════════════
   COMPONENTS — CARD
═══════════════════════════════════════════════════════════════════ */

.card {
  background: var(--sb-surface);
  border: 1px solid var(--sb-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition), transform var(--transition);
}

/* ═══════════════════════════════════════════════════════════════════
   DASHBOARD PAGE
═══════════════════════════════════════════════════════════════════ */

.dashboard { display: flex; flex-direction: column; gap: 22px; }

.muted { color: var(--sb-text-soft); }

/* Section tag (pill label) */
.section-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--sb-blue-soft);
  color: var(--sb-blue-dark);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 12px;
}

/* Hero */
.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 24px;
  padding: 28px 32px;
  align-items: start;
}

.dashboard-hero h1 {
  margin-bottom: 10px;
  font-size: clamp(1.6rem, 2.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: var(--sb-navy);
}

.dashboard-hero__right { display: flex; flex-direction: column; gap: 12px; }

.mini-stat {
  padding: 14px 16px;
  border: 1px solid var(--sb-border);
  border-radius: var(--r-lg);
  background: var(--sb-surface-soft);
}

.mini-stat span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sb-text-faint);
  margin-bottom: 5px;
  font-weight: 700;
}

.mini-stat strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--sb-navy);
}

/* Stats row */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.stat-card {
  padding: 26px 28px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--sb-blue-soft);
  pointer-events: none;
}

.stat-card h2,
.panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sb-text-soft);
  line-height: 1.3;
}

.stat-card__value {
  font-size: 46px;
  line-height: 1;
  font-weight: 800;
  color: var(--sb-blue-dark);
  margin: 10px 0 12px;
  letter-spacing: -0.04em;
}

.stat-card__highlight {
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
  color: var(--sb-navy);
  margin: 10px 0 12px;
  letter-spacing: -0.02em;
}

/* Progress bar */
.progress-bar {
  height: 8px;
  margin-top: 14px;
  background: var(--sb-border);
  border-radius: var(--r-full);
  overflow: hidden;
}

.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sb-blue-light) 0%, var(--sb-blue) 100%);
  border-radius: var(--r-full);
  transition: width 0.6s cubic-bezier(.22,.68,0,1.2);
}

/* Referral code */
.referral-code {
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px dashed rgba(37, 99, 235, 0.40);
  color: var(--sb-blue-dark);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 10px 0 12px;
  cursor: text;
  user-select: all;
}

/* Grid layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.panel { padding: 26px 28px; }

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

/* Benefits list */
.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.benefits-list li {
  position: relative;
  padding: 12px 16px 12px 46px;
  background: var(--sb-surface-soft);
  border: 1px solid var(--sb-border-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.55;
  color: var(--sb-text);
  transition: border-color var(--transition);
}

.benefits-list li:hover { border-color: var(--sb-border); }

.benefits-list li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sb-blue) 0%, var(--sb-blue-mid) 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Info list */
.info-list { display: flex; flex-direction: column; gap: 10px; }

.info-item {
  padding: 12px 16px;
  border-radius: var(--r-md);
  border: 1px solid var(--sb-border-soft);
  background: var(--sb-surface-soft);
}

.info-item span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sb-text-faint);
  font-weight: 700;
  margin-bottom: 4px;
}

.info-item strong {
  font-size: 14px;
  color: var(--sb-navy);
  word-break: break-word;
}

/* ═══════════════════════════════════════════════════════════════════
   TABLE
═══════════════════════════════════════════════════════════════════ */

.table-wrap,
.portal-table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-xl) var(--r-xl); }

.dashboard-table,
.portal-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

.dashboard-table thead th,
.portal-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--sb-text-faint);
  background: var(--sb-surface-soft);
  border-bottom: 1px solid var(--sb-border);
  white-space: nowrap;
}

.dashboard-table tbody tr,
.portal-table tbody tr {
  transition: background var(--transition);
}

.dashboard-table tbody tr:hover,
.portal-table tbody tr:hover { background: var(--sb-surface-soft); }

.dashboard-table tbody td,
.portal-table tbody td {
  padding: 14px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--sb-border-soft);
  vertical-align: middle;
  color: var(--sb-text);
}

.dashboard-table tbody tr:last-child td,
.portal-table tbody tr:last-child td { border-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════
   STATUS BADGES
═══════════════════════════════════════════════════════════════════ */

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  line-height: 1.4;
}

.status-badge--credit  { background: rgba(22,163,74,0.12);  color: #15803d; }
.status-badge--debit   { background: rgba(220,38,38,0.10);  color: #b91c1c; }
.status-badge--bonus   { background: rgba(37,99,235,0.10);  color: var(--sb-blue-dark); }
.status-badge--open    { background: rgba(37,99,235,0.10);  color: var(--sb-blue-dark); }
.status-badge--pending { background: rgba(202,138,4,0.12);  color: #92400e; }
.status-badge--closed  { background: rgba(100,116,139,0.12);color: #475569; }
.status-badge--resolved{ background: rgba(22,163,74,0.12);  color: #15803d; }

/* Ticket priority pills */
.priority-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), opacity var(--transition);
  white-space: nowrap;
}

.btn:active { transform: translateY(0) !important; }

.btn--primary, .btn-primary {
  background: linear-gradient(135deg, var(--sb-blue) 0%, var(--sb-blue-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--sb-blue-glow);
}

.btn--primary:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(37,99,235,0.32);
}

.btn--secondary {
  background: var(--sb-surface-soft);
  color: var(--sb-text);
  border: 1px solid var(--sb-border);
}

.btn--secondary:hover {
  background: var(--sb-surface);
  border-color: var(--sb-text-faint);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--sb-text-soft);
  border: 1px solid var(--sb-border);
}

.btn--ghost:hover {
  background: var(--sb-surface-soft);
  color: var(--sb-text);
}

.btn--danger {
  background: linear-gradient(135deg, #ef4444 0%, var(--sb-danger) 100%);
  color: #fff;
}

.btn--danger:hover { transform: translateY(-1px); }

.btn-block, .btn--block { width: 100%; }

/* Sidebar logout button */
.btn-sidebar {
  width: 100%;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: background var(--transition);
  font-family: inherit;
}

.btn-sidebar:hover { background: rgba(255,255,255,0.13); }

/* ═══════════════════════════════════════════════════════════════════
   FORM INPUTS (dashboard forms, modals)
═══════════════════════════════════════════════════════════════════ */

.form-input,
.cms-input,
input[class="cms-input"] {
  width: 100%;
  height: 44px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--sb-border);
  background: var(--sb-surface-soft);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  color: var(--sb-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  box-sizing: border-box;
}

.form-input:focus,
.cms-input:focus {
  outline: none;
  border-color: var(--sb-blue);
  background: #fff;
  box-shadow: 0 0 0 4px var(--sb-blue-glow);
}

textarea.form-input,
textarea.cms-input {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
}

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--sb-text);
}

/* ═══════════════════════════════════════════════════════════════════
   MODAL (dialog element)
═══════════════════════════════════════════════════════════════════ */

dialog {
  border: none;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  padding: 0;
  max-width: min(560px, 95vw);
  width: 95vw;
  animation: dialogIn .22s ease;
}

dialog::backdrop {
  background: rgba(10, 22, 40, 0.55);
  backdrop-filter: blur(3px);
}

@keyframes dialogIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--sb-border-soft);
}

.dialog-header h2 {
  font-size: 15px;
  font-weight: 800;
  margin: 0;
  color: var(--sb-navy);
}

.dialog-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--sb-text-faint);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: background var(--transition), color var(--transition);
}

.dialog-close:hover {
  background: var(--sb-surface-soft);
  color: var(--sb-text);
}

.dialog-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.dialog-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--sb-border-soft);
}

/* ═══════════════════════════════════════════════════════════════════
   TICKET CONVERSATION
═══════════════════════════════════════════════════════════════════ */

.conversation { display: flex; flex-direction: column; gap: 14px; padding: 20px 24px; }

.msg {
  padding: 14px 16px;
  border-radius: 16px;
  max-width: 92%;
  font-size: 14px;
  line-height: 1.65;
}

.msg--client {
  align-self: flex-end;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
}

.msg--support {
  align-self: flex-start;
  background: var(--sb-surface-soft);
  border: 1px solid var(--sb-border);
  color: var(--sb-text);
}

.msg__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.msg__author {
  font-size: 12px;
  font-weight: 700;
  color: var(--sb-text-soft);
}

.msg--client .msg__author { color: var(--sb-blue-dark); }

.msg__time {
  font-size: 11px;
  color: var(--sb-text-faint);
  white-space: nowrap;
}

.reply-form {
  padding: 18px 24px;
  border-top: 1px solid var(--sb-border-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reply-form textarea {
  width: 100%;
  border: 1.5px solid var(--sb-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  resize: vertical;
  min-height: 90px;
  background: var(--sb-surface-soft);
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.reply-form textarea:focus {
  outline: none;
  border-color: var(--sb-blue);
  background: #fff;
  box-shadow: 0 0 0 4px var(--sb-blue-glow);
}

.reply-form__actions {
  display: flex;
  justify-content: flex-end;
}

/* Card section head (used in tickets, etc.) */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--sb-border-soft);
}

.section-head h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  color: var(--sb-navy);
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .dashboard-stats   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid    { grid-template-columns: 1fr; }
  .dashboard-hero    { grid-template-columns: 1fr; }
  .login-wrap        { grid-template-columns: 1fr; max-width: 520px; }
  .login-panel       { padding: 40px 36px; }
  .login-features    { display: none; }
}

/* 980px layout handled by mobile-bar rules above */

@media (max-width: 640px) {
  .dashboard-stats   { grid-template-columns: 1fr; }
  .login-card        { padding: 32px 24px; }
  .login-panel       { padding: 32px 24px; }
  .login-card__header h2 { font-size: 1.6rem; }
  .dashboard-hero    { padding: 22px 20px; }
  .panel             { padding: 20px; }
  .stat-card         { padding: 20px; }
  .client-main       { padding: 14px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════
   IMPERSONATION BANNER
═══════════════════════════════════════════════════════════════════ */
.impersonate-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  border-bottom: 2px solid #f59e0b;
  padding: 0;
}

.impersonate-banner__inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.impersonate-banner__left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,0.88);
}

.impersonate-banner__left svg {
  color: #f59e0b;
  flex-shrink: 0;
}

.impersonate-banner__left strong {
  color: #fff;
  font-weight: 700;
}

.impersonate-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  background: #f59e0b;
  color: #0f172a;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  white-space: nowrap;
}

.impersonate-banner__btn:hover {
  background: #fbbf24;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════
   MOBILE TOPBAR & HAMBURGER
═══════════════════════════════════════════════════════════════════ */
.client-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 200;
  height: 56px;
  background: #0f172a;
  border-bottom: 1px solid rgba(255,255,255,.07);
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.client-mobile-bar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.client-mobile-bar__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,.08);
  border-radius: 9px;
  cursor: pointer;
  padding: 0 9px;
}
.client-mobile-bar__toggle span {
  display: block;
  height: 2px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: all .2s;
}

/* Overlay */
.client-mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 249;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .25s;
}
.client-mobile-overlay.is-visible {
  opacity: 1;
}

/* Sidebar drawer (mobile) */
@media (max-width: 768px) {
  .client-mobile-bar { display: flex; }
  .client-mobile-overlay { display: block; pointer-events: none; }
  .client-mobile-overlay.is-visible { pointer-events: all; }

  .client-shell {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 56px);
  }

  .client-sidebar {
    position: fixed !important;
    top: 0;
    left: -280px;
    width: 270px;
    height: 100vh;
    z-index: 250;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    flex-direction: column !important;
    overflow-y: auto;
    padding: 22px 16px !important;
  }
  .client-sidebar.is-open { left: 0; }

  .client-sidebar__top {
    flex-direction: column !important;
    gap: 16px !important;
  }

  .client-nav {
    flex-direction: column !important;
    gap: 3px !important;
  }

  .client-main {
    padding: 16px 14px;
    min-height: calc(100vh - 56px);
  }
}

/* Already-handled breakpoints — keep for non-mobile sizing */
@media (min-width: 769px) and (max-width: 980px) {
  .client-shell { grid-template-columns: 1fr; }
  .client-sidebar {
    position: relative;
    height: auto;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    padding: 16px 18px;
  }
  .client-sidebar__top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    flex: 1;
  }
  .client-user-card { flex: 1; min-width: 200px; }
  .client-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .client-nav__section { display: none; }
  .client-sidebar__bottom { width: 100%; padding-top: 0; }
  .client-main { padding: 20px 18px; }
}
