:root {
  --accent: #2563eb;
  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --border: #e2e5ec;
  --text: #1f2430;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

header h1 { font-size: 1.15rem; margin: 0; }

.link { color: var(--accent); text-decoration: none; font-weight: 600; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.banner {
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px;
  font-size: 0.9rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}

#file-input { display: none; }

.upload-btn {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 14px 24px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
}

.hint { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }

.receipt-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.receipt-card h3 { margin: 0 0 10px; font-size: 1rem; }

.receipt-card label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}

.receipt-card input {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  margin-top: 4px;
}

.receipt-card .remove {
  float: right;
  color: #dc2626;
  background: none;
  border: none;
  font-size: 0.85rem;
  cursor: pointer;
}

.primary-btn {
  display: inline-block;
  width: 100%;
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: 10px;
}

.primary-btn:disabled { background: #9ca3af; cursor: not-allowed; }

#status { text-align: center; color: var(--muted); margin: 10px 0; min-height: 1.2em; }

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.report-table th, .report-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.report-table tfoot td { font-weight: 700; }

.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions .primary-btn { margin-top: 0; }

#send-status { text-align: center; color: var(--muted); margin-top: 10px; }

/* ---- Employee schedule ---- */

main.wide { max-width: none; }

.schedule-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.schedule-toolbar input[type="month"] {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.legend span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-right: 4px;
}

.small-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
}
.small-btn { text-decoration: none; display: inline-block; }
.small-btn.secondary { background: var(--card-bg); color: var(--accent); border: 1px solid var(--border); }
.small-btn:disabled { background: #9ca3af; color: white; cursor: not-allowed; }

.grid-wrap {
  overflow: auto;
  max-height: 75vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
}

.schedule-table { border-collapse: separate; border-spacing: 0; font-size: 0.75rem; }

.schedule-table th, .schedule-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2px;
  text-align: center;
  white-space: nowrap;
}

.schedule-table thead th {
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 2;
  min-width: 52px;
}
.schedule-table thead th small { color: var(--muted); font-weight: 400; }
.schedule-table thead th.weekend { background: #eef2ff; }

.schedule-table .name-col {
  position: sticky;
  left: 0;
  background: var(--card-bg);
  z-index: 1;
  text-align: left;
  min-width: 150px;
}
.schedule-table thead .name-col { z-index: 3; }

.schedule-table .name-col input {
  width: 100%;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  padding: 4px;
}

.schedule-table select {
  width: 52px;
  border: none;
  border-radius: 4px;
  padding: 4px 0;
  font-size: 0.75rem;
  background: transparent;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.schedule-table .total-col { font-weight: 700; min-width: 50px; }

.schedule-table tfoot td, .schedule-table tfoot th { background: #f9fafb; font-weight: 600; }
.schedule-table tfoot tr { position: sticky; z-index: 2; }
.schedule-table tfoot tr:nth-child(1) { bottom: 66px; }
.schedule-table tfoot tr:nth-child(2) { bottom: 44px; }
.schedule-table tfoot tr:nth-child(3) { bottom: 22px; }
.schedule-table tfoot tr:nth-child(4) { bottom: 0; }
.schedule-table tfoot td, .schedule-table tfoot th { height: 22px; }
.schedule-table tfoot .hours-row td, .schedule-table tfoot .hours-row th {
  font-weight: 700;
  border-top: 2px solid var(--text);
}

.shift-D { background: #dbeafe; color: #1e3a8a; }
.shift-E { background: #fef3c7; color: #78350f; }
.shift-N { background: #ede9fe; color: #4c1d95; }
.shift-OFF { background: #f3f4f6; color: var(--muted); }

.roster { margin-top: 20px; max-width: 640px; }
.roster summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.roster input { width: 100%; padding: 6px; border: 1px solid var(--border); border-radius: 6px; }
.roster td:last-child { white-space: nowrap; }

@media print {
  @page { size: landscape; margin: 8mm; }
  header, .schedule-toolbar, .banner, .roster, .hint, #status { display: none; }
  main.wide { padding: 0; }
  .grid-wrap { overflow: visible; max-height: none; border: none; }
  .schedule-table { font-size: 7pt; }
  .schedule-table thead th, .schedule-table .name-col, .schedule-table tfoot tr { position: static; min-width: 0; }
  .schedule-table select { width: auto; }
  .schedule-table .name-col { min-width: 90px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
}

.login-form { max-width: 360px; margin: 24px auto; }
.error { color: #dc2626; font-size: 0.9rem; margin: 10px 0 0; }
