/* ─────────────────────────────────────────────────────────────────────────────
   Tracking App — Design System
   Follows shadcn/ui default theme exactly (light mode only)
───────────────────────────────────────────────────────────────────────────── */

/* ─── Design Tokens ──────────────────────────────────────────────────────── */
:root {
  /* Colors — HSL components (no hsl() wrapper, used in hsl(var(--x))) */
  --background:        0 0% 100%;
  --foreground:        240 10% 3.9%;

  --card:              0 0% 100%;
  --card-foreground:   240 10% 3.9%;

  --muted:             240 4.8% 95.9%;
  --muted-foreground:  240 3.8% 46.1%;

  --border:            240 5.9% 90%;
  --input:             240 5.9% 90%;

  --primary:           221 83% 53%;
  --primary-foreground:0 0% 100%;
  --primary-hover:     221 83% 46%;

  --secondary:         240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;

  --accent:            240 4.8% 95.9%;
  --accent-foreground: 240 5.9% 10%;

  --destructive:       0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;

  --success:           142 71% 45%;
  --success-foreground:0 0% 100%;

  --warning:           38 92% 50%;

  --ring:              221 83% 53%;

  /* Radius — matches shadcn default */
  --radius:    0.5rem;
  --radius-sm: 0.375rem;
  --radius-lg: 0.75rem;

  /* Shadows — shadcn shadow-sm */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / 0.07), 0 1px 2px -1px rgb(0 0 0 / 0.07);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);

  /* Layout */
  --sidebar-width: 240px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }

