/* HR & Payroll Management System — self-contained stylesheet.
   No build step, no CDN dependency: plain CSS with custom properties,
   safe to serve as-is from any shared host. */

/* ---------- Premium theme ----------
   Warm ivory surfaces throughout (sidebar included) + a deep gold accent,
   in the spirit of a luxury hospitality brand rather than a stock admin
   tool. A few deliberately-dark hero/banner elements (stock-hero,
   shortage-banner, auth-page background) keep their own dark tones as
   branded accents — see the hardcoded dark blocks further down. Every
   color below is a custom property so the whole app re-skins from this
   one block. */

:root {
  --color-bg: #f4efe4;
  --color-surface: #fffdf8;
  --color-surface-2: #ede4d0;
  --color-border: rgba(30, 24, 14, 0.12);
  --color-text: #2b241c;
  --color-text-muted: #756b5c;
  --color-primary: #a97c1b;
  --color-primary-hover: #c28f22;
  --color-primary-light: rgba(169, 124, 27, 0.14);
  --color-on-primary: #fffaf0;
  --color-danger: #b3392c;
  --color-danger-light: rgba(179, 57, 44, 0.12);
  --color-success: #227a4f;
  --color-success-light: rgba(34, 122, 79, 0.12);
  --color-warning: #a8620c;
  --color-warning-light: rgba(168, 98, 12, 0.12);
  --color-info: #2f6fa8;
  --color-info-light: rgba(47, 111, 168, 0.12);
  --color-sidebar-bg: #efe6d2;
  --color-sidebar-text: #6b5f4d;
  --color-sidebar-active: #e2d5b8;
  --radius: 12px;
  --radius-sm: 7px;
  --shadow-sm: 0 1px 3px rgba(30, 24, 14, 0.12);
  --shadow-md: 0 12px 28px rgba(30, 24, 14, 0.16);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--color-primary); color: var(--color-on-primary); }

/* A quiet, on-brand scrollbar rather than the OS default (Webkit only —
   harmless no-op elsewhere). */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d9cdae; border-radius: 999px; border: 3px solid var(--color-bg); }
::-webkit-scrollbar-thumb:hover { background: #c9ba91; }

/* ---------- Layout shell ---------- */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--color-sidebar-bg);
  color: var(--color-sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.01em;
  padding: 0 8px 20px;
}
.sidebar-brand svg { color: var(--color-primary); }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--color-sidebar-text);
  border-left: 2px solid transparent;
}

.sidebar-link:hover { background: var(--color-sidebar-active); color: var(--color-text); }
.sidebar-link.active { background: var(--color-primary-light); color: var(--color-primary); border-left-color: var(--color-primary); font-weight: 700; }
.sidebar-link svg { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-footer {
  border-top: 1px solid rgba(30,24,14,0.12);
  padding-top: 12px;
  margin-top: 8px;
  font-size: 12px;
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  flex-shrink: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.topbar-title { font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: 0.01em; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text-muted); }

.role-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.content { flex: 1; padding: 24px; width: 100%; }

/* ---------- Mobile shell: off-canvas drawer, sticky header, bottom nav ----------
   Base (desktop) state below; the @media (max-width: 768px) block further down
   is what actually turns the sidebar into a drawer and reveals these controls. */

.sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 899;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-backdrop.open { display: block; opacity: 1; }

#mobile-menu-btn { display: none; }

.topbar-brand-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--color-text);
}
.topbar-brand-mobile svg { color: var(--color-primary); }

.bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  background: var(--color-sidebar-bg);
  border-top: 1px solid var(--color-border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  align-items: stretch;
  justify-content: space-around;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
.bottom-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  padding: 7px 2px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 600;
  font-family: var(--font);
  color: var(--color-sidebar-text);
  border-radius: var(--radius-sm);
}
.bottom-nav-link svg { width: 20px; height: 20px; }
.bottom-nav-link.active { color: var(--color-primary); }

