:root {
  --ink: #17211e;
  --ink-soft: #33423d;
  --muted: #6e7a75;
  --deep: #10231f;
  --deep-2: #19342d;
  --deep-3: #24453c;
  --gold: #d8a94d;
  --gold-dark: #a97922;
  --gold-soft: #f5e8c8;
  --paper: #f3f5f1;
  --card: #ffffff;
  --line: #dde4dc;
  --line-soft: #ebefea;
  --green: #1f7a5a;
  --green-soft: #e2f2ea;
  --red: #b54545;
  --red-soft: #f8e6e4;
  --blue: #326d89;
  --blue-soft: #e5f0f5;
  --shadow: 0 18px 50px rgba(22, 39, 33, 0.09);
  --shadow-sm: 0 8px 24px rgba(22, 39, 33, 0.07);
  --radius: 18px;
  --radius-sm: 11px;
  --sidebar: 252px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Microsoft YaHei UI', 'Microsoft YaHei', 'PingFang SC', 'Noto Sans CJK SC', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 96% 4%, rgba(216, 169, 77, 0.13), transparent 26rem),
    radial-gradient(circle at 4% 88%, rgba(31, 122, 90, 0.08), transparent 30rem),
    var(--paper);
  -webkit-font-smoothing: antialiased;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: #f0b2aa !important;
}

.mono {
  font-family: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.boot-screen,
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.boot-screen {
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  background: var(--deep);
  color: #f8f4e9;
}

.boot-logo,
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px 4px 12px 4px;
  font-weight: 800;
  color: var(--deep);
  background: linear-gradient(145deg, #f0cd82, var(--gold));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.boot-logo {
  width: 58px;
  height: 58px;
  margin: 0 auto 6px;
  font-size: 22px;
  border-radius: 18px 5px 18px 5px;
}

.boot-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.boot-text {
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.boot-spinner {
  width: 26px;
  height: 26px;
  margin: 12px auto 0;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(400px, 0.65fr);
  overflow: auto;
  background: #f6f4ed;
}

.auth-art {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  overflow: hidden;
  color: #f7f2e5;
  background:
    linear-gradient(135deg, rgba(16, 35, 31, 0.98), rgba(24, 54, 46, 0.95)),
    repeating-linear-gradient(45deg, transparent 0 18px, rgba(255, 255, 255, 0.03) 18px 19px);
}

.auth-art::before {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  right: -170px;
  top: -90px;
  border: 1px solid rgba(216, 169, 77, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 0 90px rgba(216, 169, 77, 0.035), 0 0 0 180px rgba(216, 169, 77, 0.02);
}

.auth-art::after {
  content: '';
  position: absolute;
  left: 11%;
  right: 11%;
  bottom: 0;
  height: 32%;
  opacity: 0.12;
  background: linear-gradient(150deg, transparent 25%, var(--gold) 25% 27%, transparent 27% 50%, var(--gold) 50% 52%, transparent 52%);
  clip-path: polygon(0 80%, 20% 48%, 38% 64%, 60% 20%, 80% 52%, 100% 34%, 100% 100%, 0 100%);
}

.auth-art-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(760px, 86%);
  margin: 0 auto;
  padding: clamp(32px, 6vh, 72px) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.24;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.05em;
}

.brand-copy small {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.18em;
  opacity: 0.55;
}

.brand-light .brand-copy strong {
  color: #fffaf0;
}

.auth-hero {
  margin: auto 0;
  padding: 60px 0 40px;
}

.eyebrow {
  margin-bottom: 18px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--gold-dark);
}

.auth-hero h1 {
  margin-bottom: 24px;
  font-size: clamp(38px, 4.4vw, 64px);
  line-height: 1.24;
  letter-spacing: -0.04em;
}

.auth-lead {
  max-width: 590px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.63);
  font-size: 15px;
  line-height: 1.9;
}

.auth-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 26px;
}

.auth-features div {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 8px;
}

.auth-features span {
  grid-row: span 2;
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.auth-features strong {
  font-size: 13px;
}

.auth-features small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
  line-height: 1.6;
}

.auth-panel {
  display: grid;
  align-items: center;
  min-height: 100vh;
  padding: clamp(28px, 6vw, 80px);
  background:
    radial-gradient(circle at 100% 0, rgba(216, 169, 77, 0.14), transparent 24rem),
    #f7f5ef;
}

