/* ============================================================
   RetailPitchAgent — Shared Theme
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --bg-deep:        #0C0E12;
  --bg-page:        #10131A;
  --bg-card:        #14171E;
  --bg-card-hover:  #1A1E28;
  --bg-input:       #1A1E28;
  --amber:          #E8A838;
  --amber-glow:     #E8A83830;
  --amber-soft:     #E8A83818;
  --cream:          #F5F0E8;
  --cream-mid:      #C4BBAB;
  --cream-dim:      #8A8279;
  --green:          #4ADE80;
  --green-soft:     #4ADE8020;
  --red:            #F87171;
  --red-soft:       #F8717120;
  --blue:           #60A5FA;
  --blue-soft:      #60A5FA20;
  --border:         #2A2E38;
  --border-light:   #3A3E48;
  --font-display:   'DM Serif Display', serif;
  --font-body:      'Outfit', sans-serif;
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --nav-width:      240px;
  --transition:     0.18s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-deep);
  color: var(--cream);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ── Page Layout ───────────────────────────────────────────── */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}
.main-content {
  flex: 1;
  min-width: 0;
  padding: 36px 40px;
  background: var(--bg-page);
  margin-left: var(--nav-width);
}

/* ── Nav Sidebar ───────────────────────────────────────────── */
.nav-sidebar {
  width: var(--nav-width);
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  padding: 0 0 24px 0;
}
.nav-brand {
  padding: 28px 20px 20px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--amber);
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.nav-brand span {
  display: block;
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--cream-dim);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 2px;
}
.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding: 12px 20px 4px;
  margin-top: 4px;
}
.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 16px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--cream-mid);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 0;
  transition: background var(--transition), color var(--transition);
  position: relative;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover {
  background: var(--amber-soft);
  color: var(--cream);
  text-decoration: none;
}
.nav-item.active {
  background: var(--amber-glow);
  color: var(--amber);
  font-weight: 600;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--amber);
  border-radius: 0 2px 2px 0;
}
.nav-icon { font-size: 1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--amber);
  color: var(--bg-deep);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}
.nav-footer {
  margin-top: auto;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
}
.nav-client-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nav-client-plan {
  font-size: 0.72rem;
  color: var(--amber);
  font-weight: 500;
  text-transform: capitalize;
  margin-bottom: 10px;
}
.nav-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cream-dim);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--transition);
  width: 100%;
}
.nav-logout:hover { color: var(--red); }

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--cream);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), transform var(--transition);
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-1px); }
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 10px;
}
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-delta {
  font-size: 0.78rem;
  color: var(--cream-dim);
}
.stat-delta.up { color: var(--green); }
.stat-delta.down { color: var(--red); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-primary {
  background: var(--amber);
  color: var(--bg-deep);
  border-color: var(--amber);
}
.btn-primary:hover { background: #d4952e; border-color: #d4952e; }
.btn-secondary {
  background: transparent;
  color: var(--cream-mid);
  border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--bg-card-hover); color: var(--cream); border-color: var(--border-light); }
.btn-danger {
  background: var(--red-soft);
  color: var(--red);
  border-color: transparent;
}
.btn-danger:hover { background: #f871711a; border-color: var(--red); }
.btn-ghost {
  background: transparent;
  color: var(--cream-dim);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--cream); }
.btn-success {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}
.btn-success:hover { background: #4ade8030; border-color: var(--green); }
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-green  { background: var(--green-soft);  color: var(--green); }
.badge-red    { background: var(--red-soft);    color: var(--red); }
.badge-amber  { background: var(--amber-soft);  color: var(--amber); }
.badge-blue   { background: var(--blue-soft);   color: var(--blue); }
.badge-dim    { background: rgba(255,255,255,0.06); color: var(--cream-dim); }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream-mid);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}
.input, .select, .textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--cream);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-glow);
}
.input::placeholder, .textarea::placeholder { color: var(--cream-dim); }
.select { appearance: none; cursor: pointer; }
.select-wrapper { position: relative; }
.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cream-dim);
  pointer-events: none;
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
.input-hint {
  font-size: 0.75rem;
  color: var(--cream-dim);
  margin-top: 4px;
}
.input-error {
  font-size: 0.75rem;
  color: var(--red);
  margin-top: 4px;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
}
th {
  background: rgba(0,0,0,0.3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-dim);
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--cream-mid);
  border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-card-hover); }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cream);
}
.modal-close {
  background: none;
  border: none;
  color: var(--cream-dim);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--cream); }

/* ── Page Header ────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--cream);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--cream-dim);
  margin-top: 4px;
}

/* ── Stats Grid ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* ── Grid Layouts ───────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--cream-dim);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 1.1rem; font-weight: 600; color: var(--cream-mid); margin-bottom: 8px; }
.empty-state-desc { font-size: 0.875rem; margin-bottom: 20px; }

/* ── Toast Notifications ────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--cream);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  animation: toastIn 0.25s ease forwards;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }
.toast.warning { border-left: 3px solid var(--amber); }
.toast.hiding  { animation: toastOut 0.25s ease forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }

/* ── Score Display ──────────────────────────────────────────── */
.score-high  { color: var(--green); font-weight: 700; }
.score-med   { color: var(--amber); font-weight: 700; }
.score-low   { color: var(--red);   font-weight: 700; }

/* ── Check List ─────────────────────────────────────────────── */
.check-list { display: flex; flex-direction: column; gap: 6px; }
.check-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--cream-mid); }
.check-item.pass { color: var(--green); }
.check-item.fail { color: var(--red); }

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 99px;
  transition: width 0.4s ease;
}
.progress-fill.green { background: var(--green); }
.progress-fill.red   { background: var(--red); }

/* ── Scrollbar Styling ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--amber); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #d4952e; }
* { scrollbar-width: thin; scrollbar-color: var(--amber) var(--bg-deep); }

/* ── Utility ────────────────────────────────────────────────── */
.text-amber   { color: var(--amber); }
.text-green   { color: var(--green); }
.text-red     { color: var(--red); }
.text-blue    { color: var(--blue); }
.text-dim     { color: var(--cream-dim); }
.text-mid     { color: var(--cream-mid); }
.text-center  { text-align: center; }
.font-display { font-family: var(--font-display); }
.mt-auto      { margin-top: auto; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.flex         { display: flex; }
.flex-col     { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full       { width: 100%; }
.hidden       { display: none !important; }

/* ── Mobile Responsive ──────────────────────────────────────── */
.mobile-nav-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--cream);
}
@media (max-width: 768px) {
  .mobile-nav-toggle { display: block; }
  .nav-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }
  .nav-sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 24px 16px; padding-top: 64px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .modal { padding: 24px 20px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .main-content { padding: 20px 12px; padding-top: 64px; }
}