.quick-links-grid { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Cards / tables ---------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  gap: 12px;
  flex-wrap: wrap;
}

.card-header h2 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: 0.005em; }
.card-body { padding: 20px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

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

.stat-card .label { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; margin-bottom: 6px; }
.stat-card .value { font-size: 24px; font-weight: 700; }
.stat-card .icon-wrap {
  width: 36px; height: 36px; border-radius: 9px;
  background: var(--color-primary-light); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center; margin-bottom: 10px;
}
.stat-card .icon-wrap svg { width: 18px; height: 18px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  font-weight: 700;
  padding: 10px 20px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
tbody td { padding: 12px 20px; border-bottom: 1px solid var(--color-border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(30, 24, 14, 0.035); }
.table-wrap { overflow-x: auto; }
.text-muted { color: var(--color-text-muted); }
.text-right { text-align: right; }
.font-mono { font-variant-numeric: tabular-nums; }

/* Compact inline-editable inputs inside a table cell (e.g. Attendance's
   per-row In/Out time + Comments fields) — the default form input styling
   is full-width, which looks fine in a modal but far too wide packed into
   a table column. */
.table-input { width: auto; min-width: 92px; padding: 6px 8px; font-size: 13px; }
.table-input-wide { min-width: 150px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { background: rgba(30, 24, 14, 0.05); }
.btn-primary { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); font-weight: 700; }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { background: #942f24; }
.btn-success { background: var(--color-success); border-color: var(--color-success); color: #fff; }
.btn-success:hover { background: #185f3e; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(30, 24, 14, 0.05); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.icon-btn { padding: 6px; }

/* ---------- Forms ---------- */

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 5px; color: var(--color-text); }
.field .hint { font-size: 11.5px; color: var(--color-text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=month], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-family: var(--font);
  background: var(--color-surface-2);
  color: var(--color-text);
}
input::placeholder, textarea::placeholder { color: var(--color-text-muted); opacity: 0.8; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -1px;
  border-color: var(--color-primary);
}
/* Native date/time picker icon is dark-on-transparent by default, which now
   reads fine against the light input background — no inversion needed. */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-error { color: var(--color-danger); font-size: 12px; margin-top: 4px; }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-gray { background: rgba(30, 24, 14, 0.07); color: var(--color-text-muted); }
.badge-green { background: var(--color-success-light); color: var(--color-success); }
.badge-red { background: var(--color-danger-light); color: var(--color-danger); }
.badge-amber { background: var(--color-warning-light); color: var(--color-warning); }
.badge-blue { background: var(--color-info-light); color: var(--color-info); }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--color-border);
}
.modal-header h3 { margin: 0; font-family: var(--font-display); font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--color-border);
}

/* ---------- Toasts ---------- */

#toast-container {
  position: fixed; top: 18px; right: 18px; z-index: 100;
  display: flex; flex-direction: column; gap: 8px; max-width: 340px;
}
.toast {
  background: var(--color-surface-2); border: 1px solid var(--color-border); color: var(--color-text);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 13px; box-shadow: var(--shadow-md);
  display: flex; align-items: flex-start; gap: 10px;
  animation: toast-in 0.18s ease-out;
}
.toast.success { background: var(--color-success-light); border-color: rgba(34, 122, 79, 0.35); }
.toast.error { background: var(--color-danger-light); border-color: rgba(179, 57, 44, 0.35); }
.toast svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Auth page ---------- */

.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 900px 500px at 85% 100%, rgba(201, 162, 39, 0.16), transparent 60%),
    linear-gradient(160deg, #05060a 0%, #101219 55%, #1c1712 140%);
  padding: 20px;
}
.auth-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: var(--shadow-md); width: 100%; max-width: 380px; padding: 32px; }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--color-text); }
.auth-brand svg { color: var(--color-primary); }
.auth-card p.sub { color: var(--color-text-muted); font-size: 13px; margin: 0 0 24px; }
.auth-demo { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--color-border); font-size: 12px; color: var(--color-text-muted); }
.auth-demo code { background: rgba(30, 24, 14, 0.06); color: var(--color-text); padding: 1px 5px; border-radius: 4px; }

