:root {
  --bg: #e7eef0;
  --panel: #ffffff;
  --panel-strong: #f7fafb;
  --border: #9fb5ba;
  --border-soft: #c7d6d9;
  --text: #13272b;
  --muted: #40575d;
  --subtle: #667b81;
  --accent: #006b75;
  --accent-strong: #004f57;
  --accent-soft: #d7ecef;
  --warm: #9a5b00;
  --danger: #b42318;
  --warning: #8a5700;
  --success: #0f766e;
  --shadow: 0 14px 34px rgba(20, 39, 43, 0.1);
  --shadow-soft: 0 8px 20px rgba(20, 39, 43, 0.08);
  --radius: 20px;
  --font:
    "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(0, 107, 117, 0.13), transparent 30%),
    radial-gradient(circle at bottom right, rgba(154, 91, 0, 0.1), transparent 28%),
    linear-gradient(180deg, #f3f7f8 0%, var(--bg) 100%);
}

button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

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

.login-card {
  width: min(100%, 520px);
  padding: 32px;
  border-radius: 28px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 247, 248, 0.96)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='rgba(0,107,117,0.13)' stroke-width='2'%3E%3Cpath d='M10 36h160M10 90h160M10 144h160'/%3E%3Cpath d='M36 10v160M90 10v160M144 10v160'/%3E%3C/g%3E%3C/svg%3E");
  box-shadow: var(--shadow);
}