body {
  font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a  { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── Utility ────────────────────────────────────────────────────────────── */
.text-muted     { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }
.text-sm        { font-size: 0.8125rem; }
.font-medium    { font-weight: 500; }
.font-semibold  { font-weight: 600; }
.mt-2  { margin-top: 0.5rem; }
.mt-4  { margin-top: 1rem; }
.mt-6  { margin-top: 1.5rem; }
.mb-4  { margin-bottom: 1rem; }

/* ─── App layout ─────────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-width: 0;
  background: hsl(var(--background));
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: #FAFAFA;
  border-right: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}

.sidebar-logo-img {
  max-width: 168px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
  display: block;
}

.auth-logo-img {
  max-width: 220px;
  height: auto;
  max-height: 60px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.mobile-brand-logo {
  height: 26px;
  width: auto;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.nav-section { display: flex; flex-direction: column; gap: 0.125rem; }

.nav-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  padding: 0 0.625rem;
  margin-bottom: 0.375rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  transition: background 0.12s, color 0.12s;
}

.nav-item:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.nav-item.active {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-weight: 500;
}

.nav-item svg { flex-shrink: 0; }

/* Sidebar footer */
.sidebar-footer {
  padding: 0.875rem 1rem;
  border-top: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  overflow: hidden;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.user-meta { display: flex; flex-direction: column; overflow: hidden; }

.user-name {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.user-role {
  font-size: 0.6875rem;
  color: hsl(var(--muted-foreground));
  text-transform: capitalize;
}
/* sidebar footer role badge — fit-content width, left-aligned */
.sidebar-footer .badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  align-self: flex-start;
  width: fit-content;
}

.btn-logout {
  background: none;
  border: none;
  padding: 0.375rem;
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  transition: background 0.12s, color 0.12s;
}

.btn-logout:hover {
  background: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
}

/* ─── Mobile header ──────────────────────────────────────────────────────── */
.mobile-header {
  display: none;
  align-items: center;
  gap: 0.75rem;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: hsl(var(--background));
  border-bottom: 1px solid hsl(var(--border));
  padding: 0 1rem;
  z-index: 99;
}

.mobile-menu-btn {
  background: none;
  border: none;
  padding: 0.375rem;
  border-radius: var(--radius-sm);
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  transition: background 0.12s;
}

.mobile-menu-btn:hover { background: hsl(var(--accent)); }

.mobile-brand { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }

/* ─── Sidebar overlay ────────────────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.45);
  z-index: 99;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

/* ─── Topbar ─────────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -2rem -2rem 1.5rem -2rem;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid hsl(var(--border));
  min-height: 56px;
}

.topbar-left { display: flex; flex-direction: column; gap: 0.125rem; }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

.page-title {
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

.page-subtitle {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

/* ─── Back link ──────────────────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
  transition: color 0.12s;
}

.back-link:hover { color: hsl(var(--foreground)); }

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
}

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.card-body { padding: 1.25rem 1.5rem; }

/* ─── Chart container ────────────────────────────────────────────────────── */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-card-header {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.chart-period-tabs {
  display: inline-flex;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.2rem;
  gap: 0.125rem;
}

.chart-tab {
  padding: 0.3rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}

.chart-tab:hover {
  background: hsl(var(--background) / 0.6);
  color: hsl(var(--foreground));
}

.chart-tab.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

/* ─── Stat Cards — shadcn dashboard style ────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  letter-spacing: -0.005em;
}

.stat-value {
  font-size: 1.875rem;       /* 30px */
  font-weight: 700;
  color: hsl(var(--foreground));
  line-height: 1;
  letter-spacing: -0.04em;
}

.stat-sub {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s, opacity 0.12s;
  white-space: nowrap;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.btn:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
}

.btn:disabled { opacity: 0.5; pointer-events: none; }

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover { background: hsl(var(--primary-hover)); border-color: hsl(var(--primary-hover)); }

.btn-outline {
  background: hsl(var(--background));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.btn-outline:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
  border-color: transparent;
}

.btn-ghost:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.btn-whatsapp {
  background: #25D366;
  color: #ffffff;
  border-color: #25D366;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}

.btn-whatsapp:hover { background: #1ebe5d; border-color: #1ebe5d; color: #ffffff; }

.btn-danger {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  border-color: hsl(var(--destructive));
}

.btn-danger:hover { background: hsl(0 72% 51%); border-color: hsl(0 72% 51%); }

.btn-full { width: 100%; }

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.4;
  text-transform: capitalize;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.badge-admin    { background: hsl(var(--primary) / 0.1);  border-color: hsl(var(--primary) / 0.2);  color: hsl(var(--primary)); }
.badge-editor   { background: hsl(262 80% 60% / 0.1);     border-color: hsl(262 80% 60% / 0.2);     color: hsl(262 72% 50%); }
.badge-success  { background: hsl(var(--success) / 0.1);  border-color: hsl(var(--success) / 0.2);  color: hsl(142 60% 32%); }
.badge-warning  { background: hsl(38 92% 50% / 0.1);      border-color: hsl(38 92% 50% / 0.2);      color: hsl(32 90% 35%); }
.badge-danger   { background: hsl(var(--destructive) / 0.1); border-color: hsl(var(--destructive) / 0.2); color: hsl(0 72% 45%); }
.badge-blue     { background: hsl(var(--primary) / 0.1);  border-color: hsl(var(--primary) / 0.2);  color: hsl(var(--primary)); }

.badge-batch {
  font-size: 0.6rem;
  font-weight: 600;
  background: hsl(262 80% 60% / 0.1);
  border: 1px solid hsl(262 80% 60% / 0.2);
  color: hsl(262 72% 50%);
  padding: 0.15rem 0.45rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-you {
  font-size: 0.6rem;
  font-weight: 600;
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Alerts ─────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  border: 1px solid;
}

.alert svg { margin-top: 0.05rem; flex-shrink: 0; }

.alert-error {
  background: hsl(var(--destructive) / 0.05);
  border-color: hsl(var(--destructive) / 0.2);
  color: hsl(0 65% 40%);
}

.alert-info {
  background: hsl(var(--primary) / 0.05);
  border-color: hsl(var(--primary) / 0.2);
  color: hsl(var(--primary));
}

.alert-success {
  background: hsl(var(--success) / 0.05);
  border-color: hsl(var(--success) / 0.2);
  color: hsl(142 55% 30%);
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group  { display: flex; flex-direction: column; gap: 0.375rem; }

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  letter-spacing: -0.005em;
}

.form-input {
  width: 100%;
  padding: 0.5625rem 0.875rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  transition: border-color 0.12s, box-shadow 0.12s;
  line-height: 1.5;
}

.form-input::placeholder { color: hsl(var(--muted-foreground)); }

.form-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.12);
}

.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 2.75rem; }

.input-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 0.125rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  transition: color 0.12s;
}

.input-toggle:hover { color: hsl(var(--foreground)); }

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

.form-textarea { resize: vertical; min-height: 80px; }

/* Form field helpers */
.required    { color: hsl(var(--destructive)); }
.field-error { font-size: 0.8125rem; color: hsl(var(--destructive)); margin-top: 0.2rem; display: block; }
.field-hint  { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); margin-top: 0.2rem; display: block; }

.input-error { border-color: hsl(var(--destructive)); }
.input-error:focus {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 3px hsl(var(--destructive) / 0.1);
}

.error-list { margin: 0.25rem 0 0 1.1rem; padding: 0; font-size: 0.875rem; }

/* ─── Form card ──────────────────────────────────────────────────────────── */
.form-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  max-width: 760px;
}

