:root {
  color-scheme: light;
  --nav: #17362f;
  --nav-2: #214b43;
  --nav-line: rgba(220, 188, 118, 0.22);
  --page: #f7f3ea;
  --paper: #fffaf0;
  --paper-2: #f3eadb;
  --line: #e2d8c6;
  --line-strong: #cabda8;
  --ink: #171717;
  --text: #2e3134;
  --muted: #7d766c;
  --gold: #c88a2d;
  --gold-2: #efb24a;
  --green: #27845d;
  --green-soft: #e4f3ea;
  --blue: #1d5577;
  --blue-soft: #e5eef3;
  --red: #b64f3f;
  --red-soft: #f7e5df;
  --shadow: 0 18px 48px rgba(38, 32, 22, 0.11);
}

* { box-sizing: border-box; }

html {
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 0%, rgba(239, 178, 74, 0.24), transparent 30%),
    radial-gradient(circle at 18% 8%, rgba(200, 138, 45, 0.12), transparent 26%),
    var(--page);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

.system-state {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 32px;
  color: var(--text);
  text-align: center;
}

.system-state-mark {
  width: 82px;
  height: 62px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid rgba(202, 189, 168, 0.72);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: 0 14px 32px rgba(38, 32, 22, 0.12);
}

.system-state-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.system-state .error-mark {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  color: #fff8e9;
  background: var(--red);
  font-weight: 900;
}

.system-state strong {
  color: var(--ink);
  font-size: 20px;
}

.system-state span {
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.7;
}

.icp-link {
  color: rgba(237, 243, 238, 0.58);
  font-size: 12px;
  text-decoration: none;
  transition: color 0.18s ease;
}

.icp-link:hover {
  color: var(--gold-2);
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button, input, select, textarea {
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(183, 130, 47, 0.26);
  outline-offset: 2px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.92fr) minmax(430px, 1.08fr);
  background:
    radial-gradient(circle at 18% 18%, rgba(239, 178, 74, 0.38), transparent 30%),
    radial-gradient(circle at 34% 72%, rgba(200, 138, 45, 0.2), transparent 28%),
    linear-gradient(112deg, #17362f 0%, #214b43 45%, rgba(33, 75, 67, 0.88) 45.1%, rgba(247, 243, 234, 0.92) 45.2%),
    var(--page);
}

.login-hero {
  min-height: 100vh;
  padding: 68px 58px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #f9f3e7;
}

.brand-mark {
  width: 58px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(220, 188, 118, 0.5);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 16px 34px rgba(0,0,0,0.22), 0 12px 24px rgba(200, 138, 45, 0.18);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-lockup {
  width: min(360px, 100%);
  padding: 12px 14px;
  border: 1px solid rgba(220, 188, 118, 0.42);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88), 0 20px 44px rgba(0,0,0,0.2), 0 16px 34px rgba(200, 138, 45, 0.18);
}

.brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
}

