:root {
  color-scheme: light;
  --bg: #eef2f5;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --text: #17212f;
  --muted: #647184;
  --line: #d8e0e8;
  --brand: #005f73;
  --brand-strong: #004a5a;
  --accent: #c99700;
  --danger-bg: #fff1ed;
  --danger-text: #9b2c13;
  --shadow: 0 24px 70px rgba(23, 33, 47, 0.16);
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 16%, rgba(201, 151, 0, 0.18), transparent 360px),
    radial-gradient(circle at 86% 78%, rgba(0, 95, 115, 0.13), transparent 420px),
    linear-gradient(135deg, rgba(0, 95, 115, 0.18), rgba(238, 242, 245, 0.2) 520px),
    var(--bg);
}

a {
  color: inherit;
}

.auth-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
}

.auth-composition {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(420px, 0.46fr) minmax(560px, 0.54fr);
  grid-template-areas:
    "brand panel";
  gap: 0;
  align-items: stretch;
}

.auth-brand,
.auth-panel {
  border-radius: 0;
}

.auth-brand {
  grid-area: brand;
  display: grid;
  align-content: space-between;
  min-height: 0;
  padding: clamp(28px, 3.2vw, 56px);
  color: #ffffff;
  border-radius: 0 42px 42px 0;
  background:
    linear-gradient(145deg, rgba(0, 74, 90, 0.98), rgba(0, 95, 115, 0.92)),
    linear-gradient(45deg, #004a5a, #0b7789);
  box-shadow: var(--shadow);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  font-size: 20px;
  font-weight: 850;
  letter-spacing: 0;
  background: rgba(255, 255, 255, 0.1);
}

.brand-text {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.brand-name {
  display: block;
  font-size: 20px;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand-subtitle {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 16px;
  line-height: 1.2;
}

.auth-brand h1 {
  max-width: 560px;
  margin: 40px 0 14px;
  font-size: clamp(36px, 3.7vw, 60px);
  line-height: 1.08;
  letter-spacing: 0;
}

.auth-brand p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 17px;
  line-height: 1.5;
}

.auth-panel {
  grid-area: panel;
  align-self: center;
  width: min(720px, calc(100% - 80px));
  min-height: 0;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(32px, 4.8vw, 68px);
  box-shadow: var(--shadow);
}

.panel-kicker {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-panel h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 2.1vw, 36px);
  line-height: 1.18;
  letter-spacing: 0;
}

.panel-copy,
.page-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.form-stack {
  margin-top: 34px;
}

.field {
  margin-top: 22px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 750;
}

.form-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.form-label-row label {
  margin-bottom: 0;
}

.form-label-row a {
  color: var(--brand);
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
}

.form-label-row a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #b8c5d1;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-size: 17px;
}

input:focus {
  outline: 3px solid rgba(0, 95, 115, 0.18);
  border-color: var(--brand);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 84px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  min-width: 64px;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  color: var(--brand);
  background: #e7f2f4;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: #d8ecef;
}

.password-toggle:focus {
  outline: 3px solid rgba(0, 95, 115, 0.18);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  margin-top: 22px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

.checkbox-label input {
  width: 17px;
  min-height: 17px;
  accent-color: var(--brand);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  color: #ffffff;
  background: var(--brand);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.button:hover {
  background: var(--brand-strong);
}

.button-full {
  width: 100%;
  margin-top: 30px;
}

.button-secondary {
  color: var(--brand);
  background: #e7f2f4;
}

.button-secondary:hover {
  background: #d8ecef;
}

.errorlist,
.form-error {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid #f2c0b5;
  border-radius: 6px;
  color: var(--danger-text);
  background: var(--danger-bg);
  list-style: none;
  font-size: 15px;
}

.dashboard-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.topbar-actions form {
  margin: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar .brand-mark {
  width: 38px;
  height: 38px;
  color: var(--brand);
  border-color: #c8d5dc;
  background: #e9f3f5;
  font-size: 14px;
}

.topbar-title {
  font-weight: 800;
}

.topbar-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.page {
  width: min(1180px, 100% - 40px);
  margin: 32px auto;
}

.page-narrow {
  width: min(760px, 100% - 40px);
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid #c9dee2;
  border-radius: 999px;
  color: var(--brand-strong);
  background: #edf8f9;
  font-size: 13px;
  font-weight: 800;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #168b6b;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.metric-card,
.info-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(23, 33, 47, 0.06);
}

.metric-card {
  padding: 20px;
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-transform: uppercase;
}

.metric-value {
  margin: 12px 0 0;
  font-size: 22px;
  font-weight: 850;
}

.metric-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
  margin-top: 18px;
}

.info-panel {
  padding: 22px;
}

.info-panel h2 {
  margin: 0;
  font-size: 18px;
}

.info-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.empty-state {
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed #bdcad4;
  border-radius: 8px;
  background: var(--surface-muted);
  color: var(--muted);
  line-height: 1.55;
}

.detail-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf1f4;
  color: var(--muted);
}

.detail-row strong {
  color: var(--text);
}

.payslip-list {
  display: grid;
  gap: 12px;
}

.payslip-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 18px 20px;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(23, 33, 47, 0.06);
  text-decoration: none;
}

.payslip-card:hover {
  border-color: #a9c8cf;
  box-shadow: 0 12px 30px rgba(23, 33, 47, 0.09);
}

.payslip-card-period {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--brand-strong);
  font-size: 16px;
  font-weight: 850;
}

.payslip-card-sub,
.payslip-card-label {
  color: var(--muted);
  font-size: 12px;
}

.payslip-card-side {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: right;
}

.payslip-card-total {
  color: var(--text);
  font-size: 17px;
  font-weight: 850;
}

.payslip-card-arrow {
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: #edf8f9;
  font-size: 12px;
  font-weight: 800;
}

.breakdown-table-wrap {
  margin-top: 24px;
  overflow-x: auto;
}

.breakdown-table {
  width: 100%;
  border-collapse: collapse;
}

.breakdown-table th,
.breakdown-table td {
  padding: 12px 0;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
}

.breakdown-table th:last-child,
.breakdown-table td:last-child {
  text-align: right;
}

.print-page {
  background: #ffffff;
}

.print-sheet {
  width: min(900px, 100% - 40px);
  margin: 32px auto;
}

.print-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.print-header h1 {
  margin: 0;
}

.print-header p {
  margin: 6px 0 0;
  color: var(--muted);
}

@media (max-width: 820px) {
  .auth-page {
    padding: 14px;
  }

  .auth-composition {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "panel";
  }

  .auth-brand {
    min-height: auto;
    padding: 22px;
    border-radius: 24px 24px 0 0;
  }

  .auth-brand h1 {
    margin-top: 26px;
    font-size: 32px;
  }

  .auth-brand p {
    font-size: 15px;
  }

  .topbar,
  .hero-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 20px;
  }

  .topbar-actions,
  .payslip-card,
  .payslip-card-side,
  .print-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .payslip-card-side {
    text-align: left;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .auth-brand {
    min-height: auto;
  }

  .auth-panel {
    width: 100%;
    border-radius: 0 0 24px 24px;
    padding: 26px 22px;
  }

  .page {
    width: min(100% - 28px, 1180px);
    margin-top: 18px;
  }
}
