/* LI Comment Admin — nixtio-style light cream theme (lime accent) */
:root {
  --bg: #F3F1EA;
  --surface: #ffffff;
  --surface-2: #F7F5EE;
  --line: #E4E0D4;
  --fg: #14140F;
  --muted: #6B6B60;
  --faint: #9A998C;
  --primary: #B8E62E;        /* lime accent */
  --primary-600: #A6D11F;    /* hover */
  --primary-soft: #EFF7D6;   /* pale lime tint */
  --on-primary: #14140F;     /* dark ink on lime fills (white fails contrast) */
  --primary-ink: #4A5B07;    /* readable text on pale lime tint */
  --warn: #C77A0A;
  --bad: #dc2626;
  --info: #2563eb;
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --gap: 20px;
  --shadow: 0 1px 2px rgba(20,20,15,.04), 0 8px 28px rgba(20,20,15,.06);
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { letter-spacing: -.022em; }

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px;
  font-weight: 700; font-size: 16px;
}
.brand .logo {
  width: 32px; height: 32px; border-radius: 11px;
  background: var(--primary);
  display: grid; place-items: center; color: var(--on-primary); font-weight: 800;
}
.nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.nav .group { color: var(--faint); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; margin-bottom: 2px;
  transition: background .18s ease, color .18s ease, box-shadow .22s ease, transform .12s ease;
}
.nav a:active { transform: scale(.98); }
.nav a:hover { background: var(--surface-2); color: var(--fg); }
.nav a.active { background: var(--primary-soft); color: var(--primary-ink); font-weight: 700;
  box-shadow: inset 3px 0 0 var(--primary); }
.nav a .ico { width: 18px; text-align: center; opacity: .85; }

