/* ============================================================
   POD Fulfillment — Mockup design system (AntD-like)
   Shared tokens + components. Re-used across every page so the
   eventual React/AntD port inherits the same structure.
   ============================================================ */

:root {
  --primary: #1677ff;
  --primary-hover: #4096ff;
  --primary-soft: #e6f4ff;
  --text: rgba(0, 0, 0, 0.88);
  --text-2: rgba(0, 0, 0, 0.65);
  --text-3: rgba(0, 0, 0, 0.45);
  --border: #f0f0f0;
  --border-2: #d9d9d9;
  --bg: #f5f5f5;
  --bg-card: #ffffff;
  --sider: #001529;
  --sider-sub: #000c17;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px 0 rgba(0,0,0,.03), 0 1px 6px -1px rgba(0,0,0,.02), 0 2px 4px 0 rgba(0,0,0,.02);
  --success: #52c41a;
  --warning: #faad14;
  --error: #ff4d4f;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5715;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- Layout shell ---------- */
.layout { display: flex; min-height: 100vh; }
.sider {
  width: 232px; background: var(--sider); color: rgba(255,255,255,.65);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.sider .brand {
  height: 56px; display: flex; align-items: center; gap: 10px;
  padding: 0 20px; color: #fff; font-weight: 700; font-size: 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sider .brand .logo {
  width: 26px; height: 26px; border-radius: 6px; background: var(--primary);
  display: grid; place-items: center; color: #fff; font-size: 14px;
}
.sider .brand small { font-weight: 400; font-size: 11px; color: rgba(255,255,255,.45); display:block; line-height:1; margin-top:2px; }
.nav-group { padding: 12px 0 4px; }
.nav-group .label { padding: 6px 24px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: rgba(255,255,255,.35); }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 24px;
  color: rgba(255,255,255,.65); cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent;
}
.nav-item .ic { width: 18px; text-align: center; opacity: .9; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.04); }
.nav-item.active { color: #fff; background: var(--primary); border-left-color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 5;
}
.topbar .crumbs { color: var(--text-3); font-size: 13px; }
.topbar .crumbs b { color: var(--text-2); font-weight: 500; }
.topbar .right { display: flex; align-items: center; gap: 16px; }
.role-switch { display: flex; background: var(--bg); border-radius: 20px; padding: 3px; }
.role-switch a { padding: 4px 14px; border-radius: 16px; font-size: 13px; color: var(--text-2); }
.role-switch a.on { background: #fff; color: var(--primary); box-shadow: var(--shadow); font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 600; font-size: 13px; }

.content { padding: 24px; flex: 1; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; margin: 0 0 4px; font-weight: 600; }
.page-head .sub { color: var(--text-3); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Card ---------- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .card-head { padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 600; display:flex; align-items:center; justify-content:space-between; }
.card .card-body { padding: 20px; }
.card-grid { display: grid; gap: 16px; }

/* ---------- Stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .label { color: var(--text-3); font-size: 13px; display:flex; align-items:center; gap:6px; }
.stat .value { font-size: 28px; font-weight: 600; margin-top: 6px; line-height: 1.1; }
.stat .hint { font-size: 12px; margin-top: 6px; color: var(--text-3); }
.stat .hint.up { color: var(--success); }
.stat .hint.down { color: var(--error); }
.stat .ic-badge { float:right; width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 18px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: #fff; color: var(--text); cursor: pointer; font-size: 14px; font-family: var(--font); }
.btn:hover { color: var(--primary); border-color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color:#fff; }
.btn.danger { color: var(--error); border-color: var(--error); }
.btn.danger:hover { background: var(--error); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.lg { height: 40px; padding: 0 20px; font-size: 15px; }
.btn.block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Table ---------- */
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl thead th { text-align: left; padding: 12px 16px; background: #fafafa; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.tbl tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); color: var(--text); }
table.tbl tbody tr:hover { background: #fafafa; }
table.tbl tbody tr:last-child td { border-bottom: none; }
.tbl .muted { color: var(--text-3); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

/* ---------- Tags / status ---------- */
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; border-radius: 4px; font-size: 12px; line-height: 20px; border: 1px solid transparent; white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.tag.plain::before { display: none; }
.tag-gray   { color: #595959; background: #fafafa; border-color: #d9d9d9; }
.tag-blue   { color: #1677ff; background: #e6f4ff; border-color: #91caff; }
.tag-geek   { color: #2f54eb; background: #f0f5ff; border-color: #adc6ff; }
.tag-purple { color: #722ed1; background: #f9f0ff; border-color: #d3adf7; }
.tag-cyan   { color: #08979c; background: #e6fffb; border-color: #87e8de; }
.tag-green  { color: #389e0d; background: #f6ffed; border-color: #b7eb8f; }
.tag-gold   { color: #d48806; background: #fffbe6; border-color: #ffe58f; }
.tag-orange { color: #d46b08; background: #fff7e6; border-color: #ffd591; }
.tag-red    { color: #cf1322; background: #fff1f0; border-color: #ffa39e; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-row > label { display: block; margin-bottom: 6px; font-size: 14px; }
.form-row .req { color: var(--error); margin-left: 2px; }
.input, .select, textarea.input {
  width: 100%; height: 34px; padding: 4px 11px; border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); font-size: 14px; font-family: var(--font); background:#fff; color: var(--text);
}
textarea.input { height: auto; min-height: 80px; padding: 8px 11px; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.help { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.help.error { color: var(--error); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }

/* ---------- Steps ---------- */
.steps { display: flex; gap: 0; margin-bottom: 24px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.step .num { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--border-2); display: grid; place-items: center; font-size: 13px; }
.step.done { color: var(--text); }
.step.done .num { background: var(--primary); border-color: var(--primary); color: #fff; }
.step.active { color: var(--primary); font-weight: 500; }
.step.active .num { border-color: var(--primary); color: var(--primary); }
.step .bar { width: 48px; height: 1px; background: var(--border-2); margin: 0 12px; }

/* ---------- Misc ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty .big { font-size: 40px; opacity: .25; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; display:flex; gap:8px; align-items:flex-start; margin-bottom:16px; }
.alert.warn { background: #fffbe6; border: 1px solid #ffe58f; color: #614700; }
.alert.err  { background: #fff1f0; border: 1px solid #ffccc7; color: #5c0011; }
.alert.info { background: #e6f4ff; border: 1px solid #91caff; color: #002c8c; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.pagination { display:flex; gap:6px; justify-content:flex-end; padding:14px 16px; align-items:center; color:var(--text-3); font-size:13px; }
.pagination .pg { min-width:30px; height:30px; padding:0 6px; border:1px solid var(--border-2); border-radius:6px; display:grid; place-items:center; cursor:pointer; }
.pagination .pg.on { border-color: var(--primary); color: var(--primary); }
.row-flex { display:flex; gap:16px; align-items:flex-start; flex-wrap:wrap; }
.flex-2 { flex: 2; min-width: 320px; }
.flex-1 { flex: 1; min-width: 260px; }
hr.sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.kv { display:flex; justify-content:space-between; padding:7px 0; border-bottom:1px dashed var(--border); font-size:14px; }
.kv:last-child { border-bottom:none; }
.kv .k { color: var(--text-3); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg,#1677ff10,#722ed110); padding: 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { display:flex; align-items:center; justify-content:center; gap:10px; font-size:20px; font-weight:700; margin-bottom: 6px; }
.auth-card .brand .logo { width: 30px; height:30px; border-radius:7px; background: var(--primary); color:#fff; display:grid; place-items:center; }
