/* =============================================
   DrishSales AI — Brand: Navy + Red
   ============================================= */

:root {
  --navy:       #0d1b2a;
  --navy-mid:   #1a2e44;
  --navy-light: #243b55;
  --red:        #d32f2f;
  --red-hover:  #b71c1c;
  --accent:     #e53935;
  --white:      #ffffff;
  --off-white:  #f7f9fb;
  --border:     #dde3ea;
  --text:       #1e2d3d;
  --muted:      #6b7a8d;
  --success:    #2e7d32;
  --warning:    #e65100;
  --font:       'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius:     8px;
  --shadow:     0 1px 4px rgba(0,0,0,0.08), 0 2px 12px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top bar ---- */
.top-bar {
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-bar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo-wrap { display: flex; align-items: center; gap: 12px; }
.logo { height: 36px; width: auto; }
.app-name { font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; }
.app-name .accent { color: var(--accent); }

.top-nav { display: flex; gap: 4px; }
.nav-link {
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 6px 16px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.15s;
}
.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.nav-link.active { color: var(--white); background: var(--red); }

/* ---- Main content ---- */
.main-content {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 24px 40px;
}

/* ---- Views ---- */
.view { display: none; }
.view.active { display: block; }

/* ---- Page header ---- */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; color: var(--navy); }
.page-header .subtitle { color: var(--muted); margin-top: 4px; font-size: 0.95rem; }

/* ---- Card ---- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ---- Injection buttons + threshold ---- */
.injection-card { padding: 16px 24px; }
.injection-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.injection-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.threshold-wrap { flex-shrink: 0; text-align: center; }
.threshold-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
}
.threshold-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--navy);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.threshold-btn:hover { border-color: var(--navy-mid); background: var(--off-white); }
.threshold-display {
  min-width: 64px;
  text-align: center;
  background: var(--navy);
  color: var(--white);
  border-radius: 8px;
  padding: 4px 10px;
}
#threshold-value { font-size: 1.3rem; font-weight: 800; }
.threshold-unit { font-size: 0.72rem; color: rgba(255,255,255,0.6); margin-left: 2px; }
.threshold-hint { font-size: 0.72rem; color: var(--muted); }
.inj-btn {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.inj-btn:hover { border-color: var(--red); color: var(--red); }
.inj-btn.active { background: var(--red); border-color: var(--red); color: var(--white); }

.badge-info {
  display: inline-block;
  font-size: 0.7rem;
  background: #e8f0f7;
  color: var(--muted);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 6px;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}

/* ---- Input card header ---- */
.input-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.input-card-header .card-label { margin-bottom: 0; }

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.upload-btn:hover { border-color: var(--navy-mid); color: var(--navy); }

.upload-status {
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.upload-status.loading { background: #e8f0fe; color: #1a56db; }
.upload-status.success { background: #f0fdf4; color: var(--success); }
.upload-status.error   { background: #fff5f5; color: var(--red); }

.cap-files-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.cap-file-item  { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; padding: 5px 10px; border-radius: 6px; background: #f0fdf4; color: var(--success); }
.cap-file-item.loading { background: #e8f0fe; color: #1a56db; }
.cap-file-item.error   { background: #fff5f5; color: var(--red); }
.cap-file-remove { background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 0 0 8px; color: inherit; opacity: 0.6; flex-shrink: 0; }
.cap-file-remove:hover { opacity: 1; }
.upload-status { display: flex; align-items: center; justify-content: space-between; }

/* ---- Run actions from history ---- */
.run-actions-section { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.run-actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.run-action-btn { padding: 8px 16px; border-radius: 8px; border: 1px solid var(--navy); background: transparent; color: var(--navy); font-size: 0.82rem; cursor: pointer; font-weight: 500; transition: background 0.15s, color 0.15s; }
.run-action-btn:hover:not(:disabled) { background: var(--navy); color: #fff; }
.run-action-btn.locked { border-color: var(--border-light); color: var(--muted); cursor: not-allowed; opacity: 0.55; }
.lock-tag { font-size: 0.68rem; background: var(--border-light); color: var(--muted); padding: 1px 5px; border-radius: 4px; margin-left: 4px; }
.cap-notice { font-size: 0.78rem; color: #b45309; margin-top: 10px; background: #fffbeb; padding: 8px 10px; border-radius: 6px; border: 1px solid #fde68a; }

/* ---- Input grid ---- */
.input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 768px) { .input-grid { grid-template-columns: 1fr; } }
/* Prevent grid cells from blowing out beyond their 1fr allocation */
.input-grid > .card { min-width: 0; }

.ta {
  width: 100%;
  height: 260px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-family: var(--font);
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
  background: var(--off-white);
}
.ta:focus { border-color: var(--navy-mid); background: var(--white); }

/* ---- Textarea mic wrapper ---- */
.ta-wrap { position: relative; }

.mic-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(107,122,141,0.13);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 2;
  padding: 0;
}
.mic-btn:hover { background: rgba(107,122,141,0.25); color: var(--navy); }
.mic-btn.recording {
  background: rgba(211,47,47,0.12);
  color: var(--red);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
.mic-btn.mic-unsupported { opacity: 0.3; cursor: not-allowed; }
@keyframes mic-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(211,47,47,0.35); }
  50%      { box-shadow: 0 0 0 7px rgba(211,47,47,0); }
}

.mic-interim {
  width: 100%;
  max-width: 100%;
  min-height: 20px;
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
  font-style: italic;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}

/* ---- Action row ---- */
.action-row { display: flex; gap: 12px; margin-bottom: 16px; }

/* ---- Action grid ---- */
.action-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
@media (max-width: 900px) { .action-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .action-grid { grid-template-columns: repeat(2, 1fr); } }

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--white);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow);
  text-align: center;
}
.action-card:hover:not(:disabled) {
  border-color: var(--navy-mid);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.action-card.active {
  border-color: var(--red);
  background: #fff5f5;
}
.action-card:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.action-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
  position: relative;
  filter: grayscale(0.4);
}
.lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.action-icon  { font-size: 1.6rem; line-height: 1; }
.action-label { font-size: 0.82rem; font-weight: 700; color: var(--navy); }
.action-desc  { font-size: 0.72rem; color: var(--muted); line-height: 1.3; }

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary:hover { background: var(--red-hover); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--navy-mid); color: var(--navy); }
.btn-ghost.small { padding: 4px 12px; font-size: 0.82rem; }

/* ---- Progress ---- */
.progress-card { border-left: 3px solid var(--navy-mid); }
.progress-log {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 12px;
  max-height: 120px;
  overflow-y: auto;
}
.progress-log .log-line.done { color: var(--success); }
.progress-log .log-line.error { color: var(--red); }
.progress-log .log-line.active { color: var(--navy); font-weight: 600; }

/* ---- Limit reached banner ---- */
.limit-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(185,28,28,0.3);
  animation: banner-slide-in 0.35s ease-out;
}
@keyframes banner-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.limit-banner-icon { font-size: 2rem; flex-shrink: 0; line-height: 1; }
.limit-banner-body { flex: 1; min-width: 0; }
.limit-banner-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.limit-banner-msg {
  font-size: 0.85rem;
  opacity: 0.88;
  line-height: 1.5;
}
.limit-banner-btn {
  flex-shrink: 0;
  padding: 10px 20px;
  background: #fff;
  color: #b91c1c;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.limit-banner-btn:hover { background: #fef2f2; transform: scale(1.03); }

.progress-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--navy-mid), var(--red));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ---- Verdict banner ---- */
.verdict-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.verdict-left { display: flex; align-items: center; gap: 20px; }
.verdict-badge {
  font-size: 1.2rem;
  font-weight: 800;
  padding: 8px 22px;
  border-radius: 6px;
  letter-spacing: 1.5px;
  min-width: 110px;
  text-align: center;
}
.verdict-badge.bid { background: var(--success); color: var(--white); }
.verdict-badge.no-bid { background: var(--red); color: var(--white); }
.verdict-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.verdict-rec { font-size: 0.88rem; color: rgba(255,255,255,0.75); max-width: 520px; }

.verdict-right { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.score-ring-wrap { position: relative; width: 64px; height: 64px; }
.score-ring { width: 64px; height: 64px; }
.score-ring-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1;
}
.score-ring-label small { font-size: 0.6rem; font-weight: 400; opacity: 0.7; }
.risk-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}
.risk-pill.LOW { background: rgba(46,125,50,0.25); color: #a5d6a7; }
.risk-pill.MEDIUM { background: rgba(230,81,0,0.25); color: #ffcc80; }
.risk-pill.HIGH { background: rgba(211,47,47,0.3); color: #ef9a9a; }

/* ---- PDF links ---- */
.pdf-links-card {}
.pdf-buttons-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s;
}
.pdf-btn:hover { background: var(--navy-mid); }
.pdf-btn svg { flex-shrink: 0; }

/* ---- Skill table ---- */
.skill-table { display: flex; flex-direction: column; gap: 8px; }
.skill-row {
  display: grid;
  grid-template-columns: 200px 90px 60px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background: var(--off-white);
  font-size: 0.86rem;
}
.skill-row:nth-child(even) { background: #eef2f7; }
.skill-name { font-weight: 600; color: var(--navy); }
.skill-match { font-size: 0.78rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-align: center; }
.skill-match.STRONG  { background: #c8e6c9; color: #1b5e20; }
.skill-match.GOOD    { background: #bbdefb; color: #0d47a1; }
.skill-match.PARTIAL { background: #fff3e0; color: #bf360c; }
.skill-match.NONE    { background: #ffcdd2; color: #b71c1c; }
.skill-score { font-weight: 700; text-align: center; color: var(--navy-mid); }
.skill-evidence { color: var(--muted); font-size: 0.83rem; }

/* ---- Risk table ---- */
.risk-table { display: flex; flex-direction: column; gap: 10px; }
.risk-row {
  padding: 12px 14px;
  border-left: 4px solid var(--border);
  border-radius: 0 6px 6px 0;
  background: var(--off-white);
  font-size: 0.86rem;
}
.risk-row.high { border-color: var(--red); background: #fff5f5; }
.risk-row.medium { border-color: #e65100; background: #fff8f0; }
.risk-row.low { border-color: var(--success); background: #f1f8f1; }
.risk-severity { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; color: var(--muted); }
.risk-desc { font-weight: 600; color: var(--text); margin-bottom: 4px; }
.risk-mitigation { color: var(--muted); }

/* ---- History table ---- */
.history-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.search-input {
  flex: 1;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--navy-mid); }
.history-count { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

.history-table { width: 100%; }
.h-row {
  display: grid;
  grid-template-columns: 1fr 80px 90px 100px 140px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.87rem;
  cursor: pointer;
  transition: background 0.1s;
}
.h-row:hover { background: #f0f4f9; }
.h-row.header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  cursor: default;
  border-bottom: 2px solid var(--border);
}
.h-row.header:hover { background: transparent; }
.h-title { font-weight: 600; color: var(--navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h-score { font-weight: 700; color: var(--navy-mid); text-align: center; }
.h-verdict { text-align: center; }
.h-verdict .vbadge { font-size: 0.72rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; }
.vbadge.PROCEED { background: #c8e6c9; color: #1b5e20; }
.vbadge.STOP { background: #ffcdd2; color: #b71c1c; }
.h-risk { text-align: center; font-size: 0.78rem; font-weight: 600; }
.h-risk.HIGH { color: var(--red); }
.h-risk.MEDIUM { color: #e65100; }
.h-risk.LOW { color: var(--success); }
.h-date { color: var(--muted); font-size: 0.8rem; }
.h-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---- PDF vertical list (detail panel) ---- */
.pdf-section { margin-bottom: 20px; }
.pdf-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 8px;
}
.pdf-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: var(--white);
  transition: background 0.15s, color 0.15s;
}
.pdf-list-item:last-child { border-bottom: none; }
.pdf-list-item:hover { background: #f0f4f9; color: var(--navy); }
.pdf-list-item svg:first-child { color: var(--red); flex-shrink: 0; }
.pdf-list-label { flex: 1; }
.pdf-list-arrow { color: var(--muted); flex-shrink: 0; transition: color 0.15s; }
.pdf-list-item:hover .pdf-list-arrow { color: var(--navy); }

.pagination-row { display: flex; gap: 8px; padding-top: 16px; justify-content: center; }
.page-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover, .page-btn.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- Detail panel ---- */
#history-detail { border-top: 3px solid var(--navy); }
#detail-content { font-size: 0.88rem; }

.detail-header {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2e44 100%);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.detail-kv-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.detail-kv { display: flex; flex-direction: column; gap: 2px; }
.detail-kv .dk { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: rgba(255,255,255,0.45); }
.detail-kv .dv { font-size: 0.9rem; color: rgba(255,255,255,0.92); }
.detail-kv .dv.risk-text.HIGH   { color: #ef9a9a; }
.detail-kv .dv.risk-text.MEDIUM { color: #ffcc80; }
.detail-kv .dv.risk-text.LOW    { color: #a5d6a7; }

/* Score ring */
.score-ring-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  flex-shrink: 0;
}
.score-ring-svg {
  width: 130px;
  height: 130px;
  transform: rotate(-90deg);
}
.score-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 10;
}
.score-ring-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}
.score-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.score-ring-num {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.score-ring-label {
  font-size: 0.68rem;
  color: rgba(255,255,255,0.45);
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.5px;
}

/* ---- Bottom bar ---- */
.bottom-bar {
  background: var(--navy);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 12px;
  font-size: 0.78rem;
}

/* ---- Utilities ---- */
.hidden { display: none !important; }
.loading-msg { color: var(--muted); font-size: 0.9rem; padding: 20px 0; text-align: center; }
.empty-msg { color: var(--muted); font-size: 0.9rem; padding: 30px 0; text-align: center; }

/* =============================================
   Auth modal
   ============================================= */

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 27, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.auth-card {
  background: var(--white);
  border-radius: 12px;
  padding: 40px 36px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
}

.auth-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: 28px;
}
.auth-brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-logo { height: 40px; width: auto; }
.auth-tagline {
  font-family: 'Dancing Script', cursive;
  font-size: 1.5rem;
  font-weight: 900;
  margin: 0;
  letter-spacing: 0.02em;
  text-transform: none;
  padding-right: 2px;
  color: #64748b;
  position: relative;
}
.auth-tagline span.word-opportunities {
  background: linear-gradient(90deg, #e53935, #7c3aed);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.auth-tagline span.word-revenue {
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}
.auth-tab.active { color: var(--red); border-bottom-color: var(--red); }
.auth-tab:hover:not(.active) { color: var(--text); }

.auth-panel { display: block; }
.auth-panel.hidden { display: none; }

.form-group { margin-bottom: 14px; }
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-required { color: var(--red); }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.form-hint { font-weight: 400; color: var(--muted); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--navy-mid); }

.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, #fff0f0 0%, #fff5f5 100%);
  border: 1px solid #f5c6c6;
  border-left: 4px solid var(--red);
  color: #c0392b;
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 0.83rem;
  font-weight: 500;
  margin-bottom: 14px;
  line-height: 1.5;
  animation: errorSlide 0.2s ease;
}
.auth-error::before {
  content: '⚠';
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}
@keyframes errorSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.auth-warning-line {
  display: block;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f5c6c6;
  color: #c87800;
  font-weight: 600;
  font-size: 0.82rem;
}

.full-width { width: 100%; text-align: center; padding: 12px; font-size: 1rem; }

.auth-footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 12px;
}

/* =============================================
   User pill (navbar)
   ============================================= */

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 6px 14px;
  flex-shrink: 0;
}

.user-pill-sep {
  color: rgba(255,255,255,0.25);
  font-size: 0.8rem;
}

.user-email {
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(255,255,255,0.92);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plan-badge {
  font-family: 'Dancing Script', cursive;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0;
  letter-spacing: 0.03em;
  white-space: nowrap;
  background: none;
  border-radius: 0;
}
.plan-free    { color: #90caf9; }
.plan-starter { color: #80deea; }
.plan-pro     { color: #ce93d8; }
.plan-agency  { color: #ffcc80; }

.usage-text { font-size: 0.72rem; color: rgba(255,255,255,0.6); white-space: nowrap; }
.usage-bar-track {
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
  width: 120px;
}

.usage-bar-fill {
  height: 100%;
  background: #4caf50;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.usage-bar-fill.warn { background: #e53935; }

.btn-upgrade {
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-upgrade:hover { background: var(--red-hover); }

.btn-logout {
  background: transparent;
  color: rgba(255,255,255,0.5);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-logout:hover { color: var(--white); border-color: rgba(255,255,255,0.4); }

/* =============================================
   Upgrade / plan cards modal
   ============================================= */

.upgrade-card {
  max-width: 960px;
  width: 95vw;
  padding: 32px;
  max-height: 90vh;
  overflow-y: auto;
}

.upgrade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.upgrade-header h2 { font-size: 1.3rem; color: var(--navy); }

/* ---- Upgrade plan cards ---- */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 720px) { .plan-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .plan-cards { grid-template-columns: 1fr; } }

.upc-card {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 22px 18px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: box-shadow 0.15s;
}
.upc-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.upc-card.upc-popular { border-color: var(--red); }
.upc-card.upc-current { background: #f7f9fb; }

.upc-popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.upc-name  { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 6px; }
.upc-price { font-size: 1.5rem; font-weight: 800; color: var(--navy); margin-bottom: 14px; line-height: 1; }

.upc-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
  flex: 1;
}
.upc-feature {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 0.78rem;
  line-height: 1.35;
}
.upc-check { color: var(--success); font-weight: 700; flex-shrink: 0; }
.upc-cross { color: #ccc; flex-shrink: 0; }
.upc-dim   { color: var(--muted); }

.upc-btn {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s;
}
.upc-btn:hover { opacity: 0.88; }
.upc-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.upc-current-label {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--success);
  padding: 8px;
  background: #f0faf0;
  border-radius: 8px;
  border: 1px solid #c8e6c9;
}

.upc-contact-note {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding: 8px;
  background: #f5f5f5;
  border-radius: 8px;
  border: 1px dashed #ccc;
  font-style: italic;
}

.upgrade-contact-banner {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding: 20px 24px;
  background: #fffde7;
  border: 1px solid #f9a825;
  border-radius: 12px;
  text-align: center;
  line-height: 1.7;
  font-size: 0.9rem;
  color: var(--text);
}

.upgrade-wip-msg {
  font-weight: 700;
  color: #e65100;
  font-size: 1rem;
  margin-bottom: 6px;
}
.upgrade-contact-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.upgrade-contact-link:hover { text-decoration: underline; }

.upgrade-company {
  font-size: 1.05rem;
  margin: 4px 0;
}

/* =============================================
   Settings modal
   ============================================= */

.settings-card { max-width: 480px; }

.settings-section { margin-top: 8px; }
.settings-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 8px;
}
.settings-desc { font-size: 0.88rem; color: var(--text); margin-bottom: 16px; }
.settings-user-email { font-size: 0.82rem; color: var(--muted); margin: -18px 0 18px; }
.settings-hint { font-size: 0.78rem; color: var(--muted); margin-left: 10px; }
.settings-version {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
  letter-spacing: 0.3px;
}

.logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--off-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.logo-preview-img {
  max-height: 48px;
  max-width: 160px;
  object-fit: contain;
}
.logo-preview-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logo-upload-area {
  display: flex;
  align-items: center;
  margin-top: 8px;
}

.plan-gate-msg {
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: #5d4037;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
