:root {
  color-scheme: light;
  --ink: #151918;
  --muted: #68716e;
  --soft: #f5f7f6;
  --surface: #ffffff;
  --line: #dfe6e3;
  --charcoal: #13201d;
  --charcoal-2: #1d2b28;
  --teal: #3f9d87;
  --teal-dark: #267662;
  --gold: #f0b34e;
  --coral: #d45b42;
  --violet: #7467bc;
  --shadow: 0 18px 45px rgba(19, 32, 29, 0.13);
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
}

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

button {
  border: 0;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(520px, 1.18fr) minmax(420px, 0.82fr);
  background:
    radial-gradient(circle at 22% 26%, rgba(124, 228, 196, 0.16), transparent 30%),
    linear-gradient(118deg, #07100e 0%, #10231f 52%, #eef4f1 52.2%, #ffffff 100%);
  overflow: hidden;
}

.brand-stage {
  min-height: 100vh;
  padding: clamp(32px, 6vw, 72px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5fffa;
  position: relative;
  background:
    linear-gradient(135deg, rgba(124, 228, 196, 0.08), transparent 38%),
    repeating-linear-gradient(90deg, rgba(216, 255, 242, 0.05) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(216, 255, 242, 0.04) 0 1px, transparent 1px 64px);
}

.brand-stage::before {
  content: "";
  position: absolute;
  inset: 10% 7% 10% 12%;
  border: 1px solid rgba(216, 255, 242, 0.08);
  background:
    linear-gradient(90deg, transparent, rgba(124, 228, 196, 0.16), transparent),
    radial-gradient(circle at 72% 38%, rgba(240, 179, 78, 0.16), transparent 22%);
  clip-path: polygon(0 0, 72% 0, 100% 30%, 100% 100%, 20% 100%, 0 80%);
  pointer-events: none;
}

.brand-stage::after {
  content: "";
  position: absolute;
  width: 46vw;
  max-width: 760px;
  aspect-ratio: 1;
  left: 12%;
  bottom: -28%;
  border: 1px solid rgba(124, 228, 196, 0.13);
  border-radius: 50%;
  box-shadow: inset 0 0 80px rgba(124, 228, 196, 0.08);
  pointer-events: none;
}

.brand-lockup {
  width: min(620px, 100%);
  position: relative;
  z-index: 1;
}

.brand-logo-large {
  width: clamp(58px, 6vw, 86px);
  height: clamp(58px, 6vw, 86px);
  border-radius: 18px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.34);
}

.brand-mark-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark-row span {
  color: rgba(245, 255, 250, 0.72);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand-kicker {
  margin: 42px 0 0;
  color: #f0b34e;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.brand-title {
  margin: 14px 0 0;
  font-size: clamp(58px, 7.5vw, 108px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: 0;
  color: #f5fffa;
  text-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.brand-subtitle {
  margin: 18px 0 0;
  color: rgba(245, 255, 250, 0.74);
  font-size: clamp(18px, 1.8vw, 24px);
  font-weight: 800;
}

.command-visual {
  margin-top: 44px;
  width: min(560px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 18px;
  align-items: stretch;
}

.signal-board,
.status-stack {
  border: 1px solid rgba(216, 255, 242, 0.12);
  background: rgba(7, 16, 14, 0.62);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  border-radius: 8px;
}

.signal-board {
  min-height: 112px;
  padding: 20px;
  display: grid;
  align-content: end;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.signal-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(108deg, transparent 0 42%, rgba(124, 228, 196, 0.16) 43% 48%, transparent 49% 100%);
}

.signal-board span {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7ce4c4, rgba(124, 228, 196, 0.08));
}

.signal-board span:nth-child(1) {
  width: 72%;
}

.signal-board span:nth-child(2) {
  width: 46%;
  background: linear-gradient(90deg, #f0b34e, rgba(240, 179, 78, 0.08));
}

.signal-board span:nth-child(3) {
  width: 86%;
}

.signal-board strong {
  position: absolute;
  top: 18px;
  right: 20px;
  color: #7ce4c4;
  font-size: 12px;
  letter-spacing: 0.16em;
}

.flow-lines {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.flow-lines i {
  height: 1px;
  background: linear-gradient(90deg, rgba(124, 228, 196, 0.75), rgba(240, 179, 78, 0.42), transparent);
}

.flow-lines i:nth-child(2) {
  width: 74%;
}

.flow-lines i:nth-child(3) {
  width: 48%;
}

.status-stack {
  padding: 16px;
  display: grid;
  gap: 10px;
}

.status-stack b {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24px;
  color: rgba(245, 255, 250, 0.82);
  font-size: 12px;
  letter-spacing: 0.1em;
}

.status-stack b::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #7ce4c4;
  box-shadow: 0 0 16px rgba(124, 228, 196, 0.65);
}

.login-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 5vw, 64px);
  background:
    radial-gradient(circle at 30% 22%, rgba(240, 179, 78, 0.14), transparent 26%),
    radial-gradient(circle at 74% 72%, rgba(63, 157, 135, 0.14), transparent 28%);
}

.login-card {
  width: min(430px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(223, 230, 227, 0.86);
  border-radius: var(--radius);
  box-shadow: 0 30px 90px rgba(19, 32, 29, 0.18);
  padding: 34px;
  backdrop-filter: blur(16px);
}

.login-card-head {
  margin-bottom: 24px;
}

.login-card-head span {
  display: block;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.login-card h1 {
  margin: 7px 0 0;
  font-size: 34px;
  letter-spacing: 0;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label,
.field-label {
  color: #39433f;
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea,
.table-input,
.table-select,
.admin-input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  color: var(--ink);
  padding: 8px 9px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.table-input:focus,
.table-select:focus,
.admin-input:focus {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(63, 157, 135, 0.14);
}

.login-button,
.primary-button,
.ghost-button,
.icon-button {
  min-height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.mini-action-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #24302c;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
  margin: 0 4px 6px 0;
}

.mini-action-button:hover {
  background: #eef6f3;
  border-color: var(--teal);
}

.login-button,
.primary-button {
  background: var(--charcoal);
  color: #fff;
  padding: 0 12px;
  font-weight: 800;
  font-size: 13px;
}

.login-button {
  width: 100%;
  margin-top: 8px;
  min-height: 46px;
  font-weight: 900;
}

.ghost-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #24302c;
  padding: 0 12px;
  font-weight: 700;
}

.icon-button {
  width: 38px;
  min-width: 38px;
  padding: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: #24302c;
  font-size: 18px;
  font-weight: 900;
}

.login-button:hover,
.primary-button:hover,
.ghost-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.login-button:hover,
.primary-button:hover {
  background: #20342f;
}

.danger-button {
  color: #a43d2b;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.login-error {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--coral);
  font-weight: 700;
  font-size: 13px;
}

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

.sidebar {
  background: var(--charcoal);
  color: #f7fbf8;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 4px 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.sidebar-brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
}

.sidebar-brand strong {
  display: block;
  font-size: 20px;
  letter-spacing: 0;
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.64);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  text-align: left;
}

.nav-button:hover,
.nav-button.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 var(--gold);
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.sidebar-user {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding-top: 14px;
  display: grid;
  gap: 10px;
}

.user-name {
  font-weight: 800;
}

.user-role {
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.main-area {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 28px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(12px);
}

.topbar h2 {
  margin: 0;
  font-size: clamp(22px, 3vw, 32px);
  letter-spacing: 0;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.save-status {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef6f3;
  color: var(--teal-dark);
  font-weight: 800;
}

.module-content {
  padding: 16px 20px 32px;
  display: grid;
  gap: 12px;
}

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

.kpi-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 13px;
  min-height: 92px;
  display: grid;
  align-content: space-between;
}

.kpi-card span {
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
}

.kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(21px, 3vw, 30px);
  line-height: 1;
  letter-spacing: 0;
}

.kpi-card small {
  margin-top: 7px;
  font-size: 12px;
  color: var(--muted);
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.department-tabs {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px;
}

.tab-button {
  min-height: 32px;
  border-radius: 6px;
  background: transparent;
  color: #39433f;
  padding: 0 11px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 800;
}

.tab-button:hover,
.tab-button.active {
  background: var(--charcoal);
  color: #ffffff;
}

.tool-panel,
.chart-panel,
.user-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-panel,
.chart-panel {
  overflow: hidden;
}

.tool-panel {
  border-left: 5px solid var(--panel-accent, var(--teal));
  box-shadow: 0 10px 26px rgba(19, 32, 29, 0.05);
}

.accent-0 {
  --panel-accent: #3f9d87;
  --panel-soft: #edf7f4;
  --panel-row: #f7fcfa;
}

.accent-1 {
  --panel-accent: #d45b42;
  --panel-soft: #fff1ee;
  --panel-row: #fff9f7;
}

.accent-2 {
  --panel-accent: #7467bc;
  --panel-soft: #f1effb;
  --panel-row: #faf9ff;
}

.accent-3 {
  --panel-accent: #f0b34e;
  --panel-soft: #fff6e5;
  --panel-row: #fffaf0;
}

.accent-4 {
  --panel-accent: #2f6f9f;
  --panel-soft: #edf5fb;
  --panel-row: #f7fbfe;
}

.accent-5 {
  --panel-accent: #8a6f46;
  --panel-soft: #f5f1e9;
  --panel-row: #fcfaf6;
}

.panel-titlebar {
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft, #fbfcfb);
}

.panel-titlebar h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.panel-titlebar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.table-filter-nav {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.table-filter-nav span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.table-wrap {
  width: 100%;
  overflow: auto;
}

.data-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 6px;
  vertical-align: top;
}

.data-table th {
  text-align: left;
  color: #3c4743;
  font-size: 12px;
  background: color-mix(in srgb, var(--panel-soft, #f7f9f8) 76%, #ffffff);
  white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
  background: var(--panel-row, #fbfcfb);
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--panel-soft, #fbfcfb) 62%, #ffffff);
}

.data-table tbody tr.low-stock-row {
  background: #fff1ee;
}

.data-table tbody tr.low-stock-row td {
  border-bottom-color: #f1b5a8;
}

.data-table tbody tr.low-stock-row td:nth-child(4) .table-input {
  border-color: var(--coral);
  background: #fff7f5;
  color: #b54834;
  font-weight: 900;
}

.table-input,
.table-select {
  min-height: 30px;
  padding: 6px 7px;
  font-size: 12px;
}

textarea.table-input {
  resize: vertical;
  min-height: 30px;
  line-height: 1.32;
}

.empty-row td {
  padding: 22px 16px;
  color: var(--muted);
  text-align: center;
}

.chart-panel {
  display: grid;
  gap: 0;
}

.chart-header {
  min-height: 60px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.chart-header h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.chart-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chart-tools select,
.range-select,
.filter-input {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
}

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

.month-input {
  width: 180px;
}

.canvas-wrap {
  height: 320px;
  padding: 16px;
}

#operationChart {
  width: 100%;
  height: 100%;
  display: block;
}

.legend {
  padding: 0 16px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.metric-toggle {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.metric-toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--teal);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-scroll {
  display: grid;
  grid-template-columns: auto minmax(160px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 16px 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-scroll input {
  width: 100%;
  accent-color: var(--teal);
}

.mini-list {
  padding: 12px 16px 16px;
  display: grid;
  gap: 10px;
}

.mini-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

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

.mini-row strong,
.mini-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

.alert-list {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.alert-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: #fffaf0;
  padding: 10px;
}

.alert-row.hot {
  border-left-color: var(--coral);
  background: #fff6f3;
}

.alert-row strong,
.alert-row span,
.alert-row p {
  min-width: 0;
  overflow-wrap: anywhere;
}

.alert-row span {
  color: var(--muted);
  font-weight: 700;
}

.alert-row em {
  font-style: normal;
  border-radius: 999px;
  background: #fff4df;
  color: #a66d12;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.alert-row.hot em {
  background: #fdece8;
  color: #b54834;
}

.alert-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: #39433f;
}

.status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0 9px;
  background: #eef6f3;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.warn {
  background: #fff4df;
  color: #a66d12;
}

.status-pill.hot {
  background: #fdece8;
  color: #b54834;
}

.admin-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}

.admin-actions strong {
  font-size: 15px;
}

.compact-kpi {
  padding: 14px;
}

.compact-kpi .kpi-card {
  min-height: 96px;
}

.plan-strip {
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.plan-strip strong {
  display: block;
  font-size: 17px;
}

.plan-strip span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-strip-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.all-plan-board {
  border-left: 5px solid var(--violet);
}

.brush-plan-board {
  border-left: 5px solid var(--coral);
}

.plan-filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.all-plan-list {
  max-height: 460px;
  overflow: auto;
}

.plan-board {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.today-board {
  border-left: 5px solid var(--teal);
}

.yesterday-board {
  border-left: 5px solid var(--gold);
}

.plan-board-head {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.plan-board-head h3 {
  margin: 0;
  font-size: 17px;
}

.plan-board-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.plan-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 9px;
}

.plan-card.can-complete {
  grid-template-columns: auto minmax(0, 1fr);
}

.plan-card.complete .plan-card-body {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.plan-checkbox {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.plan-checkbox input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.plan-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.plan-card-meta strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.plan-card p {
  margin: 8px 0;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.plan-remark {
  color: var(--muted);
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
}

.brush-linked,
.brush-plan-text {
  border-color: rgba(212, 91, 66, 0.26);
  background: #fff8f5;
}

.brush-linked {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.brush-plan-text {
  margin-top: 7px;
  padding: 8px;
  border: 1px solid rgba(212, 91, 66, 0.26);
  border-radius: 6px;
  color: var(--ink);
}

.brush-amount-line {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #fff4df;
  color: #8d5b0c;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.plan-reason {
  margin: 10px 0;
}

.plan-card small {
  color: var(--muted);
  font-weight: 700;
}

.plan-delete {
  width: max-content;
  margin-top: 10px;
}

.plan-empty {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  font-weight: 700;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(19, 32, 29, 0.38);
}

.modal-panel {
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-head,
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.modal-head {
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modal-body {
  padding: 16px;
}

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

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

.modal-body textarea {
  resize: vertical;
}

.modal-foot {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #fbfcfb;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  align-items: start;
  gap: 10px;
}

.single-option-grid {
  grid-template-columns: minmax(0, 1fr);
}

.single-option-grid .option-card {
  max-width: none;
}

.single-option-grid .option-list {
  max-height: 560px;
}

.option-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: grid;
  align-content: start;
  align-self: start;
  gap: 9px;
}

.option-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.option-card h3 {
  margin: 0;
  font-size: 15px;
}

.option-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.option-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.option-list {
  display: grid;
  gap: 5px;
  max-height: 390px;
  overflow: auto;
  padding-right: 2px;
}

.option-row {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  padding: 4px 5px 4px 8px;
}

.option-row span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.user-list {
  display: grid;
  gap: 10px;
}

.backup-panel {
  margin-top: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: var(--radius);
  overflow: hidden;
}

.backup-head {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.backup-head strong {
  font-size: 17px;
}

.backup-error {
  margin: 12px 14px 0;
  border: 1px solid rgba(212, 91, 66, 0.28);
  border-radius: 6px;
  background: #fff8f5;
  color: var(--coral);
  padding: 10px 12px;
  font-weight: 800;
}

.backup-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.backup-row {
  min-height: 62px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 10px 12px;
}

.backup-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.change-log-panel {
  border-left-color: var(--violet);
}

.change-log-row {
  grid-template-columns: minmax(0, 1fr) minmax(220px, auto);
}

.log-detail {
  justify-self: end;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

.user-card {
  padding: 10px;
  display: grid;
  gap: 10px;
}

.user-card-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e7f3ef;
  color: var(--teal-dark);
  font-weight: 900;
}

.user-card h3 {
  margin: 0;
  font-size: 15px;
}

.user-card p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 7px;
}

.permission-picker {
  position: relative;
  display: grid;
  gap: 6px;
}

.permission-picker-head {
  min-height: 38px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  padding: 6px 8px;
}

.permission-picker-head strong {
  display: block;
  font-size: 12px;
}

.permission-picker-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-dropdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  padding: 8px;
  box-shadow: 0 12px 28px rgba(19, 32, 29, 0.12);
}

.permission-check-item {
  min-height: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfb;
  padding: 0 8px;
  color: #39433f;
  font-size: 12px;
  font-weight: 800;
}

.permission-check-item.checked {
  border-color: rgba(63, 157, 135, 0.38);
  background: #edf7f4;
  color: var(--teal-dark);
}

.permission-check-item input {
  width: 15px;
  height: 15px;
  accent-color: var(--teal);
}

.no-access {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .overview-grid,
  .account-grid {
    grid-template-columns: 1fr 1fr;
  }

  .permission-dropdown {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 860px) {
  .login-screen,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .login-screen {
    background: #f4f7f5;
    overflow: auto;
  }

  .brand-stage {
    min-height: 46vh;
    padding: 28px;
    justify-content: flex-start;
  }

  .login-panel {
    min-height: auto;
    padding: 22px;
    align-items: flex-start;
  }

  .command-visual {
    margin-top: 24px;
    grid-template-columns: 1fr;
  }

  .status-stack {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .module-content {
    padding: 18px 14px 30px;
  }

  .panel-titlebar,
  .chart-header,
  .admin-actions,
  .plan-strip,
  .plan-board-head,
  .backup-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .plan-workspace {
    grid-template-columns: 1fr;
  }

  .plan-filter-bar {
    justify-content: flex-start;
  }

  .alert-row {
    grid-template-columns: 1fr;
  }

  .backup-row {
    grid-template-columns: 1fr;
  }

  .log-detail {
    justify-self: start;
    text-align: left;
  }

  .alert-row p {
    grid-column: auto;
  }
}

@media (max-width: 620px) {
  .kpi-grid,
  .overview-grid,
  .account-grid,
  .option-grid,
  .nav-list {
    grid-template-columns: 1fr;
  }

  .permission-picker-head,
  .permission-dropdown {
    grid-template-columns: 1fr;
  }

  .brand-title {
    font-size: clamp(44px, 16vw, 68px);
  }

  .brand-kicker {
    margin-top: 26px;
    font-size: 11px;
  }

  .brand-subtitle {
    font-size: 17px;
  }

  .brand-mark-row {
    gap: 12px;
  }

  .brand-mark-row span {
    font-size: 11px;
  }

  .brand-logo-large {
    width: 56px;
    height: 56px;
    border-radius: 14px;
  }

  .signal-board {
    min-height: 90px;
    padding: 16px;
  }

  .status-stack {
    display: none;
  }

  .login-card {
    padding: 22px;
  }

  .user-card-head {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .user-card-head .icon-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .option-add {
    grid-template-columns: 1fr;
  }

  .department-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-button {
    width: 100%;
  }

  .modal-layer {
    align-items: flex-end;
    padding: 12px;
  }

  .modal-foot {
    flex-direction: column-reverse;
  }

  .modal-foot .ghost-button,
  .modal-foot .primary-button {
    width: 100%;
  }

  .modal-grid {
    grid-template-columns: 1fr;
  }

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

  .plan-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .table-filter-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chart-scroll {
    grid-template-columns: 1fr;
  }
}
