:root {
  --page-bg: #edf3f2;
  --surface: #ffffff;
  --surface-soft: #f6f9f8;
  --ink: #172628;
  --muted: #6c7d7f;
  --line: #dce6e4;
  --line-strong: #c8d6d3;
  --sidebar: #173b3a;
  --sidebar-soft: #214a48;
  --primary: #0f766e;
  --primary-dark: #0b5d57;
  --primary-soft: #dff1ee;
  --coral: #dc6b4f;
  --coral-soft: #fbe7e1;
  --gold: #b9841d;
  --gold-soft: #f7edd6;
  --blue: #3b6f9d;
  --blue-soft: #e3edf6;
  --danger: #b74438;
  --danger-soft: #f9e7e4;
  --shadow: 0 14px 40px rgba(23, 59, 58, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 59, 58, 0.035) 0, rgba(23, 59, 58, 0) 32%),
    var(--page-bg);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 1px;
}

[hidden] {
  display: none !important;
}

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

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  padding: 28px 18px 20px;
  color: #eff9f7;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--sidebar);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  color: #173b3a;
  background: #f4c96b;
  font-size: 20px;
  font-weight: 800;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

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

.brand-copy small {
  margin-top: 2px;
  color: rgba(239, 249, 247, 0.58);
  font-size: 11px;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 28px;
  min-width: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 12px 13px;
  border: 0;
  border-radius: 7px;
  color: rgba(239, 249, 247, 0.68);
  background: transparent;
  text-align: left;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.075);
  transform: translateX(2px);
}

.nav-item.is-active {
  color: #ffffff;
  background: var(--sidebar-soft);
  box-shadow: inset 3px 0 #f4c96b;
}

.nav-index {
  color: rgba(239, 249, 247, 0.4);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.nav-item.is-active .nav-index {
  color: #f4c96b;
}

.storage-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 10px 0;
  color: rgba(239, 249, 247, 0.55);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #68d391;
  box-shadow: 0 0 0 4px rgba(104, 211, 145, 0.12);
}

.workspace {
  min-width: 0;
}

.topbar {
  display: flex;
  min-height: 92px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
}

.topbar-label,
.modal-kicker {
  color: var(--primary);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.topbar h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.today {
  color: var(--muted);
  font-size: 13px;
}

.main-content {
  padding: 28px 34px 48px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: view-in 180ms ease-out;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-heading,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.view-heading {
  align-items: flex-end;
  margin-bottom: 22px;
}

.view-heading h2,
.panel-heading h3,
.modal-heading h2 {
  margin: 0;
}

.view-heading h2 {
  font-size: 18px;
}

.view-heading p,
.panel-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

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

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

.field > span {
  color: #526466;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

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

.field input:hover,
.field select:hover {
  border-color: #aabfbb;
}

.field input:focus,
.field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.08);
  outline: 0;
}

.compact-field {
  min-width: 146px;
}

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

.metric-card {
  position: relative;
  min-width: 0;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(23, 59, 58, 0.04);
}

.metric-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: var(--primary);
}

.metric-coral::before {
  background: var(--coral);
}

.metric-gold::before {
  background: var(--gold);
}

.metric-blue::before {
  background: var(--blue);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metric-code {
  color: #a0afaf;
  font-family: Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  overflow: hidden;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: clamp(24px, 2.4vw, 34px);
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card small {
  display: block;
  min-height: 18px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

.metric-card small.is-up {
  color: var(--primary);
}

.metric-card small.is-down {
  color: var(--danger);
}

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

.panel,
.table-panel,
.entry-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.panel {
  padding: 22px;
}

.panel-wide {
  grid-column: 1 / -1;
}

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

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
}

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

.legend-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
}

.student-dot {
  background: var(--primary);
}

.revenue-dot {
  background: var(--coral);
}

.college-comparison {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 24px;
}

.college-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.7fr) minmax(180px, 1.5fr) minmax(180px, 1.5fr);
  gap: 16px;
  align-items: center;
  padding: 0 6px;
}

.college-row.is-selected {
  padding: 10px 6px;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  background: var(--surface-soft);
}

.college-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comparison-item {
  display: grid;
  grid-template-columns: minmax(56px, auto) minmax(60px, 1fr);
  gap: 9px;
  align-items: center;
}

.comparison-value {
  color: #455759;
  font-family: Consolas, monospace;
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: #e8efed;
}

.bar-fill {
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  transition: width 420ms ease;
}

.student-fill {
  background: var(--primary);
}

