/* ═══════════════════════════════════════════════════════════════════════════
   NNEAT Partners Portal — Shared Design System
   Based on calculator.html · Extended for full portal
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  /* Brand colours */
  --red:         #650D00;
  --red-h:       #7d1000;
  --red-dim:     rgba(101,13,0,.08);
  --red-border:  rgba(101,13,0,.2);
  --orange:      #CC4205;
  --orange-h:    #e84d08;

  /* Backgrounds */
  --bg:          #f4f5f7;
  --surface:     #ffffff;
  --card:        #ffffff;

  /* Borders */
  --border:      #e2e6ea;
  --border2:     #d0d5dd;

  /* Text */
  --text:        #111827;
  --dim:         #374151;
  --muted:       #6b7280;
  --subtle:      #9ca3af;

  /* Sidebar */
  --sidebar-w:   240px;
  --sidebar-bg:  #1a0400;
  --sidebar-border: rgba(255,255,255,.07);

  /* Shadows */
  --shadow-card: 0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
  --shadow-deep: 0 8px 32px rgba(0,0,0,.12);
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a0400 0%, #650D00 60%, #8b1200 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.login-box {
  background: var(--surface);
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4);
  position: relative;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo img { height: 36px; }
.login-logo .logo-fallback {
  font-family: 'Montagu Slab', serif;
  font-size: 26px; font-weight: 600;
  color: var(--red);
}
.login-title {
  font-family: 'Montagu Slab', serif;
  font-size: 22px; font-weight: 500;
  color: var(--text); text-align: center;
  margin-bottom: 8px;
}
.login-sub {
  font-size: 13px; color: var(--muted);
  text-align: center; margin-bottom: 28px;
  line-height: 1.55;
}
.login-field { margin-bottom: 14px; }
.login-field label {
  display: block;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--dim); margin-bottom: 7px;
}
.login-field input {
  width: 100%;
  border: 1.5px solid var(--border2);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit; font-size: 15px;
  color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
.login-field input:focus { outline: none; border-color: var(--red); }
.login-field input::placeholder { color: var(--subtle); }

/* OTP input */
.otp-wrap {
  display: flex; gap: 8px; justify-content: center;
  margin-bottom: 14px;
}
.otp-digit, .partner-otp-digit {
  width: 46px; height: 54px;
  border: 1.5px solid var(--border2); border-radius: 10px;
  font-size: 22px; font-weight: 700; font-family: 'Montagu Slab', serif;
  text-align: center; color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
.otp-digit:focus, .partner-otp-digit:focus { outline: none; border-color: var(--red); }

.login-countdown {
  font-size: 12px; color: var(--muted); text-align: center;
  margin-bottom: 16px;
}
.login-countdown span { color: var(--red); font-weight: 600; }

.login-back {
  background: none; border: none;
  font-family: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer;
  display: block; margin: 10px auto 0;
  text-decoration: underline;
}
.login-back:hover { color: var(--red); }

.login-divider {
  border: none; border-top: 1px solid var(--border);
  margin: 20px 0;
}
.login-note {
  font-size: 11px; color: var(--subtle);
  text-align: center; line-height: 1.5;
}

/* ── Login lang switcher ── */
.login-lang {
  position: absolute; top: 18px; right: 18px;
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px; overflow: hidden;
}
.login-lang-btn {
  background: none; border: none;
  font-family: inherit; font-size: 10px; font-weight: 600;
  color: var(--muted); padding: 4px 10px; cursor: pointer;
  letter-spacing: 0.5px;
}
.login-lang-btn.active { background: var(--red); color: #fff; }
.login-lang-sep { width: 1px; height: 14px; background: var(--border); }

/* ══════════════════════════════════════════════════════════════════════════
   APP SHELL — SIDEBAR + CONTENT AREA
   ══════════════════════════════════════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
  transition: transform .25s ease;
}
.sidebar-logo {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-logo img { height: 30px; }
.sidebar-logo .logo-fallback {
  font-family: 'Montagu Slab', serif;
  font-size: 20px; font-weight: 600; color: #fff;
}

.sidebar-section {
  padding: 16px 0 4px;
}
.sidebar-section-label {
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.8px;
  color: rgba(255,255,255,.3);
  padding: 0 20px 8px;
}
.sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,.6);
  font-size: 13px; font-weight: 500;
  cursor: pointer; text-decoration: none;
  border-left: 3px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  background: none; border-top: none; border-right: none; border-bottom: none;
  width: 100%; text-align: left; font-family: inherit;
}
.sidebar-item:hover {
  color: #fff; background: rgba(255,255,255,.06);
  border-left-color: rgba(255,255,255,.15);
}
.sidebar-item.active {
  color: #fff; background: rgba(101,13,0,.5);
  border-left-color: var(--orange);
}
.sidebar-item .si-icon {
  width: 20px; text-align: center; font-size: 16px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-item .si-icon i { line-height: 1; }
.sidebar-item.external .si-icon-ext i { font-size: 11px; }
.sidebar-item.external .si-icon-ext {
  margin-left: auto; font-size: 10px; opacity: .5;
}

/* Support button */
.sidebar-support {
  margin: 8px 16px 4px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--orange);
  border: none; border-radius: 8px;
  padding: 10px 14px;
  color: #fff; font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: background .15s;
}
.sidebar-support:hover { background: var(--orange-h); }

.sidebar-divider {
  border: none; border-top: 1px solid var(--sidebar-border);
  margin: 8px 0;
}

/* Sidebar footer */
.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px 18px;
  border-top: 1px solid var(--sidebar-border);
}
.sidebar-lang {
  display: flex; align-items: center;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 20px; overflow: hidden;
  margin-bottom: 12px; width: fit-content;
}
.sidebar-lang-btn {
  background: none; border: none;
  color: rgba(255,255,255,.5);
  font-family: inherit; font-size: 10px; font-weight: 600;
  padding: 4px 12px; cursor: pointer;
  letter-spacing: 0.5px; transition: color .15s, background .15s;
}
.sidebar-lang-btn.active {
  background: rgba(255,255,255,.18); color: #fff;
}
.sidebar-lang-sep { width: 1px; height: 14px; background: rgba(255,255,255,.15); }

.sidebar-user {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.sidebar-email {
  font-size: 11px; color: rgba(255,255,255,.5);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1;
}
.sidebar-logout {
  background: none; border: none;
  color: rgba(255,255,255,.4); font-size: 14px;
  cursor: pointer; padding: 4px; border-radius: 4px;
  transition: color .15s;
  flex-shrink: 0;
}
.sidebar-logout:hover { color: rgba(255,255,255,.8); }

/* ── CONTENT AREA ── */
.app-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* ── TOP BAR ── */
.topbar {
  background: var(--red);
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 2px 12px rgba(101,13,0,.3);
  position: sticky; top: 0; z-index: 100;
}
.topbar-title {
  font-family: 'Montagu Slab', serif;
  font-size: 16px; font-weight: 500;
  color: #fff; letter-spacing: -0.2px;
}
.topbar-tag {
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,.65);
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  padding: 3px 10px; border-radius: 20px; letter-spacing: 0.4px;
}
/* Mobile hamburger */
.topbar-hamburger {
  display: none;
  background: none; border: none;
  color: #fff; font-size: 20px; cursor: pointer; padding: 4px;
}

/* ── MAIN PAGE AREA ── */
.page-wrap {
  flex: 1;
  padding: 32px 36px 56px;
  max-width: 1280px;
  width: 100%;
}

.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-family: 'Montagu Slab', serif;
  font-size: 26px; font-weight: 500;
  color: var(--text); letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.page-header p {
  font-size: 14px; color: var(--muted);
}

/* ── FOOTER ── */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 14px 36px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--muted);
}
.app-footer a { color: var(--red); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════════════════
   SHARED COMPONENTS (cards, buttons, tables, forms)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── CARD ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px; padding: 28px;
  box-shadow: var(--shadow-card);
}
.card-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.8px;
  color: var(--red); margin-bottom: 20px;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: none; border-radius: 8px;
  font-family: inherit; font-weight: 500; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--red); color: #fff;
  padding: 9px 18px; font-size: 13px;
}
.btn-primary:hover { background: var(--red-h); }

