/* ============================================================================
   sellerStyles.css
   Single source of truth for the LTC seller dashboard design system.

   Drop one <link rel="stylesheet" href="sellerStyles.css"> into the <head>
   of every seller page. Once present, the page picks up the unified colours,
   typography, layout primitives, and components without any further changes.

   Pages that already define :root tokens or duplicate base styles can keep
   their inline <style> blocks for now — the variables here are identical, so
   nothing visible will change. Over time, page-specific <style> blocks should
   shrink down to only the bits that are truly unique to that page.
   ============================================================================ */

:root {
  /* Background layers — darkest to lightest */
  --bg:           #222;
  --panel:        #111;
  --panel-2:      #191919;
  --panel-3:      #141414;
  --panel-soft:   #1b1b1b;

  /* Text */
  --text:         #f3f3f3;
  --muted:        #a8a8a8;
  --muted-2:      #777;

  /* Borders */
  --border:        #262626;
  --border-strong: #333;
  --border-soft:   #1f1f1f;

  /* Brand & semantic colours */
  --accent:       #6aa8ff;
  --accent-soft:  rgba(106,168,255,0.14);
  --accent-fg:    #0e1b2e;
  --ok:           #21c07b;
  --warn:         #f7b500;
  --bad:          #ff5a5a;
  --gold:         #ffc73a;

  /* Shape & elevation */
  --radius:       14px;
  --radius-sm:    8px;
  --radius-pill:  999px;
  --shadow:       0 10px 30px rgba(0,0,0,.45);
  --shadow-soft:  0 4px 14px rgba(0,0,0,.35);

  /* Spacing rhythm — used informally; pages may override */
  --gap-sm:       8px;
  --gap:          12px;
  --gap-lg:       18px;
  --gap-xl:       24px;
}

/* ----------------------------------------------------------------------------
   Reset & base
   ---------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

/* ----------------------------------------------------------------------------
   Layout: header + sidebar + content + footer
   ---------------------------------------------------------------------------- */
.main-container {
  display: flex;
  flex: 1;
  min-width: 0;
}

.content {
  flex: 1;
  padding: 32px 36px 40px;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  min-width: 0;
}

.content-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .content { padding: 20px 18px 28px; }
}

/* ----------------------------------------------------------------------------
   Page header
   ---------------------------------------------------------------------------- */
.greet,
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.greet h1,
.page-head h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 4px;
  line-height: 1.15;
}

.greet .subtle,
.page-head .subtle,
.page-head p {
  color: var(--muted);
  font-size: 15px;
  margin: 0;
  max-width: 720px;
}

@media (max-width: 640px) {
  .greet, .page-head { flex-direction: column; align-items: flex-start; }
  .greet h1, .page-head h1 { font-size: 28px; }
}

/* ----------------------------------------------------------------------------
   Cards — the universal panel
   ---------------------------------------------------------------------------- */
.card {
  background: linear-gradient(135deg, #101010, #181818);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}

.card.compact { padding: 14px 16px; }

/* The big-number "balance" card — used on balance, tax, stats summary cards */
.balance-card {
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
}
.balance-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top left, rgba(106,168,255,0.2), transparent 55%);
  opacity: 0.85;
  pointer-events: none;
}
.balance-inner { position: relative; z-index: 1; }

.balance-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.balance-label,
.section-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
}

