:root {
  color-scheme: light;
  --ink: #18202b;
  --muted: #667085;
  --line: #d9e1ea;
  --panel: #ffffff;
  --band: #f5f7fa;
  --brand: #005f9e;
  --brand-dark: #0e3f66;
  --accent: #009b72;
  --warning: #b85c00;
  --shadow: 0 18px 45px rgba(24, 32, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--band);
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 460px);
  align-items: center;
  gap: 40px;
  padding: 48px;
  background:
    linear-gradient(110deg, rgba(0, 95, 158, 0.9), rgba(0, 155, 114, 0.78)),
    url("assets/service-pattern.svg") center/cover;
}

.brand-panel {
  color: #fff;
  max-width: 760px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.brand-mark {
  width: 92px;
  height: 92px;
  flex: 0 0 auto;
}

.brand-mark.small {
  width: 48px;
  height: 48px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: currentColor;
  opacity: 0.78;
}

h1 {
  margin: 0;
  font-size: 2.6rem;
  line-height: 1.1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
}

.brand-copy {
  margin: 18px 0 0;
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 620px;
}

.login-card {
  background: var(--panel);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 16px;
}

label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand-dark);
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
}

button,
.file-button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.link-button {
  min-height: auto;
  justify-self: center;
  padding: 2px 0;
  background: transparent;
  color: var(--brand);
  font-size: 0.92rem;
}

.login-error,
.reset-message {
  margin: 0;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.login-error {
  background: #fff0f0;
  color: #9b1c1c;
  border: 1px solid #ffd1d1;
}

.reset-message {
  background: #eaf6ff;
  color: var(--brand-dark);
  border: 1px solid #c9e4f8;
}

.secondary-button {
  background: #e9eef4;
  color: var(--brand-dark);
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  background: #e9eef4;
  color: var(--brand-dark);
  font-size: 0.86rem;
}

.small-button.danger {
  background: #fff0f0;
  color: #9b1c1c;
}

.dashboard-view {
  max-width: 1220px;
  margin: 0 auto;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 0 24px;
}

.brand-compact {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-compact h1 {
  font-size: 1.55rem;
}

.menu-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px;
  background: #eaf1f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.menu-button {
  background: transparent;
  color: var(--brand-dark);
  min-height: 40px;
}

.menu-button.is-active {
  background: var(--brand);
  color: #fff;
}

.controls-band,
.table-tools {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(180px, 240px) max-content;
  gap: 14px;
  align-items: end;
  padding: 18px;
  background: #eaf1f5;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.field-group {
  display: grid;
  gap: 7px;
}

.file-button input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  min-height: 112px;
  display: grid;
  align-content: space-between;
}

.metric span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.metric strong {
  font-size: 2rem;
  letter-spacing: 0;
}

.metric.compact {
  min-height: 84px;
  padding: 14px 16px;
}

.metric.compact strong {
  font-size: 1.65rem;
}

.table-tools {
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px);
  margin-bottom: 14px;
}

.data-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  position: sticky;
  top: 0;
  background: #f0f5f8;
  color: var(--brand-dark);
  font-size: 0.82rem;
}

td:nth-child(4),
td:nth-child(5),
td:nth-child(6) {
  font-weight: 700;
}

.rate-pill {
  display: inline-flex;
  min-width: 64px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f6f1;
  color: #006b52;
}

.rate-pill.low {
  background: #fff0df;
  color: var(--warning);
}

.status-pill {
  display: inline-flex;
  min-width: 72px;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 999px;
  background: #e7f6f1;
  color: #006b52;
  font-weight: 700;
}

.status-pill.inactive {
  background: #eef1f5;
  color: var(--muted);
}

.status-pill.half-day {
  background: #fff0df;
  color: var(--warning);
}

.status-pill.leave {
  background: #fff0f0;
  color: #9b1c1c;
}

.staff-form-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.staff-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.attendance-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr)) max-content;
  gap: 14px;
  align-items: end;
}

.location-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) max-content;
  gap: 14px;
  align-items: end;
}

.form-actions,
.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.row-actions {
  flex-wrap: wrap;
}

.empty-state {
  margin: 0;
  padding: 24px;
  color: var(--muted);
}

.is-hidden {
  display: none;
}

@media (max-width: 760px) {
  .login-view {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 24px;
  }

  .brand-panel {
    display: grid;
  }

  h1 {
    font-size: 2rem;
  }

  .dashboard-view {
    padding: 16px;
  }

  .topbar,
  .controls-band,
  .table-tools,
  .staff-form,
  .attendance-form,
  .location-form {
    grid-template-columns: 1fr;
  }

  .menu-bar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

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

@media (max-width: 480px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }
}