.revenue-fill {
  background: linear-gradient(90deg, #dc6b4f, #ec927d);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 17px;
  margin-top: 24px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.ranking-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  color: var(--primary);
  background: var(--primary-soft);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.ranking-main {
  min-width: 0;
}

.ranking-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.ranking-title strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-title span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.ranking-amount {
  color: var(--ink);
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ranking-track {
  height: 5px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9efee;
}

.ranking-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.monthly-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(44px, 1fr));
  gap: 8px;
  min-height: 245px;
  margin-top: 24px;
  padding-top: 12px;
  overflow-x: auto;
}

.month-column {
  display: flex;
  min-width: 44px;
  flex-direction: column;
  align-items: stretch;
}

.month-value {
  height: 22px;
  color: var(--muted);
  font-family: Consolas, monospace;
  font-size: 9px;
  text-align: center;
  white-space: nowrap;
}

.month-track {
  display: flex;
  height: 165px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 5px 5px 2px 2px;
  background:
    repeating-linear-gradient(
      to top,
      #f4f7f6 0,
      #f4f7f6 1px,
      transparent 1px,
      transparent 41px
    ),
    #fafcfb;
}

.month-fill {
  width: 100%;
  min-height: 2px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #168a80, #0f766e);
  transition: height 420ms ease;
}

.month-label {
  margin-top: 8px;
  color: #627476;
  font-size: 10px;
  text-align: center;
}

.primary-button,
.secondary-button,
.text-button,
.table-action {
  border: 0;
  border-radius: 7px;
  font-weight: 700;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  color: #ffffff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

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

.button-plus {
  font-size: 19px;
  font-weight: 400;
  line-height: 1;
}

.secondary-button {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  color: #415355;
  background: var(--surface);
}

.secondary-button:hover {
  border-color: #aabfbb;
  background: var(--surface-soft);
}

.text-button {
  padding: 6px 3px;
  color: var(--primary);
  background: transparent;
}

.text-button:hover {
  color: var(--primary-dark);
}

.table-panel {
  overflow: hidden;
}

.history-panel {
  margin-top: 16px;
}

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

table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: #667779;
  background: #f8faf9;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

td {
  color: #354749;
  font-size: 13px;
}

tbody tr {
  transition: background 140ms ease;
}

tbody tr:hover {
  background: #fafcfc;
}

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

tfoot td {
  border-top: 1px solid var(--line-strong);
  border-bottom: 0;
  background: #f2f7f5;
  font-weight: 700;
}

.revenue-total-label {
  color: var(--muted);
  text-align: right;
}

.revenue-total-amount {
  color: var(--primary-dark);
  font-size: 14px;
}

.name-cell {
  color: var(--ink);
  font-weight: 700;
}

.college-tag,
.month-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  color: #315e5b;
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.company-name-tag,
.unregistered-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.company-name-tag {
  color: #315e5b;
  background: var(--primary-soft);
}

.unregistered-tag {
  color: #7b6b48;
  background: #f1eee6;
}

.month-tag {
  color: #785d1c;
  background: var(--gold-soft);
  font-family: Consolas, monospace;
}

.money-cell {
  color: var(--ink);
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-weight: 700;
  white-space: nowrap;
}

.secondary-text {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.actions-column {
  width: 122px;
  text-align: right;
}

td.actions-column {
  white-space: nowrap;
}

.table-action {
  padding: 5px 7px;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
}

.table-action:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.table-action.danger {
  color: var(--danger);
}

.table-action.danger:hover {
  background: var(--danger-soft);
}

.action-divider {
  margin: 0 2px;
  color: #c6d2d0;
}

.empty-state {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: #4b5d5f;
}

.empty-state span {
  font-size: 12px;
}

.entry-panel {
  margin-bottom: 16px;
  padding: 22px;
}

.current-year-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: -22px -22px 22px;
  padding: 18px 22px;
  border-bottom: 4px solid #f4c96b;
  border-radius: 7px 7px 0 0;
  color: #ffffff;
  background: var(--sidebar);
}

.current-year-banner > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.current-year-banner span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  font-weight: 700;
}

.current-year-banner strong {
  color: #f4c96b;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 26px;
  line-height: 1;
}

.current-year-banner p {
  margin: 0;
  padding: 5px 11px;
  border: 1px solid rgba(244, 201, 107, 0.58);
  border-radius: 5px;
  color: #f8e2ac;
  font-size: 11px;
  font-weight: 700;
}

.responsible-panel {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.responsible-empty {
  min-height: 108px;
  padding: 18px;
}

.responsible-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.responsible-person {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--line);
}

.responsible-person:last-child {
  border-bottom: 0;
}

.responsible-person > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border-right: 1px solid var(--line);
}

