:root {
  --blue: #1872b9;
  --green: #44b849;
  --red: #d83a34;
  --gray: #8f96a1;
  --ink: #223041;
  --muted: #617283;
  --bg: #eef4f8;
  --card: #ffffff;
  --line: #d7e1ea;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(180deg, #edf5fb 0%, #f6fafc 40%, #eef3f6 100%);
  color: var(--ink);
}
a { color: var(--blue); text-decoration: none; }
.bo-page-wrap { padding: 50px; }
.bo-shell {
  display: flex;
  min-height: calc(100vh - 100px);
  background: rgba(255,255,255,0.35);
  border-radius: 26px;
}
.bo-sidebar {
  width: 260px;
  background: #102437;
  color: white;
  padding: 22px 16px;
  border-radius: 24px 0 0 24px;
}
.bo-logo {
  width: 100%;
  max-width: 180px;
  background: white;
  border-radius: 14px;
  display: block;
  margin-bottom: 12px;
}
.bo-brand-title { font-size: 22px; font-weight: 800; }
.bo-brand-sub { font-size: 14px; opacity: 0.85; }
.bo-nav { margin-top: 20px; }
.bo-nav a {
  display: block;
  color: white;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.05);
}
.bo-nav a:hover { background: rgba(255,255,255,0.12); }
.bo-main {
  flex: 1;
  padding: 24px;
}
.bo-topbar h1 { margin: 0; font-size: 32px; }
.bo-topbar p { margin: 6px 0 0; color: var(--muted); }
.bo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 16px;
  margin-top: 18px;
}
.bo-card, .bo-table-wrap, .bo-form-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 8px 24px rgba(24, 114, 185, 0.06);
}
.bo-table-wrap { padding: 0; overflow: auto; }
.bo-card h3 { margin: 0 0 8px; font-size: 16px; }
.bo-big { font-size: 34px; font-weight: 800; }
.bo-section { margin-top: 20px; }
.bo-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.bo-filters input, .bo-filters select,
.bo-form-grid input, .bo-form-grid select, .bo-form-grid textarea {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 180px;
  width: 100%;
}
.bo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 14px;
}
.bo-form-grid .full { grid-column: 1 / -1; }
.bo-form-grid label {
  display: block;
  font-weight: 700;
  margin-bottom: 6px;
}
.bo-btn, button.bo-btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
}
.bo-btn.green { background: var(--green); }
.bo-btn.red { background: var(--red); }
.bo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.badge.green { background: #dff4e1; color: #1e6a22; }
.badge.red { background: #fde2e0; color: #9f241d; }
.badge.blue { background: #dfeefb; color: #175789; }
.badge.gray { background: #eceff3; color: #566371; }
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
th { background: #f7fafc; }
.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 700;
}
.notice.ok { background: #e6f7e7; color: #1e6a22; }
.notice.err { background: #fde7e5; color: #9f241d; }
.login-shell { min-height: 100vh; display:flex; align-items:center; justify-content:center; padding:24px; }
.login-card {
  width: 100%;
  max-width: 460px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 12px 30px rgba(24,114,185,0.08);
}
.login-logo { width: 100%; max-width: 230px; background:white; border-radius:14px; display:block; margin:0 auto 14px; }
.login-card h1 { margin: 0 0 8px; }
.login-card p { color: var(--muted); }
.login-card label { display:block; font-weight:700; margin-top:12px; margin-bottom:6px; }
.login-card input { width:100%; padding:12px; border:1px solid var(--line); border-radius:12px; }
.login-card button { width:100%; margin-top:14px; padding:12px; border:0; border-radius:12px; background:var(--blue); color:white; font-weight:700; }
.login-error { color: var(--red); min-height: 18px; margin-top: 10px; }
#map, #routeMap { width: 100%; height: 520px; border-radius: 18px; border: 1px solid var(--line); }
@media (max-width: 1100px) {
  .bo-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .bo-page-wrap { padding: 18px; }
  .bo-shell { flex-direction: column; min-height: auto; }
  .bo-sidebar { width: 100%; border-radius: 24px 24px 0 0; }
}
@media (max-width: 640px) {
  .bo-grid { grid-template-columns: 1fr; }
  .bo-form-grid { grid-template-columns: 1fr; }
  .bo-main { padding: 14px; }
  .bo-page-wrap { padding: 10px; }
}

.bo-meta { margin-top: 8px; color: var(--muted); font-size: 13px; }

.bo-grid-compact {
  grid-template-columns: repeat(6, minmax(0,1fr));
}
.register-wrap {
  max-width: 100%;
  overflow: auto;
}
.register-table {
  min-width: 1650px;
  font-size: 12px;
}
.register-table th,
.register-table td {
  padding: 9px 10px;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
}
.register-table .code-col {
  min-width: 92px;
  text-align: left;
}
.register-table .name-col {
  min-width: 190px;
  text-align: left;
}
.register-table .day-col {
  min-width: 56px;
}
.register-table .sticky-col {
  position: sticky;
  background: #fff;
  z-index: 2;
}
.register-table th.sticky-col {
  background: #f7fafc;
  z-index: 4;
}
.register-table .code-col.sticky-col {
  left: 0;
}
.register-table .name-col.sticky-col {
  left: 92px;
  box-shadow: 6px 0 8px rgba(16,36,55,0.05);
}
.register-table td.has-hours {
  background: #eef8ef;
  color: #1e6a22;
  font-weight: 700;
}
.register-table tfoot th {
  background: #eef4f8;
  font-weight: 800;
}
@media (max-width: 1300px) {
  .bo-grid-compact { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .bo-grid-compact { grid-template-columns: 1fr; }
}

/* Compact report controls and contain wide register tables inside the page */
.bo-main { min-width: 0; overflow: hidden; }
.bo-table-wrap, .register-wrap { max-width: 100%; overflow-x: auto; }
.report-filter-card {
  display: grid;
  grid-template-columns: 160px 160px minmax(180px, 260px) auto auto;
  gap: 8px;
  align-items: center;
  max-width: 880px;
  margin: 14px 0 12px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(24, 114, 185, 0.05);
}
.report-filter-card input,
.report-filter-card select {
  min-width: 0;
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
}
.report-filter-card .bo-btn {
  padding: 9px 12px;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .report-filter-card {
    grid-template-columns: 1fr 1fr;
    max-width: 100%;
  }
}
@media (max-width: 640px) {
  .report-filter-card { grid-template-columns: 1fr; }
}

/* Compact monthly period selector */
.monthly-period-filter {
  grid-template-columns: 180px 180px auto auto;
  max-width: 720px;
}
.monthly-period-filter label {
  display: grid;
  gap: 4px;
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
}
.monthly-period-filter label span {
  line-height: 1;
}
@media (max-width: 900px) {
  .monthly-period-filter { grid-template-columns: 1fr 1fr; max-width: 100%; }
}
@media (max-width: 640px) {
  .monthly-period-filter { grid-template-columns: 1fr; }
}

/* Time Adjustments payroll override clarity + confirmation */
.bo-nav a.active,
.bo-nav a[aria-current="page"] {
  background: #2386d1;
  color: #fff;
  font-weight: 900;
  border-left: 5px solid #42c45a;
  padding-left: 13px;
}
.ta-table-wrap { max-width: 100%; overflow-x: auto; }
.ta-table { min-width: 1550px; }
.ta-system-value {
  background: #eef2f7;
  border: 1px solid #c9d6e2;
  border-radius: 10px;
  padding: 10px 12px;
  color: #516173;
  font-weight: 900;
  text-align: center;
  min-width: 78px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.ta-hm {
  display: grid;
  grid-template-columns: 64px auto 64px auto;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}
.ta-hm input {
  width: 64px;
  border: 1px solid #c9d6e2;
  border-radius: 10px;
  padding: 10px 8px;
  background: #fff;
  font-weight: 800;
  text-align: center;
}
.ta-hm span { font-weight: 900; color: #516173; }
.ta-reason { min-width: 260px; }
.ta-hidden-row-form { display: none; }
.ta-confirm {
  font-size: 16px;
  line-height: 1.45;
  border: 2px solid #42c45a;
}
.ta-confirm-actions { margin-top: 12px; }
.ta-confirm-actions .bo-btn {
  display: inline-block;
  text-decoration: none;
  padding: 10px 18px;
}