.userbox {
  border-top: 1px solid var(--line);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary-ink);
  display: grid; place-items: center; font-weight: 700;
}
.userbox .meta { flex: 1; min-width: 0; }
.userbox .meta .nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .meta .rl { color: var(--faint); font-size: 11px; }
.userbox form { margin: 0; }
.linkbtn { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; padding: 4px; }
.linkbtn:hover { color: var(--bad); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 22px; margin: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .search { margin-left: auto; min-width: 240px; margin-bottom: 0; }

/* mobile nav toggle (hamburger) + drawer backdrop — hidden on desktop */
.menu-toggle {
  display: none; background: transparent; color: var(--fg); font-size: 20px;
  line-height: 1; padding: 6px 10px; border-radius: 10px; flex: 0 0 auto;
}
.menu-toggle:hover { background: var(--surface-2); filter: none; }
.backdrop {
  display: none; position: fixed; inset: 0; background: rgba(16,24,40,.45);
  z-index: 55; opacity: 0; transition: opacity .25s ease;
}
.topbar .search input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; color: var(--fg); font: inherit;
  letter-spacing: inherit; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.topbar .search input::placeholder { color: var(--faint); }
.topbar .search input:focus { border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- global search results ---------- */
.search-summary { color: var(--muted); margin: 0 0 16px; }
.search-group { margin-bottom: 18px; }
.search-group-title { font-size: 15px; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.search-group-title .count {
  font-size: 12px; font-weight: 700; color: var(--primary-ink);
  background: var(--primary-soft); border-radius: 999px; padding: 1px 9px;
}
.search-list { list-style: none; margin: 0; padding: 0; }
.search-list li + li { border-top: 1px solid var(--line); }
.search-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px;
  border-radius: var(--radius-sm); transition: background .12s ease;
}
.search-row:hover { background: var(--surface-2); }
.search-primary { font-weight: 600; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-secondary { color: var(--faint); font-size: 13px; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-row .badge { margin-left: auto; flex: none; }
.content { padding: 24px 32px; max-width: 1200px; width: 100%; }

/* ---------- cards / grid ---------- */
.grid { display: grid; gap: var(--gap); }
.stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.stat {
  display: block;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(20,20,15,.05), 0 14px 36px rgba(20,20,15,.10); }
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 36px; font-weight: 800; margin-top: 8px; line-height: 1; letter-spacing: -.03em; }
.stat .sub { color: var(--faint); font-size: 12px; margin-top: 6px; }
.stat.accent { background: var(--primary); color: var(--on-primary); border: 0; }
.stat.accent .label, .stat.accent .sub { color: rgba(20,20,15,.7); }
.stat.warn .value { color: var(--warn); }

.section-title { font-size: 13px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; margin: 26px 0 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; box-shadow: var(--shadow); margin-bottom: 16px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(20,20,15,.05), 0 12px 32px rgba(20,20,15,.09); }
/* Compact variant — the Settings page's on/off toggle cards (scrape, active
   hours, auto-recheck, auto-publish, multi-variant) were needlessly tall/
   stretched with the default .card padding; scoped here so every other .card
   on the app (accounts, queue, etc.) is untouched. */
.card.compact { padding: 10px 16px; margin-bottom: 8px; }
.card.compact .section-title { margin: 0; font-size: 12.5px; }
.card.compact p.muted { margin: 3px 0 0; font-size: 11.5px; line-height: 1.4; }
.cards-2 { grid-template-columns: 1fr 1fr; }

.meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge { background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; font-size: 12px; }
.badge.green { background: var(--primary-soft); border-color: transparent; color: var(--primary-ink); }
.badge.warn { background: #fef3c7; color: #92400e; border-color: transparent; }
.badge.red { background: #fee2e2; color: #991b1b; border-color: transparent; }
.badge.blue { background: #dbeafe; color: #1e40af; border-color: transparent; }

.post {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--muted); white-space: pre-wrap; max-height: 150px; overflow: auto; margin-bottom: 12px;
}
.comment-text { font-size: 14px; line-height: 1.6; }

textarea, input[type=text], input[type=password], input[type=datetime-local], input[type=date], input[type=email], select {
  width: 100%; background: var(--surface); color: var(--fg);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 9px 11px; font: inherit; outline: none;
}
textarea:focus, input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }

/* filter bar (queue / activity: per-user + per-date) */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; margin: 0 0 16px; box-shadow: var(--shadow);
}
.filterbar .fld { font-size: 12px; color: var(--muted); }
.filterbar select, .filterbar input[type=date] { min-width: 150px; }
.filterbar .spacer { flex: 1 1 auto; }
.filterbar .clear { color: var(--muted); font-size: 12px; align-self: center; padding: 6px 4px; }
.filterbar .clear:hover { color: var(--fg); text-decoration: underline; }
@media (max-width: 560px) {
  .filterbar { gap: 8px; }
  .filterbar .fld { flex: 1 1 100%; }
  .filterbar select, .filterbar input[type=date] { min-width: 0; }
}
label.fld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }

button { border: 0; border-radius: var(--radius-pill); padding: 8px 16px; font: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; color: #fff;
  transition: filter .15s ease, transform .1s ease, box-shadow .18s ease; }
button:hover { filter: brightness(.94); }
button:active { transform: scale(.97); }
button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn-primary, .approve { background: var(--primary); color: var(--on-primary); }
.btn-soft { background: var(--surface-2); color: var(--fg); border: 1px solid var(--line); }
.variant-tab.is-active { background: var(--primary-soft); color: var(--primary-ink); border-color: transparent; }
.reject, .btn-danger { background: var(--bad); }
.btn-warn { background: var(--warn); }
.btn-success { background: #16a34a; color: #fff; }
/* compact action buttons — for table rows and tight layouts */
button.sm, .btn-sm { padding: 4px 11px; font-size: 12px; border-radius: 8px; font-weight: 600; }
button.xs, .btn-xs { padding: 2px 8px; font-size: 11px; border-radius: 6px; font-weight: 600; }

/* LinkedIn connect button (anchor — needs its own box model) */
.btn-linkedin {
  display: inline-block; background: #0a66c2; color: #fff !important; font-weight: 600;
  padding: 7px 14px; border-radius: var(--radius-pill); cursor: pointer;
  line-height: 1.1; white-space: nowrap; font-size: 13px;
  transition: background .15s, box-shadow .15s;
}
.btn-linkedin:hover { background: #004182; box-shadow: 0 2px 8px rgba(10,102,194,.28); }
.btn-linkedin.is-muted { background: #7f93ab; }
.btn-linkedin.is-muted:hover { background: #6b7f97; box-shadow: none; }
/* small variant for table cells */
.btn-linkedin.sm { padding: 4px 10px; font-size: 12px; border-radius: 8px; }

/* connected-identity pill */
.li-linked { display: inline-block; background: var(--primary-soft); color: var(--primary-ink);
  padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

/* link-session modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 22px;
  width: min(560px, 92vw); box-shadow: var(--shadow); max-height: 88vh; overflow: auto; }
.note-warn { background: #fef3c7; color: #92400e; border: 1px solid #f4d390;
  border-radius: var(--radius-sm); padding: 8px 11px; font-size: 12.5px; }

/* responsive table wrapper: a wide table scrolls horizontally inside its card
   instead of overflowing the viewport and clipping (e.g. action buttons). */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap > table { min-width: max-content; }
/* safety net: any card holding a table scrolls rather than clipping, even if the
   table wasn't explicitly wrapped. */
.card:has(> table), .card:has(> form > table) { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s ease; }
tbody tr:hover td { background: var(--surface-2); }
/* action cell — buttons sit on one line, no wrapping */
td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: 4px; }

/* browser pool slot grid */
.pool-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.pool-slot {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 8px; font-size: 11px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
  transition: background .15s;
}
.pool-slot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: 0 0 7px; }
.pool-slot.free .dot  { background: #d1d5db; }
.pool-slot.leased .dot { background: #16a34a; }
.pool-slot.leased { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.pool-slot.dead .dot { background: var(--warn); }
.pool-slot.dead { background: #fef9c3; color: #854d0e; border-color: #fde047; }

.lvl-ERROR { color: var(--bad); font-weight: 600; }
.lvl-WARNING { color: var(--warn); font-weight: 600; }
.empty { color: var(--faint); font-style: italic; padding: 8px 0; }

.feed-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; flex: 0 0 8px; }
.feed-item .when { color: var(--faint); margin-left: auto; white-space: nowrap; font-size: 12px; }

/* centered auth pages */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.auth-card { width: 380px; max-width: 92vw; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.auth-card h2 { margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); margin-bottom: 18px; font-size: 13px; }
.auth-card .row { margin-top: 14px; }
.err { color: var(--bad); font-size: 13px; margin: 8px 0; }
.brand-center { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 18px; font-weight: 700; font-size: 18px; }

/* ============ interactivity layer (motion, viz, feedback) ============ */
@keyframes fadeRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px) scale(.98); } }
@keyframes ringFill { from { stroke-dashoffset: var(--ring-circ); } }

/* page-load stagger: any direct children of .reveal fade+rise in sequence */
.reveal > * { animation: fadeRise .5s ease both; }
.reveal > *:nth-child(1){animation-delay:.02s}.reveal > *:nth-child(2){animation-delay:.07s}
.reveal > *:nth-child(3){animation-delay:.12s}.reveal > *:nth-child(4){animation-delay:.17s}
.reveal > *:nth-child(5){animation-delay:.22s}.reveal > *:nth-child(6){animation-delay:.27s}
.reveal > *:nth-child(n+7){animation-delay:.3s}

/* spinner + busy button */
.spinner { display: inline-block; width: 15px; height: 15px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; animation: spin .6s linear infinite;
  vertical-align: -2px; }
button.is-busy { position: relative; color: transparent !important; pointer-events: none; }
button.is-busy::after { content: ""; position: absolute; inset: 0; margin: auto;
  width: 15px; height: 15px; border: 2px solid rgba(20,20,15,.55); border-right-color: transparent;
  border-radius: 50%; animation: spin .6s linear infinite; }

/* skeleton shimmer */
.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg,
  var(--surface-2) 25%, #ece8dc 37%, var(--surface-2) 63%); background-size: 800px 100%;
  animation: shimmer 1.3s infinite linear; min-height: 14px; }

/* toast notifications */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; max-width: min(380px, 92vw); }
.toast { background: var(--fg); color: #fff; border-radius: 12px; padding: 12px 14px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 10px 30px rgba(20,20,15,.22);
  display: flex; gap: 10px; align-items: flex-start; animation: toastIn .25s ease both;
  border-left: 4px solid var(--primary); }
.toast.is-out { animation: toastOut .25s ease forwards; }
.toast.ok { border-left-color: var(--primary); }
.toast.error { border-left-color: var(--bad); }
.toast.info { border-left-color: var(--info); }
.toast .ic { font-weight: 800; flex: 0 0 auto; }
.toast.ok .ic { color: var(--primary); } .toast.error .ic { color: #ff8a8a; }

/* SVG progress ring (cap usage) */
.ring { display: inline-grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--line); fill: none; }
.ring .fill { stroke: var(--primary); fill: none; stroke-linecap: round;
  animation: ringFill .9s ease both; }
.ring .lbl { position: absolute; font-size: 11px; font-weight: 700; color: var(--fg); }

/* warmup bar */
.bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px;
  transition: width .9s ease; }

/* sparkline card */
.spark { width: 100%; height: 64px; display: block; }
.spark .line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { fill: var(--primary-soft); opacity: .7; }
.spark .dot { fill: var(--primary); }

/* ---------- minimal scrollbar ---------- */
/* Webkit (Chrome, Edge, Safari) */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
  transition: background .2s ease;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-600); }