.btn-cta {
  display: block; width: 100%;
  background: var(--orange); border: none; border-radius: 4px;
  padding: 0 30px; height: 50px; line-height: 50px;
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 500;
  cursor: pointer; text-align: center;
  transition: background .15s, box-shadow .15s, transform .1s;
  margin-top: 12px; letter-spacing: 0.2px;
}
.btn-cta:hover   { background: var(--orange-h); box-shadow: 0 4px 16px rgba(204,66,5,.3); }
.btn-cta:active  { transform: scale(.99); }
.btn-cta:disabled { opacity: .5; cursor: not-allowed; }

/* Partner request — outlined secondary button */
.btn-partner {
  display: block; width: 100%;
  background: transparent;
  border: 1.5px solid var(--orange);
  border-radius: 4px;
  padding: 0 30px; height: 46px; line-height: 44px;
  color: var(--orange); font-family: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: center;
  transition: background .15s, color .15s, transform .1s;
  margin-top: 8px; letter-spacing: 0.2px;
}
.btn-partner:hover   { background: var(--orange); color: #fff; }
.btn-partner:active  { transform: scale(.99); }
.btn-partner:disabled { opacity: .5; cursor: not-allowed; }

/* Partner CTA caption */
.login-partner-cta-text {
  margin: 0 0 6px;
  font-size: 13px; color: var(--muted); text-align: center;
}

.btn-sm {
  padding: 6px 12px; font-size: 12px; border-radius: 6px;
}
.btn-danger {
  background: #fef2f2; color: #dc2626;
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fee2e2; }

.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--border2);
  color: var(--dim);
  padding: 9px 18px; font-size: 13px;
}
.btn-outline:hover { border-color: var(--red); color: var(--red); }

