:root {
  --tb-blue: #1a5b9e;
  --tb-blue-dark: #14497f;
  --tb-bg: #f4f6f9;
  --tb-text: #1f2933;
  --tb-muted: #687385;
  --tb-border: #d8dee8;
  --tb-danger: #c0392b;
  --tb-success: #1e7e45;
  --tb-radius: 10px;
  --tb-shadow: 0 6px 24px rgba(20, 40, 70, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--tb-bg);
  color: var(--tb-text);
  line-height: 1.5;
}

/* ── Auth pages (centered card) ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow);
  padding: 32px;
}

.brand {
  text-align: center;
  margin-bottom: 24px;
}
.brand h1 {
  margin: 0;
  font-size: 22px;
  color: var(--tb-blue);
  letter-spacing: 0.3px;
}
.brand p {
  margin: 4px 0 0;
  color: var(--tb-muted);
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--tb-text);
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 16px;
  background: #fff;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--tb-blue);
  box-shadow: 0 0 0 3px rgba(26, 91, 158, 0.12);
}

.btn {
  display: inline-block;
  width: 100%;
  padding: 11px 16px;
  background: var(--tb-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.btn:hover { background: var(--tb-blue-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-link {
  background: none;
  border: none;
  color: var(--tb-blue);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }

.auth-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 14px;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}
.message.show { display: block; }
.message.error   { background: #fdecea; color: var(--tb-danger); }
.message.success { background: #e7f6ec; color: var(--tb-success); }

/* ── Dashboard (placeholder for this phase) ── */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--tb-border);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar .logo { color: var(--tb-blue); font-weight: 700; }
.topbar .user { color: var(--tb-muted); font-size: 14px; }
.container { max-width: 960px; margin: 32px auto; padding: 0 24px; }
.card {
  background: #fff;
  border-radius: var(--tb-radius);
  box-shadow: var(--tb-shadow);
  padding: 24px;
}
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--tb-blue);
}

/* ── Nav links in topbar ── */
.topbar nav a {
  color: var(--tb-muted);
  text-decoration: none;
  font-size: 14px;
  margin-right: 18px;
  font-weight: 600;
}
.topbar nav a:hover { color: var(--tb-blue); }
.topbar nav a.active { color: var(--tb-blue); }

/* ── Layout helpers ── */
.container.wide { max-width: 1100px; }
.row { display: flex; flex-wrap: wrap; gap: 20px; }
.col { flex: 1; min-width: 280px; }
h2.section { margin: 0 0 16px; font-size: 18px; }
.muted { color: var(--tb-muted); }
.mt-24 { margin-top: 24px; }

/* ── Balance cards ── */
.balance-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.balance-card {
  flex: 1;
  min-width: 160px;
  background: #fff;
  border: 1px solid var(--tb-border);
  border-radius: var(--tb-radius);
  padding: 16px;
}
.balance-card .label { font-size: 13px; color: var(--tb-muted); font-weight: 600; }
.balance-card .big { font-size: 28px; font-weight: 700; color: var(--tb-blue); margin: 6px 0 2px; }
.balance-card .sub { font-size: 12px; color: var(--tb-muted); }

/* ── Buttons (inline / secondary / small) ── */
.btn.inline { width: auto; }
.btn.secondary { background: #fff; color: var(--tb-blue); border: 1px solid var(--tb-border); }
.btn.secondary:hover { background: #f4f6f9; }
.btn.small { padding: 6px 12px; font-size: 13px; width: auto; }
.btn.danger { background: var(--tb-danger); }
.btn.danger:hover { background: #a5301f; }

/* ── Table ── */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--tb-border);
  vertical-align: middle;
}
table.data th { color: var(--tb-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; }
table.data tr:last-child td { border-bottom: none; }

/* ── Status pills ── */
.status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; text-transform: capitalize; }
.status.pending   { background: #fff3e0; color: #b26a00; }
.status.approved  { background: #e7f6ec; color: var(--tb-success); }
.status.rejected  { background: #fdecea; color: var(--tb-danger); }
.status.cancelled { background: #eef2f7; color: var(--tb-muted); }

/* ── Inline form rows ── */
.field-row { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row .col { min-width: 200px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.checkbox-row input { width: auto; margin: 0; }
.checkbox-row label { margin: 0; font-weight: 500; }
.hidden { display: none; }

/* ── Calendar ── */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-title { font-size: 18px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 12px; font-weight: 700; color: var(--tb-muted); padding: 6px 0; }
.cal-cell {
  min-height: 92px;
  border: 1px solid var(--tb-border);
  border-radius: 8px;
  padding: 5px 6px;
  background: #fff;
  font-size: 12px;
  overflow: hidden;
}
.cal-cell.muted-day { background: #fafbfc; }
.cal-cell.weekend { background: #f7f9fb; }
.cal-cell.holiday { background: #fff6f5; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--tb-blue); }
.cal-date { font-weight: 700; color: var(--tb-text); margin-bottom: 4px; }
.cal-holiday-name { color: var(--tb-danger); font-size: 11px; line-height: 1.2; margin-bottom: 3px; }
.cal-leave {
  border-radius: 5px;
  padding: 2px 5px;
  margin-bottom: 3px;
  color: #fff;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-leave.pending { opacity: 0.6; border: 1px dashed rgba(255,255,255,0.8); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 14px; font-size: 13px; }
.legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* ── Modal ── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,40,70,0.45);
  display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: #fff; border-radius: var(--tb-radius); box-shadow: var(--tb-shadow);
  width: 100%; max-width: 460px; padding: 24px;
}
.modal h3 { margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.warn-box { background: #fff3e0; color: #8a5300; border-radius: 8px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

.text-danger { color: var(--tb-danger); font-weight: 600; }
.text-success { color: var(--tb-success); }
.pill-count { background: var(--tb-blue); color:#fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; margin-left: 6px; }