.app-shell {
  max-width: 1560px;
  margin: 0 auto;
  padding: clamp(16px, 2vw, 28px);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
  padding: 24px 28px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(237, 246, 248, 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='rgba(0,107,117,0.12)' stroke-width='2'%3E%3Cpath d='M10 36h160M10 90h160M10 144h160'/%3E%3Cpath d='M36 10v160M90 10v160M144 10v160'/%3E%3C/g%3E%3C/svg%3E");
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero > div:first-child {
  min-width: 0;
}

.hero-side {
  min-width: 320px;
  display: grid;
  gap: 10px;
  justify-items: end;
}

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

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.1;
  max-width: 780px;
}

.hero-text {
  max-width: 640px;
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.app-shell > .hero {
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: 24px;
}

.app-shell > .hero .eyebrow {
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
}

.app-shell > .hero h1 {
  max-width: 680px;
  font-size: clamp(20px, 2vw, 25px);
}

.app-shell > .hero .hero-text {
  max-width: 580px;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
}

.app-shell > .hero .hero-side {
  min-width: 280px;
  gap: 8px;
}

.app-shell > .hero .hero-badges {
  gap: 6px;
}

.app-shell > .hero .status-chip,
.app-shell > .hero .mini-badge {
  padding: 6px 10px;
}

.app-shell > .hero .ghost-button {
  padding: 9px 14px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(290px, 330px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar,
.panel,
.sidebar-card,
.table-card {
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  border-radius: 28px;
  position: sticky;
  top: 18px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at top right, rgba(0, 107, 117, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff, #eef5f6);
  border-color: var(--border);
}

.sidebar::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 22%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cg fill='none' stroke='rgba(11,108,116,0.05)' stroke-width='1.5'%3E%3Cpath d='M12 36h156M12 90h156M12 144h156'/%3E%3Cpath d='M36 12v156M90 12v156M144 12v156'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
}

.sidebar > * {
  position: relative;
  z-index: 1;
}

.sidebar-top {
  display: grid;
  gap: 14px;
}

.sidebar-card,
.panel,
.table-card {
  border-radius: var(--radius);
}

.sidebar-card {
  padding: 16px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, #ffffff, #f6fafb);
  border-color: var(--border-soft);
}

.sidebar-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(90deg, var(--accent), #1d7f88);
}

.sidebar-card::after {
  content: '';
  position: absolute;
  top: -28px;
  right: -28px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.34), transparent 68%);
  pointer-events: none;
}

.sidebar-card-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.sidebar-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-shell {
  padding: 8px;
  border-radius: 26px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, #ffffff, #eef6f7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(20, 39, 43, 0.08);
}

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

.nav-tab {
  border: 0;
  border-radius: 999px;
  padding: 9px 8px;
  min-height: 38px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--muted);
  background:
    linear-gradient(180deg, #ffffff, #edf4f5);
  box-shadow: inset 0 0 0 1px var(--border-soft);
  cursor: pointer;
  transition: 180ms ease;
}

.nav-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 20px rgba(0, 79, 87, 0.24);
}

.nav-tab:hover {
  color: var(--accent-strong);
  background:
    linear-gradient(180deg, #ffffff, #dceff1);
}

.control-card {
  padding: 20px;
  background:
    radial-gradient(circle at top right, rgba(0, 107, 117, 0.1), transparent 30%),
    linear-gradient(180deg, #ffffff, #edf5f6);
}

.control-card::before {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.app-shell:not([data-active-panel='fillPanel']) .control-card {
  display: none;
}

.sidebar-card-daily {
  background:
    radial-gradient(circle at top right, rgba(11, 108, 116, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(244, 251, 250, 0.96), rgba(251, 248, 242, 0.86));
}

.sidebar-card-monthly {
  background:
    radial-gradient(circle at top right, rgba(0, 107, 117, 0.16), transparent 32%),
    radial-gradient(circle at bottom left, rgba(29, 88, 120, 0.08), transparent 28%),
    linear-gradient(180deg, #ffffff, #eef6f7);
  border-color: var(--border-soft);
}

.sidebar .card-title-row,
.sidebar .sidebar-card-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(79, 73, 57, 0.08);
}

.sidebar .card-title-row {
  align-items: center;
}

.sidebar-card-daily::before {
  background: linear-gradient(90deg, rgba(11, 108, 116, 0.84), rgba(34, 88, 120, 0.74));
}

.sidebar-card-monthly::before {
  background: linear-gradient(90deg, var(--accent), #1d5878);
}

.sidebar-card-monthly .card-title-row {
  padding-bottom: 14px;
  border-bottom-color: var(--border-soft);
}

.sidebar-card-monthly h2 {
  font-size: 18px;
  letter-spacing: 0.01em;
}

.sidebar-card-monthly .mini-badge {
  color: var(--accent-strong);
  background: #ffffff;
  border-color: var(--border-soft);
}

.sidebar-card-monthly .metric-grid {
  margin-top: 4px;
}

.sidebar-card-monthly .metric-card {
  min-height: 98px;
  background:
    linear-gradient(180deg, #ffffff, #eef6f7);
  border-color: var(--border-soft);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 22px rgba(20, 39, 43, 0.08);
}

.sidebar-card-monthly .metric-card::before {
  left: 12px;
  right: 12px;
  background: linear-gradient(90deg, var(--accent), #1d7f88);
}

.sidebar-card-monthly .metric-card:nth-child(2)::before,
.sidebar-card-monthly .metric-card:nth-child(4)::before {
  background: linear-gradient(90deg, #1d5878, var(--accent-strong));
}

.sidebar-card-monthly .metric-label {
  color: var(--muted);
}

.sidebar-card-monthly .metric-value {
  color: var(--accent-strong);
  text-shadow: none;
}

.sidebar-card-monthly .leaderboard {
  padding: 12px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, #ffffff, #f2f8f9);
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.sidebar-card-monthly .leaderboard-row {
  padding: 11px 12px;
  background:
    linear-gradient(180deg, #ffffff, #f5fafb);
  border-color: var(--border-soft);
}

.sidebar-card-monthly .leaderboard-row.leader {
  background:
    linear-gradient(135deg, #dceff1, #ffffff);
  border-color: #7eb9c1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 10px 22px rgba(0, 79, 87, 0.08);
}

.sidebar-card-monthly .leaderboard-row.self {
  border-color: #6fb5bd;
  box-shadow: inset 0 0 0 1px rgba(0, 107, 117, 0.18);
}

.sidebar-card-monthly .leaderboard-rank {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.sidebar-card-monthly .leaderboard-row.leader .leaderboard-rank {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.sidebar-card-monthly .leaderboard-score strong {
  color: var(--accent-strong);
}

.sidebar .metric-grid {
  gap: 10px;
  margin-top: 2px;
}

.sidebar-card-quiet {
  background:
    linear-gradient(180deg, #fbfdfe, #f3f8f9);
}

.sidebar-card-quiet .metric-card {
  min-height: 84px;
  background:
    linear-gradient(180deg, #ffffff, #f7fafb);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 6px 14px rgba(20, 39, 43, 0.05);
}

.sidebar-card-quiet .metric-value {
  font-size: 20px;
}

.sidebar .metric-card {
  min-height: 94px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 242, 234, 0.9));
  border-color: rgba(79, 73, 57, 0.09);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 20px rgba(79, 73, 57, 0.06);
}

.sidebar .metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #1d7f88);
}

.sidebar .metric-card:nth-child(2)::before,
.sidebar .metric-card:nth-child(4)::before {
  background: linear-gradient(90deg, #1d5878, var(--accent-strong));
}

.sidebar .metric-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar .metric-value {
  font-size: 22px;
  margin-top: 10px;
  line-height: 1.1;
}

.sidebar .leaderboard {
  gap: 8px;
}

.leaderboard-empty-state {
  display: grid;
  gap: 6px;
  justify-items: start;
  text-align: left;
}

.leaderboard-empty-state strong {
  font-size: 14px;
  color: var(--text);
}

.sidebar .leaderboard-empty-state {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 247, 248, 0.92));
}

.sidebar .leaderboard-row {
  padding: 10px 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(249, 244, 236, 0.76));
  border-color: rgba(79, 73, 57, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.sidebar .leaderboard-copy strong {
  font-size: 14px;
}

.sidebar .leaderboard-copy .cell-subtle,
.sidebar .leaderboard-score {
  font-size: 12px;
}

.sidebar .leaderboard-rank {
  min-width: 46px;
  padding: 7px 8px;
  font-size: 11px;
}

.sidebar .leaderboard-score strong {
  font-size: 18px;
}

.sidebar .mini-badge,
.sidebar .status-chip {
  background: rgba(255, 255, 255, 0.94);
}

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

.control-field .field-tip {
  margin: 8px 0 0;
}

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

.table-card {
  min-width: 0;
}

.panel {
  display: none;
  padding: clamp(18px, 1.8vw, 22px);
}

.panel.active {
  display: block;
  animation: panel-fade-in 180ms ease;
}

.panel-header,
.card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.panel-header {
  margin-bottom: 16px;
}

.panel-header h2,
.table-card h3,
.sidebar-card h2 {
  margin: 0;
}

.panel-header p,
.field-tip,
.notice,
.list-subtext {
  color: var(--muted);
}

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

.primary-button,
.ghost-button,
.tiny-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  border-radius: 999px;
  padding: 12px 18px;
  border: 0;
  cursor: pointer;
  transition: 180ms ease;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 18px rgba(0, 79, 87, 0.18);
}

.ghost-button {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #9bc8ce;
}

.tiny-button {
  padding: 8px 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border: 1px solid #9bc8ce;
}

.tiny-button.danger {
  background: #f8d8d5;
  color: var(--danger);
  border-color: #e5aaa5;
}

.icon-button {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.icon-button svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.is-current {
  background: rgba(11, 108, 116, 0.18);
}

.full-width {
  width: 100%;
}

.primary-button:hover,
.ghost-button:hover,
.nav-tab:hover,
.exam-view-tab:hover,
.tiny-button:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
}

.field-label {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text);
  background: #ffffff;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.input:disabled {
  color: var(--subtle);
  background: #edf3f4;
  border-color: var(--border-soft);
}

.input.invalid {
  border-color: rgba(177, 65, 50, 0.52);
  background: rgba(177, 65, 50, 0.05);
}

.input:focus,
.primary-button:focus,
.ghost-button:focus,
.tiny-button:focus,
.nav-tab:focus,
.exam-view-tab:focus,
.summary-view-tab:focus {
  outline: none;
}

.input:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.tiny-button:focus-visible,
.nav-tab:focus-visible,
.exam-view-tab:focus-visible,
.summary-view-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(11, 108, 116, 0.16);
}

.input:focus-visible {
  border-color: var(--accent);
  background: #ffffff;
}

.exam-grid,
.exam-form-grid,
.exam-period-grid,
.exam-option-grid {
  display: grid;
  gap: 12px;
}

.exam-grid {
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  align-items: start;
}

.exam-view-tabs,
.summary-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, #ffffff, #eef6f7);
}

.exam-view-tab,
.summary-view-tab {
  flex: 1 1 128px;
  min-height: 38px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.exam-list {
  display: grid;
  gap: 12px;
}

.exam-list-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, #ffffff, #f7fafb);
  cursor: pointer;
  transition: 180ms ease;
}

.exam-list-row:hover,
.exam-list-row.active {
  border-color: #7eb9c1;
  background:
    linear-gradient(135deg, #eaf6f7, #ffffff);
  box-shadow: var(--shadow-soft);
}

.exam-list-top,
.exam-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.exam-list-top > div:first-child {
  min-width: 0;
}

.exam-list-top strong {
  overflow-wrap: anywhere;
}

.exam-actions {
  justify-content: flex-end;
}

.exam-view-tab:hover,
.summary-view-tab:hover {
  color: var(--accent-strong);
  background: #ffffff;
}

.exam-view-tab.active,
.summary-view-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 10px 18px rgba(0, 79, 87, 0.16);
}

.exam-section,
.summary-section {
  display: none;
}

.exam-section.active,
.summary-section.active {
  display: block;
  animation: panel-fade-in 180ms ease;
}

.summary-section {
  min-width: 0;
}

.exam-form-grid,
.exam-period-grid,
.exam-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.exam-workspace-body,
.exam-question-list,
.exam-review-list,
.exam-answer-options {
  display: grid;
  gap: 12px;
}

.exam-workspace-body {
  margin-top: 12px;
}

.exam-taking-body {
  padding-bottom: 96px;
}

.exam-question-card,
.exam-answer-card,
.exam-review-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
}

.exam-question-head,
.exam-review-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.exam-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--panel-strong);
}

.exam-choice.compact {
  align-items: center;
  padding: 8px 10px;
}

.exam-choice input {
  margin-top: 4px;
}

.exam-choice.compact input {
  margin-top: 0;
}

.exam-option-key {
  min-width: 20px;
  font-weight: 700;
  color: var(--accent-strong);
}

.exam-correct-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.exam-explanation,
.exam-locked-tip {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--panel-strong);
  color: var(--muted);
}

.exam-security-tip {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #d8b15b;
  background: #fff7df;
  color: #6f4a00;
  font-size: 13px;
  line-height: 1.5;
}

.exam-floating-timer {
  position: fixed;
  right: clamp(14px, 2.4vw, 34px);
  bottom: 22px;
  z-index: 40;
  min-width: 156px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid #74aeb6;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 16px 34px rgba(0, 79, 87, 0.26);
}

.exam-floating-timer .metric-label {
  color: rgba(255, 255, 255, 0.78);
}

.exam-floating-timer .metric-value {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.15;
}

.exam-running-summary {
  padding-right: 18px;
}

.exam-publish-check,
.exam-answer-navigator {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
}

.exam-publish-check.success {
  border-color: #8ccfbd;
  background: #effbf8;
}

.exam-publish-check.warning {
  border-color: #e5aaa5;
  background: #fff3f1;
}

.exam-publish-check-head,
.exam-answer-navigator-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.exam-publish-issue-list {
  margin: 0;
  padding-left: 20px;
  color: var(--danger);
}

.exam-question-nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 8px;
}

.exam-question-nav-button {
  min-width: 0;
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.exam-question-nav-button:hover {
  transform: translateY(-1px);
}

.exam-question-nav-button.is-answered {
  color: #ffffff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.exam-question-nav-button.is-unanswered {
  color: var(--warning);
  border-color: #d8b15b;
  background: #fff7df;
}

.exam-review-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
}

.exam-review-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.exam-review-filter-button:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.exam-review-filter-button.active {
  color: #ffffff;
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
}

.exam-review-filter-button.active .mini-badge {
  color: var(--accent-strong);
  border-color: rgba(255, 255, 255, 0.72);
}

.exam-review-options {
  display: grid;
  gap: 8px;
}

.exam-review-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--panel-strong);
}

.exam-review-option.is-selected {
  border-color: #d8b15b;
  background: #fff7df;
}

.exam-review-option.is-correct {
  border-color: #80c2b4;
  background: #e1f5f0;
}

.exam-review-option.is-selected.is-correct {
  border-color: #0f766e;
  background: #dcf4ee;
}

.exam-review-option-tags {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.exam-answer-card.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(11, 108, 116, 0.16);
}

.score-hero {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(135deg, #ffffff, #edf6f7);
}

.date-status,
.notice,
.conflict-banner {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.date-status-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.notice[data-type='warning'],
.conflict-banner {
  color: var(--danger);
  background: #fde7e4;
  border-color: #e5aaa5;
}

.notice[data-type='success'] {
  color: var(--success);
  background: #dcf4ee;
  border-color: #8ccfbd;
}

.status-chip,
.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.status-chip.working {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.status-chip.non_working {
  background: #f8d8d5;
  color: var(--danger);
}

.metric-grid,
.summary-cards {
  display: grid;
  gap: 12px;
}

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

.summary-cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}

.metric-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--border-soft);
  display: grid;
  align-content: start;
  min-height: 108px;
  box-shadow: var(--shadow-soft);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.metric-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
}

.leaderboard {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.leaderboard-row,
.list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.leaderboard-row:hover,
.list-row:hover,
.metric-card:hover,
.item-row:hover {
  transform: translateY(-1px);
}

.leaderboard-row.leader {
  border-color: #c69446;
  background: linear-gradient(135deg, #fff1d6, #ffffff);
}

.leaderboard-row.self {
  border-color: #6fb5bd;
  box-shadow: inset 0 0 0 1px rgba(0, 107, 117, 0.18);
}

.leaderboard-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.leaderboard-copy {
  min-width: 0;
}

.leaderboard-copy strong,
.leaderboard-score strong {
  display: block;
}

.leaderboard-rank {
  min-width: 52px;
  padding: 8px 10px;
  border-radius: 999px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.leaderboard-row.leader .leaderboard-rank {
  color: #704000;
  background: #f5d7a6;
}

.leaderboard-score {
  text-align: right;
  white-space: nowrap;
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.category-card {
  display: grid;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 18px;
  background: var(--panel-strong);
  border: 1px solid var(--border-soft);
}

.category-card .card-title-row {
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.category-title {
  margin: 0;
  font-size: 18px;
}

.item-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.item-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff, #f7fafb);
  border: 1px solid var(--border-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.item-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.item-name {
  line-height: 1.5;
  font-weight: 600;
}

.item-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.item-field-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}

.item-inline-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.item-inline-tip {
  font-size: 11px;
  color: var(--subtle);
}

.item-ticket-wrap {
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.item-ticket-input {
  min-height: 78px;
  resize: vertical;
  line-height: 1.6;
}

.item-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

.item-manual-wrap {
  display: grid;
  grid-template-columns: auto 96px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #eef8f9;
  border: 1px dashed #82bdc5;
}

.item-manual-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.item-access-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 9px;
  color: var(--accent-strong);
  background: #ffffff;
  border: 1px solid #9bc8ce;
}

.item-note-wrap {
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.item-conflict {
  min-height: 18px;
  margin-top: -4px;
  font-size: 12px;
  color: var(--warning);
}

.item-conflict.active {
  color: var(--danger);
}

.item-manual-input {
  min-width: 0;
  width: 100%;
  max-width: 96px;
  text-align: center;
  padding: 9px 10px;
}

.item-manual-hint {
  line-height: 1.45;
}

.item-counter {
  max-width: 100%;
  white-space: normal;
  line-height: 1.45;
}

.range-bar,
.settings-grid,
.table-grid {
  display: grid;
  gap: 16px;
}

.range-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 18px;
}

.monthly-bar {
  grid-template-columns: minmax(0, 220px);
}

.history-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.history-panel {
  gap: 18px;
}

.panel.history-panel.active {
  display: grid;
}

.history-summary-cards {
  margin-bottom: 0;
}

.history-summary-cards .history-metric-card {
  min-height: 120px;
  background:
    linear-gradient(180deg, #ffffff, #f4f9fa);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    var(--shadow-soft);
}

.history-summary-cards .history-metric-card:nth-child(1) {
  background: linear-gradient(180deg, #f6fbfb, #e2f1f2);
}

.history-summary-cards .history-metric-card:nth-child(2) {
  background: linear-gradient(180deg, #fff9ef, #f2e4c8);
}

.history-summary-cards .history-metric-card:nth-child(3) {
  background: linear-gradient(180deg, #f4f8ff, #dce8f5);
}

.history-summary-cards .history-metric-card:nth-child(4) {
  background: linear-gradient(180deg, #f5fbf7, #deeee3);
}

.history-summary-cards .metric-value {
  font-size: 26px;
}

.praise-panel {
  gap: 18px;
}

.panel.praise-panel.active {
  display: grid;
}

.praise-filter-bar {
  align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.praise-filter-actions {
  align-self: end;
}

.praise-grid {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  align-items: start;
}

.praise-record-card {
  min-width: 0;
}

.praise-record-table td:nth-child(3),
.praise-record-table td:nth-child(5) {
  max-width: 260px;
}

.history-filter-shell,
.history-record-shell {
  position: relative;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(180deg, #ffffff, #f6fafb);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.history-filter-shell::before,
.history-record-shell::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 20px 20px 0 0;
}

.history-filter-shell::before {
  background: linear-gradient(90deg, #b87616, #c69446);
}

.history-record-shell::before {
  background: linear-gradient(90deg, var(--accent), #1d7f88);
}

.history-filter-shell::after,
.history-record-shell::after {
  content: '';
  position: absolute;
  top: -30px;
  right: -24px;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.42), transparent 70%);
  pointer-events: none;
}

.history-card-head {
  margin-bottom: 14px;
}

.history-filter-shell .history-bar {
  margin-bottom: 14px;
}

.history-toolbar {
  justify-content: flex-start;
}

.history-list {
  display: grid;
  gap: 18px;
}

.history-day-group {
  display: grid;
  gap: 12px;
}

.history-day-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.history-day-head strong {
  font-size: 16px;
}

.history-log-list {
  display: grid;
  gap: 12px;
}

.history-log-card {
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border-soft);
  background:
    linear-gradient(180deg, #ffffff, #f8fbfc);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 10px 24px rgba(20, 39, 43, 0.06);
}

.history-log-main {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.history-log-time {
  display: grid;
  gap: 4px;
  padding: 12px 10px;
  border-radius: 14px;
  text-align: center;
  background: #edf6f7;
  border: 1px solid #c6dde0;
}

.history-log-time span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.history-log-time strong {
  font-size: 18px;
  line-height: 1.1;
}

.history-log-copy {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.history-log-topline {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.history-log-actor {
  display: grid;
  gap: 4px;
}

.history-log-actor strong {
  font-size: 16px;
  line-height: 1.35;
}

.history-log-actor span {
  color: var(--muted);
  font-size: 13px;
}

.history-log-detail {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(237, 246, 247, 0.75);
  border: 1px solid rgba(198, 221, 224, 0.9);
  color: var(--text);
  line-height: 1.65;
}

.history-action-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.history-action-auth {
  color: #1d5878;
  background: #e4f0f7;
  border-color: #b9d2e6;
}

.history-action-exam {
  color: #0b6b75;
  background: #dceff1;
  border-color: #9fcbd0;
}

.history-action-leave {
  color: #7b4c00;
  background: #f8ecd2;
  border-color: #e3c68e;
}

.history-action-staff {
  color: #5a4a16;
  background: #f1ead3;
  border-color: #d8c898;
}

.history-action-calendar {
  color: #00645e;
  background: #ddf3ee;
  border-color: #9cd4c8;
}

.history-action-danger {
  color: var(--danger);
  background: #fde7e4;
  border-color: #e5aaa5;
}

.history-action-default {
  color: var(--text);
  background: #eef2f4;
  border-color: #d3dde2;
}

.history-empty-state {
  margin-top: 6px;
}

.leave-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 0;
}

.leave-filter-bar {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.table-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
}

.leave-grid {
  margin-top: 18px;
  align-items: start;
}

.leave-panel-header {
  margin-bottom: 14px;
}

.leave-panel-header > div:first-child {
  max-width: 760px;
}

.leave-notice {
  margin-bottom: 18px;
}

.leave-panel .leave-grid {
  gap: 20px;
}

.leave-simple-stack {
  grid-template-columns: 1fr;
}

.leave-panel {
  gap: 22px;
}

.panel.leave-panel.active {
  display: grid;
}

.leave-panel .leave-card {
  position: relative;
  background:
    linear-gradient(180deg, #ffffff, #f6fafb);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-soft);
}

.leave-panel .leave-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
}

.leave-card-type-form::before,
.leave-card-type-list::before {
  background: linear-gradient(90deg, var(--accent), #0a7e88);
}

.leave-card-entitlement-form::before,
.leave-card-entitlement-list::before {
  background: linear-gradient(90deg, var(--warm), #b87616);
}

.leave-card-record-form::before,
.leave-card-summary::before,
.leave-card-records::before {
  background: linear-gradient(90deg, #1d5878, var(--accent));
}

.leave-card-head {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-soft);
}

.leave-banner {
  margin-top: 22px;
  background:
    linear-gradient(135deg, #fff1d6, #ffffff);
  border-style: dashed;
}

.leave-balance-card {
  margin-top: 0;
  background:
    linear-gradient(135deg, #dceff1, #ffffff);
  border-color: #7eb9c1;
}

.leave-date-grid {
  align-items: end;
}

.leave-end-field {
  display: none;
}

.leave-config-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.leave-config-full {
  grid-column: 1 / -1;
}

.leave-panel .summary-cards {
  margin-top: 10px;
}

.leave-panel .summary-cards .metric-card:nth-child(1) {
  background: linear-gradient(180deg, #f7fbfb, #e2f3f1);
}

.leave-panel .summary-cards .metric-card:nth-child(2) {
  background: linear-gradient(180deg, #fffaf0, #f5e6cd);
}

.leave-panel .summary-cards .metric-card:nth-child(3) {
  background: linear-gradient(180deg, #f3faff, #dcecf5);
}

.leave-panel .summary-cards .metric-card:nth-child(4) {
  background: linear-gradient(180deg, #fff5ec, #f2dec8);
}

.leave-panel .summary-cards .metric-card:nth-child(5) {
  background: linear-gradient(180deg, #f4fbf6, #dbeee0);
}

.leave-panel .summary-cards .metric-card:nth-child(6) {
  background: linear-gradient(180deg, #fff2f2, #f3d8d8);
}

.leave-panel .metric-card {
  background:
    linear-gradient(180deg, #ffffff, #f1f6f7);
}

.leave-panel .table-scroll {
  background:
    linear-gradient(180deg, #ffffff, #f6fafb);
}

.leave-panel .data-table th,
.leave-panel .data-table td {
  font-size: 13px;
}

.leave-simple-overview {
  display: grid;
  gap: 14px;
}

.leave-person-summary {
  padding: 16px 18px;
}

.leave-person-summary-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.leave-person-summary-head strong,
.leave-person-total strong {
  display: block;
  font-size: 18px;
  line-height: 1.35;
}

.leave-person-total {
  text-align: right;
}

.leave-person-total span,
.leave-person-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.leave-person-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.leave-person-stat {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: #ffffff;
}

.leave-person-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.leave-person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.leave-person-tag {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
}

.leave-person-tag.muted {
  background: #e2e9eb;
  color: var(--muted);
}

.leave-selected-account {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #82bdc5;
  background:
    linear-gradient(135deg, #e4f3f5, #ffffff);
}

.leave-selected-account[data-empty='true'] {
  border-style: dashed;
  background:
    linear-gradient(135deg, #f3f7f8, #ffffff);
}

.leave-selected-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.leave-selected-account strong {
  font-size: 16px;
  line-height: 1.4;
}

.leave-selected-account p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.leave-account-row.is-selected td {
  background: #dceff1;
}

.leave-account-table th,
.leave-account-table td {
  white-space: nowrap;
}

.leave-account-table th:last-child,
.leave-account-table td:last-child {
  width: 1%;
}

.leave-account-table td:nth-child(6) {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leave-account-table .list-actions {
  gap: 6px;
  flex-wrap: nowrap;
}

.leave-writeoff-table {
  min-width: 720px;
  table-layout: fixed;
}

.leave-writeoff-table th:nth-child(1),
.leave-writeoff-table td:nth-child(1) {
  width: 24%;
}

.leave-writeoff-table th:nth-child(2),
.leave-writeoff-table td:nth-child(2) {
  width: 128px;
}

.leave-writeoff-table th:nth-child(3),
.leave-writeoff-table td:nth-child(3) {
  width: 108px;
}

.leave-writeoff-table th:nth-child(5),
.leave-writeoff-table td:nth-child(5) {
  width: 92px;
}

.leave-writeoff-table td {
  word-break: break-word;
}

.leave-writeoff-table td:nth-child(5) {
  white-space: nowrap;
}

.leave-row-actions {
  gap: 8px;
  flex-wrap: nowrap;
}

.leave-panel .data-table td:first-child,
.leave-panel .data-table td:nth-child(2) {
  font-weight: 600;
}

.leave-panel .checkbox-row {
  padding: 10px 12px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--border-soft);
}

.table-card {
  padding: 18px;
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
}

.table-scroll {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #ffffff;
}

.table-scroll .data-table {
  margin-top: 0;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  color: var(--text);
  font-weight: 700;
  background: #e7f1f3;
}

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

.monthly-table {
  min-width: 1180px;
}

.monthly-table th,
.monthly-table td {
  text-align: center;
  white-space: nowrap;
}

.monthly-table th:first-child,
.monthly-table td:first-child {
  text-align: left;
}

.staff-item-matrix-scroll {
  max-height: 68vh;
}

.staff-item-matrix {
  min-width: 1120px;
}

.staff-item-matrix th,
.staff-item-matrix td {
  min-width: 92px;
  text-align: center;
  white-space: nowrap;
}

.staff-item-matrix .matrix-staff-col {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 128px;
  text-align: left;
  background: #f4fafb;
  box-shadow: 1px 0 0 var(--border-soft);
}

.staff-item-matrix thead .matrix-staff-col,
.staff-item-matrix tfoot .matrix-staff-col {
  z-index: 3;
  background: #dfeff1;
}

.staff-item-matrix .matrix-total-col,
.staff-item-matrix .matrix-total-cell {
  font-weight: 800;
  color: var(--accent-strong);
  background: #f0f8f9;
}

.matrix-category,
.matrix-item {
  display: block;
}

.matrix-category {
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 600;
}

.matrix-item {
  margin-top: 2px;
  color: var(--text);
}

.matrix-zero {
  color: #aab8bc;
}

.staff-item-matrix tfoot th,
.staff-item-matrix tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  font-weight: 800;
  background: #e7f1f3;
  box-shadow: 0 -1px 0 var(--border-soft);
}

.sticky-cell {
  position: sticky;
  left: 0;
  background: var(--panel-strong);
}

.monthly-table thead .sticky-cell {
  z-index: 3;
}

.monthly-table tbody .sticky-cell {
  z-index: 1;
}

.summary-row td {
  font-weight: 700;
  background: #dceff1;
}

.summary-row .sticky-cell {
  background: #cfe8eb;
}

.staff-cell {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.cell-subtle {
  font-size: 11px;
  color: var(--subtle);
}

.cell-emphasis,
.total-cell {
  color: var(--accent);
  font-weight: 700;
}

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

.list-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.empty-state {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  border-radius: 18px;
  background: #ffffff;
  border: 1px dashed var(--border);
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .workspace,
  .exam-grid,
  .settings-grid,
  .table-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

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

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

@media (max-width: 980px) {
  .hero {
    align-items: flex-start;
  }

  .app-shell > .hero .hero-side {
    min-width: 220px;
  }

  .panel-header,
  .card-title-row {
    gap: 12px;
  }

  .exam-view-tab {
    flex-basis: calc(50% - 8px);
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .hero,
  .panel,
  .login-card {
    padding: 18px;
  }

  .hero {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 14px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 22px;
    max-width: none;
    line-height: 1.15;
  }

  .hero-text {
    max-width: none;
    margin-top: 8px;
    font-size: 13px;
  }

  .hero-side {
    min-width: 0;
    width: 100%;
    justify-items: stretch;
  }

  .hero-badges,
  .account-bar {
    justify-content: flex-start;
  }

  .account-bar {
    gap: 10px;
  }

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

  .sidebar {
    display: contents;
  }

  .sidebar-top {
    order: 1;
  }

  .main-panels {
    order: 2;
  }

  .sidebar-card-daily {
    order: 3;
  }

  .sidebar-card-monthly {
    order: 4;
  }

  .metric-grid,
  .summary-cards,
  .range-bar,
  .history-bar,
  .leave-filter-bar,
  .leave-bar {
    grid-template-columns: 1fr;
  }

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

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

  .toolbar {
    justify-content: flex-start;
  }

  .toolbar > .primary-button,
  .toolbar > .ghost-button,
  .toolbar > .tiny-button {
    flex: 1 1 150px;
  }

  .history-log-main {
    grid-template-columns: 1fr;
  }

  .history-log-time {
    justify-items: start;
    text-align: left;
  }

  .item-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-meta-grid {
    grid-template-columns: 1fr;
  }

  .item-manual-wrap {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .leave-person-summary-head,
  .leave-person-total {
    text-align: left;
  }

  .leave-person-summary-head,
  .leave-person-stats {
    grid-template-columns: 1fr;
  }

  .leave-person-summary-head {
    display: grid;
  }

  .item-manual-input {
    max-width: 120px;
  }

  .sidebar-card-header,
  .account-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar-card,
  .table-card,
  .panel,
  .login-card {
    border-radius: 22px;
  }

  .nav-shell {
    border-radius: 22px;
  }

  .nav-tab {
    padding: 12px 8px;
    min-height: 42px;
    font-size: 14px;
  }

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

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

  .exam-view-tab {
    width: 100%;
    min-height: 42px;
    padding: 10px 8px;
  }

  .exam-list-row,
  .exam-question-card,
  .exam-answer-card,
  .exam-review-card {
    padding: 12px;
    border-radius: 14px;
  }

  .exam-actions .tiny-button {
    flex: 1 1 128px;
  }

  .exam-question-nav-grid {
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  }

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

  .exam-review-filter-button {
    justify-content: space-between;
  }

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

  .exam-floating-timer {
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    min-width: 0;
    border-radius: 16px;
  }

  .exam-floating-timer .metric-value {
    margin-top: 0;
    white-space: nowrap;
  }

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

  .exam-review-option-tags {
    grid-column: 2;
    justify-content: flex-start;
  }

  .sidebar .metric-card {
    min-height: 88px;
  }

  .sidebar-card::after {
    display: none;
  }
}

@media (max-width: 640px) {
  .table-scroll-auto {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-scroll-auto .responsive-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .table-scroll-auto .responsive-table thead {
    display: none;
  }

  .table-scroll-auto .responsive-table tbody,
  .table-scroll-auto .responsive-table tr,
  .table-scroll-auto .responsive-table td {
    display: block;
    width: 100%;
  }

  .table-scroll-auto .responsive-table tr {
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .table-scroll-auto .responsive-table td {
    display: grid;
    grid-template-columns: minmax(82px, 36%) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 0;
    border-bottom: 0;
  }

  .table-scroll-auto .responsive-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }
}

@media (max-width: 480px) {
  .app-shell,
  .login-screen {
    padding: 8px;
  }

  .hero,
  .panel,
  .table-card,
  .login-card {
    padding: 14px;
    border-radius: 18px;
  }

  .history-filter-shell,
  .history-record-shell {
    padding: 14px;
  }

  .hero h1 {
    font-size: 20px;
  }

  .primary-button,
  .ghost-button {
    padding: 11px 14px;
  }

  .tiny-button,
  .status-chip,
  .mini-badge {
    padding: 7px 10px;
  }

  .exam-view-tabs,
  .nav-tabs {
    grid-template-columns: 1fr 1fr;
  }

  .exam-floating-timer {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }

  .exam-taking-body {
    padding-bottom: 112px;
  }

  .table-scroll-auto .responsive-table td {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .history-log-card {
    padding: 14px;
  }
}

@media (max-width: 900px) {
  .leave-writeoff-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .leave-writeoff-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
  }

  .leave-writeoff-table thead {
    display: none;
  }

  .leave-writeoff-table,
  .leave-writeoff-table tbody,
  .leave-writeoff-table tr,
  .leave-writeoff-table td {
    display: block;
    width: 100%;
  }

  .leave-writeoff-table th:nth-child(n),
  .leave-writeoff-table td:nth-child(n) {
    width: 100%;
    white-space: normal;
  }

  .leave-writeoff-table tr {
    padding: 12px 14px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
  }

  .leave-writeoff-table td {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 7px 0;
    border-bottom: 0;
  }

  .leave-writeoff-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  .leave-writeoff-table td[data-label='假期项目'] {
    font-size: 15px;
    font-weight: 700;
  }

  .leave-writeoff-table td[data-label='操作'] {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    margin-top: 4px;
    border-top: 1px solid var(--border-soft);
  }

  .leave-writeoff-table td[data-label='操作']::before {
    content: none;
  }

  .leave-row-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .leave-row-actions .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }
}
