/* ============================================================
   dealstack — shared styles
   ============================================================ */

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

:root {
  --bg:      #f0f2f5;
  --surf:    #ffffff;
  --surf2:   #f7f8fa;
  --border:  #e4e6ea;
  --accent:  #1877f2;
  --adim:    rgba(24,119,242,0.08);
  --text:    #1c1e21;
  --muted:   #65676b;
  --muted2:  #b0b3b8;
  --ok:      #16a34a;
  --ok-d:    rgba(22,163,74,0.10);
  --warn:    #d97706;
  --warn-d:  rgba(217,119,6,0.10);
  --red:     #dc2626;
  --red-d:   rgba(220,38,38,0.10);
  --radius:  10px;
  --shadow:  0 1px 3px rgba(0,0,0,0.10), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

a { color: var(--accent); text-decoration: none; }

/* ── NAV ── */
.nav {
  background: var(--surf);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 50;
}
.nav-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.logo { font-size: 17px; font-weight: 700; letter-spacing: -.3px; color: var(--text); cursor: pointer; flex-shrink: 0; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2px; flex: 1; }
.nl { padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all .15s; }
.nl:hover { color: var(--text); background: var(--surf2); }
.nl.active { color: var(--accent); background: var(--adim); }
.nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.nbtn { padding: 7px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: opacity .15s; }
.nbtn:hover { opacity: .85; }
.nbtn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.nbtn-ghost:hover { background: var(--surf2); }
.nbtn-primary { background: var(--accent); color: #fff; box-shadow: 0 1px 3px rgba(24,119,242,0.3); }

/* Mobile bottom nav */
.bnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surf);
  border-top: 1px solid var(--border);
  box-shadow: 0 -1px 4px rgba(0,0,0,0.06);
  display: none;
  z-index: 40;
}
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 9px 0 11px;
  cursor: pointer;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  position: relative;
}
.bnav-item.active { color: var(--accent); }
.bnav-item svg { width: 20px; height: 20px; }
.bnav-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 7px;
  right: calc(50% - 22px);
}

/* ── PAGE ── */
.page { max-width: 1160px; margin: 0 auto; padding: 28px 24px 80px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 18px; transition: color .15s; }
.back-link:hover { color: var(--accent); }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; letter-spacing: -.3px; }
.page-sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }

/* ── CARDS ── */
.card {
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

/* ── FORM ELEMENTS ── */
.input-group { margin-bottom: 12px; }
.input-label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 5px; display: block; }
.input-field {
  width: 100%;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
.input-field:focus { border-color: var(--accent); }
.input-field::placeholder { color: var(--muted2); }
select.input-field { cursor: pointer; }
textarea.input-field { resize: vertical; min-height: 90px; line-height: 1.5; }

/* ── BUTTONS ── */
.btn {
  display: block;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  transition: opacity .15s, transform .1s;
  text-align: center;
}
.btn:active { transform: scale(.98); opacity: .9; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surf2); color: var(--text); border: 1px solid var(--border); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 12px; width: auto; border-radius: 7px; display: inline-block; }
.btn + .btn { margin-top: 8px; }

/* ── BADGES ── */
.badge { font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 20px; display: inline-block; }
.badge-ok { background: var(--ok-d); color: var(--ok); }
.badge-warn { background: var(--warn-d); color: var(--warn); }
.badge-muted { background: var(--surf2); color: var(--muted); border: 1px solid var(--border); }
.badge-accent { background: var(--adim); color: var(--accent); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--surf);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text);
  box-shadow: var(--shadow-md);
  z-index: 200;
  max-width: 320px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex-shrink: 0; }

/* ── MODAL ── */
.modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}
.modal-bg.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--surf);
  border-radius: 16px 16px 0 0;
  padding: 24px 20px 36px;
  width: 100%;
  max-width: 480px;
  transform: translateY(100%);
  transition: transform .3s;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
}
.modal-bg.show .modal { transform: translateY(0); }
.modal-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.modal-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }

/* ── UPLOAD ZONE ── */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  background: var(--surf2);
  transition: all .15s;
}
.upload-zone:hover { border-color: var(--accent); background: var(--adim); }

/* ── ALERT BOXES ── */
.alert { border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.alert-warn { background: var(--warn-d); border: 1px solid var(--warn); }
.alert-ok { background: var(--ok-d); border: 1px solid var(--ok); }
.alert-accent { background: var(--adim); border: 1px solid var(--accent); }
.alert-title { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.alert-ok .alert-title { color: var(--ok); }
.alert-warn .alert-title { color: var(--warn); }
.alert-accent .alert-title { color: var(--accent); }
.alert-sub { font-size: 12px; color: var(--muted); }

/* ── LOADING ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ── */
@media (max-width: 700px) {
  .nav-right { display: none; }
  .nav-links { display: none; }
  .bnav { display: flex; }
  .page { padding: 16px 16px 80px; }
  .nav-inner { padding: 0 16px; }
}