/* ── FORM ELEMENTS ── */
.field-label {
  font-size: 11px; font-weight: 600; color: var(--dim);
  margin-bottom: 7px; text-transform: uppercase; letter-spacing: 0.8px;
  display: block;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border2); border-radius: 8px;
  padding: 10px 13px;
  color: var(--text); font-family: inherit; font-size: 14px;
  transition: border-color .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--red);
}
.input::placeholder, .textarea::placeholder { color: var(--subtle); }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23650D00'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  padding-right: 36px;
}
.textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.form-row { margin-bottom: 16px; }
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }

/* ── TABLES ── */
.data-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--border); }
.data-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
  background: #f0f2f5; padding: 10px 14px;
  text-align: left; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px; border-bottom: 1px solid var(--border);
  color: var(--muted); vertical-align: middle;
}
.data-table td:first-child { color: var(--text); font-weight: 500; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafbfc; }
.data-table .td-actions { text-align: right; white-space: nowrap; }
.data-table .td-center { text-align: center; }

/* ── BADGES ── */
.badge {
  display: inline-block;
  padding: 2px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 600;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-yellow { background: #fef9c3; color: #854d0e; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f3f4f6; color: #4b5563; }

/* ── ALERT / MESSAGE BOX ── */
.alert {
  border-radius: 10px; padding: 12px 16px;
  font-size: 13px; line-height: 1.55;
  margin-top: 14px; display: none;
}
.alert.visible { display: block; }
.alert-error   { background: #fff5f5; border: 1px solid #fca5a5; color: #b91c1c; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
.spinner-dark {
  border-color: rgba(0,0,0,.15); border-top-color: var(--red);
}

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 56px 24px; color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 14px; opacity: .4; line-height: 1; }
.empty-state-icon i { font-size: 40px; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--dim); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; }

/* ══════════════════════════════════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px; margin-bottom: 28px;
}
.home-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 24px;
  box-shadow: var(--shadow-card);
  cursor: pointer; text-decoration: none;
  display: block;
  transition: border-color .18s, box-shadow .18s, transform .15s;
}
.home-card:hover {
  border-color: var(--red);
  box-shadow: 0 4px 24px rgba(101,13,0,.12);
  transform: translateY(-2px);
}
.home-card-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--red-dim); border: 1px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px; color: var(--red);
}
.home-card h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.home-card p  { font-size: 12px; color: var(--muted); line-height: 1.5; }

.home-links-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.home-link-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 22px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; box-shadow: var(--shadow-card);
  transition: border-color .18s, box-shadow .18s;
}
.home-link-card:hover {
  border-color: var(--red);
  box-shadow: 0 4px 20px rgba(101,13,0,.1);
}
.home-link-card .hlc-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--red-dim); border: 1px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; color: var(--red);
}
.home-link-card h4 { font-size: 13px; font-weight: 600; color: var(--text); }
.home-link-card p  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════════════════
   CALCULATOR (migrated from calculator.html, no standalone header/hero)
   ══════════════════════════════════════════════════════════════════════════ */
.calc-layout {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 24px; align-items: start;
}

/* Tier selector */
.tier-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 10px; margin-bottom: 24px;
}
.tier-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px; padding: 16px 8px 14px;
  cursor: pointer; text-align: center;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.tier-btn:hover { border-color: var(--red); background: var(--red-dim); }
