:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #eef4f2;
  --text: #17201c;
  --muted: #66736d;
  --line: #d9e0dc;
  --accent: #0f7a5f;
  --accent-2: #155e9f;
  --danger: #b42318;
  --warning: #9a5b00;
  --paid: #4f46e5;
  --shadow: 0 10px 30px rgba(28, 40, 34, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

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

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

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

.main {
  width: min(1180px, calc(100% - 28px));
  margin: 22px auto 56px;
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eef4f2;
}

.login {
  width: min(420px, 100%);
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login h1,
.section h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

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

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

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

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

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.section {
  margin-top: 18px;
}

.clock {
  display: grid;
  gap: 18px;
  align-items: center;
  grid-template-columns: 1fr auto;
}

.timer {
  font-size: 42px;
  font-weight: 750;
  line-height: 1;
}

.btn {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: #e8eeeb;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.blue {
  background: var(--accent-2);
  color: #fff;
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 11px;
  min-height: 42px;
}

textarea {
  resize: vertical;
  min-height: 84px;
}

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

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #e8f4ef;
}

.notice {
  border: 1px solid #e5c67a;
  background: #fff7df;
  color: #5f3e00;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.error {
  color: var(--danger);
  font-size: 14px;
}

.success {
  color: var(--accent);
  font-size: 14px;
}

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

.metric {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 14px;
}

.metric strong {
  display: block;
  font-size: 24px;
  margin-top: 5px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: var(--muted);
  background: #f2f5f4;
  font-weight: 700;
}

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

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #e8eeeb;
}

.status.submitted {
  color: var(--accent-2);
  background: #e8f1fb;
}

.status.approved {
  color: var(--accent);
  background: #e7f5ef;
}

.status.paid {
  color: var(--paid);
  background: #ecebff;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 3px 8px;
  background: #fff3db;
  color: var(--warning);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 24, 20, 0.45);
  z-index: 30;
  padding: 16px;
}

.modal {
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hidden {
  display: none !important;
}

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

  .grid.two,
  .grid.three,
  .clock,
  .summary-row {
    grid-template-columns: 1fr;
  }

  .main {
    width: min(100% - 20px, 1180px);
    margin-top: 12px;
  }

  .timer {
    font-size: 36px;
  }

  .panel {
    padding: 14px;
  }
}
