:root {
  color-scheme: light;
  --ink: #112746;
  --muted: #7c6d5c;
  --line: #eadfce;
  --surface: rgba(255, 255, 255, 0.88);
  --shell: #fbf7f1;
  --nav: #fffaf4;
  --nav-active: #faf3e9;
  --blue: #113e78;
  --green: #3e7c55;
  --amber: #b78a43;
  --red: #a9473f;
  --teal: #356c72;
  --gold: #b9914e;
  --gold-soft: #f4eadb;
  --shadow: 0 12px 34px rgba(27, 33, 45, 0.06);
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 255, 255, 0.95), transparent 32%),
    linear-gradient(110deg, #fffaf5 0%, #fbf7f1 44%, #ffffff 100%);
}

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

button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  min-height: 36px;
  border-radius: 9px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.76) inset;
}

button:hover {
  border-color: #c8a96d;
}

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

button.primary {
  background: #fffaf5;
  border-color: #d9c49f;
  color: #9a6f2a;
}

button.success {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

button.danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

button.subtle-danger {
  background: #fff;
  color: var(--red);
  border-color: #efc5c5;
}

button.mini {
  min-width: 58px;
  min-height: 28px;
  padding: 0 7px;
}

button.icon {
  width: 36px;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
}

.hidden-input {
  display: none;
}

.inline-select {
  min-height: 24px;
  border-radius: 4px;
  padding: 2px 22px 2px 6px;
  font-size: 12px;
}

.dept-select {
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-transform: uppercase;
}

label.wide {
  grid-column: 1 / -1;
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.side-nav {
  background: var(--nav);
  color: var(--ink);
  padding: 22px 18px;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 0 8px 24px;
}

.brand strong {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

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

.nav-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.nav-list button {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  text-align: left;
  width: 100%;
  min-height: 58px;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  border-radius: 10px;
  padding: 0 18px;
  box-shadow: none;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
}

.nav-list button.active {
  background: var(--nav-active);
  border-color: var(--line);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.nav-list button span:first-child {
  color: #8d8172;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 23px;
}

.main {
  min-width: 0;
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid var(--line);
}

.collapse-button {
  position: fixed;
  left: 318px;
  top: 26px;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 999px;
  color: var(--ink);
  background: #fffaf5;
}

.topbar-meta {
  display: flex;
  gap: 18px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.role-switch {
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
  text-transform: none;
  font-size: 12px;
}

.role-switch select {
  width: auto;
  min-width: 150px;
  min-height: 48px;
  padding: 8px 18px;
}

.content {
  min-height: calc(100vh - 78px);
  margin: 0 26px 26px 0;
  padding: 34px 36px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 0 18px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.content > h1 {
  margin: 0 0 20px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
}

.user-badge {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid #ddc8a7;
  border-radius: 999px;
  color: var(--gold);
  font-family: var(--serif);
  background: #fffaf5;
}

.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
}

.section-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0;
}

.section-body {
  padding: 18px 24px;
}

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

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

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

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

.metric {
  min-height: 124px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 25px 28px 20px 94px;
  background: rgba(255, 255, 255, 0.78);
  position: relative;
  box-shadow: var(--shadow);
}

.metric i,
.section-emblem {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid #e0ccb0;
  border-radius: 999px;
  color: var(--gold);
  font-style: normal;
  font-family: ui-sans-serif, system-ui, sans-serif;
  background: #fffaf5;
}

.metric i {
  position: absolute;
  left: 28px;
  top: 29px;
  font-size: 24px;
}

.section-emblem {
  margin-right: 14px;
  vertical-align: middle;
  font-size: 22px;
}

.metric span {
  display: block;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 500;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.toolbar label {
  min-width: 160px;
}

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

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

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--serif);
  font-size: 14px;
}

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

th {
  color: #6d6371;
  background: rgba(255, 250, 245, 0.72);
  font-family: var(--serif);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.timecard-grid {
  font-size: 12px;
  table-layout: auto;
}

.timecard-grid th,
.timecard-grid td {
  padding: 7px 9px;
}

.timecard-grid th:nth-child(n+6):nth-child(-n+13),
.timecard-grid td:nth-child(n+6):nth-child(-n+13) {
  text-align: right;
  min-width: 48px;
}

.timecard-grid th:nth-last-child(-n+3),
.timecard-grid td:nth-last-child(-n+3) {
  text-align: center;
  width: 74px;
}

.timecard-grid .day-even td {
  background: #fff;
}

.timecard-grid .day-odd td {
  background: rgba(250, 243, 233, 0.58);
}

.timecard-grid tr.lunch td,
.timecard-grid tr.benefit td {
  color: #52606b;
}

.timecard-grid tfoot th {
  background: #edf2f5;
  color: var(--ink);
}

.timecard-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(360px, 1fr) minmax(120px, 1fr);
  align-items: end;
}

.centered-toolbar {
  justify-content: center;
  align-items: end;
}

.nav-pair button {
  align-self: end;
  margin-bottom: 0;
}

.period-nav label {
  min-width: 250px;
}

.timecard-summary {
  max-width: 920px;
}

.timecard-summary th,
.timecard-summary td {
  text-align: right;
}

.timecard-summary th:first-child,
.timecard-summary td:first-child {
  text-align: left;
}

.action-cell {
  padding-left: 4px;
  padding-right: 4px;
}

.nav-pair {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pair h2 {
  min-width: 170px;
  text-align: center;
}

.employee-nav label {
  min-width: 220px;
}

.nav-pair.compact {
  gap: 6px;
}

.nav-pair.compact button {
  min-width: 30px;
}

.check-label {
  display: flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
}

.check-label input {
  width: auto;
  min-height: auto;
}

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  background: #eef2f5;
  color: var(--muted);
}

.status.in {
  background: #e5f4ec;
  color: var(--green);
}

.status.out {
  background: #edf1f4;
  color: #52606b;
}

.status.lunch {
  background: #fff2dc;
  color: var(--amber);
}

.status.review {
  background: #ffe8e5;
  color: var(--red);
}

.status.approved {
  background: #e7f3f4;
  color: var(--teal);
}

.note {
  color: var(--muted);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
}

.kiosk {
  max-width: 760px;
  margin: 0 auto;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-pad button {
  min-height: 60px;
  font-size: 20px;
  font-weight: 750;
}

.kiosk-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kiosk-actions button {
  min-height: 58px;
  font-weight: 750;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.request-row,
.issue-row {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.request-row:first-child,
.issue-row:first-child {
  padding-top: 0;
}

.request-row:last-child,
.issue-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.calendar {
  display: grid;
  grid-template-columns: 120px repeat(6, minmax(130px, 1fr));
  overflow-x: auto;
}

.calendar.employee-calendar {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.calendar div {
  min-height: 48px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.calendar div:not(.head):not(.name) {
  cursor: pointer;
}

.calendar div:not(.head):not(.name):hover {
  background: #f0f6fa;
}

.employee-calendar div:not(.head) {
  cursor: default;
}

.employee-calendar div:not(.head):hover {
  background: #fff;
}

.calendar .head,
.calendar .name {
  background: #f7f9fa;
  color: var(--muted);
  font-weight: 750;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 250, 245, 0.5);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  background: #202326;
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  max-width: 360px;
  z-index: 20;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  padding: 0;
  background: #fffaf5;
}

dialog::backdrop {
  background: rgba(32, 35, 38, 0.42);
}

.modal-body {
  padding: 16px;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 10px;
  }

  .brand {
    padding-bottom: 10px;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 10px;
  }

  .nav-list button {
    grid-template-columns: 1fr;
    justify-items: center;
    font-size: 12px;
  }

  .nav-list button span:first-child {
    display: none;
  }

  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4,
  .split {
    grid-template-columns: 1fr;
  }

  .topbar {
    height: auto;
    align-items: flex-start;
    gap: 10px;
    flex-direction: column;
    padding: 14px;
  }

  .content {
    padding: 14px;
  }
}

@media print {
  @page {
    size: landscape;
    margin: 0.28in;
  }

  body {
    background: #fff;
  }

  .app-shell {
    display: block;
    min-height: 0;
  }

  .side-nav,
  .topbar,
  .actions,
  .toolbar,
  .toast,
  dialog,
  .section:has(#punchDialog),
  .section:has(#scheduleDialog),
  .section-header button,
  .action-cell {
    display: none !important;
  }

  .content {
    padding: 0;
  }

  .section {
    border: 0;
    box-shadow: none;
    margin-bottom: 8px;
    page-break-inside: avoid;
  }

  .section-header {
    padding: 4px 0;
    border-bottom: 1px solid #bbb;
  }

  .section-body {
    padding: 4px 0;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    font-size: 9px;
  }

  th,
  td {
    padding: 2px 4px;
  }

  .timecard-grid th:nth-last-child(-n+3),
  .timecard-grid td:nth-last-child(-n+3) {
    display: none;
  }

.summary-box {
  break-before: avoid;
}
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, #fff 0, #f7f1e8 58%, #efe4d6 100%);
}

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

.login-panel img {
  width: 56px;
  height: 56px;
}

.login-panel h1 {
  margin: 0;
}
