:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --surface-2: #f7efe0;
  --text: #1d2a33;
  --muted: #5c6b73;
  --accent: #0e7490;
  --accent-2: #d97706;
  --line: #dfd4bf;
  --danger: #b42318;
  --ok: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 116, 144, 0.10), transparent 28%),
    radial-gradient(circle at top right, rgba(217, 119, 6, 0.12), transparent 22%),
    var(--bg);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 24px 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
}

.topbar h1 {
  margin: 0;
  font-size: 28px;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
}

nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

nav a,
.button-link,
button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.logout-form {
  margin: 0;
}

.logout-button {
  font: inherit;
}

button:hover,
nav a:hover,
.button-link:hover {
  border-color: var(--accent);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(29, 42, 51, 0.06);
}

.toolbar,
.employee-form,
.override-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
}

select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: white;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  margin-top: 22px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-link:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow: 0 14px 28px rgba(29, 42, 51, 0.08);
}

.card-link.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(14, 116, 144, 0.12);
}

.card strong {
  display: block;
  font-size: 34px;
  margin-bottom: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

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

.section-head h2 {
  margin: 0 0 4px;
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge.ok {
  background: rgba(6, 118, 71, 0.12);
  color: var(--ok);
}

.badge.warn {
  background: rgba(217, 119, 6, 0.14);
  color: var(--accent-2);
}

.badge.danger {
  background: rgba(180, 35, 24, 0.10);
  color: var(--danger);
}

.status {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.status.ok {
  background: rgba(6, 118, 71, 0.08);
  color: var(--ok);
}

.status.error {
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.login-page {
  min-height: 100vh;
}

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

.login-card {
  width: min(100%, 420px);
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(29, 42, 51, 0.12);
}

.login-card h1 {
  margin: 0 0 8px;
}

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

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

.alert.error {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.08);
  color: var(--danger);
}

.muted-inline {
  color: var(--muted);
  font-size: 14px;
}

.period-details summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.period-details-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.period-detail-item {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

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

  .page {
    padding: 16px;
  }

  table {
    font-size: 14px;
  }

  .override-form {
    min-width: 220px;
  }

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