::-webkit-scrollbar-corner { background: transparent; }

/* Firefox */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ---------- UX polish layer ---------- */
html { scroll-behavior: smooth; }
::selection { background: var(--primary-soft); color: var(--primary-ink); }

/* keyboard focus rings */
button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft), 0 0 0 1px var(--primary); }
a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

/* topbar shadow appears as page scrolls */
.topbar { transition: box-shadow .25s ease; }
.topbar.scrolled { box-shadow: 0 1px 0 var(--line), 0 4px 20px rgba(20,20,15,.07); }

/* sidebar subtle depth */
.sidebar { box-shadow: 4px 0 16px rgba(20,20,15,.04); }

/* primary button lime glow on hover */
.btn-primary:hover, .approve:hover { box-shadow: 0 4px 18px -4px rgba(184,230,46,.55); }

/* badge transitions (color/background swaps animate smoothly) */
.badge { transition: background .15s, color .15s, border-color .15s; }

/* auth-card slides in on page load */
@keyframes authCardIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-card { animation: authCardIn .4s ease both; }

/* modal card: slide+scale in when backdrop opens, reverse on close */
@keyframes modalCardIn { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-backdrop.is-open .modal { animation: modalCardIn .25s ease both; }
.modal-backdrop.is-closing .modal { animation: modalCardIn .18s ease reverse both; }

/* card exit: fade+lift before DOM removal */
@keyframes cardOut { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
.card.removing { animation: cardOut .22s ease forwards; pointer-events: none; }

/* ============ responsive layout ============ */
/* Tablet / laptop: relax the fixed content max-width so the layout uses the
   available width instead of leaving a wide right gutter that the table then
   overflows into. */
@media (max-width: 1100px) {
  .content { max-width: 100%; }
}

/* Below 880px: the sidebar becomes an off-canvas drawer toggled by the hamburger,
   so navigation is never lost (previously it was display:none = unreachable). */
@media (max-width: 880px) {
  .cards-2 { grid-template-columns: 1fr; }
  .menu-toggle { display: inline-grid; place-items: center; }

  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; height: 100dvh;
    z-index: 60; transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 0 48px rgba(20,20,15,.28);
  }
  .app.nav-open .sidebar { transform: none; }
  .app.nav-open .backdrop { display: block; opacity: 1; }

  .topbar { padding: 0 14px; gap: 10px; }
  .topbar h1 { font-size: 18px; }
  .topbar .search { min-width: 0; flex: 1 1 auto; max-width: 340px; }
  /* the standalone topbar avatar is redundant with the drawer's user box on mobile */
  .topbar > .avatar { display: none; }

  .content { padding: 16px 14px; }
  .stats { margin-bottom: 16px; }
}

/* Phones: tighten spacing and let the search shrink to an icon-sized field. */
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat { padding: 16px; }
  .stat .value { font-size: 28px; }
  .content { padding: 12px 12px; }
  .card { padding: 14px 14px; }
  .topbar { height: 56px; }
  .topbar .search { max-width: 160px; }
  /* stacked form rows read better than cramped inline fields on a phone */
  .row > input[type=text], .row > input[type=email], .row > input[type=password],
  .row > input[type=datetime-local], .row > select { max-width: 100% !important; flex: 1 1 100%; }
  .modal { padding: 16px; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover, .stat:hover { transform: none; }
}
