:root {
  --ink: #17212b;
  --muted: #65727f;
  --line: #d9e1e8;
  --soft: #eef5f7;
  --soft-2: #f7faf6;
  --accent: #0d766e;
  --accent-dark: #084b45;
  --warn: #b83131;
  --shadow: 0 12px 30px rgba(23, 33, 43, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #edf5f7 0%, #fafafa 42%, #f2f6ef 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
.hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}
.login-card h1 { font-size: clamp(28px, 5vw, 42px); }
.demo-logins {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-size: 13px;
}
.error-text { color: var(--warn); min-height: 18px; }

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(16px, 4vw, 44px);
  background: #0b2f34;
  color: #fff;
}
.app-header h1 { margin-top: 4px; font-size: clamp(24px, 3vw, 38px); line-height: 1.08; }
.eyebrow, .section-kicker {
  color: #6c7b84;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.app-header .eyebrow { color: #a9d7d1; }
.header-actions, .toolbar-actions { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }

.app-shell { width: min(1180px, calc(100% - 24px)); margin: 18px auto 48px; }
.tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.tab {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.view {
  display: none;
  padding: clamp(16px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.view.active { display: block; }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.toolbar h2 { margin-top: 5px; font-size: clamp(22px, 3vw, 32px); }

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}
.primary-btn, .ghost-btn, .small-btn {
  min-height: 42px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 700;
}
.primary-btn { background: var(--accent); color: #fff; }
.primary-btn:hover, .primary-btn:focus { background: var(--accent-dark); }
.ghost-btn { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.small-btn { min-height: 34px; padding: 6px 10px; border-color: var(--line); background: #fff; color: var(--warn); }
.small-btn.success { color: var(--accent-dark); }

label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.tight { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wide { grid-column: 1 / -1; }
.compact-label { min-width: 180px; }

.split-panel, .admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}
.panel, .split-panel > section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-2);
  padding: 16px;
}
.panel { display: grid; gap: 12px; }
.panel h3, .split-panel h3 { margin-bottom: 14px; }
.list { display: grid; gap: 8px; }
.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.item-main { display: grid; gap: 3px; }
.item-title { font-weight: 700; }
.item-meta { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.status-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.approved { background: #e6f4ef; color: #0a5d52; }
.pending { background: #fff5df; color: #805617; }
.rejected { background: #fdeaea; color: #9d2323; }

.roster-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(160px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 18px;
}
.day-card { min-width: 160px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.day-card h3 { padding: 12px; background: #e7f2ef; font-size: 15px; }
.day-card .list { padding: 10px; }
.assignment {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
  font-size: 13px;
}
.assignment strong { font-size: 14px; }
.assignment.on-leave { background: #fff5df; border-color: #efd59a; }

.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.dashboard-strip { margin-top: 18px; margin-bottom: 0; }
.summary-box { min-height: 72px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.summary-box span { color: var(--muted); font-size: 13px; font-weight: 700; }
.summary-box strong { display: block; margin-top: 5px; font-size: 24px; }
.report-section { margin-top: 18px; }
.report-section h3 { margin-bottom: 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 920px; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 13px; }
th { background: #f2f6f6; color: #43515d; font-size: 12px; text-transform: uppercase; }

@media (max-width: 760px) {
  .app-header, .toolbar { align-items: stretch; flex-direction: column; }
  .header-actions, .toolbar-actions { align-items: stretch; }
  .tabs { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid.tight, .split-panel, .admin-grid, .summary-strip { grid-template-columns: 1fr; }
  .compact-label { min-width: 0; }
}

@media print {
  .app-header, .tabs, #clock, #account, #admin, #roster, #leave, .toolbar-actions, .primary-btn, .ghost-btn { display: none !important; }
  body { background: #fff; }
  .app-shell { width: 100%; margin: 0; }
  #reports.view { display: block; border: 0; box-shadow: none; padding: 0; }
  .table-wrap { overflow: visible; border: 0; }
  table { min-width: 0; }
}
