:root {
  --green-900: #0c4a2b;
  --green-800: #105c36;
  --green-700: #167a45;
  --green-600: #1e9152;
  --green-100: #dcf1e3;
  --green-50: #eff8f2;
  --mango: #f0a030;
  --mango-50: #fff4e4;
  --mango-ink: #9a5600;
  --on-accent: #2a1a00;
  --focus: rgba(30, 145, 82, 0.45);
  --focus-soft: rgba(30, 145, 82, 0.18);
  --blue: #2f6fde;
  --blue-50: #eaf1fd;
  --purple: #7a4ad3;
  --purple-50: #f2ecfc;
  --red: #c93b3b;
  --red-50: #fcecec;
  --ink: #18261e;
  --muted: #5d6d64;
  --line: #e1e8e3;
  --bg: #f3f6f4;
  --card: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 60, 36, 0.06), 0 4px 14px rgba(16, 60, 36, 0.05);
  --sidebar: 248px;
  --font: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 650; }
h3 { font-size: 0.98rem; font-weight: 650; }
p { margin: 0; }
svg.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Sign in */
.login {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-brand {
  background: var(--green-900);
  color: #fff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand .brand-name { font-size: 1.5rem; }
.login-brand h2 { font-size: 2rem; max-width: 18ch; margin-top: 18px; font-weight: 700; }
.login-brand p { color: rgba(255, 255, 255, 0.78); max-width: 42ch; margin-top: 12px; }
.login-form-wrap { display: grid; place-items: center; padding: 32px 20px; }
.login-form { width: 100%; max-width: 380px; }
.login-form h1 { margin-bottom: 6px; }
.login-form .sub { color: var(--muted); margin-bottom: 24px; }
.login-form .field { margin-bottom: 16px; }
.login-form .btn { width: 100%; justify-content: center; padding: 12px; }
.login-foot { color: var(--muted); font-size: 0.82rem; margin-top: 28px; text-align: center; }

.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 44px; width: auto; max-width: 200px; object-fit: contain; background: #fff; border-radius: 10px; padding: 4px; flex: none; }
.brand-name { font-weight: 700; font-size: 1.15rem; line-height: 1.1; }
.brand:has([data-brand-text]:not([hidden])) img { max-width: 110px; }
.brand-sub { font-size: 0.78rem; opacity: 0.8; }

/* Shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100%; }
.sidebar {
  background: var(--green-900);
  color: #fff;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidebar .brand { padding: 20px 20px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.94rem;
}
.nav a:hover { background: rgba(255, 255, 255, 0.07); text-decoration: none; color: #fff; }
.nav a.active { background: var(--green-600); color: #fff; font-weight: 600; }
.nav .count {
  margin-left: auto;
  background: var(--mango);
  color: var(--on-accent);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 99px;
  min-width: 22px;
  padding: 2px 7px;
  text-align: center;
}
.nav-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.nav-foot button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  border-radius: 10px;
  cursor: pointer;
}
.nav-foot button:hover { background: rgba(255, 255, 255, 0.07); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 24px;
  min-height: 64px;
}
.topbar .menu-btn, .topbar .mobile-brand { display: none; }
.mobile-brand { align-items: center; gap: 8px; font-weight: 700; color: var(--green-900); }
.mobile-brand img { height: 30px; width: auto; max-width: 90px; object-fit: contain; }
.search { flex: 1; max-width: 460px; position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding: 10px 12px 10px 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font: inherit; }
.user-chip { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--green-100);
  color: var(--green-800);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex: none;
}
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: 0.92rem; }
.user-chip .who span { font-size: 0.78rem; color: var(--muted); text-transform: capitalize; }

#view { padding: 24px; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Cards and grids */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head a { font-size: 0.86rem; font-weight: 600; }
.grid { display: grid; gap: 18px; }
.grid + .grid, .grid + .card, .card + .grid, .card + .card { margin-top: 18px; }
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2-1 { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi { display: flex; gap: 14px; align-items: flex-start; border: 0; }
.kpi .tile { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none; }
.kpi .tile svg { width: 26px; height: 26px; }
.kpi .value { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.01em; }
.kpi .label { color: var(--muted); font-size: 0.9rem; }
.kpi .delta { font-size: 0.82rem; font-weight: 600; margin-top: 6px; display: inline-flex; align-items: center; gap: 3px; }
.kpi .delta svg { width: 14px; height: 14px; }
.kpi.green { background: var(--green-50); } .kpi.green .tile { background: var(--green-600); } .kpi.green .value { color: var(--green-800); }
.kpi.blue { background: var(--blue-50); } .kpi.blue .tile { background: var(--blue); } .kpi.blue .value { color: #1d4fa8; }
.kpi.mango { background: var(--mango-50); } .kpi.mango .tile { background: var(--mango); } .kpi.mango .value { color: var(--mango-ink); }
.kpi.purple { background: var(--purple-50); } .kpi.purple .tile { background: var(--purple); } .kpi.purple .value { color: #4f2b96; }
.up { color: var(--green-700); }
.down { color: var(--red); }
.flat { color: var(--muted); }

.chart-box { position: relative; height: 270px; }
.donut-wrap { display: grid; grid-template-columns: 180px 1fr; gap: 18px; align-items: center; }
.donut-wrap .chart-box { height: 180px; }
.legend { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 10px; font-size: 0.92rem; }
.legend .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.legend .share { margin-left: auto; font-weight: 600; }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-list .n { font-weight: 700; color: var(--muted); }
.rank-list .name { font-weight: 600; }
.rank-list .meta { font-size: 0.8rem; color: var(--muted); }
.rank-list .amt { font-weight: 650; text-align: right; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--green-50); color: var(--green-700); }
.feed .ic.payment { background: var(--blue-50); color: var(--blue); }
.feed .ic.return { background: var(--mango-50); color: var(--mango-ink); }
.feed .ic.visit { background: var(--purple-50); color: var(--purple); }
.feed .t { font-size: 0.92rem; }
.feed .when { font-size: 0.78rem; color: var(--muted); }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-align: center;
}
.quick a:hover { text-decoration: none; filter: brightness(0.97); }
.quick a svg { width: 28px; height: 28px; }
.quick .q1 { background: var(--green-50); } .quick .q1 svg { color: var(--green-700); }
.quick .q2 { background: var(--blue-50); } .quick .q2 svg { color: var(--blue); }
.quick .q3 { background: var(--mango-50); } .quick .q3 svg { color: var(--mango-ink); }
.quick .q4 { background: var(--purple-50); } .quick .q4 svg { color: var(--purple); }

.ring-row { display: flex; align-items: center; gap: 20px; }
.ring { width: 120px; height: 120px; flex: none; }
.ring circle { fill: none; stroke-width: 11; }
.ring .bg { stroke: var(--green-100); }
.ring .fg { stroke: var(--green-600); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-size: 22px; font-weight: 700; fill: var(--ink); }
.stat-list { display: grid; gap: 8px; }
.stat-list span { display: block; font-size: 0.8rem; color: var(--muted); }
.stat-list b { font-size: 1.05rem; }

.progress { height: 8px; background: var(--green-100); border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress span { display: block; height: 100%; background: var(--green-600); border-radius: 99px; }
.progress.warn span { background: var(--mango); }
.progress.low span { background: var(--red); }

/* Buttons and forms */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid transparent;
  background: var(--green-700);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px 15px;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--green-800); text-decoration: none; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn svg { width: 18px; height: 18px; }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg); }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #a92f2f; }
.btn.sm { padding: 6px 10px; font-size: 0.84rem; border-radius: 8px; }
.btn.icon-only { padding: 8px; }
.link-btn { background: none; border: 0; color: var(--green-700); font: inherit; font-weight: 600; cursor: pointer; padding: 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.86rem; font-weight: 600; color: #34453b; }
.field .hint { font-size: 0.78rem; color: var(--muted); }
input, select, textarea {
  font: inherit;
  color: var(--ink);
  border: 1px solid #cdd8d1;
  background: #fff;
  border-radius: 9px;
  padding: 9px 11px;
  width: 100%;
  min-width: 0;
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus { border-color: var(--green-600); outline: 2px solid var(--focus-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 0.92rem; }
.check input { width: 18px; height: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { background: var(--red-50); color: var(--red); border-radius: 9px; padding: 10px 12px; font-size: 0.9rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { width: auto; }
.toolbar input, .toolbar select { padding: 8px 10px; width: auto; min-width: 150px; max-width: 280px; }
.toolbar input[type=search] { min-width: 220px; }
.range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.range select { width: auto; }
.range input[type=date] { width: 150px; }

/* Line items */
.lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: minmax(0, 2.4fr) 90px 120px 110px 40px; gap: 10px; align-items: end; padding: 12px; background: var(--bg); border-radius: 10px; }
.line.no-price { grid-template-columns: minmax(0, 3fr) 110px 40px; }
.line .total { font-weight: 650; padding: 9px 0; text-align: right; }
.line .remove { align-self: end; }
.sum-row { display: flex; justify-content: flex-end; gap: 20px; font-size: 1.05rem; margin-top: 8px; }
.sum-row b { font-size: 1.25rem; color: var(--green-800); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.82rem; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafcfb; white-space: nowrap; }
table.data td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--green-50); }
table.data .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data tfoot td { font-weight: 700; background: #fafcfb; border-top: 1px solid var(--line); }

.badge { display: inline-block; font-size: 0.76rem; font-weight: 650; padding: 3px 9px; border-radius: 99px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.green { background: var(--green-100); color: var(--green-800); }
.badge.mango { background: var(--mango-50); color: var(--mango-ink); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.blue { background: var(--blue-50); color: #1d4fa8; }
.badge.purple { background: var(--purple-50); color: #4f2b96; }

.empty { text-align: center; color: var(--muted); padding: 36px 16px; }
.empty .btn { margin-top: 12px; }
.loading { color: var(--muted); padding: 30px 0; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.84rem; }
.right { text-align: right; }
.stack { display: grid; gap: 4px; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-strip div { background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.summary-strip span { display: block; font-size: 0.8rem; color: var(--muted); }
.summary-strip b { font-size: 1.15rem; }
.detail-list { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 0.92rem; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; font: inherit; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--green-800); border-color: var(--green-700); font-weight: 650; }

.report-card { display: flex; flex-direction: column; gap: 10px; }
.report-card p { color: var(--muted); font-size: 0.9rem; flex: 1; }

/* Modal */
dialog.modal { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25); }
dialog.modal.wide { width: min(820px, calc(100vw - 24px)); }
dialog.modal::backdrop { background: rgba(12, 40, 25, 0.45); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-body { padding: 18px 20px; display: grid; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: #fff; }

.toast-box { position: fixed; right: 18px; bottom: 18px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--green-900); color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; font-size: 0.92rem; animation: toast-in 0.2s ease-out; }
.toast.error { background: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.offline-bar { background: var(--mango); color: var(--on-accent); text-align: center; padding: 6px; font-size: 0.86rem; font-weight: 600; }

.bottom-nav { display: none; }
.scrim { display: none; }

/* Tablet and phone */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; z-index: 50; transform: translateX(-100%); transition: transform 0.2s ease; }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 40; }
  .topbar .menu-btn, .topbar .mobile-brand { display: inline-flex; }
  .topbar { padding: 10px 14px; }
  .user-chip .who { display: none; }
  #view { padding: 18px 14px 96px; }
  .bottom-nav {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: #fff;
    border-top: 1px solid var(--line);
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottom-nav a, .bottom-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 8px 0 9px; font-size: 0.72rem; color: var(--muted); background: none; border: 0; font-family: inherit; cursor: pointer;
  }
  .bottom-nav a.active { color: var(--green-700); font-weight: 650; }
  .bottom-nav a:hover { text-decoration: none; }
  .bottom-nav .fab svg { background: var(--green-700); color: #fff; border-radius: 50%; width: 42px; height: 42px; padding: 10px; margin-top: -20px; box-shadow: 0 4px 12px rgba(16, 92, 54, 0.35); }
  .toast-box { bottom: 88px; left: 14px; right: 14px; }
}

@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { flex-direction: column; gap: 8px; padding: 14px; }
  .kpi .tile { width: 40px; height: 40px; border-radius: 10px; }
  .kpi .tile svg { width: 21px; height: 21px; }
  .kpi .value { font-size: 1.12rem; }
  .cols-3, .cols-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .donut-wrap { grid-template-columns: 1fr; }
  .donut-wrap .chart-box { height: 200px; }
  .chart-box { height: 230px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .detail-list { grid-template-columns: 110px 1fr; }
  .search { display: none; }
  .card { padding: 14px; }
  .line, .line.no-price { grid-template-columns: 1fr 1fr; }
  .line .product-field { grid-column: 1 / -1; }
  .line .total { text-align: left; }
  .page-actions { width: 100%; }
  .toolbar > select, .toolbar > input, .toolbar > div { width: 100%; max-width: none; }
  .page-actions .btn { flex: 1; justify-content: center; }

  table.data.cards thead { display: none; }
  table.data.cards, table.data.cards tbody, table.data.cards tr, table.data.cards td { display: block; width: 100%; }
  table.data.cards tr { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; margin-bottom: 10px; background: #fff; }
  table.data.cards td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.data.cards td::before { content: attr(data-label); color: var(--muted); font-size: 0.82rem; text-align: left; }
  table.data.cards td.num { text-align: right; }
  table.data.cards tfoot { display: block; }
  table.data.cards tfoot tr { background: var(--green-50); }
  .login { grid-template-columns: 1fr; }
  .login-brand { padding: 28px 22px; }
  .login-brand h2 { font-size: 1.4rem; }
  .login-brand .tagline-extra { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

@media print {
  .sidebar, .topbar, .bottom-nav, .page-actions, .toolbar, .no-print, .toast-box { display: none !important; }
  .shell { display: block; }
  body { background: #fff; font-size: 12px; }
  #view { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .print-head { display: flex !important; }
}
.print-head { display: none; align-items: center; justify-content: space-between; border-bottom: 2px solid var(--green-700); padding-bottom: 10px; margin-bottom: 16px; }

/* Settings page */
.swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.swatch { display: flex; align-items: center; gap: 10px; }
.swatch input[type=color] { width: 52px; height: 42px; padding: 3px; border-radius: 9px; cursor: pointer; flex: none; }
.swatch input[type=text] { font-family: Consolas, "Courier New", monospace; text-transform: lowercase; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px 6px 6px; font: inherit; font-size: 0.86rem; cursor: pointer; }
.preset:hover { border-color: var(--green-600); }
.preset span.chips { display: inline-flex; }
.preset span.chips i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; margin-left: -5px; display: block; }
.preset span.chips i:first-child { margin-left: 0; }
.logo-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.logo-preview .on-dark, .logo-preview .on-light { border-radius: 12px; padding: 14px; display: grid; place-items: center; min-width: 150px; min-height: 84px; }
.logo-preview .on-dark { background: var(--green-900); }
.logo-preview .on-light { background: var(--bg); border: 1px solid var(--line); }
.logo-preview img { max-height: 60px; max-width: 200px; object-fit: contain; }
.logo-preview .on-dark img { background: #fff; border-radius: 8px; padding: 4px; }
.logo-preview .fav { width: 32px; height: 32px; }
.preview-box { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; grid-template-columns: 120px 1fr; min-height: 150px; }
.preview-box .pv-side { background: var(--pv-side); padding: 12px 10px; display: grid; gap: 6px; align-content: start; }
.preview-box .pv-side span { display: block; height: 10px; border-radius: 5px; background: rgba(255,255,255,0.35); }
.preview-box .pv-side span.on { background: var(--pv-primary-light); height: 22px; }
.preview-box .pv-main { padding: 14px; display: grid; gap: 10px; align-content: start; background: #fff; }
.preview-box .pv-btn { justify-self: start; background: var(--pv-primary); color: #fff; border-radius: 8px; padding: 7px 14px; font-weight: 600; font-size: 0.86rem; }
.preview-box .pv-badge { justify-self: start; background: var(--pv-accent); color: var(--pv-on-accent); border-radius: 99px; padding: 2px 10px; font-weight: 700; font-size: 0.78rem; }
.preview-box .pv-bar { height: 8px; border-radius: 99px; background: var(--pv-primary-soft); overflow: hidden; }
.preview-box .pv-bar i { display: block; height: 100%; width: 68%; background: var(--pv-primary-light); }
@media (max-width: 640px) {
  .swatches { grid-template-columns: 1fr; }
  .preview-box { grid-template-columns: 80px 1fr; }
}

/* Officer features */
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; padding: 12px; background: var(--bg); border-radius: 10px; }

/* Weekly plans */
.week-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.week-label { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; flex: 1; justify-content: center; }
.week-label input { width: auto; }
.plan-day .card-head { margin-bottom: 8px; }
.plan-item { background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 10px; display: grid; gap: 8px; }
.plan-item .remove-item { justify-self: end; }

@media (max-width: 640px) {
  .feature-grid { grid-template-columns: 1fr; }
  .week-label { justify-content: flex-start; }
}

/* Offline capture */
.outbox-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: var(--mango-50); color: var(--mango-ink); font-weight: 650; font-size: 0.84rem; white-space: nowrap;
}
.outbox-pill:hover { text-decoration: none; filter: brightness(0.97); }
.outbox-pill svg { width: 16px; height: 16px; }
.outbox-pill.alert { background: var(--red-50); color: var(--red); }
.nav-foot .outbox-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  color: #fff; background: rgba(255, 255, 255, 0.1); margin-bottom: 4px;
}
.nav-foot .outbox-link:hover { text-decoration: none; background: rgba(255, 255, 255, 0.16); }
.nav-foot .outbox-link .count {
  margin-left: auto; background: var(--mango); color: var(--on-accent); font-size: 0.72rem; font-weight: 700;
  border-radius: 99px; min-width: 22px; padding: 2px 7px; text-align: center;
}
@media (max-width: 640px) {
  .outbox-pill span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}
