:root {
  color-scheme: light;
  --ink: #10243d;
  --muted: #60758f;
  --line: #dbe7f4;
  --paper: #f4f8ff;
  --card: #ffffff;
  --forest: #1f5fae;
  --forest-2: #2e72c5;
  --mint: #dceaff;
  --lime: #e4efff;
  --amber: #e9a53d;
  --danger: #c64949;
  --shadow: 0 18px 60px rgba(32, 74, 130, .11);
  --radius: 20px;
  --sidebar: 260px;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 4%, rgba(120, 177, 240, .2), transparent 27rem),
    radial-gradient(circle at 8% 92%, rgba(181, 216, 250, .28), transparent 30rem),
    var(--paper);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.055'/%3E%3C/svg%3E");
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
}

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: linear-gradient(145deg, #347fda, #174f91);
  color: #fff;
  font: 700 25px/1 "Segoe UI", sans-serif;
  box-shadow: 0 12px 28px rgba(31, 95, 174, .24);
}

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(430px, .9fr);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(36px, 6vw, 92px);
  color: #f8fbff;
  background:
    linear-gradient(145deg, rgba(12, 55, 102, .7), rgba(7, 27, 54, .88)),
    radial-gradient(circle at 75% 22%, #4b8dd4 0, transparent 34%),
    #0d3159;
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(215, 234, 255, .18);
  border-radius: 50%;
}

.auth-hero::before {
  width: 34rem;
  height: 34rem;
  right: -13rem;
  bottom: -17rem;
}