.responsible-person > div:last-child {
  border-right: 0;
}

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

.responsible-person strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.responsible-person .responsible-name strong {
  color: var(--primary);
}

.form-grid {
  display: grid;
  gap: 14px;
}

.revenue-form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.history-heading {
  align-items: flex-end;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 30, 30, 0.52);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  padding: 24px;
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 30px 80px rgba(11, 38, 37, 0.26);
  animation: modal-in 180ms ease-out;
}

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

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

.modal-heading h2 {
  margin-top: 3px;
  font-size: 19px;
}

.icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #657678;
  background: var(--surface);
  font-size: 21px;
  line-height: 1;
}

.icon-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

#student-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

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

.toast {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 7px;
  color: #304345;
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-left-color: var(--danger);
}

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

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

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

  .panel-wide {
    grid-column: auto;
  }

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

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

  .sidebar {
    position: static;
    height: auto;
    padding: 18px 18px 14px;
  }

  .brand {
    padding: 0 4px 16px;
  }

  .main-nav {
    flex-direction: row;
    margin-top: 14px;
    overflow-x: auto;
  }

  .nav-item {
    width: auto;
    min-width: max-content;
  }

  .nav-item.is-active {
    box-shadow: inset 0 -3px #f4c96b;
  }

  .storage-status {
    display: none;
  }

  .topbar {
    min-height: 78px;
    padding: 15px 22px;
  }

  .main-content {
    padding: 22px;
  }

  .view-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-bar {
    width: 100%;
    justify-content: flex-start;
  }

  .history-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .today {
    font-size: 12px;
  }

  .main-content {
    padding: 18px 14px 38px;
  }

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

  .metric-card {
    padding: 17px;
  }

  .compact-field {
    min-width: 0;
    flex: 1 1 132px;
  }

  .college-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
  }

  .college-row.is-selected {
    padding: 12px;
    border-left: 3px solid var(--primary);
  }

  .comparison-item {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .panel,
  .entry-panel {
    padding: 17px;
  }

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

  .form-actions .primary-button {
    width: 100%;
  }

  .modal-dialog {
    padding: 20px;
  }
}

.project-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.project-tabs {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e6eeec;
}

.project-tab {
  min-height: 34px;
  padding: 7px 15px;
  border: 0;
  border-radius: 6px;
  color: #5d706f;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.project-tab:hover {
  color: var(--primary);
}

.project-tab.is-active {
  color: var(--primary-dark);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(23, 59, 58, 0.08);
}

.project-section {
  display: none;
}

.project-section.is-active {
  display: block;
  animation: view-in 180ms ease-out;
}

.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.section-toolbar h3 {
  margin: 0;
  font-size: 15px;
}

.section-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.project-year-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.project-year-group + .project-year-group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.project-year-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 7px 7px;
}

