/* ==========================================================================
   绿循 ERP — admin visual system
   ========================================================================== */
:root {
  --bg: #f1f5f0;
  --bg-deep: #e8efe8;
  --surface: #ffffff;
  --surface-soft: #f7faf6;
  --surface-tint: #eef7ef;
  --ink: #122a25;
  --ink-2: #29423b;
  --muted: #677c74;
  --muted-2: #8a9c95;
  --line: #e1e9e2;
  --line-strong: #cfdcd2;
  --brand: #0f3d34;
  --brand-2: #155146;
  --brand-3: #1d6b59;
  --accent: #20b486;
  --accent-dark: #0e8f68;
  --lime: #cdf16d;
  --lime-soft: #eefad0;
  --orange: #e8843c;
  --orange-soft: #fdf2e6;
  --blue: #4c7df0;
  --blue-soft: #edf1fd;
  --violet: #8c6be8;
  --danger: #d9534f;
  --danger-soft: #fceeee;
  --warning: #c88a1c;
  --warning-soft: #fbf4df;
  --shadow-sm: 0 1px 2px rgba(18, 42, 37, 0.04), 0 4px 14px rgba(18, 42, 37, 0.04);
  --shadow-md: 0 18px 50px rgba(15, 61, 52, 0.1);
  --shadow-lg: 0 30px 90px rgba(8, 35, 29, 0.22);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --sidebar-w: 264px;
  --font: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1000px 700px at 82% -10%, rgba(205, 241, 109, 0.13), transparent 60%),
    radial-gradient(900px 600px at -10% 100%, rgba(32, 180, 134, 0.08), transparent 55%),
    var(--bg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

button {
  cursor: pointer;
}

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

img,
svg {
  display: block;
}

h1, h2, h3, h4, p {
  margin: 0;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: var(--lime);
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid rgba(32, 180, 134, 0.35);
  outline-offset: 2px;
}

.is-hidden,
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Boot
   -------------------------------------------------------------------------- */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--brand);
  color: #fff;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.boot-screen.done {
  opacity: 0;
  visibility: hidden;
}

.boot-mark {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
}

.boot-ring {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(205, 241, 109, 0.22);
  border-top-color: var(--lime);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

.boot-leaf {
  width: 28px;
  height: 28px;
  background: var(--lime);
  border-radius: 2px 18px 2px 18px;
  transform: rotate(-12deg);
}

.boot-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.boot-copy strong {
  font-size: 24px;
  letter-spacing: 0.06em;
}

.boot-copy span {
  color: rgba(255, 255, 255, 0.58);
  letter-spacing: 0.16em;
  font-size: 12px;
}

.boot-bar {
  width: 190px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.boot-bar i {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: var(--lime);
  animation: bootLoad 1.25s ease-in-out infinite;
}

@keyframes bootLoad {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(360%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Shared primitives
   -------------------------------------------------------------------------- */
.brand-mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: var(--lime);
  position: relative;
  overflow: hidden;
}

.brand-mark::before {
  content: "";
  position: absolute;
  width: 24px;
  height: 17px;
  left: 9px;
  top: 12px;
  border-radius: 4px 9px 4px 9px;
  background: var(--brand);
  transform: rotate(-9deg);
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 8px;
  right: 7px;
  top: 17px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: inset 0 0 0 2px var(--brand);
}

.brand-mark.small {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border-radius: 12px;
}

.brand-mark.small::before {
  width: 21px;
  height: 15px;
  left: 8px;
  top: 11px;
}

.brand-mark.small::after {
  right: 6px;
  top: 15px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: var(--lime);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 13px;
  background: var(--lime-soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid rgba(15, 61, 52, 0.06);
}

.avatar.sm {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 10px;
  font-size: 12px;
}

.avatar.lg {
  width: 52px;
  height: 52px;
  flex-basis: 52px;
  border-radius: 16px;
  font-size: 17px;
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon svg {
  width: 18px;
  height: 18px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  transition: 0.18s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 20px rgba(15, 61, 52, 0.18);
}

.btn-primary:hover {
  background: var(--brand-2);
  box-shadow: 0 10px 26px rgba(15, 61, 52, 0.24);
}

.btn-lime {
  background: var(--lime);
  color: var(--brand);
}

.btn-lime:hover {
  background: #d7f77b;
}

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover {
  background: var(--accent-dark);
}

.btn-soft {
  background: var(--surface-tint);
  color: var(--brand-2);
  border-color: rgba(32, 180, 134, 0.1);
}

.btn-soft:hover {
  background: #e4f3e5;
}

.btn-outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink-2);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(217, 83, 79, 0.12);
}

.btn-danger:hover {
  background: #f9dede;
}

.btn-sm {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  border-radius: 9px;
  gap: 5px;
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

.btn-lg {
  min-height: 50px;
  border-radius: 13px;
  font-size: 14.5px;
}

.btn-block {
  width: 100%;
}

.btn-arrow {
  margin-left: auto;
  display: inline-flex;
}

.btn .spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.btn-outline .spinner,
.btn-soft .spinner {
  border-color: rgba(15, 61, 52, 0.2);
  border-top-color: var(--brand);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 700;
}

.field-label small {
  color: var(--muted-2);
  font-weight: 500;
}

.field-hint {
  color: var(--muted-2);
  font-size: 11.5px;
  line-height: 1.5;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 180, 134, 0.1);
}

.input-icon {
  color: var(--muted-2);
  display: inline-flex;
}

.input-icon svg {
  width: 17px;
  height: 17px;
}

.input-shell input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 13.5px;
}

.input-shell input::placeholder {
  color: var(--muted-2);
}

.password-toggle {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
}

.password-toggle:hover {
  background: var(--surface-soft);
}

.password-toggle svg {
  width: 17px;
  height: 17px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="url"],
input[type="tel"],
input[type="search"],
input[type="email"],
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  outline: none;
  font-size: 13.5px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(32, 180, 134, 0.1);
}

.input-shell input:focus {
  border-color: transparent;
  box-shadow: none;
}

.input-shell input,
.input-shell input:hover,
.input-shell input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--surface-soft);
  color: var(--muted);
  cursor: not-allowed;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.form-error {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  border: 1px solid rgba(217, 83, 79, 0.16);
  color: #a93e3a;
  font-size: 12.5px;
  line-height: 1.5;
}