/* ---------- Misc ---------- */

.empty-state { text-align: center; padding: 48px 20px; color: var(--color-text-muted); }
.empty-state svg { width: 32px; height: 32px; margin: 0 auto 10px; opacity: 0.5; }

/* Icon size utilities (used on the raw <svg> from lib/icons.php) */
svg.w-4 { width: 16px; height: 16px; }
svg.w-5 { width: 20px; height: 20px; }
svg.w-6 { width: 24px; height: 24px; }
svg.w-8 { width: 32px; height: 32px; }
svg { flex-shrink: 0; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.mt-2 { margin-top: 8px; }
.w-full { width: 100%; }

@media (max-width: 860px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Mobile shell (drawer + sticky header + bottom nav) ---------- */

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 900;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
  }
  .sidebar.open { left: 0; }

  body.sidebar-open-lock { overflow: hidden; }

  #mobile-menu-btn { display: inline-flex; }

  .topbar { position: sticky; top: 0; z-index: 800; padding: 0 14px; }
  .topbar-title { display: none; }
  .topbar-brand-mobile { display: flex; }
  .topbar-user-name { display: none; }

  .content { padding: 14px 14px calc(82px + env(safe-area-inset-bottom, 0px)); }

  .bottom-nav { display: flex; }

  /* KPI cards: first 4 into a 2x2 grid, 5th (Net Pay) spans full width */
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px 14px; }
  .stat-card .icon-wrap { width: 30px; height: 30px; margin-bottom: 8px; }
  .stat-card .label { font-size: 11.5px; }
  .stat-card .value { font-size: 20px; }
  .stat-card:nth-child(5) { grid-column: span 2; }
  .stat-card:nth-child(5) .value { font-size: 25px; color: var(--color-primary); }

  /* Quick links: 2-column, thumb-friendly grid */
  .quick-links-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .quick-links-grid .btn { min-height: 44px; width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .topbar-brand-mobile span { display: none; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 10px 12px; }
  .stat-card .label { font-size: 11px; }
  .stat-card .value { font-size: 18px; }
  .quick-links-grid { grid-template-columns: 1fr; }
}

/* ---------- Stock Audit — scan workspace ---------- */

.scan-bar {
  display: flex; gap: 10px; align-items: center;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.scan-bar svg { color: var(--color-primary); flex-shrink: 0; }
#scan-input {
  flex: 1; font-size: 18px; padding: 10px 12px; font-variant-numeric: tabular-nums;
}
.scan-status-dot {
  width: 10px; height: 10px; border-radius: 999px; background: var(--color-border); flex-shrink: 0;
}
.scan-status-dot.live { background: var(--color-success); box-shadow: 0 0 0 3px var(--color-success-light); }

.live-banner {
  border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px;
  font-size: 15px; font-weight: 600; display: none; align-items: center; gap: 14px;
  border: 1px solid var(--color-border); background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.live-banner.show { display: flex; }
.live-banner.ok { background: var(--color-success-light); border-color: rgba(34, 122, 79, 0.35); color: var(--color-success); }
.live-banner.short { background: var(--color-danger-light); border-color: rgba(179, 57, 44, 0.35); color: var(--color-danger); }
.live-banner.over { background: var(--color-warning-light); border-color: rgba(168, 98, 12, 0.35); color: var(--color-warning); }
.live-banner .lb-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: rgba(30,24,14,0.06); flex-shrink: 0; }
.live-banner .lb-icon svg { width: 22px; height: 22px; }
.live-banner .lb-text { line-height: 1.5; }
.live-banner .lb-sub { font-weight: 400; font-size: 13px; opacity: 0.85; }