.auth-form-wrap {
  width: min(390px, 100%);
  margin: auto;
}

.auth-form-wrap h2 {
  margin-bottom: 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.auth-form-wrap > .muted {
  margin-bottom: 28px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-form .field label {
  color: var(--ink-soft);
}

.auth-form .btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 13px 18px;
}

.auth-footnote {
  margin: 24px 0 0;
  color: #8b938e;
  font-size: 11px;
  line-height: 1.7;
}

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

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  padding: 24px 18px 18px;
  color: rgba(255, 255, 255, 0.82);
  background:
    radial-gradient(circle at 100% 0, rgba(216, 169, 77, 0.12), transparent 17rem),
    linear-gradient(180deg, var(--deep), #0d1d19);
  box-shadow: 10px 0 40px rgba(10, 25, 21, 0.12);
}

.sidebar::after {
  content: '';
  position: absolute;
  inset: auto 20px 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(216, 169, 77, 0.3), transparent);
}

.sidebar-brand {
  margin: 0 8px 34px;
}

.sidebar-brand .brand-mark {
  width: 38px;
  height: 38px;
}

.main-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.nav-group-label {
  margin: 18px 12px 7px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.17em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.64);
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

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

.nav-item.active {
  color: #fff9ea;
  background: linear-gradient(90deg, rgba(216, 169, 77, 0.2), rgba(216, 169, 77, 0.06));
  box-shadow: inset 3px 0 0 var(--gold);
}

.sidebar-foot {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 16px 8px 0;
}

.side-user strong {
  display: block;
  color: #fff;
  font-size: 13px;
}

.side-user span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

.side-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}

.text-button {
  border: 0;
  padding: 0;
  color: var(--green);
  font-size: 11px;
  background: transparent;
  cursor: pointer;
}

.text-button.light {
  color: rgba(255, 255, 255, 0.48);
}

.text-button:hover {
  text-decoration: underline;
}

