
/* VynDeal — Theme variables
 * Dark theme: deep navy, classy, alternating bands
 * Light theme: warm beige, not blinding white
 * Load this ONCE in every page
 */

/* ── DARK THEME (default) ─────────────────────────────────── */
:root, :root[data-theme="dark"] {
  /* Backgrounds — layered navy-black */
  --bg:         #0d0d1a;   /* page background */
  --surface:    #13132a;   /* card / panel */
  --surface2:   #1a1a35;   /* alternating row, input */
  --surface3:   #22224a;   /* hover state */
  --surface4:   #2a2a5a;   /* active/selected */

  /* Borders */
  --border:     #ffffff08;
  --border2:    #ffffff14;
  --border3:    #ffffff20;

  /* Text */
  --text:       #e8e8f2;   /* primary */
  --text2:      #9898c0;   /* secondary */
  --text3:      #5a5a80;   /* placeholder/muted */

  /* Brand */
  --purple:     #7c6fff;
  --purple2:    #6458e8;
  --purplefade: #7c6fff18;
  --purpleborder:#7c6fff40;

  /* Status */
  --green:      #22c55e;
  --greenfade:  #22c55e18;
  --amber:      #f59e0b;
  --amberfade:  #f59e0b18;
  --red:        #ef4444;
  --redfade:    #ef444418;
  --blue:       #3b82f6;
  --bluefade:   #3b82f618;

  /* Input */
  --input:      #0d0d1a;
  --input-border:#ffffff18;

  /* Card */
  --card:       #13132a;
  --card-hover: #1a1a35;
}

/* ── LIGHT THEME ──────────────────────────────────────────── */
:root[data-theme="light"] {
  --bg:         #f5f0e8;
  --surface:    #fdfaf5;
  --surface2:   #ede8df;
  --surface3:   #e5dfd4;
  --surface4:   #dcd5c8;
  --border:     #c0b8a820;
  --border2:    #c0b8a835;
  --border3:    #c0b8a850;
  --text:       #2a1f0e;
  --text2:      #5a4a35;
  --text3:      #9c8a72;
  --purple:     #6348e8;
  --purple2:    #5238d0;
  --purplefade: #6348e814;
  --purpleborder:#6348e840;
  --green:      #1a6e3c;
  --greenfade:  #1a6e3c14;
  --amber:      #92490a;
  --amberfade:  #92490a14;
  --red:        #a81c1c;
  --redfade:    #a81c1c14;
  --blue:       #1a4db8;
  --bluefade:   #1a4db814;
  --input:      #fffef9;
  --input-border:#c0b8a835;
  --card:       #fdfaf5;
  --card-hover: #ede8df;
}

/* ── BASE STYLES ─────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  transition: background .2s, color .2s;
}

/* ── COMMON COMPONENTS ───────────────────────────────────── */

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 16px;
}

/* Alternating rows */
.row-alt:nth-child(even) { background: var(--surface2); }

/* Pills / badges */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
}

.pill-new,     .p-new       { background: var(--surface2); color: var(--text3); }
.pill-warm,    .p-warm      { background: var(--amberfade); color: var(--amber); }
.pill-hot,     .p-hot       { background: var(--redfade);   color: var(--red); }
.pill-engaged, .p-engaged   { background: var(--bluefade);  color: var(--blue); }
.pill-quoted,  .p-quoted    { background: var(--purplefade);color: var(--purple); }
.pill-po,      .p-po-received { background: var(--greenfade); color: var(--green); }
.pill-won,     .p-won       { background: var(--greenfade); color: var(--green); }
.pill-lost,    .p-lost      { background: var(--redfade);   color: var(--red); }
.pill-contacted, .p-contacted { background: var(--bluefade); color: var(--blue); }
.pill-rfq,     .p-rfq       { background: var(--amberfade); color: var(--amber); }

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary  { background: var(--purple); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--purple2); }

.btn-success  { background: var(--green); color: #fff; }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); }

.btn-danger   { background: var(--red); color: #fff; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.btn-xs { padding: 4px 8px;  font-size: 11px; border-radius: 5px; }

/* Inputs */
.input, input[type="text"], input[type="email"],
input[type="number"], input[type="date"], input[type="password"],
select, textarea {
  background: var(--input);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 100%;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.input:focus, input:focus, select:focus, textarea:focus {
  border-color: var(--purple);
}
input::placeholder, textarea::placeholder { color: var(--text3); }
select option { background: var(--surface); }

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: #00000080;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid var(--border2);
}

/* Section label */
.section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 8px;
}

/* Divider */
.divider { border: none; border-top: 1px solid var(--border2); margin: 12px 0; }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--purplefade);
  border: 1px solid var(--purpleborder);
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border3); border-radius: 3px; }

/* Mobile bottom nav */
@media (max-width: 720px) {
  .modal-overlay.open { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; }
}