.shortage-banner {
  border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px;
  background: linear-gradient(135deg, #3a1e1c, #4a2624); color: #fff;
  border: 1px solid rgba(226, 87, 76, 0.35);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  box-shadow: var(--shadow-md);
}
.shortage-banner.positive { background: linear-gradient(135deg, #16362a, #1c4433); border-color: rgba(63, 174, 116, 0.35); }
.shortage-banner .sb-label { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.85; margin-bottom: 4px; }
.shortage-banner .sb-value { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.shortage-banner .sb-meta { font-size: 13px; opacity: 0.9; }

.discrepancy-neg { color: var(--color-danger); font-weight: 700; }
.discrepancy-zero { color: var(--color-text-muted); }
.discrepancy-pos { color: var(--color-info); font-weight: 700; }

.session-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
}
.session-pill.Open { background: var(--color-success-light); color: var(--color-success); }
.session-pill.Closed { background: rgba(30, 24, 14, 0.07); color: var(--color-text-muted); }

.row-flash { animation: row-flash-anim 0.9s ease-out; }
@keyframes row-flash-anim {
  0% { background: rgba(169, 124, 27, 0.28); }
  100% { background: transparent; }
}


/* ---------- Sidebar section labels (merged HR & Payroll / Stock Audit nav) ---------- */

.sidebar-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: rgba(30,24,14,0.5); padding: 16px 16px 6px;
}
.sidebar-group-label:first-child { padding-top: 6px; }

/* ---------- Stock & Sales Manager ---------- */

.stock-hero {
  background: linear-gradient(135deg, #0e1015 0%, #1b1f28 60%, #2c2412 100%);
  color: #fdfaf2;
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.stock-hero h1 { margin: 0; font-family: var(--font-display); font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.stock-hero h1 svg { color: var(--color-primary); }
.stock-hero .hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.btn-on-dark { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); color: #fff; }
.btn-on-dark:hover { background: rgba(255,255,255,0.22); }
.btn-on-dark.btn-danger-outline { background: rgba(220,38,38,0.28); border-color: rgba(248,113,113,0.45); color: #fecaca; }
.btn-on-dark.btn-danger-outline:hover { background: rgba(220,38,38,0.42); }

.mode-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.mode-toggle {
  display: inline-flex; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: 999px; padding: 3px; gap: 2px;
}
.mode-toggle button {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: transparent; padding: 7px 16px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; cursor: pointer; color: var(--color-text-muted);
}
.mode-toggle button svg { width: 15px; height: 15px; }
.mode-toggle button.active { background: var(--color-primary); color: var(--color-on-primary); }
.key-hint {
  display: inline-block; padding: 1px 7px; border: 1px solid var(--color-border);
  border-radius: 5px; background: var(--color-surface); font-family: monospace; font-size: 11px; font-weight: 700;
}

.beep-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-muted); white-space: nowrap; }
.beep-toggle input { width: auto; }

.tab-bar { display: flex; gap: 4px; border-bottom: 1px solid var(--color-border); margin-bottom: 16px; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border: none; background: none; cursor: pointer;
  font-size: 13px; font-weight: 700; color: var(--color-text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn svg { width: 15px; height: 15px; }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.search-wrap { position: relative; max-width: 320px; width: 100%; }
.search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--color-text-muted); width: 15px; height: 15px; }
.search-wrap input { padding-left: 32px; }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-surface-2); font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--color-text-muted);
}
.chip:hover { background: rgba(30, 24, 14, 0.05); }
.chip.active { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); }
.chip .count { opacity: 0.75; margin-left: 3px; }

.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper button {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--color-border);
  background: var(--color-surface-2); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; line-height: 1; color: var(--color-text); padding: 0;
}
.stepper button:hover { background: rgba(30, 24, 14, 0.07); }
.stepper button:disabled { opacity: 0.35; cursor: not-allowed; }
.stepper button:disabled:hover { background: var(--color-surface-2); }
.stepper .stepper-val { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 700; }

@media (max-width: 860px) {
  .mode-row { flex-direction: column; align-items: flex-start; }
  .mode-row > .text-muted { margin-left: 0; }
}