.auth-hero::after {
  width: 22rem;
  height: 22rem;
  right: -5rem;
  bottom: -10rem;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup .brand-mark { width: 44px; height: 44px; border-radius: 14px; }

.brand-name {
  font-weight: 700;
  letter-spacing: .12em;
  font-size: 13px;
}

.brand-sub {
  color: rgba(235, 245, 255, .62);
  font-size: 12px;
  margin-top: 3px;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin-top: clamp(100px, 18vh, 180px);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #cfe4ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-kicker::before {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
}

.hero-copy h1 {
  margin: 24px 0 22px;
  font: 500 clamp(44px, 5vw, 82px)/1.08 Georgia, "Songti SC", serif;
  letter-spacing: -.035em;
}

.hero-copy p {
  max-width: 540px;
  color: rgba(247, 255, 249, .64);
  line-height: 1.9;
  font-size: 15px;
}

.hero-metrics {
  position: absolute;
  z-index: 1;
  left: clamp(36px, 6vw, 92px);
  right: clamp(36px, 6vw, 92px);
  bottom: clamp(32px, 5vw, 68px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.hero-metrics > div {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
}

.hero-metrics strong {
  display: block;
  color: #d7e9ff;
  font: 500 25px Georgia, serif;
}

.hero-metrics span { color: rgba(255,255,255,.45); font-size: 12px; }

.auth-panel {
  display: grid;
  align-content: center;
  padding: clamp(32px, 7vw, 96px);
  background: rgba(255, 255, 255, .83);
  backdrop-filter: blur(24px);
}

.auth-card { width: min(100%, 440px); margin: auto; }
.auth-card h2 { margin: 0 0 10px; font: 500 34px/1.2 Georgia, "Songti SC", serif; }
.auth-card .lead { color: var(--muted); margin: 0 0 34px; line-height: 1.7; }

.field { display: grid; gap: 8px; margin-bottom: 17px; }
.field > label { font-size: 13px; font-weight: 700; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.5; }

.field input,
.field select,
.field textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  padding: 13px 14px;
  outline: none;
  transition: border .18s, box-shadow .18s, background .18s;
}

.field textarea { min-height: 116px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .search-input:focus {
  border-color: var(--forest-2);
  box-shadow: 0 0 0 4px rgba(33, 92, 73, .1);
  background: white;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.choice-card {
  min-height: 46px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafcfb;
  cursor: pointer;
}
.choice-card:has(input:checked) {
  border-color: var(--forest-2);
  background: #edf5f1;
  color: var(--forest);
  font-weight: 700;
}
.choice-card input { accent-color: var(--forest); }
.choice-card span { white-space: nowrap; }
.trust-box {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8faf9;
}
.trust-box legend {
  padding: 0 7px;
  color: var(--forest);
  font-size: 14px;
  font-weight: 700;
}
.trust-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
}
.trust-toggle input { accent-color: var(--forest); }

.btn {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform .16s, background .16s, border .16s, opacity .16s;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-primary { background: var(--forest); color: white; }
.btn-primary:hover { background: var(--forest-2); }
.btn-accent { background: var(--lime); color: #233417; }
.btn-ghost { background: white; border-color: var(--line); color: var(--ink); }
.btn-danger { color: var(--danger); background: #fff4f3; border-color: #f4cfcb; }
.btn-block { width: 100%; }
.btn-sm { min-height: 38px; border-radius: 9px; padding: 8px 13px; font-size: 14px; }

.auth-submit { margin-top: 8px; min-height: 50px; }
.auth-note { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 18px; }
.auth-switch { margin-top: 26px; color: var(--muted); font-size: 13px; }
.link-button { color: var(--forest-2); border: 0; background: transparent; padding: 0; font-weight: 700; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 20px;
  color: var(--ink);
  background:
    radial-gradient(circle at 0 0, rgba(89, 151, 220, .18), transparent 20rem),
    linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  border-right: 1px solid #d9e6f4;
  box-shadow: 8px 0 28px rgba(35, 78, 128, .055);
  display: flex;
  flex-direction: column;
}

.sidebar .brand-lockup { padding: 0 10px 28px; }
.sidebar .brand-name { color: #123a67; font-size: 15px; letter-spacing: .06em; }
.sidebar .brand-sub { color: #7288a2; font-size: 11px; letter-spacing: .12em; }
.nav-label { color: #7c92ab; font-size: 11px; font-weight: 700; letter-spacing: .13em; padding: 9px 12px; }
.nav { display: grid; gap: 5px; }
.nav button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
  color: #4d657e;
  font-size: 15px;
  transition: background .16s, color .16s, transform .16s;
}

.nav button:hover { background: #edf5ff; color: #164f8b; transform: translateX(2px); }
.nav button.active { background: #dfedff; color: #174f8b; font-weight: 800; box-shadow: inset 3px 0 0 #2e73c7; }
.nav-icon { width: 22px; text-align: center; font-size: 18px; }
.primary-label { padding-top: 0; color: #39658f; }
.primary-nav { gap: 8px; margin-bottom: 14px; }
.primary-nav button {
  min-height: 50px;
  border: 1px solid #d7e6f6;
  background: rgba(255,255,255,.94);
  color: #173f6d;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(31, 94, 160, .07);
}
.primary-nav .nav-icon { color: #2a6ebd; font-size: 19px; }
.primary-nav button:hover { background: #f2f8ff; transform: translateY(-1px); }
.primary-nav button.active { background: #2d70c4; color: white; border-color: #2d70c4; box-shadow: 0 10px 24px rgba(45, 112, 196, .22); }
.primary-nav button.active .nav-icon { color: white; }
.secondary-nav button { min-height: 42px; font-size: 14px; }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid #dce7f3; }
.sidebar-user { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #1d5f9f;
  background: var(--mint);
  font-weight: 800;
}
.sidebar-user strong, .sidebar-user span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user strong { color: #173b64; font-size: 14px; }
.sidebar-user span { color: #7287a0; font-size: 12px; margin-top: 3px; }
.sidebar-actions { display: flex; gap: 8px; margin-top: 14px; }
.sidebar-actions button {
  flex: 1;
  border: 1px solid #d8e5f2;
  color: #56718d;
  background: rgba(255,255,255,.7);
  border-radius: 9px;
  padding: 7px;
  font-size: 12px;
}

.main { min-width: 0; padding: 30px clamp(22px, 4vw, 56px) 56px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-title { margin: 0; font: 500 clamp(28px, 3.4vw, 42px)/1.1 Georgia, "Songti SC", serif; letter-spacing: -.025em; }
.page-subtitle { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.date-chip { background: rgba(255,255,255,.82); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; color: var(--muted); font-size: 13px; }

.view { animation: view-in .28s ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card, .panel {
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(214, 225, 219, .82);
  border-radius: var(--radius);
  box-shadow: 0 10px 36px rgba(24, 55, 44, .055);
}
.stat-card { padding: 20px; position: relative; overflow: hidden; }
.stat-card::after {
  content: attr(data-mark);
  position: absolute;
  right: 14px;
  top: 9px;
  color: rgba(23, 62, 50, .06);
  font: 500 56px Georgia, serif;
}
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { margin: 14px 0 6px; font: 500 32px/1 Georgia, serif; }
.stat-meta { color: #71859a; font-size: 12px; }
.stat-card.accent { background: var(--forest); color: white; border-color: var(--forest); }
.stat-card.accent .stat-label, .stat-card.accent .stat-meta { color: rgba(255,255,255,.56); }
.stat-card.accent::after { color: rgba(255,255,255,.08); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }

.primary-hub {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.primary-action {
  min-height: 102px;
  padding: 17px 18px;
  border: 1px solid #d5e4f4;
  border-radius: 18px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(145deg, #ffffff, #f7fbff);
  box-shadow: 0 12px 34px rgba(39, 87, 143, .07);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}

.primary-action:hover {
  transform: translateY(-2px);
  border-color: #9bc1e8;
  box-shadow: 0 16px 38px rgba(39, 87, 143, .12);
}

.primary-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #4c8ddd, #2566b4);
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 9px 20px rgba(45, 112, 196, .2);
}

.primary-action-copy { min-width: 0; }
.primary-action-copy strong { display: block; font-size: 18px; }
.primary-action-copy small { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.primary-action-count { color: #215d9f; font: 700 25px/1 Georgia, serif; text-align: right; }
.primary-action-count small { display: block; margin-top: 5px; color: var(--muted); font: 500 11px/1.2 "Microsoft YaHei UI", sans-serif; }

.expiry-reminder {
  margin-bottom: 18px;
  padding: 15px 17px;
  border: 1px solid #d3e3f4;
  border-left: 4px solid #2f73c5;
  border-radius: 16px;
  display: grid;
  grid-template-columns: minmax(230px, .9fr) minmax(260px, 1.3fr) auto;
  align-items: center;
  gap: 18px;
  background: #f7fbff;
}

.expiry-reminder.has-alerts {
  border-color: #ead7b2;
  border-left-color: var(--amber);
  background: #fffbf3;
}

.expiry-head { display: flex; align-items: center; gap: 11px; }
.expiry-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #1f5fae;
  background: #e4efff;
  font-size: 19px;
}
.expiry-reminder.has-alerts .expiry-icon { color: #a5680e; background: #fff0cc; }
.expiry-head span:not(.expiry-icon) { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.expiry-head strong { display: block; margin-top: 4px; font-size: 15px; }
.expiry-list { display: grid; gap: 5px; }
.expiry-list p { margin: 0; color: var(--muted); font-size: 12px; }
.expiry-item { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.expiry-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expiry-item span { flex: 0 0 auto; color: #9a6411; font-weight: 700; }

.complaint-banner {
  margin-bottom: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d2e2f4;
  border-left: 4px solid var(--forest);
  border-radius: 16px;
  background: #f5f9ff;
}
.complaint-banner span { display: block; color: #557090; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.complaint-banner strong { display: block; margin-top: 5px; font: 500 21px/1.2 Georgia, "Songti SC", serif; }
.complaint-banner p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px 16px; }
.panel-head h3 { margin: 0; font: 500 21px/1.2 Georgia, "Songti SC", serif; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.panel-body { padding: 0 22px 20px; }

.record-list { display: grid; }
.record-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 15px 0; border-top: 1px solid var(--line); }
.record-row:first-child { border-top: 0; }
.record-row h4 { margin: 0 0 7px; font-size: 15px; }
.record-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 10px; background: #edf3f0; color: #52655c; font-size: 12px; font-weight: 700; }
.pill.high { background: #fff0ed; color: #b64d3c; }
.pill.open { background: #fff6e5; color: #9c6a19; }
.pill.in_progress { background: #e9f3ff; color: #3c6d9f; }
.pill.done { background: #e9f7ee; color: #337250; }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 18px 20px; border-left: 1px solid var(--line); }
.timeline-item::before { content: ""; position: absolute; left: -4px; top: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--forest-2); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item strong { display: block; font-size: 12px; }
.timeline-item span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; line-height: 1.5; }

.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 9px; }
.filters .search-input { width: min(280px, 65vw); }
.filters select { border: 1px solid var(--line); border-radius: 11px; background: white; padding: 10px 12px; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.wide-table table { min-width: 1040px; }
.wide-table th, .wide-table td { white-space: nowrap; }
.wide-table th, .wide-table td { padding-left: 12px; padding-right: 12px; }
.wide-table .cell-title { min-width: 150px; white-space: normal; }
.wide-table .actions { gap: 4px; }
.wide-table .actions .btn-sm { padding-left: 10px; padding-right: 10px; }
th, td { padding: 16px 18px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: #496581; font-size: 15px; font-weight: 800; background: #f5f9ff; white-space: nowrap; }
td { font-size: 16px; }
tbody tr:hover { background: #f8fbff; }
tbody tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 700; margin-bottom: 4px; }
.feedback-count {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 6px 11px;
  border-radius: 999px;
  color: #174f8b;
  background: #e5f0ff;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}
.feedback-count small { color: #54779b; font-size: 12px; font-weight: 700; }
.cell-sub { color: var(--muted); font-size: 13px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.external-link { display: block; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--forest-2); text-decoration: underline; text-underline-offset: 3px; }
.link-actions { display: flex; align-items: center; gap: 8px; min-width: 190px; }
.actions { display: flex; gap: 6px; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty strong { display: block; color: var(--ink); margin-bottom: 8px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.pagination-actions { display: flex; gap: 8px; }

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(10, 25, 20, .58);
  backdrop-filter: blur(8px);
}
.modal-card {
  width: min(100%, 620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 30px 90px rgba(10, 28, 22, .35);
  animation: modal-in .22s ease;
}
@keyframes modal-in { from { opacity: 0; transform: scale(.98) translateY(8px); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 22px 24px 0; }
.modal-head h3 { margin: 0; font: 500 24px/1.2 Georgia, "Songti SC", serif; }
.modal-head p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #f1f4f2; color: var(--muted); font-size: 20px; }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }

.toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 10px; }
.toast {
  min-width: 260px;
  max-width: 420px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #142d25;
  color: white;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease;
}
.toast.error { background: #8c3934; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.loading-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, 1fr); }
.skeleton { height: 118px; border-radius: var(--radius); background: linear-gradient(90deg, #e9eeeb, #f6f8f7, #e9eeeb); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.notice {
  padding: 13px 15px;
  border-radius: 12px;
  background: #fff6e5;
  border: 1px solid #f2dfb6;
  color: #795b22;
  font-size: 12px;
  line-height: 1.7;
}

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .complaint-banner { align-items: flex-start; flex-direction: column; }
  .expiry-reminder { grid-template-columns: 1fr auto; }
  .expiry-list { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 820px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-hero { min-height: 300px; padding: 28px; }
  .hero-copy { margin-top: 70px; }
  .hero-copy h1 { font-size: 46px; }
  .hero-metrics { display: none; }
  .auth-panel { padding: 38px 24px 54px; }
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 14px; }
  .sidebar .brand-lockup { padding-bottom: 12px; }
  .nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
  .nav-label, .sidebar-foot { display: none; }
  .nav button { flex: 0 0 auto; justify-content: center; white-space: nowrap; }
  .primary-nav { margin-bottom: 8px; }
  .primary-nav button { min-width: 132px; }
  .main { padding: 22px 16px 40px; }
  .topbar { align-items: center; }
  .topbar-actions .date-chip { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .expiry-reminder { grid-template-columns: 1fr; }
  .expiry-list { grid-column: auto; grid-row: auto; }
}

@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .nav { display: flex; }
  .topbar { margin-bottom: 20px; }
  .topbar .btn span { display: none; }
  .page-title { font-size: 30px; }
  .toolbar { align-items: stretch; }
  .filters { width: 100%; }
  .filters .search-input { width: 100%; }
  .filters select { flex: 1; }
  td, th { padding: 12px; }
  .primary-hub { grid-template-columns: 1fr; }
  .primary-action { min-height: 88px; }
}