.project-year-heading strong {
  color: var(--primary);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.project-year-heading span {
  color: var(--muted);
  font-size: 10px;
}

.document-list-panel {
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-document-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.document-year-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.document-year-group + .document-year-group {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.document-year-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.document-year-heading strong {
  color: var(--primary);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.document-year-heading span {
  color: var(--muted);
  font-size: 11px;
}

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

.document-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

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

.document-card-title {
  min-width: 0;
}

.document-card-title strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-title span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  color: #a33d31;
  background: var(--danger-soft);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.document-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.document-card-actions .primary-button,
.document-card-actions .secondary-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.activity-list-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-empty-state {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.activity-month-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.activity-month-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  background: #f7faf9;
}

.activity-month-heading strong {
  color: var(--primary);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.activity-month-heading span {
  color: var(--muted);
  font-size: 11px;
}

.activity-table {
  min-width: 1120px;
}

.activity-link {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  text-underline-offset: 2px;
}

.activity-link:hover {
  text-decoration: underline;
}

.activity-photos {
  display: flex;
  align-items: center;
  gap: 5px;
}

.activity-photo-thumb {
  width: 38px;
  height: 30px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-soft);
}

.activity-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.activity-photo-count {
  color: var(--muted);
  font-size: 10px;
}

.activity-dialog {
  width: min(100%, 760px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

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

.activity-form-grid .field-wide {
  grid-column: 1 / -1;
}

.attachment-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.mentor-table {
  min-width: 1120px;
}

.mentor-dialog {
  width: min(100%, 760px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

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

.mentor-form-grid .field-wide {
  grid-column: 1 / -1;
}

.mentor-type-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  color: #6b5120;
  background: var(--gold-soft);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.mentor-record-table {
  min-width: 1180px;
}

.service-content-cell {
  max-width: 280px;
  color: #526466;
  font-size: 11px;
  line-height: 1.6;
  white-space: normal;
}

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

.mentor-stat-grid article {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mentor-stat-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.mentor-stat-grid strong {
  color: var(--primary);
  font-size: 28px;
}

.mentor-export-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.mentor-export-panel h3 {
  margin: 0;
  font-size: 17px;
}

.mentor-export-panel p {
  max-width: 650px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.detected-document-name {
  padding: 11px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
}

.project-list-panel,
.project-detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.project-list-panel {
  position: sticky;
  top: 16px;
  padding: 20px 14px 14px;
}

.project-list-panel .panel-heading {
  padding: 0 6px 14px;
}

.team-status-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 12px;
}

.team-status-filter {
  min-height: 31px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #5e7071;
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
}

.team-status-filter:hover,
.team-status-filter.is-active {
  color: var(--primary-dark);
  border-color: #b8d9d4;
  background: var(--primary-soft);
}

.team-status-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}

.team-status-active {
  color: #315e5b;
  background: var(--primary-soft);
}

.team-status-graduated {
  color: #4f6681;
  background: var(--blue-soft);
}

.team-status-removed {
  color: #8e4b40;
  background: var(--danger-soft);
}

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

.project-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: border-color 160ms ease, background 160ms ease;
}

.project-list-item:hover {
  background: var(--surface-soft);
}

.project-list-item.is-selected {
  border-color: #b8d9d4;
  background: var(--primary-soft);
}

.project-select-button {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 9px 8px;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  text-align: left;
}

.project-list-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-meta {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.project-list-company {
  overflow: hidden;
  color: #59706d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-list-actions {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity 160ms ease;
}

.project-list-item:hover .project-list-actions,
.project-list-item.is-selected .project-list-actions {
  opacity: 1;
}

.project-detail-panel {
  min-height: 530px;
  padding: 22px;
}

.project-detail-empty {
  min-height: 480px;
}

.compact-empty {
  min-height: 120px;
  padding: 20px;
}

.project-detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.project-detail-heading h3 {
  margin: 3px 0 0;
  font-size: 20px;
}

.project-detail-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.project-detail-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.project-company-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.project-company-panel > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.project-company-panel > div:nth-child(4) {
  border-right: 0;
}

.project-company-panel span {
  color: var(--muted);
  font-size: 10px;
}

.project-company-panel strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-company-panel .company-address {
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  border-right: 0;
}

.company-registration-status {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  text-align: center;
}

#view-project-license {
  justify-self: start;
  margin: 10px 14px 12px;
}

.project-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 22px 0 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.project-summary > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
  padding: 13px 16px;
  border-right: 1px solid var(--line);
}

.project-summary > div:last-child {
  border-right: 0;
}

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

.project-summary strong {
  overflow: hidden;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-student-table {
  border: 1px solid var(--line);
  border-radius: 7px;
}

.project-student-table table {
  min-width: 1160px;
}

.stacked-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stacked-cell strong {
  color: #354749;
  font-size: 12px;
}

.stacked-cell span {
  color: var(--muted);
  font-size: 11px;
}

.mono-cell {
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 12px;
  white-space: nowrap;
}

.leader-tag,
.member-tag {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.leader-tag {
  color: #8a4b20;
  background: var(--gold-soft);
}

.member-tag {
  color: #4d6866;
  background: #e9f0ef;
}

.photo-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.photo-link {
  padding: 2px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.photo-missing {
  color: #9aa8a8;
  font-size: 10px;
  white-space: nowrap;
}

.student-dialog {
  width: min(100%, 860px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

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

#project-modal .modal-dialog {
  width: min(100%, 720px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.project-form-grid .field-wide {
  grid-column: 1 / -1;
}

.company-toggle-field {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
}

.company-toggle-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  accent-color: var(--primary);
}

.company-toggle-field > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.company-toggle-field strong {
  color: var(--ink);
  font-size: 12px;
}

.company-toggle-field small {
  color: var(--muted);
  font-size: 10px;
}

.project-company-fields {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.license-upload-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 15px;
  align-items: stretch;
  margin-top: 18px;
}

.license-upload {
  position: relative;
  display: grid;
  min-height: 160px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #acc0bc;
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
}

.license-upload:hover {
  border-color: var(--primary);
}

.license-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.license-upload img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  background: #eef3f2;
}

.license-upload > span {
  padding: 14px;
  font-size: 12px;
  text-align: center;
}

.ocr-status {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.ocr-status.is-loading {
  color: var(--primary);
}

.ocr-status.is-success {
  color: var(--primary-dark);
  border-color: #b8d9d4;
  background: var(--primary-soft);
}

.ocr-status.is-error {
  color: var(--danger);
  border-color: #e9c2bc;
  background: var(--danger-soft);
}

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

.leader-field {
  display: flex;
  min-height: 65px;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-soft);
}

.leader-field input {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  accent-color: var(--primary);
}

.leader-field > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.leader-field strong {
  color: var(--ink);
  font-size: 12px;
}

.leader-field small {
  color: var(--muted);
  font-size: 10px;
}

.photo-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 18px;
}

.photo-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.photo-field > span {
  color: #526466;
  font-size: 12px;
  font-weight: 700;
}

.photo-upload {
  position: relative;
  display: grid;
  min-height: 180px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed #acc0bc;
  border-radius: 7px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.035), rgba(220, 107, 79, 0.04)),
    var(--surface-soft);
  cursor: pointer;
}

.photo-upload:hover {
  border-color: var(--primary);
}

.photo-upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-upload img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background: #eef3f2;
}

.photo-upload > span {
  padding: 12px;
  font-size: 12px;
  text-align: center;
}

.photo-dialog {
  width: min(100%, 820px);
}

.photo-dialog > img {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 7px;
  object-fit: contain;
  background: #eef3f2;
}

@media (max-width: 1120px) {
  .project-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

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

@media (max-width: 860px) {
  .project-layout {
    grid-template-columns: 1fr;
  }

  .project-list-panel {
    position: static;
  }

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

  .project-detail-heading {
    flex-direction: column;
  }

  .project-detail-actions {
    width: 100%;
    justify-content: flex-start;
  }

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

  .project-company-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-company-panel > div:nth-child(2) {
    border-right: 0;
  }

  .project-company-panel > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .project-company-panel > div:nth-child(4) {
    border-right: 0;
  }

  .project-summary > div:nth-child(2) {
    border-right: 0;
  }

  .project-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .section-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-toolbar .filter-bar {
    width: 100%;
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .document-grid {
    grid-template-columns: 1fr;
  }

  .project-list {
    grid-template-columns: 1fr;
  }

  .project-list-actions {
    opacity: 1;
  }

  .project-detail-panel {
    padding: 16px;
  }

  .project-summary {
    grid-template-columns: 1fr;
  }

  .project-summary > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-summary > div:last-child {
    border-bottom: 0;
  }

  .project-detail-actions .secondary-button,
  .project-detail-actions .primary-button {
    flex: 1 1 140px;
  }

  .project-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .project-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .section-toolbar {
    padding: 14px;
  }

  .section-toolbar .primary-button {
    width: 100%;
  }

  .current-year-banner {
    margin: -17px -17px 18px;
    padding: 16px 17px;
  }

  .current-year-banner > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .current-year-banner strong {
    font-size: 22px;
  }

  .responsible-person {
    grid-template-columns: 1fr;
  }

  .responsible-person > div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .responsible-person > div:last-child {
    border-bottom: 0;
  }

  .student-form-grid,
  .photo-section,
  .project-form-grid,
  .license-upload-section,
  .activity-form-grid,
  .mentor-form-grid {
    grid-template-columns: 1fr;
  }

  .mentor-stat-grid {
    grid-template-columns: 1fr;
  }

  .mentor-export-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .project-company-panel {
    grid-template-columns: 1fr;
  }

  .project-company-panel > div,
  .project-company-panel > div:nth-child(2),
  .project-company-panel > div:nth-child(4) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .project-company-panel > div:last-of-type {
    border-bottom: 0;
  }

  .photo-upload {
    min-height: 150px;
  }

  .photo-upload img {
    height: 150px;
  }
}

.dashboard-command .metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 6px 24px rgba(23, 59, 58, 0.04);
}

.dashboard-command .metric-card {
  padding: 15px 14px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}

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

.dashboard-command .metric-card::before {
  display: none;
}

.dashboard-command .metric-head {
  align-items: flex-start;
  flex-direction: column;
  gap: 2px;
}

.dashboard-command .metric-code {
  font-size: 8px;
}

.dashboard-command .metric-card strong {
  margin-top: 9px;
  font-size: 22px;
}

.dashboard-command .metric-card small {
  margin-top: 6px;
  font-size: 10px;
}

.dashboard-command .dashboard-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr);
}

.dashboard-command .panel-wide {
  grid-column: 1 / -1;
}

.dashboard-command .monthly-chart {
  min-height: 225px;
  margin-top: 14px;
}

.dashboard-command .month-track {
  height: 150px;
}

.dashboard-command .month-fill {
  background: linear-gradient(180deg, #168a80, #0f766e);
}

@media (max-width: 1060px) {
  .dashboard-command .metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .dashboard-command .metric-card {
    border-bottom: 1px solid var(--line);
  }

  .dashboard-command .metric-card:nth-child(4n) {
    border-right: 0;
  }
}

@media (max-width: 860px) {
  .dashboard-command .metric-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .dashboard-command .metric-card:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .dashboard-command .metric-card:nth-child(2n) {
    border-right: 0;
  }

  .dashboard-command .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-command .panel-wide {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .dashboard-command .metric-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-command .metric-card,
  .dashboard-command .metric-card:nth-child(2n),
  .dashboard-command .metric-card:nth-child(4n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .dashboard-command .metric-card:last-child {
    border-bottom: 0;
  }
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  background: #eef3f2;
}

.login-screen.is-visible {
  display: grid;
}

.login-visual {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 46px;
  color: #eff9f7;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 48%),
    #173b3a;
}

.login-visual::after {
  position: absolute;
  right: -120px;
  bottom: -180px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  content: "";
  background: rgba(244, 201, 107, 0.1);
}

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

.login-brand > span:last-child {
  display: flex;
  flex-direction: column;
}

.login-brand strong {
  font-size: 18px;
}

.login-brand small {
  color: rgba(239, 249, 247, 0.58);
  font-size: 11px;
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.login-copy > span {
  color: #f4c96b;
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.login-copy h1 {
  margin: 14px 0 0;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 500;
  line-height: 1.25;
}

.login-copy p {
  max-width: 520px;
  margin: 18px 0 0;
  color: rgba(239, 249, 247, 0.62);
  font-size: 13px;
  line-height: 1.8;
}

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

.login-form {
  display: flex;
  width: min(100%, 400px);
  flex-direction: column;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(23, 59, 58, 0.12);
}

.login-form h2 {
  margin: 4px 0 0;
}

.login-submit {
  width: 100%;
  min-height: 44px;
}

.login-error {
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.user-summary > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.user-summary strong {
  font-size: 12px;
}

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

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 13px;
  font-weight: 700;
}

.compact-button {
  min-height: 34px;
  padding: 6px 11px;
}

.system-table {
  min-width: 1000px;
}

.status-badge {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  padding: 3px 7px;
  border-radius: 5px;
  color: #5d706f;
  background: #e9f0ef;
  font-size: 10px;
  font-weight: 700;
}

.status-badge.is-active {
  color: #315e5b;
  background: var(--primary-soft);
}

.status-badge.is-disabled {
  color: #8e4b40;
  background: var(--danger-soft);
}

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

.user-form-grid .field-wide {
  grid-column: 1 / -1;
}

.form-switch {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.form-switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.role-assignment,
.permission-section {
  margin-top: 18px;
}

.role-assignment > span,
.permission-section > span {
  display: block;
  margin-bottom: 10px;
  color: #526466;
  font-size: 12px;
  font-weight: 700;
}

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

.permission-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.permission-check input {
  margin-top: 2px;
  accent-color: var(--primary);
}

.permission-check span {
  display: flex;
  flex-direction: column;
}

.permission-check strong {
  font-size: 11px;
}

.permission-check small {
  color: var(--muted);
  font-size: 9px;
}

.role-dialog {
  width: min(100%, 820px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.permission-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.permission-group {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.permission-group > strong {
  display: block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 12px;
}

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

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

  .login-visual {
    min-height: 280px;
    padding: 30px;
  }

  .login-copy h1 {
    font-size: 30px;
  }

  .login-panel {
    padding: 24px;
  }

  .topbar-user {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .login-visual {
    min-height: 220px;
    padding: 24px;
  }

  .login-copy p {
    display: none;
  }

  .login-form {
    padding: 24px;
  }

  .user-form-grid,
  .permission-grid,
  .permission-group .permission-grid {
    grid-template-columns: 1fr;
  }

  .user-summary {
    width: 100%;
    padding-left: 0;
    border-left: 0;
  }
}