.form-note {
  display: flex;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-tint);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.55;
}

.form-note .icon {
  color: var(--accent-dark);
  flex: 0 0 auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}

.pill.gray { background: #f1f4f1; color: var(--muted); }
.pill.lime { background: var(--lime-soft); color: #4d6a11; }
.pill.orange { background: var(--orange-soft); color: #a45b19; }
.pill.blue { background: var(--blue-soft); color: #355fc2; }
.pill.red { background: var(--danger-soft); color: #a93e3a; }
.pill.green { background: #e6f8f0; color: #0b7f5c; }
.pill.dark { background: var(--brand); color: var(--lime); }

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.admin { background: var(--lime-soft); border-color: #dceeb1; color: #4d6a11; }

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.section-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.section-head .link {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.section-head .link svg {
  width: 14px;
  height: 14px;
}

/* --------------------------------------------------------------------------
   Login
   -------------------------------------------------------------------------- */
.login-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(420px, 0.88fr);
  background: var(--surface);
}

.login-visual {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 46px 54px 40px;
  background:
    radial-gradient(900px 600px at 92% 6%, rgba(205, 241, 109, 0.14), transparent 60%),
    radial-gradient(700px 500px at -5% 100%, rgba(32, 180, 134, 0.2), transparent 60%),
    linear-gradient(150deg, #0b2f28 0%, #0f3d34 48%, #123e35 100%);
  color: #fff;
}

.login-grid {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 70px 70px;
  mask-image: linear-gradient(to bottom right, #000, transparent 80%);
}

.login-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  pointer-events: none;
}

.orb-one {
  width: 540px;
  height: 540px;
  right: -260px;
  bottom: -260px;
  border: 1px solid rgba(205, 241, 109, 0.18);
  box-shadow: inset 0 0 120px rgba(205, 241, 109, 0.05);
}

.orb-two {
  width: 280px;
  height: 280px;
  right: 80px;
  top: 90px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

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

.login-brand div {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.login-brand strong {
  font-size: 16px;
  letter-spacing: 0.04em;
}

.login-brand span {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10.5px;
  letter-spacing: 0.16em;
}

.login-visual-copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  max-width: 620px;
  padding: 48px 0;
}

.login-visual-copy h1 {
  margin-top: 18px;
  font-size: clamp(38px, 4.6vw, 70px);
  line-height: 1.08;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.login-visual-copy h1 em {
  color: var(--lime);
  font-style: normal;
  position: relative;
}

.login-visual-copy p {
  max-width: 460px;
  margin-top: 22px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 14px;
  line-height: 1.8;
}

.login-proof {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.login-proof div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.login-proof strong {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.92);
}

.login-proof span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
}

.login-footnote {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 10.5px;
  letter-spacing: 0.14em;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background:
    radial-gradient(600px 400px at 100% 0%, rgba(205, 241, 109, 0.12), transparent 60%),
    var(--surface);
}

.login-panel-inner {
  width: min(390px, 100%);
}

.login-heading {
  margin-bottom: 26px;
}

.login-heading h2 {
  margin-top: 9px;
  font-size: 30px;
  letter-spacing: -0.035em;
  font-weight: 800;
}

.login-heading p {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12.5px;
}

.login-hint {
  margin-bottom: 18px;
  padding: 11px 14px;
  border-radius: 11px;
  background: var(--lime-soft);
  border: 1px solid #dfedb9;
  color: #50651b;
  font-size: 11.5px;
  line-height: 1.6;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 17px;
}

.login-form .form-error {
  margin-top: -3px;
}

.login-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 26px;
  color: var(--muted-2);
  font-size: 11px;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(32, 180, 134, 0.12);
}

.login-version {
  margin-top: 44px;
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background:
    radial-gradient(420px 300px at 100% 100%, rgba(205, 241, 109, 0.06), transparent 65%),
    linear-gradient(180deg, #0d352d 0%, #0b2d27 100%);
  color: #fff;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 22px;
}

.sidebar-brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.sidebar-brand-copy strong {
  font-size: 14px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-copy span {
  color: rgba(255, 255, 255, 0.4);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
  padding-right: 2px;
}

.nav-group-label {
  padding: 16px 12px 6px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: 0.18s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
}

.nav-item .nav-icon {
  display: inline-flex;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.nav-item .nav-icon svg {
  width: 19px;
  height: 19px;
}

.nav-item.active {
  background: var(--lime);
  color: var(--brand);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.nav-item.active::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  margin-left: auto;
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.8);
  display: inline-grid;
  place-items: center;
  font-size: 9px;
  font-weight: 800;
}

.nav-item.active .nav-badge {
  background: rgba(15, 61, 52, 0.1);
  color: var(--brand);
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-tip {
  display: flex;
  gap: 9px;
  padding: 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-tip-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  background: rgba(205, 241, 109, 0.12);
  color: var(--lime);
}

.sidebar-tip-icon svg {
  width: 15px;
  height: 15px;
}

.sidebar-tip div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-tip strong {
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
}

.sidebar-tip span {
  font-size: 9.5px;
  color: rgba(255, 255, 255, 0.34);
  line-height: 1.45;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  text-align: left;
  transition: 0.18s ease;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-user .avatar {
  background: rgba(205, 241, 109, 0.14);
  color: var(--lime);
  border-color: transparent;
}

.sidebar-user-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.sidebar-user-copy strong {
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-copy span {
  color: rgba(255, 255, 255, 0.34);
  font-size: 9.5px;
}

.sidebar-user > .icon {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.3);
}

.sidebar-user > .icon svg {
  width: 16px;
  height: 16px;
}

.sidebar-scrim {
  display: none;
}

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 14px 30px;
  background: rgba(241, 245, 240, 0.84);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(214, 226, 215, 0.7);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.menu-btn {
  display: none;
  background: var(--surface);
}

.topbar-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.crumb-sep {
  opacity: 0.45;
}

.topbar-title h1 {
  margin-top: 2px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.topbar-date {
  padding-right: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  border-right: 1px solid var(--line-strong);
  line-height: 1.4;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  transition: 0.18s ease;
}

.user-chip:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.user-chip-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.user-chip-copy strong {
  font-size: 11px;
}

.user-chip-copy span {
  color: var(--muted-2);
  font-size: 9px;
}

.user-chip > .icon {
  color: var(--muted-2);
}

.user-chip > .icon svg {
  width: 14px;
  height: 14px;
}

.user-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 60;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  animation: popIn 0.16s ease;
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}

.user-pop-head div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-pop-head strong {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-pop-head span {
  color: var(--muted-2);
  font-size: 10px;
}

.user-pop button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  text-align: left;
}

.user-pop button:hover {
  background: var(--surface-soft);
}

.user-pop button svg {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

.user-pop button.danger {
  color: var(--danger);
}

.user-pop button.danger svg {
  color: var(--danger);
}

.view {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: 26px 30px 40px;
  flex: 1;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 30px 22px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Page building blocks
   -------------------------------------------------------------------------- */
.page-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: pageIn 0.28s ease both;
}

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

.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: 13px;
  background: var(--lime-soft);
  border: 1px solid #dfedb9;
  color: #50651b;
  font-size: 12px;
  line-height: 1.55;
}

.alert .icon {
  flex: 0 0 auto;
  margin-top: 1px;
}

.alert strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
}

.alert .link {
  margin-left: auto;
  font-weight: 800;
  white-space: nowrap;
}

.alert.info {
  background: var(--blue-soft);
  border-color: #dfe7fc;
  color: #385aa7;
}

.alert.warn {
  background: var(--warning-soft);
  border-color: #f0e3bd;
  color: #8a6317;
}

.alert.danger {
  background: var(--danger-soft);
  border-color: #f5d8d7;
  color: #a93e3a;
}

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 28px 30px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(650px 380px at 90% -30%, rgba(205, 241, 109, 0.18), transparent 65%),
    radial-gradient(400px 260px at 55% 120%, rgba(32, 180, 134, 0.18), transparent 60%),
    linear-gradient(135deg, #0e382f, #123e35 60%, #0f3d34);
  color: #fff;
  box-shadow: 0 24px 52px rgba(15, 61, 52, 0.16);
}

.hero::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -60px;
  top: -130px;
  border: 1px solid rgba(205, 241, 109, 0.16);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(205, 241, 109, 0.025), 0 0 0 100px rgba(205, 241, 109, 0.02);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  color: var(--lime);
}

.hero-copy h2 {
  margin-top: 10px;
  font-size: clamp(21px, 2.3vw, 30px);
  line-height: 1.25;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.hero-copy p {
  max-width: 500px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.52);
  font-size: 12px;
}

.hero-metrics {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 26px;
  flex: 0 0 auto;
}

.hero-metrics div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 80px;
}

.hero-metrics strong {
  font-size: 21px;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

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

.hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.hero-actions .btn-lime {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.page-head h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
  font-weight: 800;
}

.page-head p {
  max-width: 620px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.page-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 146px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 38px rgba(15, 61, 52, 0.08);
}

.kpi-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -52px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--tint, var(--surface-tint));
  opacity: 0.7;
}

.kpi-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kpi-label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tint, var(--surface-tint));
  color: var(--tone, var(--brand));
}

.kpi-icon svg {
  width: 17px;
  height: 17px;
}

.kpi-value {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.04em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.kpi-value small {
  font-size: 11px;
  letter-spacing: 0;
  color: var(--muted);
  font-weight: 600;
  margin-left: 4px;
}

.kpi-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 10.5px;
  line-height: 1.4;
}

.kpi-foot .up { color: var(--accent-dark); font-weight: 700; }
.kpi-foot .down { color: var(--danger); font-weight: 700; }

.kpi-card.tone-green { --tint: #e9f8ef; --tone: #0e8f68; }
.kpi-card.tone-lime { --tint: #f0fad7; --tone: #5a7718; }
.kpi-card.tone-orange { --tint: #fdf1e5; --tone: #c26c21; }
.kpi-card.tone-blue { --tint: #edf1fd; --tone: #3e65c7; }
.kpi-card.tone-violet { --tint: #f1edfd; --tone: #7658d4; }
.kpi-card.tone-dark { --tint: #e8f1ed; --tone: #144f42; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-main-side {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.85fr);
  gap: 16px;
}

.grid-side-main {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.55fr);
  gap: 16px;
}

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

.card-pad {
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}

.card-head h3 {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.card-head p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.card-head .head-side {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.card-body {
  padding: 18px 20px 20px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 0;
  border: 0;
}

/* Charts */
.chart-legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
}

.legend-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-key i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

.legend-key.out i {
  background: var(--brand);
}

.legend-key.profit i {
  background: var(--orange);
}

.chart-wrap {
  width: 100%;
  margin-top: 8px;
}

.chart-wrap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart-grid line {
  stroke: #eaf0ea;
  stroke-width: 1;
}

.chart-axis-label {
  fill: #93a49d;
  font-size: 9px;
  font-family: var(--font);
}

.chart-bar.in {
  fill: var(--accent);
  transition: opacity 0.16s ease;
}

.chart-bar.out {
  fill: var(--brand);
  transition: opacity 0.16s ease;
}

.chart-bar:hover {
  opacity: 0.78;
}

.chart-bar-bg {
  fill: #f3f7f3;
}

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 6px;
}

.donut {
  position: relative;
  width: 162px;
  height: 162px;
  flex: 0 0 162px;
  border-radius: 50%;
  background: conic-gradient(#e9efea 0deg 360deg);
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1px rgba(15, 61, 52, 0.04);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}

.donut-center {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.2;
}

.donut-center strong {
  display: block;
  font-size: 18px;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.donut-center span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.donut-legend-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
}

.donut-legend-row i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.donut-legend-row span {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.donut-legend-row strong {
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 46px 22px;
  gap: 8px;
}

.empty-visual {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  border-radius: 18px;
  background: var(--surface-tint);
  color: var(--accent-dark);
  border: 1px dashed #cfe3d4;
}

.empty-visual svg {
  width: 25px;
  height: 25px;
}

.empty-state h4 {
  font-size: 13px;
  font-weight: 800;
}

.empty-state p {
  max-width: 340px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.6;
}

.empty-state .btn {
  margin-top: 8px;
}

.empty-inline {
  padding: 24px 16px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 700px;
}

.data-table th {
  padding: 10px 14px;
  background: var(--surface-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: left;
  white-space: nowrap;
}

.data-table th:first-child {
  padding-left: 20px;
}

.data-table th:last-child {
  padding-right: 20px;
  text-align: right;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2ed;
  color: var(--ink-2);
  font-size: 11.5px;
  vertical-align: middle;
}

.data-table td:first-child {
  padding-left: 20px;
}

.data-table td:last-child {
  padding-right: 20px;
  text-align: right;
}

.data-table tbody tr {
  transition: background 0.14s ease;
}

.data-table tbody tr:hover {
  background: #fbfdfb;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.data-table .strong {
  color: var(--ink);
  font-weight: 800;
}

.data-table .muted {
  color: var(--muted-2);
}

.data-table .actions {
  white-space: nowrap;
  text-align: right;
}

.data-table .actions .btn + .btn {
  margin-left: 4px;
}

.cell-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.cat-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 3px;
  background: var(--dot, var(--accent));
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cell-stack strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cell-stack span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.cat-name {
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.stock-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
}

.stock-cell strong {
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stock-cell span {
  color: var(--muted-2);
  font-size: 9px;
}

.stock-low strong {
  color: var(--orange);
}

.accum-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}

.accum-cell strong {
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.accum-cell span {
  color: var(--muted-2);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

/* Filters and toolbars */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
}

.search-box .icon {
  position: absolute;
  left: 11px;
  color: var(--muted-2);
  pointer-events: none;
}

.search-box .icon svg {
  width: 15px;
  height: 15px;
}

.search-box input {
  min-height: 38px;
  padding-left: 34px;
  background: var(--surface);
  font-size: 12px;
}

.filter-select {
  width: auto;
  min-width: 120px;
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 11.5px;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
}

.date-range span {
  color: var(--muted-2);
  font-size: 10px;
}

.date-range input {
  width: 132px;
  min-height: 38px;
  font-size: 11px;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.check-line input {
  width: 14px;
  height: 14px;
  min-height: auto;
  accent-color: var(--accent);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 10.5px;
}

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 5px;
}

.page-btn {
  display: inline-grid;
  place-items: center;
  min-width: 29px;
  height: 29px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.page-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Activity list */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-row {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid #edf2ed;
}

.activity-row:first-child {
  padding-top: 2px;
}

.activity-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 10px;
  background: var(--surface-tint);
  color: var(--accent-dark);
}

.activity-icon.out {
  background: var(--orange-soft);
  color: #b5651f;
}

.activity-icon svg {
  width: 15px;
  height: 15px;
}

.activity-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.activity-copy strong {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-copy span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.activity-side {
  text-align: right;
  flex: 0 0 auto;
}

.activity-side strong {
  display: block;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.activity-side span {
  color: var(--muted-2);
  font-size: 9px;
}

/* Detail lists */
.mini-list {
  display: flex;
  flex-direction: column;
}

.mini-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #edf2ed;
}

.mini-list-row:last-child {
  border-bottom: 0;
}

.mini-list-row span {
  color: var(--muted);
  font-size: 11px;
}

.mini-list-row strong {
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.partner-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.partner-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.partner-rank {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
}

.partner-rank.top {
  background: var(--lime-soft);
  color: #5a7718;
}

.partner-copy {
  flex: 1;
  min-width: 0;
}

.partner-copy strong {
  display: block;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.partner-copy span {
  color: var(--muted-2);
  font-size: 9px;
}

.partner-amount {
  font-size: 11.5px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 32, 27, 0.48);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.18s ease;
}

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

.modal-card {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.modal-card.md { width: min(620px, 100%); }
.modal-card.lg { width: min(760px, 100%); }
.modal-card.xl { width: min(900px, 100%); }
.modal-card.sm { width: min(430px, 100%); }

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 21px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-head-copy {
  flex: 1;
  min-width: 0;
}

.modal-head h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.modal-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.modal-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 15px 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.modal-foot .left {
  margin-right: auto;
  color: var(--muted-2);
  font-size: 10px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.confirm-copy {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}

.confirm-copy strong {
  color: var(--ink);
}

.danger-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--danger-soft);
  color: var(--danger);
}

.danger-icon svg {
  width: 21px;
  height: 21px;
}

/* segmented control */
.segmented {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.segmented button {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.segmented button.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(18, 42, 37, 0.1);
}

/* movement form calculator */
.calc-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--line);
}

.calc-cell {
  padding: 11px 13px;
  background: var(--surface-soft);
}

.calc-cell span {
  display: block;
  color: var(--muted-2);
  font-size: 9.5px;
}

.calc-cell strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.calc-cell.wide {
  grid-column: span 3;
}

.stock-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.stock-note strong {
  color: var(--ink-2);
}

.stock-note.warn {
  color: var(--danger);
}

/* color swatches */
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  transition: 0.16s ease;
}

.swatch:hover {
  transform: scale(1.08);
}

.swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--surface);
}

.swatch.active::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 2px solid #fff;
  border-bottom: 0;
  border-right: 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* permission grid */
.permission-group + .permission-group {
  margin-top: 16px;
}

.permission-group-title {
  margin-bottom: 8px;
  color: var(--muted-2);
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.permission-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: 0.16s ease;
}

.permission-option:hover {
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.permission-option.checked {
  border-color: rgba(32, 180, 134, 0.35);
  background: var(--surface-tint);
}

.permission-option input {
  width: 15px;
  height: 15px;
  min-height: auto;
  margin-top: 1px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.permission-option div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.permission-option strong {
  font-size: 11px;
  font-weight: 700;
}

.permission-option span {
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
}

.template-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.template-chip {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.template-chip:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.role-toggle {
  display: flex;
  gap: 8px;
}

.role-option {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: 0.16s ease;
}

.role-option.checked {
  border-color: var(--accent);
  background: var(--surface-tint);
}

.role-option input {
  width: 15px;
  height: 15px;
  min-height: auto;
  margin-top: 1px;
  accent-color: var(--accent);
}

.role-option div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.role-option strong {
  font-size: 11.5px;
}

.role-option span {
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.4;
}

/* switch */
.switch-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.switch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.switch-copy strong {
  font-size: 11.5px;
}

.switch-copy span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.switch {
  position: relative;
  display: inline-flex;
  width: 38px;
  height: 22px;
  flex: 0 0 38px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch i {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #dbe4dc;
  transition: 0.18s ease;
}

.switch i::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: 0.18s ease;
}

.switch input:checked + i {
  background: var(--accent);
}

.switch input:checked + i::after {
  transform: translateX(16px);
}

/* --------------------------------------------------------------------------
   Employees
   -------------------------------------------------------------------------- */
.employee-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.employee-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: 0.18s ease;
}

.employee-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(15, 61, 52, 0.07);
}

.employee-card.inactive {
  opacity: 0.62;
}

.employee-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.employee-title {
  flex: 1;
  min-width: 0;
}

.employee-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.employee-title strong {
  display: block;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.employee-title span {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 10px;
  font-family: var(--mono);
}

.employee-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.employee-meta div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.employee-meta svg {
  width: 13px;
  height: 13px;
  color: var(--muted-2);
}

.employee-perms {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 21px;
}

.employee-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.employee-foot .last {
  color: var(--muted-2);
  font-size: 9px;
}

.employee-actions {
  display: flex;
  gap: 4px;
}

/* --------------------------------------------------------------------------
   Mini program page
   -------------------------------------------------------------------------- */
.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.config-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 96px;
}

.config-status {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.status-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border-radius: 13px;
  background: var(--brand);
  color: #fff;
}

.status-hero .status-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 12px;
  background: rgba(205, 241, 109, 0.14);
  color: var(--lime);
}

.status-hero .status-icon svg {
  width: 20px;
  height: 20px;
}

.status-hero strong {
  display: block;
  font-size: 12.5px;
}

.status-hero span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
}

.status-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--line);
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 10.5px;
}

.status-row span {
  color: var(--muted);
}

.status-row strong {
  font-weight: 700;
}

.status-row .ok { color: var(--accent-dark); }
.status-row .miss { color: var(--orange); }

.upload-steps {
  display: flex;
  flex-direction: column;
  gap: 13px;
  counter-reset: step;
}

.upload-step {
  display: flex;
  gap: 10px;
}

.upload-step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border-radius: 6px;
  background: var(--surface-tint);
  color: var(--accent-dark);
  font-size: 9.5px;
  font-weight: 800;
}

.upload-step div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.upload-step strong {
  font-size: 10.5px;
}

.upload-step span {
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.5;
}

.secret-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.5;
}

.secret-status .icon {
  color: var(--accent-dark);
  flex: 0 0 auto;
}

.secret-status .icon svg {
  width: 14px;
  height: 14px;
}

.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: 0.16s ease;
}

.file-drop:hover {
  border-color: var(--accent);
  background: var(--surface-tint);
}

.file-drop svg {
  width: 20px;
  height: 20px;
  color: var(--muted-2);
}

.file-drop strong {
  font-size: 10.5px;
}

.file-drop span {
  color: var(--muted-2);
  font-size: 9.5px;
}

.file-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.deploy-list {
  display: flex;
  flex-direction: column;
}

.deploy-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid #edf2ed;
}

.deploy-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.deploy-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--muted-2);
}

.deploy-status-dot.success { background: var(--accent); }
.deploy-status-dot.failed { background: var(--danger); }
.deploy-status-dot.uploading { background: var(--orange); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 132, 60, 0.25); }
  50% { box-shadow: 0 0 0 4px rgba(232, 132, 60, 0.06); }
}

.deploy-copy {
  flex: 1;
  min-width: 0;
}

.deploy-copy strong {
  display: block;
  font-size: 10.5px;
}

.deploy-copy span {
  display: block;
  margin-top: 1px;
  color: var(--muted-2);
  font-size: 9px;
  line-height: 1.45;
}

.deploy-copy .err {
  color: var(--danger);
}

/* settings */
.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 16px;
  align-items: start;
}