.form-section {
  padding: 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: hsl(var(--foreground));
  /* gap on .form-section handles spacing — no margin needed */
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: hsl(var(--muted) / 0.5);
  border-top: 1px solid hsl(var(--border));
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.form-actions-standalone {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* ─── Toggle switch ──────────────────────────────────────────────────────── */
.toggle-label { display: flex; align-items: flex-start; gap: 0.875rem; cursor: pointer; }
.toggle-switch { position: relative; flex-shrink: 0; margin-top: 0.1rem; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }

.toggle-track {
  display: block;
  width: 40px;
  height: 22px;
  background: hsl(var(--border));
  border-radius: 99px;
  transition: background 0.18s;
  position: relative;
}

.toggle-switch input:checked + .toggle-track { background: hsl(var(--success)); }

.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s;
}

.toggle-switch input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }

.toggle-text { font-size: 0.875rem; font-weight: 500; display: block; }

/* ─── Tables ─────────────────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }

thead tr { border-bottom: 1px solid hsl(var(--border)); }

thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: hsl(var(--muted) / 0.4); }

tbody td { padding: 0.875rem 1rem; color: hsl(var(--foreground)); vertical-align: middle; }

/* ─── User table cells ───────────────────────────────────────────────────── */
.user-cell  { display: flex; align-items: center; gap: 0.75rem; }

.user-avatar-sm {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600;
  flex-shrink: 0;
}

.cell-name  { font-size: 0.875rem; font-weight: 500; display: flex; align-items: center; gap: 0.4rem; letter-spacing: -0.005em; }
.cell-email { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }

/* ─── Action group ───────────────────────────────────────────────────────── */
.action-group { display: flex; align-items: center; gap: 0.375rem; justify-content: flex-end; flex-wrap: wrap; }

/* ─── Filter bar ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-left { display: flex; align-items: center; gap: 0.5rem; }

/* Status filter dropdown */
.filter-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.filter-select-icon {
  position: absolute;
  left: 0.75rem;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
  z-index: 1;
}
.filter-select {
  padding-left: 2.25rem;
  min-width: 200px;
  cursor: pointer;
  font-size: 0.8125rem;
}

/* Legacy tab styles kept for backwards compat */
.filter-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.filter-tab {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.filter-tab:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.filter-tab.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

/* ─── Search ─────────────────────────────────────────────────────────────── */
.search-form  { display: flex; }
.search-wrap  { position: relative; display: flex; align-items: center; }
.search-icon  { position: absolute; left: 0.75rem; color: hsl(var(--muted-foreground)); pointer-events: none; }
.search-input { padding-left: 2.25rem; width: 240px; }

/* ─── Tracking numbers ───────────────────────────────────────────────────── */
.tracking-number {
  font-family: 'Geist Mono', 'Courier New', monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
}

.tracking-number-lg { font-size: 1rem; padding: 0.275rem 0.75rem; }
.tracking-cell      { display: flex; align-items: center; gap: 0.5rem; }

/* ─── Route cell ─────────────────────────────────────────────────────────── */
.route-cell {
  display: flex; align-items: center; gap: 0.3rem;
  font-size: 0.875rem; white-space: nowrap;
}

.route-from { color: hsl(var(--muted-foreground)); }
.route-cell svg { color: hsl(var(--muted-foreground)); flex-shrink: 0; }

/* ─── Recipient rows (additional recipients form) ────────────────────────── */
.recipient-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.recipient-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipient-row {
  background: hsl(var(--muted) / 0.35);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recipient-row-header {
  display: flex;
  justify-content: flex-end;
}

.recipient-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
}

.recipient-remove {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: none;
  border: 1px solid hsl(var(--border));
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.recipient-remove:hover {
  background: hsl(var(--destructive) / 0.07);
  border-color: hsl(var(--destructive) / 0.35);
  color: hsl(var(--destructive));
}

.recipient-empty-hint {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  padding: 0.875rem;
  text-align: center;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
}

/* ─── Recipient detail view ──────────────────────────────────────────────── */
.recipient-detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid hsl(var(--border));
}

.recipient-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recipient-detail-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.recipient-detail-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8125rem;
}

/* ─── Tracking field row ─────────────────────────────────────────────────── */
.tracking-field-wrap { display: flex; gap: 0.5rem; align-items: flex-start; }
.tracking-btn-wrap   { display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; }

