:root {
  --bg: #10131f;
  --panel: #172033;
  --panel-2: #202a42;
  --line: rgba(216, 226, 245, 0.16);
  --text: #f6f8ff;
  --muted: #aab6ce;
  --cyan: #38bdf8;
  --green: #34d399;
  --orange: #ffb454;
  --pink: #f472b6;
  --violet: #a78bfa;
  --red: #fb7185;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(56, 189, 248, .26), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(244, 114, 182, .20), transparent 24%),
    linear-gradient(135deg, #10131f 0%, #172033 48%, #22213a 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(216, 226, 245, .18);
  border-radius: 12px;
  background: rgba(12, 17, 31, .72);
  color: var(--text);
  padding: 0 14px;
}

select option {
  color: #111827;
}

input::placeholder { color: #7e8fae; }
h1, h2, h3, h4, p { margin: 0; }
.hidden { display: none !important; }
.empty-text { color: var(--muted); }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(480px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(28, 39, 65, .94), rgba(24, 23, 45, .94));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .36);
}

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

.brand-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  font-size: 26px;
  font-weight: 800;
}

.brand-row h1 { font-size: 20px; }
.brand-row p,
.demo-tip,
.message,
.eyebrow,
.notice,
.scope-card p,
.scope-card span,
.section-head p,
.metric-card p,
.panel-head span,
.modal-sheet p {
  color: var(--muted);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 28px 0 18px;
}

.auth-tabs button,
.logout-btn,
.ghost-btn {
  height: 44px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
}

.auth-tabs button.active,
.primary-btn,
.auth-form button {
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  color: white;
  font-weight: 700;
}

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

.auth-form button {
  height: 48px;
  border-radius: 12px;
}

.demo-tip {
  margin-top: 16px;
  font-size: 14px;
}

.message {
  min-height: 20px;
  margin-top: 10px;
}

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

.sidebar {
  padding: 28px 20px;
  background: rgba(11, 15, 28, .84);
  border-right: 1px solid var(--line);
}

.nav {
  display: grid;
  gap: 10px;
  margin: 34px 0;
}

.nav-item {
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, .92), rgba(244, 114, 182, .86));
}

.scope-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(32, 42, 66, .86), rgba(38, 32, 58, .86));
}

.scope-card strong {
  display: block;
  margin: 10px 0;
  font-size: 18px;
}

.logout-btn {
  width: 100%;
  margin-top: 18px;
}

.main {
  padding: 28px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.topbar h2 {
  font-size: 34px;
}

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

.month-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 5px;
  border: 1px solid rgba(216, 226, 245, .18);
  border-radius: 14px;
  background: rgba(12, 17, 31, .58);
}

.month-tab {
  min-width: 62px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
}

.month-tab.active {
  background: linear-gradient(90deg, rgba(56, 189, 248, .96), rgba(244, 114, 182, .86));
  color: #fff;
  font-weight: 700;
}

.month-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.month-filter input {
  width: 148px;
  min-height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
}

.primary-btn,
.inline-add button {
  height: 46px;
  padding: 0 18px;
  border-radius: 12px;
}

.notice {
  margin-bottom: 18px;
  padding: 14px 18px;
  border: 1px solid rgba(52, 211, 153, .28);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(52, 211, 153, .12), rgba(56, 189, 248, .1));
}

.view { display: none; }
.view.active { display: block; }

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

.metric-card,
.panel,
.section-head,
.table-wrap,
.card-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(31, 42, 68, .96), rgba(18, 25, 42, .96));
  box-shadow: 0 18px 50px rgba(0, 0, 0, .2);
}

.metric-card {
  position: relative;
  min-height: 142px;
  padding: 22px;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -32px;
  width: 116px;
  height: 116px;
  border-radius: 999px;
  background: var(--bubble);
  opacity: .22;
}

.metric-card.cyan { --bubble: var(--cyan); }
.metric-card.green { --bubble: var(--green); }
.metric-card.orange { --bubble: var(--orange); }
.metric-card.pink { --bubble: var(--pink); }
.metric-card span { color: var(--muted); }
.metric-card strong {
  display: block;
  margin: 14px 0 8px;
  font-size: 34px;
}

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

.wide-panel {
  min-height: 360px;
}

.panel {
  min-height: 280px;
  padding: 24px;
}

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

.section-head {
  padding: 20px 22px;
}

.panel-head h3,
.section-head h3 {
  font-size: 23px;
}

.bar-chart {
  height: 250px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
  align-items: end;
  padding-top: 34px;
}

.bar {
  position: relative;
  min-height: 20px;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(180deg, var(--cyan), var(--violet));
}

.bar strong {
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  color: #dff7ff;
  font-size: 12px;
  white-space: nowrap;
}

.bar span {
  position: absolute;
  left: 50%;
  bottom: -24px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.legend,
.reminder-list {
  display: grid;
  gap: 14px;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.legend-row span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--dot);
}

.reminder-item {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .06);
}

.reminder-item h4 {
  margin-bottom: 6px;
  font-size: 16px;
}

.reminder-item p {
  color: var(--muted);
  font-size: 14px;
}

.reminder-item.warning { border-color: rgba(255, 180, 84, .36); background: rgba(255, 180, 84, .1); }
.reminder-item.danger { border-color: rgba(251, 113, 133, .36); background: rgba(251, 113, 133, .1); }
.reminder-item.info { border-color: rgba(56, 189, 248, .34); background: rgba(56, 189, 248, .1); }

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.chip {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, .14);
  color: #bdeeff;
}

.chip.accent {
  background: rgba(244, 114, 182, .14);
  color: #ffd2e8;
}

.row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  height: 32px;
  margin-right: 6px;
  padding: 0 10px;
  border-radius: 10px;
  background: rgba(56, 189, 248, .15);
  color: #c9f1ff;
  white-space: nowrap;
}

.row-btn.danger {
  background: rgba(251, 113, 133, .15);
  color: #ffd0d8;
}

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

.card-grid article {
  padding: 20px;
}

.card-grid h4 {
  margin-bottom: 12px;
  font-size: 19px;
}

.card-grid p {
  margin: 8px 0;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 8, 18, .64);
  backdrop-filter: blur(10px);
}

.modal-sheet {
  width: min(680px, 100%);
  max-height: min(780px, 92vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(31, 42, 68, .98), rgba(28, 24, 47, .98));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .48);
}

.modal-sheet header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .09);
  font-size: 26px;
  line-height: 1;
}

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

.modal-form label {
  display: grid;
  gap: 8px;
  color: #dce6fb;
}

.modal-form .check {
  display: flex;
  align-items: center;
}

.modal-form .check input {
  width: auto;
  min-height: auto;
}

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

.salary-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(52, 211, 153, .16), rgba(56, 189, 248, .13));
  border: 1px solid rgba(52, 211, 153, .28);
}

.salary-preview span {
  color: var(--muted);
}

.salary-preview strong {
  font-size: 24px;
}

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

.inline-add button {
  background: linear-gradient(90deg, var(--green), var(--cyan));
  font-weight: 700;
}

.modal-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.ghost-btn {
  padding: 0 18px;
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .metric-grid,
  .dashboard-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main,
  .sidebar {
    padding: 18px;
  }
  .topbar,
  .section-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
  .toolbar,
  .month-tabs {
    justify-content: flex-start;
  }
  .month-tabs {
    flex-wrap: wrap;
  }
  .metric-grid,
  .dashboard-grid,
  .card-grid,
  .inline-add,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .topbar h2 {
    font-size: 28px;
  }
  .modal-form footer {
    flex-direction: column;
  }
}