.settings-main {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  background: var(--line);
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: var(--surface);
  font-size: 10.5px;
}

.info-row span {
  color: var(--muted);
}

.info-row strong {
  text-align: right;
  font-weight: 700;
  word-break: break-all;
}

.info-row strong.ok { color: var(--accent-dark); }
.info-row strong.miss { color: var(--orange); }

.account-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.account-box div {
  min-width: 0;
}

.account-box strong {
  display: block;
  font-size: 12px;
}

.account-box span {
  display: block;
  color: var(--muted-2);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Loading, toast
   -------------------------------------------------------------------------- */
.view-loading {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, #eaf0ea 25%, #f4f8f4 37%, #eaf0ea 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.skeleton.hero-s { height: 150px; }
.skeleton.kpi-s { height: 130px; }
.skeleton.card-s { height: 280px; }
.skeleton-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: min(360px, calc(100vw - 44px));
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-md);
  font-size: 11.5px;
  line-height: 1.5;
  pointer-events: auto;
  animation: toastIn 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.success .toast-icon { color: var(--lime); }
.toast.error { background: #8f3330; }
.toast.info { background: #2f465f; }
.toast .toast-icon { flex: 0 0 auto; margin-top: 1px; }
.toast .toast-icon svg { width: 15px; height: 15px; }

.toast.leaving {
  animation: toastOut 0.2s ease forwards;
}

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

@keyframes toastOut {
  to { opacity: 0; transform: translateY(6px); }
}

/* error panel */
.error-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 60px 20px;
  text-align: center;
}

.error-panel .danger-icon {
  margin-bottom: 5px;
}

.error-panel h3 {
  font-size: 15px;
}

.error-panel p {
  max-width: 420px;
  color: var(--muted);
  font-size: 11.5px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1280px) {
  .employee-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-layout { grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr); }
}

@media (max-width: 1120px) {
  .login-root { grid-template-columns: minmax(0, 0.95fr) minmax(400px, 1.05fr); }
  .login-visual { padding: 38px 38px 32px; }
  .login-proof { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .topbar-date { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .config-layout, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .config-aside, .settings-aside { position: static; }
  .grid-main-side, .grid-side-main { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
  :root { --sidebar-w: 250px; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 20px 0 60px rgba(8, 35, 29, 0.25);
  }
  .app-shell.nav-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: inline-grid; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: block;
    background: rgba(9, 32, 27, 0.42);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
  }
  .app-shell.nav-open .sidebar-scrim { opacity: 1; visibility: visible; }
  .main { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 13px 20px; }
  .view { padding: 20px 20px 34px; }
  .app-footer { padding: 0 20px 20px; }
  .login-root { grid-template-columns: minmax(0, 1fr); }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 30px 22px; }
}

@media (max-width: 720px) {
  .topbar-actions .btn span:not(.spinner) { display: none; }
  .topbar-actions .btn { min-width: 38px; padding: 0 10px; }
  .topbar-actions .btn svg { margin: 0; }
  .user-chip-copy, .user-chip > .icon { display: none; }
  .user-chip { padding: 3px; border: 0; background: transparent; }
  .page-head { align-items: flex-start; }
  .hero { flex-direction: column; align-items: flex-start; padding: 22px; }
  .hero-metrics { width: 100%; gap: 12px; justify-content: space-between; }
  .hero-actions { width: 100%; flex-wrap: wrap; }
  .hero-actions .btn { flex: 1; }
  .kpi-grid, .kpi-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .span-2 { grid-column: span 1; }
  .data-table { min-width: 680px; }
  .toolbar { align-items: flex-start; }
  .toolbar-left { width: 100%; }
  .search-box { flex: 1; min-width: 150px; }
  .employee-grid { grid-template-columns: minmax(0, 1fr); }
  .permission-grid { grid-template-columns: minmax(0, 1fr); }
  .donut-wrap { flex-direction: column; align-items: flex-start; }
  .donut { width: 140px; height: 140px; flex-basis: 140px; }
  .modal-layer { padding: 12px; align-items: end; }
  .modal-card { max-height: calc(100vh - 24px); border-radius: 20px 20px 14px 14px; }
  .modal-body { padding: 17px; }
  .modal-head { padding: 17px 17px 13px; }
  .modal-foot { padding: 12px 17px; }
  .calc-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-cell.wide { grid-column: span 2; }
  .pagination { flex-direction: column; align-items: stretch; }
  .pagination-btns { justify-content: center; }
  .toast-stack { right: 12px; bottom: 12px; }
  .login-heading h2 { font-size: 26px; }
}

@media (max-width: 480px) {
  .topbar { min-height: 68px; padding: 11px 14px; gap: 8px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-crumb { font-size: 9px; }
  .topbar-right { gap: 6px; }
  .view { padding: 15px 14px 30px; }
  .app-footer { padding: 0 14px 16px; }
  .kpi-grid, .kpi-grid.cols-3 { gap: 9px; }
  .kpi-card { min-height: 130px; padding: 14px; }
  .kpi-value { font-size: 20px; }
  .hero { border-radius: 16px; }
  .hero-metrics strong { font-size: 17px; }
  .card-head { padding: 15px 15px 0; }
  .card-body { padding: 15px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 15px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 15px; }
  .login-panel { padding: 24px 18px; }
  .login-version { margin-top: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