/* ─── Mode toggle ────────────────────────────────────────────────────────── */
.mode-toggle {
  display: inline-flex;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.2rem;
  gap: 0.125rem;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4rem 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  background: transparent;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s;
}

.mode-btn.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-sm);
}

/* ─── Batch rows ─────────────────────────────────────────────────────────── */
.batch-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.batch-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.1s;
}

.batch-row:hover { background: hsl(var(--muted) / 0.35); }

.batch-row-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6875rem; font-weight: 600;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  margin-top: 1.75rem;
}

.batch-row-fields {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 0.6fr;
  gap: 0.75rem;
  flex: 1;
}

.batch-remove {
  background: none; border: none;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  margin-top: 1.75rem;
  flex-shrink: 0;
  display: flex; align-items: center;
  transition: background 0.12s, color 0.12s;
}

.batch-remove:hover {
  background: hsl(var(--destructive) / 0.08);
  color: hsl(var(--destructive));
}

/* ─── Shipment detail ────────────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: flex-start;
}

.detail-fields { display: flex; flex-direction: column; gap: 0.875rem; }

.detail-field { display: flex; gap: 1rem; align-items: flex-start; }

.detail-label {
  min-width: 110px;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-top: 0.125rem;
  flex-shrink: 0;
}

.detail-value { font-size: 0.9rem; color: hsl(var(--foreground)); }

.detail-link { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 2px; }
.detail-link:hover { text-decoration: none; }

.notes-text { font-size: 0.875rem; color: hsl(var(--foreground)); line-height: 1.65; }

.sibling-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  transition: background 0.1s;
}

.sibling-row:last-child { border-bottom: none; }
.sibling-row:hover { background: hsl(var(--muted) / 0.5); }

/* ─── Auth page ──────────────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: hsl(var(--background));
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.auth-brand-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-lg);
  background: hsl(var(--primary) / 0.08);
  border: 1px solid hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.25rem;
}

.auth-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.auth-subtitle { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

/* ─── Confirm Modal ──────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(2px);
}

.modal-backdrop.open { display: flex; animation: backdropIn 0.15s ease; }

@keyframes backdropIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  animation: modalIn 0.18s cubic-bezier(0.34, 1.1, 0.64, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 1.5rem 1rem;
}

.modal-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1px solid;
}

.modal-icon.icon-danger  { background: hsl(var(--destructive) / 0.08); border-color: hsl(var(--destructive) / 0.2); color: hsl(var(--destructive)); }
.modal-icon.icon-warning { background: hsl(38 92% 50% / 0.08);         border-color: hsl(38 92% 50% / 0.2);         color: hsl(32 90% 38%); }
.modal-icon.icon-default { background: hsl(var(--primary) / 0.08);     border-color: hsl(var(--primary) / 0.2);     color: hsl(var(--primary)); }

.modal-title   { font-size: 1rem; font-weight: 600; letter-spacing: -0.015em; color: hsl(var(--foreground)); margin-bottom: 0.25rem; }
.modal-message { font-size: 0.875rem; color: hsl(var(--muted-foreground)); line-height: 1.55; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.4);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 3rem 1.5rem;
  color: hsl(var(--muted-foreground));
}

.empty-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-lg);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.empty-title { font-size: 0.9375rem; font-weight: 600; color: hsl(var(--foreground)); letter-spacing: -0.01em; }
.empty-desc  { font-size: 0.875rem; color: hsl(var(--muted-foreground)); max-width: 280px; text-align: center; line-height: 1.55; }

/* ─── Error pages ────────────────────────────────────────────────────────── */
.error-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; background: hsl(var(--background));
}

.error-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.error-code  { font-size: 5rem; font-weight: 800; color: hsl(var(--primary)); line-height: 1; letter-spacing: -0.05em; }
.error-title { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.025em; }
.error-message { color: hsl(var(--muted-foreground)); margin-bottom: 0.5rem; }

/* ─── Feature checklist (kept for reference) ─────────────────────────────── */
.feature-checklist { display: flex; flex-direction: column; gap: 0.5rem; }
.feature-item  { display: flex; align-items: center; gap: 0.6rem; font-size: 0.875rem; }
.feature-done  { color: hsl(var(--success)); }
.feature-pending { color: hsl(var(--muted-foreground)); }

/* ─── Topbar heading row (show page) ─────────────────────────────────────── */
.topbar-heading-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.2rem;
}

