/* PengyouGo admin panel. Sidebar layout on computers, drawer on phones and tablets. */
:root {
  --bg: #f3f6fb; --surface: #ffffff; --surface-2: #f8fafc; --text: #0f172a; --muted: #64748b; --line: #e5eaf2;
  --accent: #2563eb; --accent-2: #14b8a6; --accent-soft: #eaf1ff; --grad: linear-gradient(135deg, #2563eb, #14b8a6);
  --danger: #dc2626; --ok: #059669; --warn: #b45309;
  --side: #0b1220; --side-text: #cbd5e1; --side-muted: #64748b; --side-active: rgba(96, 165, 250, 0.16);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #070b14; --surface: #111a2b; --surface-2: #0d1524; --text: #e6edf7; --muted: #8b98ae; --line: #1f2b40;
    --accent: #60a5fa; --accent-soft: #15254a; --danger: #f87171; --ok: #34d399; --warn: #fbbf24;
    --side: #050912; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #070b14; --surface: #111a2b; --surface-2: #0d1524; --text: #e6edf7; --muted: #8b98ae; --line: #1f2b40;
  --accent: #60a5fa; --accent-soft: #15254a; --danger: #f87171; --ok: #34d399; --warn: #fbbf24;
  --side: #050912; --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif; }
a { color: var(--accent); text-decoration: none; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.small, small { font-size: 0.8rem; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px; }
.side-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.side-brand strong { color: #fff; display: block; }
.side-brand small { color: var(--side-muted); }
.logo { width: 38px; height: 38px; display: block; flex: none; } /* the company mark (logo-mark.svg, same file as the site root) */
.side nav { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--side-muted); padding: 14px 10px 6px; }
.side nav a, .nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--side-text); font-weight: 600;
  border: 0; background: none; font: inherit; width: 100%; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.side nav a:hover, .nav-btn:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.side nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #60a5fa; }
.side nav a span { flex: 1; }
.side-foot { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.count { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.72rem; font-weight: 800; display: inline-grid; place-items: center; }
.scrim { display: none; }

.main-col { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 14px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.top h1 { flex: 1; margin: 0; font-size: 1.35rem; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-right { display: flex; align-items: center; gap: 10px; }
.theme { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1.1rem; cursor: pointer; }
.me { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: 0.85rem; flex: none; }
.avatar.sm { width: 34px; height: 34px; font-size: 0.75rem; }
.avatar.ic { background: var(--accent-soft); color: var(--accent); }
.avatar .i { width: 18px; height: 18px; }
.burger { display: none; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.burger span { width: 18px; height: 2px; border-radius: 2px; background: var(--text); }
main { padding: 24px 28px; max-width: 1400px; width: 100%; }
footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px; margin-top: auto; }

/* ---------- Building blocks ---------- */
h2 { font-size: 1.05rem; margin: 24px 0 12px; }
h3 { font-size: 0.95rem; margin: 20px 0 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card h2:first-child, .card .card-head h2 { margin-top: 0; }
.card.narrow { max-width: 400px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head strong { font-size: 1.2rem; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.grid .wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
button, .button {
  font: inherit; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 9px 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: transform 0.1s, box-shadow 0.15s;
}
button:active, .button:active { transform: scale(0.98); }
button.primary, .button.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.small, .button.small { padding: 5px 12px; font-size: 0.8rem; }
button.link { border: 0; background: none; color: var(--muted); padding: 6px 10px; box-shadow: none; }
.row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.row input, .row select { flex: 1; min-width: 130px; width: auto; }
form { margin: 0 0 8px; }
form.inline { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 0; }
form.inline input { width: 150px; padding: 6px 10px; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; margin: 0; flex: 1; max-width: 460px; }
code { font-size: 0.8rem; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge.paid, .badge.approved { background: #d1fae5; color: #065f46; }
.badge.trial, .badge.open, .badge.awaiting { background: #e0e7ff; color: #3730a3; }
.badge.expired, .badge.rejected, .badge.suspended { background: #fee2e2; color: #991b1b; }
.badge.pending, .badge.submitted, .badge.refund_requested { background: #fef3c7; color: #92400e; }
.badge.refunded, .badge.closed, .badge.none { background: var(--surface-2); color: var(--muted); }
.flash { padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 600; animation: slide 0.3s ease-out; }
.flash.ok { background: #d1fae5; color: #065f46; }
.flash.err { background: #fee2e2; color: #991b1b; }
@keyframes slide { from { opacity: 0; transform: translateY(-6px); } }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.tabs a.active { background: var(--grad); border-color: transparent; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
pre.log { background: #0b1120; color: #cbd5e1; padding: 12px; border-radius: 12px; font-size: 0.75rem; overflow-x: auto; max-height: 300px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
tbody tr:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }

/* ---------- Dashboard ---------- */
.hello { font-size: 1.1rem; font-weight: 700; margin: 0 0 18px; }
.hello .muted { font-weight: 500; font-size: 0.9rem; margin-left: 6px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: 20px; color: #fff;
  box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s;
}
.kpi:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16); }
.kpi::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }
.kpi.blue { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.kpi.green { background: linear-gradient(135deg, #059669, #10b981); }
.kpi.teal { background: linear-gradient(135deg, #0f766e, #14b8a6); }
.kpi.violet { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.kpi.amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.kpi.slate { background: linear-gradient(135deg, #475569, #64748b); }
.kpi-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.18); margin-bottom: 8px; }
.kpi-label { font-size: 0.8rem; opacity: 0.9; font-weight: 600; }
.kpi strong { font-size: 1.7rem; letter-spacing: -0.02em; line-height: 1.2; }
.kpi small { opacity: 0.85; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.bar i { display: block; width: 100%; max-width: 26px; border-radius: 8px 8px 4px 4px; background: var(--grad); min-height: 2px; transition: opacity 0.15s; }
.bars.rev .bar i { background: linear-gradient(180deg, #10b981, #059669); }
.bar:hover i { opacity: 0.75; }
.bar span { font-size: 0.65rem; color: var(--muted); }
.list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; color: var(--text); }
.row-item:hover { background: var(--surface-2); }
.row-item + .row-item { border-top: 1px solid var(--line); }
.ri-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ri-main strong { font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ri-main small { color: var(--muted); }
.go { color: var(--muted); font-size: 1.3rem; }
.empty { padding: 26px 10px; text-align: center; color: var(--muted); font-weight: 600; }
.quick { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.quick a { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 700; }
.quick a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Other pages ---------- */
.review p { margin: 8px 0; }
.review-head .stars { color: #f59e0b; letter-spacing: 1px; margin-left: 4px; }
textarea { font-family: inherit; line-height: 1.5; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 62vh; overflow-y: auto; padding: 4px; margin-bottom: 12px; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.msg small { display: block; color: var(--muted); margin-bottom: 4px; }
.msg.user { align-self: flex-start; }
.msg.admin { align-self: flex-end; background: var(--accent-soft); }
.msg.bot { align-self: center; max-width: 95%; background: transparent; border-style: dashed; font-size: 0.9rem; }
.msg img { display: block; max-width: 260px; max-height: 360px; margin-top: 8px; border-radius: 12px; border: 1px solid var(--line); }
.reply-box { display: flex; flex-direction: column; gap: 8px; }
.qr-preview { max-width: 180px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }

/* ---------- Login page ---------- */
body.auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(900px 500px at 100% 0%, rgba(37, 99, 235, 0.18), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(20, 184, 166, 0.16), transparent 60%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: 0 30px 60px rgba(15, 23, 42, 0.15); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth-brand small { display: block; color: var(--muted); }
.auth-box h1 { font-size: 1.4rem; margin: 0 0 14px; }
.auth-box .card { border: 0; box-shadow: none; padding: 0; background: none; max-width: none; }
.auth-box button.primary { width: 100%; justify-content: center; padding: 12px; }
.auth-box .foot { text-align: center; color: var(--muted); font-size: 0.75rem; margin: 18px 0 0; }

/* ---------- Tablet ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-3 > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 30; transform: translateX(-100%); transition: transform 0.25s ease; box-shadow: 20px 0 40px rgba(0, 0, 0, 0.3); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(7, 11, 20, 0.5); }
  .burger { display: inline-flex; }
  .top { padding: 12px 16px; }
  main { padding: 18px 16px; }
}
/* ---------- Phone ---------- */
@media (max-width: 700px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis .kpi:last-child { grid-column: 1 / -1; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .me-name { display: none; }
  .top h1 { font-size: 1.1rem; }
  .kpi strong { font-size: 1.35rem; }
  .bars { height: 120px; gap: 3px; }
  .card { padding: 16px; border-radius: 18px; }
  /* Tables become stacked cards; admin.js adds the column name as a label. */
  .table-wrap { background: none; border: 0; box-shadow: none; }
  table, thead, tbody, tr, td { display: block; }
  thead { display: none; }
  tbody tr { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px; margin-bottom: 10px; box-shadow: var(--shadow); }
  td { border: 0; padding: 6px 0; display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; flex: none; padding-top: 2px; }
  td:empty { display: none; }
  .toolbar form { max-width: none; }
}
.reply-box .attach { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 14px; }
.reply-box .attach input { width: auto; }
.chat .file-link { display: inline-block; margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(127, 127, 127, 0.12); text-decoration: none; }
.badge.support { background: rgba(124, 58, 237, 0.15); color: #7c3aed; }
.avatar-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; margin-bottom: 10px; }

/* Sourcing */
.badge.src-new { background: #fee2e2; color: #b91c1c; }
.badge.src-assigned { background: #e0e7ff; color: #3730a3; }
.badge.src-in_progress { background: #fef3c7; color: #92400e; }
.badge.src-quoted { background: #dbeafe; color: #1d4ed8; }
.badge.src-completed { background: #dcfce7; color: #166534; }
.badge.src-closed { background: #e5e7eb; color: #374151; }
.kpi.on { outline: 3px solid #0f172a; outline-offset: 2px; }
.src-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; }
.src-dl dt { color: #64748b; font-weight: 600; }
.src-dl dd { margin: 0; overflow-wrap: anywhere; }
.src-files { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.src-thumb img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid #e2e8f0; }
.src-video { width: 220px; max-width: 100%; border-radius: 10px; background: #000; }
/* Supplier quotes */
label.check { flex-direction: row; align-items: center; gap: 8px; align-self: end; min-height: 42px; }
label.check input { width: auto; }
.src-quotes tr.src-chosen td { background: #dcfce7; }
.src-quote-form { margin-top: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: 14px; }
.src-quote-form h4 { margin: 0; }
.filters { gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
form.inline { display: inline; }
/* Small line icons inside text (badges, links, buttons, "All caught up"). */
.badge .i, .file-link .i, .attach .i, .button .i, .empty .i { width: 16px; height: 16px; vertical-align: -3px; }

/* Sourcing: the team's live progress bar, team members and the team-chat counter. */
.stage-bar { list-style: none; display: flex; gap: 4px; margin: 14px 0 0; padding: 0 0 6px; overflow-x: auto; }
.stage-bar li { flex: 1 0 86px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 0.72rem; line-height: 1.25; color: var(--muted); position: relative; }
.stage-bar li::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 3px; background: var(--line); z-index: 0; }
.stage-bar li:first-child::before { display: none; }
.stage-bar li i { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 0.78rem; background: var(--surface); border: 2px solid var(--line); }
.stage-bar li.done { color: var(--text); }
.stage-bar li.done::before, .stage-bar li.now::before { background: #16a34a; }
.stage-bar li.done i { background: #16a34a; border-color: #16a34a; color: #fff; }
.stage-bar li.now { color: var(--text); font-weight: 800; }
.stage-bar li.now i { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.team-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.team-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); font-size: 0.85rem; font-weight: 600; }
.team-chip small { font-weight: 500; color: var(--muted); }
.team-chip form { margin: 0; }
.count.team { background: #7c3aed; }
.badge.src-source { background: var(--accent-soft); }
.stage-bar .rounds { display: inline-block; padding: 0 5px; border-radius: 999px; background: #7c3aed; color: #fff; font-size: 0.66rem; font-weight: 800; }
.msg.step { border-style: solid; border-color: #16a34a; align-self: stretch; max-width: 100%; }
.step-tag { font-weight: 700; }
.reply-box textarea[name="note"], form textarea[name="note"] { width: 100%; margin: 6px 0; }
.record { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.record summary { cursor: pointer; font-weight: 700; }
.record ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.record li { padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 0.9rem; }
.record li.step { border-left: 3px solid #16a34a; }
.record li small { color: var(--muted); }

/* Final price: the order's products with warranty / guarantee, and claims. */
.order-items-form { margin: 8px 0; }
.order-items-form summary { cursor: pointer; font-weight: 600; }
.item-row { display: grid; grid-template-columns: 1.4fr 1.4fr .6fr .7fr .8fr .8fr 1.6fr; gap: 6px; margin: 6px 0; }
@media (max-width: 900px) { .item-row { grid-template-columns: 1fr 1fr; } }
.order-items { margin: 6px 0; padding-inline-start: 20px; }
.order-items li { margin: 6px 0; }
.claim { border-inline-start: 3px solid #f59e0b; padding: 6px 10px; margin: 6px 0; background: rgba(245, 158, 11, .06); border-radius: 6px; }
.claim-photo { border-radius: 8px; margin: 4px 0; }

/* Field team: shop visit form (phone first), visits, ledger */
.visit-form { max-width: 720px; display: flex; flex-direction: column; gap: 10px; }
.visit-form h2 { margin: 14px 0 0; font-size: 1rem; }
.visit-form .cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 640px) { .visit-form .cols3 { grid-template-columns: 1fr; } }
.gps { padding: 10px 12px; border-radius: 10px; background: rgba(37, 99, 235, .08); }
.gps .ok { color: #15803d; font-weight: 600; }
.gps .weak { color: #b45309; font-weight: 600; }
.photo-pick { display: block; padding: 18px; border: 2px dashed #94a3b8; border-radius: 12px; text-align: center; font-weight: 600; cursor: pointer; }
.photo-pick input { display: block; margin: 10px auto 0; }
#preview { max-width: 100%; border-radius: 12px; }
.form-msg.err { color: #b91c1c; font-weight: 600; }
.form-msg.ok { color: #15803d; }
.visit { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid rgba(148, 163, 184, .25); flex-wrap: wrap; }
.visit img { border-radius: 10px; max-width: 100%; height: auto; }
td.neg { color: #b91c1c; }
.filters { flex-wrap: wrap; }

/* Tasks, daily reports, awards */
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid rgba(148, 163, 184, .25); }
.task.done strong { text-decoration: line-through; opacity: .7; }
.report { padding: 12px 0; border-bottom: 1px solid rgba(148, 163, 184, .25); }
.report h4 { margin: 6px 0 2px; font-size: .85rem; color: #64748b; }
.report p { margin: 0; white-space: pre-line; }
.awards { list-style: none; padding: 0; margin: 0; }
.awards li { padding: 4px 0; }

/* AI employees */
fieldset.perms { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: grid; gap: 2px; }
fieldset.perms label.check { min-height: 32px; align-self: start; }
.ai-step { padding: 12px 0; border-bottom: 1px solid rgba(148, 163, 184, .25); }
.ai-step p { margin: 4px 0; }
.ai-note { background: rgba(99, 102, 241, .08); border-radius: 10px; padding: 8px 10px; }