.login-hero h1 {
  max-width: 560px;
  margin: 46px 0 20px;
  font-size: clamp(42px, 5vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.login-hero p {
  max-width: 540px;
  margin: 0;
  color: rgba(249, 243, 231, 0.72);
  line-height: 1.85;
  font-size: 16px;
}

.login-meta {
  display: grid;
  gap: 12px;
  max-width: 560px;
  color: rgba(249, 243, 231, 0.68);
  font-size: 13px;
}

.login-meta span {
  padding-top: 12px;
  border-top: 1px solid rgba(220, 188, 118, 0.18);
}

.login-panel {
  display: grid;
  place-items: center;
  padding: 44px;
}

.login-card {
  width: min(100%, 430px);
  padding: 34px;
  border: 1px solid rgba(202, 189, 168, 0.72);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card h2 {
  margin: 0 0 22px;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select,
.field textarea,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fffdf7;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: rgba(183, 130, 47, 0.8);
  box-shadow: 0 0 0 4px rgba(183, 130, 47, 0.12);
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 40px;
  border-radius: 6px;
  padding: 10px 15px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button {
  border: 1px solid #082136;
  color: #fff8e9;
  background: linear-gradient(180deg, #12324a, #071d31);
  box-shadow: 0 8px 18px rgba(7, 29, 49, 0.18);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(7, 29, 49, 0.22);
}

.secondary-button {
  color: #21313d;
  background: #fffaf0;
  border: 1px solid var(--line-strong);
}

.secondary-button:hover {
  border-color: var(--gold);
  color: #0c1a25;
  box-shadow: 0 8px 18px rgba(183, 130, 47, 0.12);
}

.danger-button {
  border: 1px solid rgba(182, 79, 63, 0.35);
  color: #fff;
  background: linear-gradient(180deg, #c25e4b, #923929);
}

.ghost-button {
  border: 1px solid transparent;
  color: var(--blue);
  background: transparent;
}

.ghost-button:hover {
  color: var(--ink);
  background: rgba(29, 85, 119, 0.08);
}

.table-link {
  min-height: 32px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(29, 85, 119, 0.16);
  border-radius: 6px;
  padding: 6px 9px;
  color: var(--blue);
  background: rgba(29, 85, 119, 0.06);
  font: inherit;
  font-weight: 900;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

.table-link:hover {
  color: var(--ink);
  border-color: rgba(183, 130, 47, 0.42);
  background: rgba(183, 130, 47, 0.12);
}

.link-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.amount-link {
  justify-content: flex-end;
  min-width: 112px;
}

.wide { width: 100%; }
.error { margin: 6px 0 14px; color: var(--red); }
.muted { color: var(--muted); }

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

.shell.nav-collapsed {
  grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 22px 18px;
  color: #edf3ee;
  background:
    radial-gradient(circle at 18% 4%, rgba(239, 178, 74, 0.42), transparent 34%),
    radial-gradient(circle at 86% 38%, rgba(200, 138, 45, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.1), transparent 34%),
    linear-gradient(160deg, var(--nav), var(--nav-2) 58%, #142f31);
  border-right: 1px solid rgba(239, 178, 74, 0.28);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.08), 18px 0 44px rgba(200, 138, 45, 0.08);
}

.sidebar-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(239, 178, 74, 0.34);
}

.nav-toggle {
  margin-left: auto;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 178, 74, 0.42);
  border-radius: 999px;
  color: rgba(255, 248, 232, 0.78);
  background:
    linear-gradient(145deg, rgba(239, 178, 74, 0.2), rgba(255, 255, 255, 0.04)),
    rgba(9, 26, 34, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.nav-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateX(2px) rotate(-45deg);
}

.nav-toggle:hover {
  color: #fff8e8;
  border-color: rgba(220, 188, 118, 0.5);
  background:
    linear-gradient(145deg, rgba(216, 164, 78, 0.22), rgba(255, 255, 255, 0.05)),
    rgba(9, 26, 34, 0.52);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.nav-toggle:focus-visible {
  outline: 2px solid rgba(216, 164, 78, 0.62);
  outline-offset: 3px;
}

.sidebar-head strong {
  display: block;
  color: #fff7e7;
  font-size: 15px;
  line-height: 1.35;
}

.sidebar-head small {
  color: rgba(237, 243, 238, 0.55);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar nav button {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 12px 13px;
  color: rgba(237, 243, 238, 0.72);
  background: transparent;
  text-align: left;
}

.sidebar nav button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar nav button::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 11px;
  border-radius: 999px;
  background: rgba(239, 178, 74, 0.52);
  box-shadow: 0 0 14px rgba(239, 178, 74, 0.24);
}

.sidebar nav button.active,
.sidebar nav button:hover {
  color: #fff9eb;
  border-color: rgba(239, 178, 74, 0.42);
  background:
    radial-gradient(circle at 12% 50%, rgba(255, 226, 155, 0.22), transparent 36%),
    linear-gradient(90deg, rgba(200, 138, 45, 0.96), rgba(183, 130, 47, 0.52));
  box-shadow: 0 10px 22px rgba(200, 138, 45, 0.18);
}

.sidebar nav button.active::after {
  content: "";
  position: absolute;
  top: 9px;
  right: -19px;
  bottom: 9px;
  width: 3px;
  border-radius: 999px;
  background: #efb24a;
  box-shadow: 0 0 18px rgba(239, 178, 74, 0.44);
}

.sidebar-footer {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(239, 178, 74, 0.3);
}

.sidebar-footer strong {
  color: #fff8e8;
}

.sidebar-footer small {
  color: rgba(237, 243, 238, 0.58);
}

.sidebar-footer .icp-link {
  display: inline-block;
}

.nav-collapsed .sidebar {
  padding: 20px 12px;
}

.nav-collapsed .sidebar-head {
  align-items: center;
  flex-direction: column;
  gap: 10px;
}

.nav-collapsed .sidebar-head > div:not(.brand-mark),
.nav-collapsed .sidebar nav button span,
.nav-collapsed .sidebar-footer > div {
  display: none;
}

.nav-collapsed .brand-mark {
  width: 44px;
  height: 44px;
}

.nav-collapsed .nav-toggle {
  width: 40px;
  height: 40px;
  margin-left: 0;
  background:
    linear-gradient(145deg, rgba(216, 164, 78, 0.2), rgba(255, 255, 255, 0.04)),
    rgba(9, 26, 34, 0.42);
}

.nav-collapsed .nav-toggle::before {
  transform: translateX(-2px) rotate(135deg);
}

.nav-collapsed .sidebar nav button {
  justify-content: center;
  min-height: 44px;
  padding: 12px 0;
}

.nav-collapsed .sidebar nav button::before {
  margin-right: 0;
}

.nav-collapsed .sidebar nav button.active::after {
  right: -13px;
}

.nav-collapsed .sidebar-footer {
  width: 100%;
}

.nav-collapsed .logout-button {
  padding: 10px 0;
  font-size: 0;
}

.nav-collapsed .logout-button::before {
  content: "出";
  font-size: 13px;
}

.workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: 74px minmax(0, 1fr);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 243, 234, 0.9);
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-title strong {
  color: var(--ink);
  font-size: 18px;
}

.topbar-title span {
  color: var(--muted);
  font-size: 13px;
}

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

.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sync-indicator::before {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  content: "";
}

.sync-indicator.saving::before {
  background: var(--gold);
  animation: sync-pulse 1s ease-in-out infinite;
}

.sync-indicator.error {
  color: var(--red);
}

.sync-indicator.error::before {
  background: var(--red);
}

@keyframes sync-pulse {
  50% { opacity: 0.35; }
}

.company-chip,
.user-chip {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  background: rgba(255, 250, 240, 0.78);
}

.user-chip {
  color: var(--nav);
  font-weight: 800;
}

.content {
  min-width: 0;
  padding: 28px 30px 54px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.page-header h1 {
  margin: 4px 0 7px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}

.page-header p {
  margin: 0;
}

.eyebrow {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 0;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.compact-cards {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.card {
  min-height: 120px;
  position: relative;
  padding: 20px 22px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,250,240,0.4));
}

.card:last-child {
  border-right: 0;
}

.card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 14px;
}

.card strong {
  color: var(--ink);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.1;
}

.card small {
  display: block;
  margin-top: 13px;
  color: var(--green);
  font-weight: 800;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.88);
  box-shadow: 0 12px 34px rgba(38, 32, 22, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  gap: 16px;
}

.panel-head,
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 234, 219, 0.42);
}

.panel-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-bar {
  justify-content: flex-start;
  flex-wrap: wrap;
  background: rgba(255, 250, 240, 0.62);
}

.filter-bar input,
.filter-bar select {
  width: min(100%, 220px);
}

.filter-bar input {
  width: min(100%, 340px);
}

.table-wrap {
  overflow: auto;
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.72);
}

.pagination-summary {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pagination-controls label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pagination-controls select {
  width: 96px;
}

.pagination-controls input {
  width: 82px;
}

.pagination-controls .ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  color: #5f5b53;
  background: rgba(246, 240, 229, 0.84);
  white-space: nowrap;
  font-weight: 900;
}

td {
  color: var(--text);
}

tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

tbody tr:hover {
  background: rgba(183, 130, 47, 0.07);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 5px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.status.done {
  color: #146441;
  background: var(--green-soft);
  border: 1px solid rgba(39, 132, 93, 0.18);
}

.status.pending {
  color: #8b5b13;
  background: #faedd6;
  border: 1px solid rgba(183, 130, 47, 0.22);
}

.status.warn {
  color: #9a3e30;
  background: var(--red-soft);
  border: 1px solid rgba(182, 79, 63, 0.18);
}

.status.wait {
  color: #18536e;
  background: var(--blue-soft);
  border: 1px solid rgba(29, 85, 119, 0.18);
}

.notice {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(183, 130, 47, 0.08), transparent),
    rgba(255, 250, 240, 0.7);
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
}

.activity-list {
  display: grid;
  gap: 0;
  padding: 4px 18px 18px;
}

.activity-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(183, 130, 47, 0.13);
}

.activity-item strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 4px;
}

.activity-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 26, 37, 0.54);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(960px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(202, 189, 168, 0.86);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(12, 26, 37, 0.32);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 234, 219, 0.58);
}