/* ─── Timeline ───────────────────────────────────────────────────────────── */
.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 0 0.875rem;
}

/* Track: contains dot + connector, centered column */
.timeline-track {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
  margin-top: 0.25rem;
  position: relative;
  z-index: 1;
  background-color: hsl(var(--background)); /* ensures dot covers line */
}

/* dot colour variants — solid fill, no opacity so the connector line is hidden behind */
.badge-warning-dot  { background: hsl(38 92% 50%);          border-color: hsl(32 90% 40%); }
.badge-blue-dot     { background: hsl(var(--primary));       border-color: hsl(221 83% 40%); }
.badge-success-dot  { background: hsl(var(--success));       border-color: hsl(142 60% 32%); }
.badge-danger-dot   { background: hsl(var(--destructive));   border-color: hsl(0 72% 45%); }

/* Connector: absolute, centered behind the dot, runs top-to-bottom */
.timeline-connector {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: hsl(var(--border));
}

.timeline-connector-hidden { background: transparent; }

.timeline-body {
  padding-bottom: 1.5rem;
}

.timeline-item-last .timeline-body { padding-bottom: 0; }

.timeline-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.timeline-time {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.timeline-note {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  line-height: 1.6;
  margin-bottom: 0.3rem;
  background: hsl(var(--muted) / 0.5);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
}

.timeline-actor {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
}

.timeline-role {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  text-transform: capitalize;
}

/* ─── Paginator ──────────────────────────────────────────────────────────── */
.paginator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid hsl(var(--border));
  flex-wrap: wrap;
  gap: 0.5rem;
}

.paginator-info {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.paginator-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  border: 1px solid transparent;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}

.page-btn:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }

.page-btn.active {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}

.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.page-ellipsis {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  padding: 0 0.25rem;
  line-height: 32px;
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.65s linear infinite; }

.input-generated {
  border-color: hsl(var(--success)) !important;
  box-shadow: 0 0 0 3px hsl(var(--success) / 0.12) !important;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

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

@media (max-width: 768px) {
  .mobile-header { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    z-index: 200;
  }

  .sidebar.open { transform: translateX(0); }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: calc(56px + 1rem);
  }

  .topbar {
    margin: -1rem -1rem 1rem -1rem;
    padding: 0.625rem 1rem;
  }

  .batch-row-fields { grid-template-columns: 1fr 1fr; }
  .recipient-row { grid-template-columns: 1fr 1fr; }
  .recipient-fields { grid-template-columns: 1fr; }
  .search-input { width: 180px; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row   { grid-template-columns: 1fr; }
  .recipient-fields { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: row; flex-wrap: nowrap; }
  .auth-card { padding: 1.5rem; }
}

@media (max-width: 480px) {
  .stats-grid          { grid-template-columns: repeat(2, 1fr); }
  .batch-row-fields    { grid-template-columns: 1fr; }
  .recipient-row       { grid-template-columns: 1fr 1fr 1fr; }
}

/* ─── Notification log (grouped by channel) ──────────────────────────────── */
.notif-channel-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}

.notif-channel-row:last-child { border-bottom: none; }

.notif-channel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
}

.notif-channel-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.notif-channel-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.notif-channel-count {
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
}

.notif-channel-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.notif-channel-action {
  display: flex;
  align-items: center;
}

/* ─── Toast notifications (shadcn-style) ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: calc(100vw - 2.5rem);
}

.toast {
  pointer-events: all;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.875rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: flex-start;
  gap: 0.625rem;
  width: 360px;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  animation: toast-slide-in 0.25s cubic-bezier(0.16,1,0.3,1);
}

.toast.toast-removing {
  animation: toast-slide-out 0.2s ease forwards;
}

@keyframes toast-slide-in {
  from { opacity: 0; transform: translateX(calc(100% + 1.25rem)); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(calc(100% + 1.25rem)); }
}

.toast-icon {
  display: flex;
  align-items: center;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.toast-success .toast-icon { color: hsl(var(--success)); }
.toast-error   .toast-icon { color: hsl(var(--destructive)); }

.toast-body { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }

.toast-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1.45;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  padding: 0.15rem;
  display: flex;
  align-items: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  margin-top: 0.05rem;
  line-height: 1;
}

.toast-close:hover {
  color: hsl(var(--foreground));
  background: hsl(var(--accent));
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  animation: toast-progress linear forwards;
}

.toast-success .toast-progress { background: hsl(var(--success) / 0.5); }
.toast-error   .toast-progress { background: hsl(var(--destructive) / 0.5); }

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0; }
}


/* ─── Combobox (shadcn-style) ────────────────────────────────────────────── */
.combobox {
  position: relative;
  display: inline-flex;
}

