/* ─── Design tokens ───────────────────────────────────────────────────── */
:root {
  --brand:        #06C167;   /* Uber Eats green */
  --brand-dark:   #049A51;
  --brand-dim:    rgba(6,193,103,.12);
  --surface-0:    #0F0F0F;   /* page bg */
  --surface-1:    #1A1A1A;   /* card */
  --surface-2:    #242424;   /* card hover / raised */
  --surface-3:    #2E2E2E;   /* input / table row */
  --text-primary: #F7F7F7;
  --text-muted:   #8A8A8A;
  --text-dim:     #555;
  --border:       #2A2A2A;
  --red:          #FF4D4F;
  --amber:        #FAAD14;
  --blue:         #1890FF;
  --radius-sm:    6px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --shadow-card:  0 2px 12px rgba(0,0,0,.45);
}

/* ─── Reset / base ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  background: var(--surface-0);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }

/* ─── Layout shell ────────────────────────────────────────────────────── */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
}

/* ─── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -.3px;
}

.topbar-brand-dot {
  width: 28px; height: 28px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-user {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ─── Sidebar ─────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--surface-1);
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-label {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px 4px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: var(--surface-3);
  color: var(--text-primary);
}

.sidebar-link.active { color: var(--brand); }

.sidebar-icon { font-size: 1rem; width: 18px; text-align: center; }

/* ─── Main content area ───────────────────────────────────────────────── */
.main {
  padding: 28px 32px;
  overflow-y: auto;
}

/* ─── Page header ─────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.4px;
}

.page-subtitle {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ─── Stat cards ──────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.stat-card-label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card-value {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -.5px;
  line-height: 1;
}

.stat-card-value.green { color: var(--brand); }
.stat-card-value.amber { color: var(--amber); }
.stat-card-value.blue  { color: var(--blue);  }

.stat-card-sub {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Section title ───────────────────────────────────────────────────── */
.section-title {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ─── Card ────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.card-body { padding: 20px; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s, background .15s;
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { opacity: .88; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #000;
}

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--border);
}

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

.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-xs { padding: 3px 9px;  font-size: .74rem; }

/* ─── Badges / pills ──────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success  { background: rgba(6,193,103,.15);  color: var(--brand); }
.badge-warning  { background: rgba(250,173,20,.15);  color: var(--amber); }
.badge-danger   { background: rgba(255,77,79,.15);   color: var(--red);   }
.badge-info     { background: rgba(24,144,255,.15);  color: var(--blue);  }
.badge-muted    { background: var(--surface-3);      color: var(--text-muted); }

/* ─── Table ───────────────────────────────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}

.data-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--surface-1);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}

.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table td {
  padding: 13px 16px;
  vertical-align: middle;
  color: var(--text-primary);
}

.data-table td.muted { color: var(--text-muted); font-size: .8rem; }

/* ─── Order number chip ───────────────────────────────────────────────── */
.order-id {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: .82rem;
  font-weight: 700;
  background: var(--surface-3);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  color: var(--brand);
}

/* ─── Store card (dashboard) ──────────────────────────────────────────── */
.store-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color .15s, background .15s;
  box-shadow: var(--shadow-card);
}

.store-card:hover {
  border-color: var(--brand);
  background: var(--surface-2);
}

.store-avatar {
  width: 44px; height: 44px;
  background: var(--brand-dim);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.store-meta { flex: 1; min-width: 0; }
.store-name { font-weight: 700; font-size: .95rem; }
.store-detail { font-size: .78rem; color: var(--text-muted); margin-top: 1px; }

/* ─── Detail page layout ──────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

.detail-section {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.detail-section-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

.detail-section-body { padding: 20px; }

/* ─── Line items table ────────────────────────────────────────────────── */
.line-items { width: 100%; border-collapse: collapse; font-size: .84rem; }
.line-items th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0 10px;
  border-bottom: 1px solid var(--border);
}
.line-items td {
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.line-items tr:last-child td { border-bottom: none; }
.line-items .item-name { font-weight: 600; }
.line-items .item-desc { font-size: .76rem; color: var(--text-muted); margin-top: 2px; }

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: .84rem;
  padding: 5px 0;
  color: var(--text-muted);
}
.totals-row.total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

/* ─── Info list (customer panel) ──────────────────────────────────────── */
.info-list { display: flex; flex-direction: column; gap: 12px; }
.info-row { display: flex; flex-direction: column; gap: 2px; }
.info-label { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); }
.info-value { font-size: .88rem; color: var(--text-primary); }

/* ─── Forms ───────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.form-hint  { font-size: .74rem; color: var(--text-dim); }

.form-input,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"] {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .88rem;
  padding: 9px 12px;
  width: 100%;
  outline: none;
  transition: border-color .15s;
}

.form-input:focus,
input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}

/* ─── Flash messages ──────────────────────────────────────────────────── */
.flash {
  padding: 12px 20px;
  font-size: .84rem;
  font-weight: 500;
  text-align: center;
}
.flash-notice { background: var(--brand-dim); color: var(--brand); }
.flash-alert  { background: rgba(255,77,79,.12); color: var(--red); }

/* ─── Pagination ──────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px;
  font-size: .82rem;
}
.pagination a, .pagination span {
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.pagination a:hover { background: var(--surface-3); color: var(--text-primary); }
.pagination .current { background: var(--brand); color: #000; border-color: var(--brand); font-weight: 700; }

/* ─── Login page ──────────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-0);
}
.login-box {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 8px 40px rgba(0,0,0,.6);
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-mark {
  width: 48px; height: 48px;
  background: var(--brand);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 12px;
}
.login-title { font-size: 1.3rem; font-weight: 800; text-align: center; margin-bottom: 4px; }
.login-sub   { font-size: .82rem; color: var(--text-muted); text-align: center; margin-bottom: 28px; }

/* ─── Utilities ───────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-green   { color: var(--brand); }
.text-amber   { color: var(--amber); }
.text-red     { color: var(--red); }
.font-mono    { font-family: "SF Mono","Fira Code",monospace; }
.fw-700       { font-weight: 700; }
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }
.gap-4  { gap: 16px; }
.mb-4   { margin-bottom: 16px; }
.mb-6   { margin-bottom: 24px; }
.mt-1   { margin-top: 4px; }
.mt-2   { margin-top: 8px; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
