:root {
  --bg: #f2f2f2;
  --bg-soft: #e8eaee;
  --surface: #ffffff;
  --ink: #0a1b3d;
  --muted: #5a6478;
  --line: #d5dae3;
  --navy: #0a1b3d;
  --navy-soft: #13284f;
  --sidebar-bg: #2d5711;
  --sidebar-bg-dark: #24470e;
  --sidebar-bg-deep: #1b360a;
  --brand: #FDDD05;
  --brand-dark: #e6c800;
  --brand-ink: #3f640d;
  --brand-soft: #fff8c2;
  --accent: #FDDD05;
  --danger: #b42318;
  --warning: #b54708;
  --success: #067647;
  --info: #175cd3;
  --shadow: 0 10px 30px rgba(10, 27, 61, 0.08);
  --radius: 14px;
  --sidebar: 272px;
  --font-display: "Manrope", "Segoe UI", sans-serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(107, 168, 23, 0.08), transparent 34%),
    linear-gradient(180deg, #f7f8fa 0%, var(--bg) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}
body.nav-open { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, svg, video, canvas { max-width: 100%; height: auto; }
pre, code { overflow-wrap: anywhere; word-break: break-word; }

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
}

.sidebar {
  --sidebar-pad: 0.85rem;
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar);
  height: 100vh;
  height: 100dvh;
  z-index: 20;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar-bg);
  color: #fff;
  border-right: 1px solid rgba(255,255,255,0.08);
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--sidebar-bg);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem var(--sidebar-pad) 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: transparent;
}

.brand-logo-only {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  max-height: 140px;
  object-fit: contain;
  background: #fff !important;
  border-radius: 12px !important;
  padding: 8px !important;
  box-shadow: none !important;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #1a1a1a;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
  flex-shrink: 0;
}

.brand-logo,
.brand-logo-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.brand-copy {
  min-width: 0;
}
.brand-copy strong {
  display: block;
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-copy span {
  display: block;
  color: rgba(237,242,248,0.58);
  font-size: 0.68rem;
  margin-top: 0.18rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 0.65rem 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(253,221,5,0.45) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(253,221,5,0.35);
  border-radius: 999px;
}

.nav-group { margin-bottom: 0.95rem; }
.nav-admin-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.68rem 0.8rem;
  margin-bottom: 0.18rem;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, color 0.16s ease;
}
.nav-admin-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-admin-panel.is-open .nav-admin-toggle {
  background: rgba(255,255,255,0.08);
}
.nav-admin-toggle .nav-ico {
  width: 1.15rem;
  height: 1.15rem;
  color: #fff;
}
.nav-admin-toggle span { flex: 1; }
.nav-admin-toggle .nav-ico:last-child {
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  transition: transform 0.18s ease;
  transform: rotate(-90deg);
}
.nav-admin-panel.is-open .nav-admin-toggle .nav-ico:last-child {
  transform: rotate(0deg);
}
.nav-admin-links {
  display: none;
  padding: 0.15rem 0 0.2rem;
}
.nav-admin-panel.is-open .nav-admin-links {
  display: block;
}
.nav-label {
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.2rem 0.7rem 0.45rem;
  font-weight: 700;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.8rem;
  margin-bottom: 0.18rem;
  border-radius: 11px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(253,221,5,0.28), rgba(253,221,5,0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(253,221,5,0.35);
}
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 10px rgba(253,221,5,0.55);
}
.nav-ico {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  opacity: 1;
  color: #fff;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-link.active .nav-ico,
.nav-link:hover .nav-ico { opacity: 1; color: #fff; }

.sidebar-foot {
  padding: 0.85rem var(--sidebar-pad) 1rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}
.sidebar-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
}
.sidebar-user strong {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
}
.sidebar-user span {
  display: block;
  font-size: 0.72rem;
  color: #fff;
}
.sidebar-foot .btn {
  width: 100%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
}
.sidebar-foot .btn:hover {
  background: rgba(253,221,5,0.28);
  border-color: rgba(253,221,5,0.45);
  color: #1a1a1a;
}

.main {
  min-width: 0;
  margin-left: var(--sidebar);
  width: calc(100% - var(--sidebar));
  max-width: calc(100% - var(--sidebar));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at top left, rgba(107, 168, 23, 0.08), transparent 34%),
    linear-gradient(180deg, #f7f8fa 0%, var(--bg) 100%);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.5rem;
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-start {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  flex: 1 1 220px;
}
.topbar-copy { min-width: 0; }

.topbar h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.topbar p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 180px;
}

.content {
  padding: 1.35rem 1.5rem 2.5rem;
  min-width: 0;
  width: 100%;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.05rem;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}
.stat:nth-child(2) { animation-delay: 0.05s; }
.stat:nth-child(3) { animation-delay: 0.1s; }
.stat:nth-child(4) { animation-delay: 0.15s; }
.stat:nth-child(5) { animation-delay: 0.2s; }
.stat:nth-child(6) { animation-delay: 0.25s; }
.stat .label { color: var(--muted); font-size: 0.82rem; }
.stat .value {
  margin-top: 0.4rem;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 650;
}
a.stat-link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
}
a.stat-link:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(10, 27, 61, 0.08);
}
a.stat-link:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  min-width: 0;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f9fbfc);
}
.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-family: var(--font-display);
}
.panel-body { padding: 1.15rem; }

.grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}
.grid-form .full { grid-column: 1 / -1; }

.field label {
  display: block;
  font-size: 0.84rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
}
.field .hint {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.3rem;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.72rem 0.85rem;
  outline: none;
  font-size: 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #f0b384;
  box-shadow: 0 0 0 3px rgba(253, 221, 5, 0.28);
}
.field textarea { min-height: 110px; resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 10px;
  padding: 0.72rem 1rem;
  font-weight: 700;
  cursor: pointer;
  max-width: 100%;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #1a1a1a;
  box-shadow: 0 8px 18px rgba(253, 221, 5, 0.35);
}
.btn-secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-danger {
  background: #fff;
  color: var(--danger);
  border: 1px solid #f3c1bd;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line);
}
.btn-sm { padding: 0.45rem 0.7rem; font-size: 0.86rem; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table.data {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.92rem;
  overflow-wrap: break-word;
}
table.data th {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafb;
}
table.data tr:hover td { background: #fafcfc; }
table.data.payment-lines {
  min-width: 920px;
}
table.data.payment-lines th,
table.data.payment-lines td {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
table.data.payment-lines tfoot td {
  border-top: 2px solid var(--line);
  background: #f8fafb;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand-ink);
}
.badge.danger { background: #fee4e2; color: #912018; }
.badge.warn { background: #fef0c7; color: #93370d; }
.badge.info { background: #d1e9ff; color: #1849a9; }

.alert {
  border-radius: 12px;
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  animation: rise 0.35s ease both;
  overflow-wrap: anywhere;
}
.alert code {
  display: inline-block;
  max-width: 100%;
}
.alert-success { background: #e8f8ef; border-color: #abefc6; color: #067647; }
.alert-error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert-info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.alert-warning { background: #fffaeb; border-color: #fedf89; color: #b54708; }

.empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.empty strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
}

.kv {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  gap: 0.55rem 1rem;
  font-size: 0.94rem;
}
.kv dd { overflow-wrap: anywhere; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.profile-info-panel { overflow: hidden; }
.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  padding: .55rem .55rem 0;
}
.profile-tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: #2f6fed;
  font: inherit;
  font-weight: 600;
  font-size: .92rem;
  padding: .7rem 1rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.profile-tab.active {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
  position: relative;
  top: 1px;
}
.profile-pane { display: none; }
.profile-pane.active { display: block; animation: rise .25s ease both; }
.profile-rows { display: grid; gap: 0; }
.profile-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid #eef0f3;
}
.profile-row:last-child { border-bottom: none; }
.profile-label {
  font-weight: 700;
  color: var(--ink);
}
.profile-value {
  color: #5b6472;
  word-break: break-word;
}
@media (max-width: 900px) {
  .profile-row { grid-template-columns: 1fr; gap: .25rem; }
  .profile-tab { flex: 1 1 auto; text-align: center; }
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 1.1rem 1.1rem;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0.35rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.timeline .when { color: var(--muted); font-size: 0.8rem; }
.timeline .what { font-weight: 700; margin-top: 0.15rem; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: #2a4407;
}
.auth-page.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  place-items: stretch;
  padding: 0;
  gap: 0;
}
.auth-hero {
  display: grid;
  place-items: center;
  padding: 2.5rem;
  color: #edf2f8;
  background: #2a4407;
}
.auth-hero-inner { max-width: 460px; }
.auth-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 1rem 0 0.7rem;
}
.auth-hero p { color: rgba(237,246,243,0.82); line-height: 1.6; }
.auth-hero ul {
  margin: 1.4rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}
.auth-hero li {
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.auth-side {
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(107,168,23,0.08), transparent 40%),
    #f2f2f2;
}
.auth-card {
  width: min(440px, 100%);
  background: rgba(255,255,255,0.96);
  border-radius: 18px;
  padding: 1.6rem;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
  animation: rise 0.5s ease both;
}
.auth-card h1 {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
}
.auth-card .sub { color: var(--muted); margin-bottom: 1.25rem; }
.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.2rem;
}
.auth-footer {
  margin-top: 1.15rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.auth-footer a {
  color: var(--brand-ink);
  font-weight: 700;
  text-decoration: underline;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.22);
}

@media (max-width: 900px) {
  .auth-page.auth-split { grid-template-columns: 1fr; }
  .auth-hero { min-height: 240px; padding: 1.5rem; }
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-weight: 650;
  font-size: 0.86rem;
}
.tab.active {
  background: var(--brand-soft);
  border-color: #f0b384;
  color: var(--brand-ink);
}

.service-panels [data-service] { display: none; }
.service-panels [data-service].active { display: block; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.35rem;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.pagination { margin-top: 1rem; }
.pagination nav > div { justify-content: center; }

.code-block {
  background: #0f1c22;
  color: #d7ebe4;
  border-radius: 12px;
  padding: 1rem;
  overflow: auto;
  font-size: 0.82rem;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.field-submit {
  display: flex;
  align-items: flex-end;
}
.field-submit .btn { width: auto; }
@media (max-width: 900px) {
  .field-submit {
    display: block;
    align-items: stretch;
  }
  .field-submit .btn { width: 100%; }
}
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 240px;
  justify-content: flex-end;
}
.filter-form input,
.filter-form select {
  min-width: 0 !important;
  flex: 1 1 160px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 16px;
  background: #fff;
}
.filter-form .btn {
  flex: 0 0 auto;
}
.pagination nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.inv-tabs { flex-wrap: wrap; }
.ts-wrapper {
  width: 100%;
  min-width: 0;
}
.ts-wrapper .ts-control {
  min-height: 44px;
  border-radius: 10px;
  border-color: var(--line);
  padding: 0.45rem 0.7rem;
  font-size: 16px;
}
.ts-dropdown { z-index: 60; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell {
    background: transparent;
  }
  .main {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, var(--sidebar));
    max-width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    z-index: 40;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    padding-left: env(safe-area-inset-left);
  }
  .sidebar-inner {
    height: 100%;
  }
  .sidebar.open { transform: translateX(0); }
  .menu-toggle { display: inline-flex; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .grid-form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .content, .topbar { padding-left: 1rem; padding-right: 1rem; }
  .user-chip { display: none; }
  .topbar-actions { justify-content: flex-start; }
  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 27, 61, 0.45);
    z-index: 30;
  }
  .backdrop.show { display: block; }
  .form-actions .btn { flex: 1 1 auto; }
}

.signup-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 320px 1fr;
  background: #f2f2f2;
}
.signup-aside {
  background: #2a4407;
  color: #edf2f8;
  padding: 2rem 1.4rem;
}
.signup-aside h1 {
  font-family: var(--font-display);
  margin: 1rem 0 .6rem;
}
.signup-aside p { color: rgba(237,246,243,.78); line-height: 1.55; }
.signup-aside-card {
  margin-top: 1.4rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  display: grid;
  gap: .35rem;
}
.signup-main { padding: 1.4rem; }
.signup-shell {
  max-width: 980px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem 1.5rem;
}
.signup-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.signup-top h1 {
  margin: .2rem 0 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
}
.signup-brands {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
}
.signup-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: .55rem;
  margin-bottom: 1.2rem;
}
.signup-step {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: .7rem .65rem;
  background: #f8fafb;
  display: grid;
  gap: .25rem;
}
.signup-step span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dce5ea;
  font-size: .78rem;
  font-weight: 800;
}
.signup-step strong {
  font-size: .78rem;
  line-height: 1.25;
  color: var(--muted);
}
.signup-step.active {
  border-color: #f0b384;
  background: var(--brand-soft);
}
.signup-step.active span,
.signup-step.done span {
  background: var(--brand);
  color: #fff;
}
.signup-step.active strong,
.signup-step.done strong { color: var(--brand-ink); }
.signup-panel { display: none; }
.signup-panel.active { display: block; animation: rise .3s ease both; }
.signup-panel h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
}
.signup-panel em { color: #b42318; font-style: normal; }
.signup-nav {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.pickup-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: .85rem;
  background: #fafbfc;
}
.pickup-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.pickup-card-head strong {
  font-size: .95rem;
  color: var(--brand-ink);
}
@media (max-width: 980px) {
  .signup-page { grid-template-columns: 1fr; }
  .signup-aside { display: none; }
  .signup-steps {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    grid-template-columns: none;
    padding-bottom: 0.35rem;
  }
  .signup-step {
    min-width: 148px;
    flex: 0 0 148px;
  }
  .signup-main { padding: 1rem; }
  .signup-shell { padding: 1rem; }
  .signup-top {
    flex-direction: column;
    align-items: stretch;
  }
  .signup-top .btn {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .panel-head { align-items: stretch; }
  .panel-head .filter-form,
  .panel-head form {
    width: 100%;
    justify-content: stretch;
  }
  .panel-head .filter-form .btn,
  .panel-head form .btn { width: 100%; }
  .profile-row { grid-template-columns: 1fr; gap: .25rem; }
  .profile-tab { flex: 1 1 auto; text-align: center; }
  .pickup-card-head { flex-wrap: wrap; }
  .stat .value { font-size: 1.35rem; }
  .tabs { gap: 0.35rem; }
  .tab { flex: 1 1 auto; text-align: center; }

  table.data.stack-cards {
    min-width: 0;
  }
  table.data.stack-cards thead { display: none; }
  table.data.stack-cards,
  table.data.stack-cards tbody,
  table.data.stack-cards tr,
  table.data.stack-cards td {
    display: block;
    width: 100%;
  }
  table.data.stack-cards tr {
    margin: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
  }
  table.data.stack-cards tr:hover td { background: transparent; }
  table.data.stack-cards td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid #eef0f3;
  }
  table.data.stack-cards td:last-child { border-bottom: none; }
  table.data.stack-cards td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    flex: 0 0 38%;
    max-width: 38%;
  }
  table.data.stack-cards td:not([data-label])::before,
  table.data.stack-cards td[data-label=""]::before { display: none; }
  table.data.stack-cards td:not([data-label]),
  table.data.stack-cards td[data-label=""] {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  table.data.stack-cards tr.is-empty {
    border: none;
    margin: 0;
  }
  table.data.stack-cards tr.is-empty td {
    display: block;
    border: none;
  }
  table.data.stack-cards tr.is-empty td::before { display: none; }
}

@media (max-width: 640px) {
  .stats { grid-template-columns: 1fr 1fr !important; }
  .signup-nav {
    flex-direction: column-reverse;
  }
  .signup-nav .btn,
  .inv-actions .btn,
  .form-actions .btn {
    width: 100%;
  }
  .signup-top h1 { font-size: 1.35rem; }
  .content { padding-bottom: max(2rem, env(safe-area-inset-bottom)); }
  .pagination nav {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr !important; }
  .topbar { padding-top: 0.85rem; padding-bottom: 0.85rem; }
  .topbar p { font-size: 0.82rem; }
  .auth-page { padding: 1rem; }
  .auth-card { padding: 1.15rem; }
  .auth-hero { min-height: 0; padding: 1.15rem; }
  .signup-steps { gap: 0.4rem; }
  .signup-step { min-width: 132px; flex-basis: 132px; }
}