.main-area {
  min-height: 100vh;
  margin-left: var(--sidebar);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 15px clamp(20px, 3.5vw, 54px);
  border-bottom: 1px solid rgba(221, 228, 220, 0.8);
  background: rgba(243, 245, 241, 0.9);
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-kicker {
  margin-bottom: 1px;
  color: var(--gold-dark);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.topbar h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

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

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #d6dcd5;
  border-radius: 50%;
  color: var(--deep);
  font-size: 12px;
  font-weight: 800;
  background: linear-gradient(145deg, #fbf7ec, #ead7ad);
}

.user-meta {
  line-height: 1.25;
}

.user-meta strong {
  display: block;
  font-size: 12px;
}

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

.page-content {
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 28px clamp(18px, 3.5vw, 54px) 60px;
}

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

.page-intro h3 {
  margin-bottom: 5px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.page-intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 13px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--card);
  cursor: pointer;
  transition: 150ms ease;
}

.btn:hover {
  border-color: #bcc7be;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.btn-primary {
  border-color: var(--deep);
  color: #fffaf0;
  background: var(--deep);
}

.btn-primary:hover {
  border-color: var(--deep-3);
  background: var(--deep-3);
}

.btn-gold {
  border-color: var(--gold);
  color: #2c2108;
  background: linear-gradient(135deg, #edca7d, var(--gold));
}

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

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-danger {
  border-color: #efd2ce;
  color: var(--red);
  background: #fffafa;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 11px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}

.icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.panel {
  border: 1px solid rgba(221, 228, 220, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.panel-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.panel-body {
  padding: 22px;
}

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

.metric-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid rgba(221, 228, 220, 0.9);
  border-radius: var(--radius);
  padding: 19px 20px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.metric-card.dark {
  color: #fff8e8;
  border-color: transparent;
  background:
    radial-gradient(circle at 100% 0, rgba(216, 169, 77, 0.28), transparent 12rem),
    linear-gradient(135deg, var(--deep), var(--deep-3));
}

.metric-card::after {
  content: '';
  position: absolute;
  right: -32px;
  bottom: -45px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(216, 169, 77, 0.18);
  border-radius: 50%;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.metric-card.dark .metric-label {
  color: rgba(255, 255, 255, 0.63);
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 8px;
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.metric-card.dark .metric-icon {
  color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}

.metric-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.metric-value {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 13px;
  font-size: clamp(23px, 2.3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.1;
}

.metric-value small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
}

.metric-card.dark .metric-value small {
  color: rgba(255, 255, 255, 0.5);
}

.metric-foot {
  margin-top: 9px;
  color: var(--muted);
  font-size: 10px;
}

.metric-card.dark .metric-foot {
  color: rgba(255, 255, 255, 0.45);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.78);
}

.filter-bar .field {
  min-width: 142px;
  gap: 5px;
}

.filter-bar .field.grow {
  flex: 1 1 200px;
}

.filter-bar .btn {
  margin-left: auto;
}

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

.field label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.field label .required {
  color: var(--red);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 37px;
  border: 1px solid #d9e0d8;
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12px;
  background: #fcfdfb;
  outline: none;
  transition: 150ms ease;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(31, 122, 90, 0.1);
}

.input[readonly],
.input:disabled,
.select:disabled,
.textarea:disabled {
  color: #66716c;
  background: #f2f4f1;
  cursor: default;
}

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

.field-hint {
  color: #909b95;
  font-size: 9px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 37px;
  border: 1px solid #d9e0d8;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fcfdfb;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.checkbox-field span {
  font-size: 12px;
}

.form-error {
  border: 1px solid #efd2ce;
  border-radius: 9px;
  padding: 10px 12px;
  color: var(--red);
  font-size: 11px;
  line-height: 1.6;
  background: var(--red-soft);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #6d7973;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: #f7f9f5;
}

.data-table td {
  font-size: 11.5px;
}

.data-table tbody tr {
  transition: background 120ms ease;
}

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

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

.data-table .num {
  text-align: right;
  font-family: 'Cascadia Mono', 'SFMono-Regular', Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.data-table .money {
  font-weight: 700;
}

.data-table .positive {
  color: var(--green);
}

.data-table .negative {
  color: var(--red);
}

.data-table .center {
  text-align: center;
}

.data-table.full-fields {
  width: max-content;
  min-width: 100%;
}

.data-table.full-fields th,
.data-table.full-fields td {
  padding: 9px 10px;
}

.data-table.full-fields .sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--card);
  box-shadow: 1px 0 0 var(--line-soft);
}

.data-table.full-fields thead .sticky-col {
  z-index: 4;
  background: #f7f9f5;
}

.data-table.full-fields tbody tr:hover .sticky-col {
  background: #fbfcf9;
}

.data-table.full-fields .actions-col {
  position: sticky;
  right: 0;
  z-index: 2;
  min-width: 104px;
  background: var(--card);
  box-shadow: -1px 0 0 var(--line-soft);
}

.data-table.full-fields thead .actions-col {
  z-index: 4;
  background: #f7f9f5;
}

.data-table.full-fields tbody tr:hover .actions-col {
  background: #fbfcf9;
}

.data-table.full-fields .cell-note {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table.full-fields .cell-note span {
  display: block;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.data-table.full-fields tr.is-voided td {
  color: #98a19c;
}

.data-table.full-fields tr.is-voided .sticky-col,
.data-table.full-fields tr.is-voided .actions-col {
  background: #fbfbfb;
}

.record-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 240px;
}

.record-main strong {
  overflow: hidden;
  font-size: 11.5px;
  text-overflow: ellipsis;
}

.record-main span {
  color: var(--muted);
  font-size: 9.5px;
}

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

.link-button {
  border: 0;
  border-radius: 5px;
  padding: 4px 6px;
  color: var(--green);
  font-size: 10px;
  background: transparent;
  cursor: pointer;
}

.link-button:hover {
  background: var(--green-soft);
}

.link-button.danger {
  color: var(--red);
}

.link-button.danger:hover {
  background: var(--red-soft);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 9px;
  font-weight: 700;
  background: #eef2ed;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.badge.green {
  color: #176448;
  background: var(--green-soft);
}

.badge.red {
  color: #a33c3c;
  background: var(--red-soft);
}

.badge.gold {
  color: #8a641c;
  background: var(--gold-soft);
}

.badge.blue {
  color: #2f627b;
  background: var(--blue-soft);
}

.badge.gray {
  color: #65716b;
  background: #edf0ec;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.pagination-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 30px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: var(--gold-dark);
  background: var(--gold-soft);
}

.empty-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}

.empty-state strong {
  font-size: 14px;
}

.empty-state p {
  max-width: 380px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.loading-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
  font-size: 12px;
}

.loading-state::before {
  content: '';
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border: 2px solid #dfe6de;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 22px;
  background: rgba(12, 26, 22, 0.58);
  backdrop-filter: blur(4px);
  animation: fade-in 150ms ease;
}

@keyframes fade-in {
  from { opacity: 0; }
}

.modal {
  width: min(540px, 100%);
  max-height: calc(100vh - 44px);
  overflow: auto;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 35px 90px rgba(9, 24, 20, 0.3);
  animation: modal-in 180ms ease;
}

.modal.modal-wide {
  width: min(1120px, 100%);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line-soft);
  padding: 21px 24px 18px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.modal-head h3 {
  margin-bottom: 3px;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.modal-close svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.modal-body {
  padding: 22px 24px;
}

.modal-foot {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.modal-foot .form-error {
  margin-right: auto;
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  padding: 11px 13px;
  color: #fff;
  font-size: 11px;
  line-height: 1.55;
  background: rgba(16, 35, 31, 0.96);
  box-shadow: 0 18px 45px rgba(9, 25, 20, 0.25);
  animation: toast-in 180ms ease;
}

.toast.error {
  background: rgba(126, 43, 43, 0.97);
}

.toast.success {
  background: rgba(22, 96, 70, 0.97);
}

.toast::before {
  content: '';
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--gold);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.noscript {
  position: fixed;
  z-index: 500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  color: #fff;
  background: var(--deep);
}

.mobile-only {
  display: none;
}

.nav-overlay {
  display: none;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth-screen {
    grid-template-columns: minmax(0, 1fr) minmax(370px, 0.8fr);
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar: 272px;
  }
  .sidebar {
    transform: translateX(-104%);
    transition: transform 220ms ease;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .nav-overlay.open {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    background: rgba(8, 20, 16, 0.42);
    backdrop-filter: blur(2px);
  }
  .main-area {
    margin-left: 0;
  }
  .mobile-only {
    display: inline-grid;
  }
  .topbar {
    min-height: 72px;
  }
  .auth-screen {
    display: block;
    background: #f7f5ef;
  }
  .auth-art {
    min-height: auto;
    padding: 30px 0 50px;
  }
  .auth-art-inner {
    width: min(680px, 88%);
    padding: 0;
  }
  .auth-hero {
    padding: 48px 0 30px;
  }
  .auth-hero h1 {
    font-size: clamp(33px, 8vw, 48px);
  }
  .auth-panel {
    min-height: auto;
    padding: 48px 24px 70px;
  }
  .auth-form-wrap {
    width: min(440px, 100%);
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: center;
    padding: 12px 16px;
  }
  .topbar-right {
    gap: 8px;
  }
  .user-meta,
  .topbar .page-actions .btn span {
    display: none;
  }
  .user-chip {
    border-left: 0;
    padding-left: 0;
  }
  .page-content {
    padding: 20px 14px 44px;
  }
  .page-intro {
    align-items: flex-start;
    flex-direction: column;
  }
  .metric-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .metric-card {
    min-height: 116px;
  }
  .filter-bar .btn {
    margin-left: 0;
  }
  .auth-features {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  .auth-features div {
    grid-template-columns: 26px 1fr;
  }
  .panel-head,
  .panel-body {
    padding: 16px;
  }
  .modal-backdrop {
    align-items: end;
    padding: 0;
  }
  .modal,
  .modal.modal-wide {
    width: 100%;
    max-height: 94vh;
    border-radius: 18px 18px 0 0;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .toast-root {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
  .data-table th,
  .data-table td {
    padding: 10px 11px;
  }
}

@media print {
  .sidebar,
  .topbar,
  .filter-bar,
  .page-intro-actions,
  .table-actions,
  .page-actions,
  .toast-root,
  .pagination {
    display: none !important;
  }
  .main-area {
    margin: 0;
  }
  .page-content {
    width: 100%;
    padding: 0;
  }
  body {
    background: #fff;
  }
  .panel,
  .table-wrap,
  .metric-card {
    border-color: #bbb;
    box-shadow: none;
  }
  .data-table {
    min-width: 0;
    font-size: 8px;
  }
}