.modal-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: 20px;
}

.modal-body {
  padding: 20px;
}

.password-form {
  width: min(420px, 100%);
  margin: 0 auto;
}

.writeoff-receipt-picker {
  flex: 1 1 420px;
  max-width: 620px;
  margin-bottom: 0;
}

.writeoff-receipt-row {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
}

.writeoff-context {
  margin-bottom: 14px;
}

.writeoff-filter {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-bottom: 0;
}

.writeoff-filter input {
  width: min(100%, 520px);
}

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

.detail-item {
  min-height: 74px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.7);
}

.detail-item span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-item strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.detail-section {
  margin-top: 16px;
}

.detail-section h3 {
  margin: 0;
  padding: 0 0 12px;
  color: var(--ink);
  font-size: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }

.file-input {
  position: relative;
  overflow: hidden;
}

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

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

@media (max-width: 1180px) {
  .shell { grid-template-columns: 210px minmax(0, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .card { border-bottom: 1px solid var(--line); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 780px) {
  .login-page,
  .shell,
  .shell.nav-collapsed {
    grid-template-columns: 1fr;
  }

  .login-page {
    background: var(--page);
  }

  .login-hero {
    min-height: 360px;
    padding: 34px 24px;
    background: linear-gradient(160deg, var(--nav), var(--nav-2));
  }

  .login-hero h1 {
    font-size: 36px;
  }

  .login-panel {
    padding: 22px;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-collapsed .sidebar {
    padding: 14px 16px;
  }

  .nav-collapsed .sidebar-head {
    align-items: center;
    flex-direction: row;
    gap: 12px;
    margin: 0;
    padding: 0;
    border-bottom: 0;
  }

  .nav-collapsed .sidebar-head > div:not(.brand-mark) {
    display: block;
  }

  .nav-collapsed .brand-mark {
    width: 44px;
    height: 44px;
  }

  .nav-collapsed .nav-toggle {
    width: 36px;
    height: 36px;
    margin-left: auto;
  }

  .nav-collapsed .sidebar nav,
  .nav-collapsed .sidebar-footer {
    display: none;
  }

  .sidebar-footer {
    position: static;
    margin-top: 18px;
  }

  .workspace {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 16px;
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .content {
    padding: 22px 16px 42px;
  }

  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar > * {
    flex: 1 1 100%;
  }

  .filter-bar input,
  .filter-bar select {
    width: 100%;
  }

  .pagination-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .cards,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .card {
    border-right: 0;
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }
}