.balance-amount {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.balance-footnote {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.55;
}
.balance-footnote strong { color: var(--text); }

.incoming-amount {
  font-size: 14px;
  color: var(--muted);
}

/* ----------------------------------------------------------------------------
   Summary grids — 4-up stat cards used on tax, stats, label history, etc.
   ---------------------------------------------------------------------------- */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.summary-card {
  background: linear-gradient(135deg, #101010, #181818);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-card .label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.summary-card .value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.summary-card .sub {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 4px;
}

/* Semantic accents on summary cards */
.summary-card.green { border-color: rgba(33,192,123,0.3); }
.summary-card.green .value { color: var(--ok); }
.summary-card.amber { border-color: rgba(247,181,0,0.3); }
.summary-card.amber .value { color: var(--warn); }
.summary-card.blue { border-color: rgba(106,168,255,0.3); }
.summary-card.blue .value { color: var(--accent); }
.summary-card.red { border-color: rgba(255,90,90,0.3); }
.summary-card.red .value { color: var(--bad); }

@media (max-width: 1100px) { .summary-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px)  { .summary-row { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------------------------
   Metric rows — label/value pairs inside a card
   ---------------------------------------------------------------------------- */
.mini-metrics { display: flex; flex-direction: column; gap: 12px; }

.metric-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  gap: 12px;
}

.metric-label { color: var(--muted); }
.metric-value { font-weight: 600; font-variant-numeric: tabular-nums; }

.metric-muted { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ----------------------------------------------------------------------------
   Sections (in-page subdivisions)
   ---------------------------------------------------------------------------- */
.section { margin-bottom: 26px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}

.section-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0;
}

.section-head .meta {
  font-size: 13px;
  color: var(--muted);
}

/* ----------------------------------------------------------------------------
   Toolbars (filters + search)
   ---------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.toolbar .label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.toolbar input,
.toolbar select,
.toolbar input[type="date"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  color-scheme: dark;
  transition: border-color 0.15s ease;
}
.toolbar input:focus,
.toolbar select:focus { border-color: var(--accent); }
.toolbar input { min-width: 240px; flex: 0 1 320px; }

/* ----------------------------------------------------------------------------
   Buttons — pill-style by default, like the balance page
   ---------------------------------------------------------------------------- */
.btn {
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.08);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.08s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease;
  box-shadow: var(--shadow-soft);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}
.btn:hover {
  background: #222;
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(0,0,0,0.55);
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
}
.btn:active { transform: translateY(0); box-shadow: 0 3px 10px rgba(0,0,0,0.35); }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}
.btn.primary:hover {
  background: #82baff;
  border-color: #82baff;
  color: var(--accent-fg);
}

.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255,255,255,0.04); }