.tier-btn.active {
  border-color: var(--red); background: var(--red-dim);
  box-shadow: 0 0 0 3px rgba(101,13,0,.08);
}
.tier-pill {
  display: inline-block; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 2px 8px; border-radius: 20px; margin-bottom: 9px;
  background: var(--red-dim); color: var(--red);
  border: 1px solid var(--red-border);
}
.tier-btn.active .tier-pill { background: var(--red); color: #fff; border-color: var(--red); }
.tier-name  { font-size: 14px; font-weight: 600; color: var(--text); }
.tier-price { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Domain selector */
.domain-section { display: none; margin-bottom: 22px; }
.domain-section.visible { display: block; }
.domain-select {
  width: 100%; background: var(--surface);
  border: 1.5px solid var(--border2); border-radius: 8px;
  padding: 11px 38px 11px 13px; color: var(--text);
  font-family: inherit; font-size: 14px;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23650D00'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 17px;
  transition: border-color .15s;
}
.domain-select:focus { outline: none; border-color: var(--red); }

/* Breakdown table */
.breakdown {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; overflow-x: auto; overflow-y: hidden; margin-bottom: 18px;
}
.breakdown table { min-width: 480px; }
.breakdown table { width: 100%; border-collapse: collapse; font-size: 13px; }
.breakdown th {
  background: #edf0f3; padding: 9px 13px;
  text-align: left; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
.breakdown td {
  padding: 12px 13px; border-bottom: 1px solid var(--border); color: var(--muted);
}
.breakdown td:last-child { text-align: right; color: var(--text); font-weight: 600; }
.breakdown td.item-name  { color: var(--text); font-weight: 600; }
.breakdown td.note       { color: var(--subtle); font-style: italic; font-size: 11px; }
.breakdown tr:last-child td { border-bottom: none; }
.breakdown tr.eag-row, .breakdown tr.eag-note-row { display: none; }
.breakdown tr.eag-row.visible, .breakdown tr.eag-note-row.visible { display: table-row; }

/* Total card */
.total-card {
  background: linear-gradient(135deg, #650D00 0%, #8b1200 100%);
  border-radius: 14px; padding: 20px 22px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 4px 20px rgba(101,13,0,.25);
}
.total-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: rgba(255,255,255,.7); margin-bottom: 3px;
}
.total-amount {
  font-family: 'Montagu Slab', serif;
  font-size: 34px; font-weight: 500; color: #fff;
  letter-spacing: -1px; text-align: right;
}
.total-period { font-size: 11px; color: rgba(255,255,255,.55); text-align: right; margin-top: 2px; }
.total-sub    { font-size: 11px; color: rgba(255,255,255,.5); margin-top: 4px; }

/* AI Card */
.ai-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 26px 28px;
  box-shadow: var(--shadow-card); margin-top: 24px;
}
.ai-header { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; }
.ai-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--red-dim); border: 1px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: var(--red);
}
.ai-header-text h3 { font-size: 15px; font-weight: 600; color: var(--text); }
.ai-header-text p  { font-size: 12px; color: var(--muted); margin-top: 1px; }
.ai-textarea {
  width: 100%; background: var(--bg);
  border: 1.5px solid var(--border2); border-radius: 10px;
  padding: 12px 14px; color: var(--text);
  font-family: inherit; font-size: 14px;
  resize: vertical; min-height: 88px; line-height: 1.6;
  transition: border-color .15s;
}
.ai-textarea::placeholder { color: var(--subtle); }
.ai-textarea:focus { outline: none; border-color: var(--red); }
.ai-response {
  display: none; margin-top: 14px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  font-size: 13px; color: var(--dim); line-height: 1.7;
}
.ai-response.visible { display: block; }
.ai-response.error   { border-color: #fca5a5; background: #fff5f5; color: #b91c1c; }
.ai-response.success { border-color: #bbf7d0; background: #f0fdf4; color: var(--dim); }
.ai-response strong  { color: var(--text); }

/* Features table */
.features-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card);
}
.features-card-header {
  padding: 22px 26px 18px; border-bottom: 1px solid var(--border);
}
.features-card-header .card-label { margin-bottom: 4px; }
.features-card-header p { font-size: 13px; color: var(--muted); }
.features-table-wrap { overflow-x: auto; }
.features-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.features-table th {
  background: #f8f9fb; padding: 11px 15px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.features-table th.tier-col { text-align: center; min-width: 100px; }
.features-table td {
  padding: 10px 15px; border-bottom: 1px solid var(--border);
  color: var(--muted); vertical-align: middle;
}
.features-table td.feat { color: var(--dim); }
.features-table td.tv   { text-align: center; font-size: 13px; font-weight: 500; }
.features-table tr:last-child td { border-bottom: none; }
.features-table tr:hover td { background: #fafbfc; }
.features-table tr.sect td {
  background: #f2f4f7; color: var(--red);
  font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.8px; padding: 6px 15px;
}
.features-table th.active-col { background: var(--red-dim); color: var(--red); }
.features-table td.active-col { background: rgba(101,13,0,.03); }
.th-badge {
  display: inline-block; margin-top: 5px;
  padding: 2px 9px; border-radius: 20px;
  font-size: 10px; font-weight: 600;
  text-transform: none; letter-spacing: 0;
}
.th-t1 { background: rgba(101,13,0,.07); color: var(--red); border: 1px solid var(--red-border); }
.th-t2 { background: rgba(101,13,0,.12); color: var(--red); border: 1px solid rgba(101,13,0,.25); }
.th-t3 { background: var(--red); color: #fff; border: 1px solid var(--red); }
.chk { color: #16a34a; font-size: 15px; font-weight: 700; }
.crs { color: var(--border2); font-size: 15px; }

/* ══════════════════════════════════════════════════════════════════════════
   DOCUMENTS PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.docs-filters {
  display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap;
}
.docs-filter-btn {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 6px 14px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.docs-filter-btn:hover { border-color: var(--red); color: var(--red); }
.docs-filter-btn.active {
  background: var(--red); color: #fff; border-color: var(--red);
}

.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.doc-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  transition: border-color .18s, box-shadow .18s;
}
.doc-card:hover { border-color: var(--red-border); box-shadow: 0 4px 20px rgba(101,13,0,.08); }
.doc-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--red-dim); border: 1px solid var(--red-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; margin-bottom: 12px; flex-shrink: 0;
  color: var(--red);
}
.doc-card h4  { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.doc-card p   { font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; margin-bottom: 14px; }
.doc-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.doc-size { font-size: 11px; color: var(--subtle); }

/* ══════════════════════════════════════════════════════════════════════════
   CERTIFICATE PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.cert-profile-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 20px; padding: 44px 40px;
  box-shadow: var(--shadow-deep);
  max-width: 560px; margin: 0 auto;
  text-align: center;
}
.cert-profile-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 22px; border-radius: 30px;
  font-size: 12px; font-weight: 600; color: #fff;
  letter-spacing: 0.5px; margin-bottom: 26px;
}
.cert-profile-badge i { font-size: 16px; }
.cert-profile-company {
  font-family: 'Montagu Slab', serif;
  font-size: 30px; font-weight: 600; color: var(--text);
  margin-bottom: 6px; line-height: 1.2;
}
.cert-profile-domain {
  font-size: 13px; color: var(--subtle); letter-spacing: 1px;
  margin-bottom: 16px;
}
.cert-profile-contact {
  font-size: 13px; color: var(--muted); margin-bottom: 22px;
}
.cert-profile-contact i { margin-right: 4px; }
.cert-profile-dates {
  display: flex; justify-content: center; gap: 12px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.cert-date-chip {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 16px;
  font-size: 13px; color: var(--dim); text-align: left;
}
.cert-date-chip span {
  display: block; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); margin-bottom: 3px;
}
.cert-profile-ref {
  font-size: 10px; color: var(--subtle); letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 30px;
}
.cert-profile-actions {
  border-top: 1px solid var(--border); padding-top: 24px;
}
.cert-print-hint {
  font-size: 11px; color: var(--subtle); margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ══════════════════════════════════════════════════════════════════════════
   SUPPORT PAGE
   ══════════════════════════════════════════════════════════════════════════ */
.support-wrap {
  max-width: 640px;
}

/* ══════════════════════════════════════════════════════════════════════════
   ADMIN PANEL
   ══════════════════════════════════════════════════════════════════════════ */
.admin-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.admin-toolbar h2 {
  font-size: 16px; font-weight: 600; color: var(--text);
}
.filter-row {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px;
}
.filter-row .input, .filter-row .select {
  max-width: 220px; font-size: 13px; padding: 8px 11px;
}
.filter-row .select { max-width: 180px; }

/* Log row metadata expand */
.log-meta {
  font-size: 11px; color: var(--subtle); font-family: monospace;
  white-space: pre-wrap; word-break: break-all;
}

/* Upload doc form */
.upload-form {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px; margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}
.upload-form h3 { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 18px; }
.file-drop-zone {
  border: 2px dashed var(--border2);
  border-radius: 10px; padding: 28px;
  text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
}
.file-drop-zone:hover, .file-drop-zone.dragover {
  border-color: var(--red); background: var(--red-dim);
}
.file-drop-zone-icon { font-size: 28px; margin-bottom: 8px; opacity: .5; line-height: 1; }
.file-drop-zone-icon i { font-size: 28px; }
.file-drop-zone p { font-size: 13px; color: var(--muted); }
.file-drop-zone input[type=file] { display: none; }
.file-selected {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--dim); margin-bottom: 16px;
  display: none;
}
.file-selected.visible { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .calc-layout { grid-template-columns: 420px 1fr; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 4px 0 32px rgba(0,0,0,.4);
  }
  .sidebar.open { transform: translateX(0); }
  .app-content { margin-left: 0; }
  .topbar-hamburger { display: block; }
  .page-wrap { padding: 20px 18px 48px; }
  .topbar { padding: 0 18px; }
  .home-grid { grid-template-columns: 1fr; }
  .home-links-grid { grid-template-columns: 1fr; }
  .form-grid-2 { grid-template-columns: 1fr; }
  .app-footer { padding: 14px 18px; }
}

@media (max-width: 600px) {
  html, body { overflow-x: hidden; }
  .tier-grid  { gap: 8px; }
  .tier-btn   { padding: 12px 4px 10px; border-radius: 10px; }
  .tier-pill  { font-size: 8px; padding: 2px 6px; margin-bottom: 7px; }
  .tier-name  { font-size: 13px; }
  .tier-price { font-size: 10px; margin-top: 3px; }
  .total-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 18px; }
  .total-amount { font-size: 32px; text-align: left; }
  .total-period { text-align: left; }
  .breakdown table  { font-size: 12px; }
  .breakdown th     { padding: 8px; font-size: 8px; }
  .breakdown td     { padding: 10px 8px; }
  .breakdown th:nth-child(2), .breakdown td:nth-child(2),
  .breakdown th:nth-child(5), .breakdown td:nth-child(5) { display: none; }
  .features-table th { padding: 10px 10px; font-size: 9px; }
  .features-table td { padding: 9px 10px; font-size: 12px; }
  .features-table th.tier-col { min-width: 80px; }
  .th-badge { padding: 2px 7px; font-size: 9px; }
  .ai-icon  { width: 38px; height: 38px; border-radius: 9px; font-size: 16px; }
  .ai-header-text h3 { font-size: 14px; }
  .ai-textarea  { font-size: 14px; min-height: 80px; }
  .btn-cta { font-size: 14px; height: 46px; line-height: 46px; }
  .docs-grid { grid-template-columns: 1fr; }
}

/* ── Sidebar overlay on mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 199;
}
.sidebar-overlay.visible { display: block; }
