/* ===== No Limits — Store Dashboard ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
:root {
  --bg: #0b1220;
  --panel: #111a2c;
  --panel-2: #16213a;
  --line: #24304a;
  --text: #e8edf6;
  --muted: #8b98b0;
  --accent: #e63946;
  --accent-2: #ff5a66;
  --ok: #2dd4a7;
  --warn: #f5b942;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  min-height: 100vh;
}
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

/* ---- Login ---- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  position: relative;
  background: var(--bg) url('/admin/login-bg.jpg') center / cover no-repeat;
}
.login-wrap::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,13,28,.55) 0%, rgba(5,13,28,.78) 100%);
}
.login-card {
  width: 100%; max-width: 380px; background: rgba(17,26,44,.90); border: 1px solid var(--line);
  border-radius: 16px; padding: 36px 32px; text-align: center;
  position: relative; backdrop-filter: blur(8px);
  box-shadow: 0 24px 70px -20px rgba(0,0,0,.65);
}
.login-card img { margin-bottom: 12px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); margin-bottom: 12px;
}
.login-err { color: var(--accent-2); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---- Buttons ---- */
.btn {
  width: 100%; background: var(--accent); border: 0; color: #fff; font-weight: 600;
  padding: 12px 18px; border-radius: 10px;
}
.btn:hover { background: var(--accent-2); }
.btn-sm { width: auto; padding: 8px 16px; font-size: 14px; }
.linkish { background: none; border: 0; color: var(--muted); text-decoration: none; font-size: 14px; }
.linkish:hover { color: var(--text); }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.topbar-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.topbar-right { margin-left: auto; display: flex; gap: 18px; align-items: center; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tab {
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 10px; font-weight: 600;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--panel-2); border-color: var(--line); color: var(--text); }
.badge {
  background: var(--accent); color: #fff; border-radius: 99px; font-size: 11.5px;
  padding: 1px 7px; margin-left: 4px; vertical-align: 1px;
}

/* ---- Layout ---- */
.content { max-width: 1200px; margin: 0 auto; padding: 24px 20px 80px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 20px; min-width: 150px;
}
.stat strong { display: block; font-size: 24px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.hot { border-color: var(--accent); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-head h2 { font-size: 20px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type="search"], .filters select, .markup-bar select, .markup-bar input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  padding: 8px 12px; border-radius: 10px;
}
.chip {
  background: var(--panel); border: 1px solid var(--line); color: var(--muted);
  padding: 6px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 600;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---- Orders ---- */
.orders { display: flex; flex-direction: column; gap: 14px; }
.order-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.order-top { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.order-no { font-weight: 800; font-size: 16.5px; }
.order-date { color: var(--muted); font-size: 13px; }
.order-total { margin-left: auto; font-weight: 800; font-size: 16.5px; }
.order-cust { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.order-cust a { color: var(--text); }
.order-note { background: var(--panel-2); border-radius: 8px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 12px; }
.vendor-group { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.vendor-group-head {
  background: var(--panel-2); padding: 8px 14px; font-size: 13.5px; font-weight: 700;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.vendor-group-head .v-label { color: var(--warn); }
.vendor-group-head a { color: var(--muted); font-weight: 500; }
.oi { display: flex; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.oi-qty { color: var(--muted); min-width: 36px; }
.oi-name { flex: 1; min-width: 200px; }
.oi-name a { color: var(--text); }
.oi-price { font-variant-numeric: tabular-nums; }
.order-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.status-sel { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.status-pill { border-radius: 99px; padding: 3px 12px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.st-new { background: rgba(230,57,70,.15); color: var(--accent-2); }
.st-processing { background: rgba(245,185,66,.15); color: var(--warn); }
.st-completed { background: rgba(45,212,167,.15); color: var(--ok); }
.st-cancelled { background: rgba(139,152,176,.15); color: var(--muted); }
.order-profit { color: var(--muted); font-size: 13px; margin-left: auto; }

/* ---- Products table ---- */
.markup-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px; font-size: 14px;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.prod-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 900px; }
.prod-table th {
  text-align: left; padding: 10px 12px; background: var(--panel-2); color: var(--muted);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; position: sticky; top: 0;
}
.prod-table td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.prod-table tr:hover td { background: rgba(255,255,255,.02); }
.p-thumb { width: 42px; height: 42px; object-fit: contain; background: #fff; border-radius: 8px; display: block; }
.p-thumb-ph { width: 42px; height: 42px; border-radius: 8px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.pname { max-width: 380px; }
.pname small { color: var(--muted); display: block; }
.price-input {
  width: 110px; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 6px 8px; border-radius: 8px; font-variant-numeric: tabular-nums;
}
.price-input.saved { border-color: var(--ok); }
.price-input.err { border-color: var(--accent); }
.margin-pos { color: var(--ok); }
.margin-neg { color: var(--accent-2); }
.hint { color: var(--muted); font-size: 13px; }
.toggle { width: 40px; height: 22px; border-radius: 99px; background: var(--line); border: 0; position: relative; transition: background .15s; }
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: left .15s;
}
.toggle.on { background: var(--ok); }
.toggle.on::after { left: 20px; }

/* ---- Vendors ---- */
.vendor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 26px; }
.vendor-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.vendor-card h3 { font-size: 17px; margin-bottom: 2px; }
.vendor-card a { color: var(--muted); font-size: 13.5px; word-break: break-all; }
.vendor-card .v-counts { margin: 10px 0 4px; font-size: 14px; }
.vendor-card .v-notes { color: var(--muted); font-size: 13.5px; }
.vendor-add, .settings-form {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 20px; max-width: 460px; display: flex; flex-direction: column; gap: 10px;
}
.vendor-add h3, .settings-form h3 { font-size: 16px; margin-bottom: 4px; }
.vendor-add input, .settings-form input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 12px; border-radius: 10px;
}
.settings-info { margin-top: 26px; max-width: 640px; color: var(--muted); }
.settings-info h3 { color: var(--text); margin-bottom: 8px; }

.empty { color: var(--muted); text-align: center; padding: 50px 20px; border: 1px dashed var(--line); border-radius: 14px; }
@media (max-width: 720px) {
  .content { padding: 16px 12px 60px; }
  .topbar { padding: 12px 14px; gap: 10px; }
}