.btn.danger {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
}
.btn.danger:hover { background: #ff7b7b; border-color: #ff7b7b; color: #fff; }

.btn[disabled],
.btn.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* Smaller button used inside tables / inline actions */
.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: var(--panel-3);
  color: #ddd;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.15s ease, color 0.15s ease;
  font-family: inherit;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm.primary { background: var(--accent-soft); border-color: rgba(106,168,255,0.4); color: #b8d2ff; }
.btn-sm.primary:hover { color: #fff; border-color: var(--accent); }

.action-buttons { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.actions-helper {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.6;
}
.actions-helper strong { color: var(--text); }

/* ----------------------------------------------------------------------------
   Pills, badges, tags, status indicators
   ---------------------------------------------------------------------------- */
.badge-pill {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.35);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-weight: 500;
}
.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-pill);
  background: var(--ok);
  flex-shrink: 0;
}

.tag {
  padding: 3px 9px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: rgba(255,255,255,0.02);
  color: #ccc;
  display: inline-flex;
  align-items: center;
}
.tag.yes,
.tag.green { color: var(--ok); border-color: rgba(33,192,123,0.4); background: rgba(33,192,123,0.08); }
.tag.no,
.tag.red { color: var(--bad); border-color: rgba(255,90,90,0.4); background: rgba(255,90,90,0.08); }
.tag.maybe,
.tag.amber { color: var(--warn); border-color: rgba(247,181,0,0.4); background: rgba(247,181,0,0.1); }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11px;
  border-radius: var(--radius-pill);
  border: 1px solid;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill.active   { color: var(--ok);   border-color: rgba(33,192,123,0.4); background: rgba(33,192,123,0.08); }
.status-pill.flagged  { color: var(--warn); border-color: rgba(247,181,0,0.4);  background: rgba(247,181,0,0.1); }
.status-pill.removed  { color: var(--bad);  border-color: rgba(255,90,90,0.4);  background: rgba(255,90,90,0.08); }
.status-pill.pending  { color: var(--muted); border-color: var(--border-strong); background: rgba(255,255,255,0.03); }

/* ----------------------------------------------------------------------------
   Tables
   ---------------------------------------------------------------------------- */
.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
  overflow: hidden;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
thead {
  background: linear-gradient(135deg, #1f1f1f, #161616);
}
thead th {
  text-align: left;
  padding: 11px 14px;
  font-weight: 600;
  color: #ccc;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
tbody tr {
  border-bottom: 1px solid var(--border-soft);
  transition: background 0.15s ease;
}
tbody tr:hover { background: rgba(255,255,255,0.02); }
tbody tr:last-child { border-bottom: none; }
tbody td {
  padding: 11px 14px;
  vertical-align: middle;
  color: #e6e6e6;
}
tfoot td {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
  border-top: 2px solid var(--border-strong);
  background: rgba(255,255,255,0.02);
  font-variant-numeric: tabular-nums;
}

/* ----------------------------------------------------------------------------
   Order/link badge — used to point to orders, conversations, etc.
   ---------------------------------------------------------------------------- */
.order-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  font-size: 12px;
  color: #ddd;
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.order-badge:hover { border-color: var(--accent); color: var(--accent); }

.order-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.order-link:hover { text-decoration: underline; }

/* ----------------------------------------------------------------------------
   Empty state
   ---------------------------------------------------------------------------- */
.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty-block {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: rgba(255,255,255,0.01);
}

/* ----------------------------------------------------------------------------
   Info banners (informational tips at the top of pages)
   ---------------------------------------------------------------------------- */
.info-banner {
  background: linear-gradient(135deg, rgba(106,168,255,0.1), rgba(106,168,255,0.04));
  border: 1px solid rgba(106,168,255,0.25);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13px;
  color: #bcd4ff;
  margin-bottom: 18px;
  line-height: 1.55;
}
.info-banner strong { color: var(--text); }

.info-banner.amber {
  background: linear-gradient(135deg, rgba(247,181,0,0.1), rgba(247,181,0,0.04));
  border-color: rgba(247,181,0,0.3);
  color: #f0d68a;
}

.info-banner.red {
  background: linear-gradient(135deg, rgba(255,90,90,0.1), rgba(255,90,90,0.04));
  border-color: rgba(255,90,90,0.3);
  color: #ffaaaa;
}

/* ----------------------------------------------------------------------------
   Modal (dialog) — used for appeals, confirmations, etc.
   ---------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--panel-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal h2 { font-size: 18px; font-weight: 700; margin: 0; }
.modal p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
.modal label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.modal textarea,
.modal input[type="text"],
.modal input[type="email"],
.modal input[type="number"] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
}
.modal textarea {
  resize: vertical;
  min-height: 110px;
}
.modal textarea:focus,
.modal input:focus { border-color: var(--accent); }
.modal .actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 6px;
}
.modal .err {
  font-size: 12px;
  color: var(--bad);
  display: none;
}
.modal .err.show { display: block; }

/* ----------------------------------------------------------------------------
   Toast notification
   ---------------------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ok);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 2100;
}
.toast.show { opacity: 1; }
.toast.bad   { background: var(--bad); }
.toast.warn  { background: var(--warn); color: #1a1300; }

/* ----------------------------------------------------------------------------
   Utility classes
   ---------------------------------------------------------------------------- */
.text-right { text-align: right; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 12px; }
.money { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SF Mono, Menlo, Consolas, monospace; }

.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 6px; }
.gap { gap: 12px; }
.gap-lg { gap: 18px; }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 6px; }
.mb { margin-bottom: 12px; }
.mb-lg { margin-bottom: 18px; }
.mb-xl { margin-bottom: 24px; }
.mt { margin-top: 12px; }
.mt-lg { margin-top: 18px; }

/* ----------------------------------------------------------------------------
   Mobile sidebar drawer — critical styles load here so the sidebar is already
   hidden before accountsidebar.html is fetched (prevents the flash-on-load).
   ---------------------------------------------------------------------------- */
@media (max-width: 760px) {
  #sidebar-container {
    position: fixed !important;
    top: 57px;
    left: 0;
    bottom: 0;
    width: 240px !important;
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.4,0,.2,1);
    height: auto;
    min-height: unset;
    background: #222;
  }
  #sidebar-container.mobile-open {
    transform: translateX(0) !important;
  }
  .sidebar-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 1045;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }
  .sidebar-mobile-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
}

.hidden { display: none !important; }