.combobox-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4375rem 0.875rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 0.8125rem;
  font-weight: 400;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, background 0.12s;
  min-width: 180px;
  justify-content: space-between;
}
.combobox-trigger:hover { border-color: hsl(var(--ring) / 0.5); }
.combobox-trigger.open  { border-color: hsl(var(--ring)); box-shadow: 0 0 0 2px hsl(var(--ring) / 0.15); }

.combobox-trigger-inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.combobox-trigger-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.combobox-chevron {
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
  transition: transform 0.15s;
}
.combobox-trigger.open .combobox-chevron { transform: rotate(180deg); }

.combobox-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}
.combobox-content.open { display: block; }

/* When combobox sits on the right side, open dropdown leftward */
.combobox-right .combobox-content { left: auto; right: 0; }

.combobox-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
}
.combobox-search-icon { flex-shrink: 0; color: hsl(var(--muted-foreground)); }
.combobox-search-input {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  padding: 0;
}
.combobox-search-input::placeholder { color: hsl(var(--muted-foreground)); }

.combobox-list {
  max-height: 260px;
  overflow-y: auto;
  padding: 0.25rem;
}

.combobox-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4375rem 0.625rem;
  border-radius: var(--radius-sm);
  border: none;
  background: none;
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.combobox-option:hover { background: hsl(var(--accent)); }
.combobox-option.selected { font-weight: 500; }
.combobox-option-check { flex-shrink: 0; color: hsl(var(--primary)); opacity: 0; }
.combobox-option.selected .combobox-option-check { opacity: 1; }
.combobox-no-results {
  padding: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

/* ─── Filter bar (updated) ───────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.filter-left { display: flex; align-items: center; gap: 0.5rem; }

/* ─── Mobile card list wrapper ───────────────────────────────────────────── */
.card-list {
  display: flex;
  flex-direction: column;
}

/* ─── Mobile / Desktop visibility helpers (after card-list so none wins) ─── */
.table-desktop { display: block; }
.table-mobile  { display: none !important; }

/* ─── Shared mobile card ─────────────────────────────────────────────────── */
.mobile-card {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1rem 1.125rem;
  border-bottom: 1px solid hsl(var(--border));
  position: relative;
}
.mobile-card:last-child { border-bottom: none; }

/* left icon/thumb */
.mc-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius);
  background: hsl(var(--muted));
  border: 1px solid hsl(var(--border));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
}
.mc-thumb-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  background: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
}

/* body */
.mc-body {
  flex: 1;
  min-width: 0;
  padding-right: 2rem; /* space for dots btn */
}
.mc-title {
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.3;
  color: hsl(var(--foreground));
  display: flex;
  align-items: center;
  gap: 0.375rem;
  flex-wrap: wrap;
}
.mc-subtitle {
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-meta {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

/* footer row */
.mc-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.mc-footer-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  white-space: nowrap;
}

/* ─── Clickable mobile card ──────────────────────────────────────────────── */
.mobile-card-clickable { cursor: pointer; transition: background 0.12s; }
.mobile-card-clickable:hover { background: hsl(var(--accent) / 0.6); }

/* ─── 3-dots action menu ─────────────────────────────────────────────────── */
.dots-wrap {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  z-index: 2;
}

.dots-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: hsl(var(--muted-foreground));
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.dots-btn:hover,
.dots-btn.open {
  background: hsl(var(--accent));
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

.dots-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 148px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 50;
  padding: 0.25rem;
  flex-direction: column;
}
.dots-dropdown.open { display: flex; }

.dots-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: hsl(var(--foreground));
  background: none;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.1s;
  text-decoration: none;
}
.dots-item:hover { background: hsl(var(--accent)); }
.dots-item-danger { color: hsl(var(--destructive)); }
.dots-item-danger:hover { background: hsl(var(--destructive) / 0.08); }

/* ─── Mobile breakpoint ──────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .table-desktop { display: none !important; }
  .table-mobile  { display: flex !important; }

  /* Filter bar: search left (flex:1), combobox right (fixed) */
  .filter-bar        { flex-direction: row; flex-wrap: nowrap; width: 100%; gap: 0.5rem; align-items: center; }
  .combobox-trigger  { min-width: 110px; }
  .search-wrap       { width: 100%; }
  .search-input      { width: 100%; }
}
