:root {
  color-scheme: light;
  --ink: #202124;
  --muted: #687076;
  --line: #dfe3e6;
  --paper: #fafafa;
  --panel: #ffffff;
  --green: #2f7d5c;
  --green-dark: #1f5d44;
  --blue: #315f9f;
  --red: #b44949;
  --amber: #a36c1f;
  --shadow: 0 18px 45px rgba(32, 33, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(32, 33, 36, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(32, 33, 36, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

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

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1;
}

h2 {
  font-size: 22px;
}

.clock-panel {
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  text-align: right;
}

.clock-panel span,
.clock-panel strong {
  display: block;
}

.clock-panel span {
  color: var(--muted);
  font-size: 13px;
}

.clock-panel strong {
  margin-top: 4px;
  font-size: 24px;
}

.status-band {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: center;
  min-height: 150px;
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid #cbd7d0;
  border-radius: 8px;
  background: linear-gradient(135deg, #f5fbf6, #f7f7f2 48%, #f0f5f9);
  box-shadow: var(--shadow);
}

.status-copy span {
  display: block;
  font-size: 30px;
  font-weight: 800;
}

.status-copy p {
  max-width: 680px;
  margin: 10px 0 0;
  color: #405047;
  font-size: 17px;
  line-height: 1.6;
}

.progress-wrap {
  min-width: 0;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #405047;
}

.progress-track {
  height: 18px;
  overflow: hidden;
  border: 1px solid #b7c4bc;
  border-radius: 999px;
  background: #ffffff;
}

#progressFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--blue));
  transition: width 260ms ease;
}

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

.metric,
.panel,
.history-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 25px rgba(32, 33, 36, 0.05);
}

.metric {
  min-height: 116px;
  padding: 18px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.metric strong {
  display: block;
  margin-top: 16px;
  font-size: 34px;
}

.metric.accent {
  border-color: #b7d0c2;
  background: #f5fbf6;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
  margin-bottom: 18px;
}

.panel,
.history-section {
  padding: 20px;
}

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

.icon-button {
  width: 74px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f7;
  color: var(--ink);
}

.time-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.time-pair div {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.time-pair span,
label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.time-pair strong {
  display: block;
  margin-top: 12px;
  font-size: 30px;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.primary-button {
  min-height: 88px;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
}

.primary-button.dark {
  background: #263238;
}

.manual-form,
.timeoff-form {
  display: grid;
  gap: 12px;
}

.manual-form {
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: end;
}

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

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

input,
select {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.manual-form button,
.timeoff-form button,
.sync-form button,
.tool-buttons button {
  height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--blue);
  color: #ffffff;
  white-space: nowrap;
}

.tool-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

#clearButton {
  background: #f5eeee;
  color: var(--red);
  border: 1px solid #e0c3c3;
}

.ghost-button {
  width: 100%;
  height: 42px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6f7f7;
  color: var(--ink);
}

.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #f1f3f4;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.sync-pill.ok {
  background: #eef7f1;
  color: var(--green-dark);
}

.sync-pill.bad {
  background: #f8ecec;
  color: var(--red);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

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

td {
  font-size: 15px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef4f0;
  color: var(--green-dark);
  font-size: 13px;
}

.tag.warn {
  background: #fff4e0;
  color: var(--amber);
}

.tag.bad {
  background: #f8ecec;
  color: var(--red);
}

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

@media (max-width: 860px) {
  .topbar,
  .status-band,
  .workspace {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

  .clock-panel {
    text-align: left;
  }

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

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .status-band,
  .panel,
  .history-section {
    padding: 16px;
  }

  .metrics-grid,
  .time-pair,
  .action-row,
  .tool-buttons {
    grid-template-columns: 1fr;
  }

  .status-copy span {
    font-size: 25px;
  }

  .primary-button {
    min-height: 76px;
  }
}
