:root {
  color-scheme: light;
  --corporate-night: #101D30;
  --corporate-blue: #203E63;
  --corporate-interaction: #152C49;
  --corporate-pearl: #F2F4F7;
  --corporate-white: #FFFFFF;
  --corporate-text: #17263C;
  --corporate-muted: #596579;
  --corporate-border: #D8DEE7;
  --corporate-gold: #B88936;
  --navy: var(--corporate-blue);
  --navy-dark: var(--corporate-night);
  --navy-soft: var(--corporate-interaction);
  --ink: var(--corporate-text);
  --muted: var(--corporate-muted);
  --line: var(--corporate-border);
  --panel: var(--corporate-white);
  --page: var(--corporate-pearl);
  --accent: var(--corporate-gold);
  --accent-dark: #8b6427;
  --teal: var(--corporate-blue);
  --danger: #b42318;
  --success: #027a48;
}

* {
  box-sizing: border-box;
}

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

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

button {
  border: 0;
  border-radius: 6px;
  padding: 11px 16px;
  background: var(--teal);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  filter: brightness(0.94);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  background: #ffffff;
  color: var(--ink);
}

input[type="file"] {
  padding: 9px;
}

input:focus,
select:focus {
  border-color: var(--teal);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.danger {
  background: var(--danger);
  color: #ffffff;
}

.small {
  padding: 8px 10px;
  font-size: 12px;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.message.success {
  color: var(--success);
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--corporate-blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-view {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1fr);
  background: var(--corporate-pearl);
}

.login-brand {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100vh;
  padding: 64px;
  background: linear-gradient(135deg, rgba(32, 62, 99, 0.28), transparent 75%), var(--corporate-night);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-brand > * { position: relative; z-index: 1; }
.login-brand .eyebrow { color: var(--corporate-gold); }
.login-brand::before {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 44%, rgba(255, 255, 255, 0.035) 50%, transparent 56%);
  animation: macbull-brand-light 7s linear infinite;
}

.login-brand h1 {
  margin-bottom: 14px;
  font-size: 64px;
  line-height: 0.95;
}

.login-brand p:not(.eyebrow) {
  max-width: 420px;
  color: #d8e7f3;
  font-size: 20px;
  line-height: 1.55;
}

.logo-panel {
  width: min(100%, 320px);
  margin-bottom: 34px;
  padding: 18px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid rgba(184, 137, 54, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  animation: macbull-logo-halo 3s ease-in-out infinite;
}

.logo-panel img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.login-card {
  position: relative;
  isolation: isolate;
  width: min(440px, calc(100% - 40px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 18px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--corporate-text);
  box-shadow: 0 18px 48px rgba(16, 29, 48, 0.08);
  animation: macbull-card-shadow 6s ease-in-out infinite;
}

.login-card::before, .login-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 7%;
  width: 86%;
  height: 2px;
  pointer-events: none;
}
.login-card::before { background: var(--corporate-gold); }
.login-card::after {
  background: linear-gradient(90deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%);
  background-size: 250% 100%;
  animation: macbull-card-line 5s linear infinite;
}
.login-card .eyebrow { display: flex; gap: 12px; align-items: center; color: var(--corporate-muted); }
.login-card .eyebrow::before { content: ""; width: 32px; height: 2px; background: var(--corporate-gold); }
.login-card .muted { line-height: 1.6; margin-bottom: 0; }
.login-card label { color: var(--corporate-text); font-size: 14px; }
.login-password-field { display: grid; gap: 7px; }
.login-card input { min-width: 0; min-height: 52px; font-size: 16px; }
.login-card .password-row { grid-template-columns: minmax(0, 1fr) 72px; }
.login-card .icon-button { min-width: 0; padding: 10px; font-size: 14px; }
.login-card #login-submit {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 54px;
  background: var(--corporate-blue);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
.login-card #login-submit::after {
  content: "";
  position: absolute;
  inset: -25% -50%;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.12) 50%, transparent 60%);
  animation: macbull-button-light 4s ease-in-out infinite;
}
.login-card #login-submit:hover:not(:disabled) { background: var(--corporate-interaction); filter: none; }
.login-card #login-submit:active:not(:disabled) { box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2); }
.login-card #login-submit:disabled { opacity: 0.8; cursor: wait; }
.login-card #login-submit:disabled::after { animation-play-state: paused; opacity: 0; }
.login-card #login-message { min-height: 40px; line-height: 1.5; overflow-wrap: anywhere; }
.login-accent-line { position: relative; overflow: hidden; height: 3px; background: var(--corporate-border); }
.login-accent-line::after {
  content: "";
  display: block;
  width: 26%;
  height: 100%;
  background: linear-gradient(90deg, var(--corporate-gold), rgba(184, 137, 54, 0.12));
  animation: macbull-accent-line 5s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes macbull-logo-halo {
  0%, 100% { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 9px rgba(184, 137, 54, 0.1); }
  50% { box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22), 0 0 26px rgba(184, 137, 54, 0.24); }
}
@keyframes macbull-brand-light {
  from { transform: translateX(-65%); }
  to { transform: translateX(65%); }
}
@keyframes macbull-card-shadow {
  0%, 100% { box-shadow: 0 18px 48px rgba(16, 29, 48, 0.08); }
  50% { box-shadow: 0 18px 48px rgba(16, 29, 48, 0.12); }
}
@keyframes macbull-card-line {
  from { background-position: 150% 0; }
  to { background-position: -150% 0; }
}
@keyframes macbull-button-light {
  0%, 55% { transform: translateX(-65%); opacity: 0; }
  65% { opacity: 1; }
  95%, 100% { transform: translateX(65%); opacity: 0; }
}
@keyframes macbull-accent-line {
  from { transform: translateX(0); }
  to { transform: translateX(285%); }
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: 30px;
  color: var(--corporate-text);
}

.password-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.icon-button {
  min-width: 72px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  background: var(--navy-dark);
  color: #ffffff;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px 22px;
}

.sidebar-brand img {
  width: 58px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  background: #ffffff;
  padding: 5px;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand span {
  color: #bfd4e5;
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav button {
  width: 100%;
  border-left: 3px solid transparent;
  background: transparent;
  color: #d8e7f3;
  text-align: left;
}

.side-nav button:hover,
.side-nav button.active {
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.main-shell {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--corporate-white);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin-bottom: 0;
  font-size: 30px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-chip {
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  background: #f8fafc;
}

.user-chip span,
.user-chip small {
  display: block;
  overflow-wrap: anywhere;
}

.user-chip small {
  color: var(--muted);
}

.content {
  min-width: 0;
  padding: 28px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header,
.section-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.page-header h2,
.section-header h3 {
  margin-bottom: 6px;
}

.page-header p,
.section-header p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  box-shadow: 0 14px 40px rgba(16, 24, 40, 0.06);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(9, 34, 55, 0.55);
}

.modal-card {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.22);
}

.modal-card h3 {
  margin-bottom: 0;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  font-size: 25px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.85fr);
  gap: 18px;
}

.wide {
  min-width: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px;
  gap: 12px;
  margin-bottom: 18px;
}

.employee-toolbar {
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(180px, 0.5fr));
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.employees-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 0.8fr);
  margin-bottom: 18px;
}

.form-panel,
.employee-form {
  display: grid;
  gap: 14px;
}

.employee-form {
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.employee-form h3,
.employee-form .button-row,
.employee-form .message {
  grid-column: 1 / -1;
}

.button-row,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-actions {
  margin: 14px 0 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #ffffff;
  color: #52627a;
  font-size: 12px;
  text-transform: uppercase;
}

.data-table td {
  font-size: 14px;
}

.data-table td span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.data-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.data-table tr.selected-row {
  background: #e6f4f1;
}

.numeric,
.numeric-input {
  text-align: right;
}

.payroll-capture {
  margin-bottom: 18px;
}

.payroll-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr);
  margin-bottom: 0;
}

.payroll-total-grid {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

.payroll-company-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 2px 0 8px;
  overflow-x: auto;
}

.payroll-company-tab {
  min-width: 190px;
  max-width: 230px;
  min-height: 72px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  flex: 0 0 auto;
}

.payroll-company-tab:hover,
.payroll-company-tab.selected {
  border-color: var(--accent);
  background: #fff7e8;
}

.payroll-company-tab strong {
  font-size: 13px;
}

.payroll-company-tab span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.payroll-company-tab em {
  color: var(--navy);
  font-style: normal;
  font-weight: 800;
}

.payroll-table-wrap {
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payroll-table {
  min-width: 2100px;
}

.payroll-table input {
  min-width: 92px;
  padding: 8px 9px;
  font-size: 13px;
}

.payroll-table th:nth-child(3),
.payroll-table td:nth-child(3) {
  width: 220px;
}

.attendance-panel {
  margin-bottom: 18px;
}

.attendance-stat-grid {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.attendance-table-wrap {
  max-height: 62vh;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.attendance-table {
  min-width: 1320px;
}

.attendance-table input,
.attendance-table select {
  min-width: 96px;
  padding: 8px 9px;
  font-size: 13px;
}

.attendance-table input[type="checkbox"] {
  min-width: auto;
  width: auto;
}

.attendance-table th:nth-child(2),
.attendance-table td:nth-child(2) {
  width: 260px;
}

.attendance-table th:nth-child(9),
.attendance-table td:nth-child(9) {
  width: 260px;
}

.center-cell {
  text-align: center;
}

.reconciliation-panel {
  margin-bottom: 18px;
}

.comparison-panel {
  margin-bottom: 18px;
}

.comparison-grid {
  grid-template-columns: 1fr;
}

.comparison-table {
  min-width: 1100px;
}

.comparison-filters {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
}

.compact-check {
  min-height: 56px;
}

.weekly-employee-table {
  min-width: 1900px;
}

.reconciliation-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(160px, 0.4fr) minmax(260px, 0.8fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 16px;
}

.check-field {
  grid-template-columns: auto 1fr;
  align-items: center;
  color: var(--ink);
}

.check-field input {
  width: auto;
}

.mapping-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.format-report {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.format-summary,
.format-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 13px;
}

.format-summary strong,
.format-item strong {
  color: var(--ink);
}

.format-summary.has-errors,
.format-item.format-error {
  border-color: #fecdca;
  background: #fff6f5;
}

.reconciliation-table {
  min-width: 1900px;
}

.reconciliation-summary-table {
  min-width: 1500px;
}

.difference-cell {
  color: var(--danger);
  font-weight: 800;
}

.dirty-row {
  background: #fff7e8 !important;
}

.periods-table {
  min-width: 1220px;
}

.balanced-table th:nth-child(1),
.balanced-table td:nth-child(1) {
  width: 24%;
}

.balanced-table th:nth-child(2),
.balanced-table td:nth-child(2) {
  width: 17%;
}

.balanced-table th:nth-child(3),
.balanced-table td:nth-child(3) {
  width: 20%;
}

.balanced-table th:nth-child(4),
.balanced-table td:nth-child(4) {
  width: 12%;
}

.balanced-table th:nth-child(5),
.balanced-table td:nth-child(5) {
  width: 14%;
}

.balanced-table th:nth-child(6),
.balanced-table td:nth-child(6) {
  width: 13%;
}

.employees-table th:nth-child(1),
.employees-table td:nth-child(1) {
  width: 72px;
}

.employees-table th:nth-child(2),
.employees-table td:nth-child(2) {
  width: 34%;
}

.employee-master-table {
  min-width: 1080px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.tab {
  min-height: 76px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
}

.tab:hover,
.tab.selected {
  border-color: var(--accent);
  background: #fff7e8;
}

.tab strong,
.tab span {
  grid-column: 1;
}

.tab strong {
  font-size: 13px;
}

.tab span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.tab em {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 28px;
  border-radius: 999px;
  padding: 5px 8px;
  background: #ffffff;
  color: var(--navy);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.badge,
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
  font-weight: 800;
}

.badge.real,
.badge.success {
  background: #dcfae6;
  color: var(--success);
}

.badge.dev,
.badge.warning {
  background: #fff4d6;
  color: var(--accent-dark);
}

.danger-badge {
  background: #fee4e2;
  color: var(--danger);
}

.muted-badge {
  background: #eef2f6;
  color: #52627a;
}

.avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--navy);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.avatar.large {
  width: 56px;
  height: 56px;
  font-size: 16px;
}

.avatar-img {
  width: 34px;
  height: 34px;
  display: inline-block;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}

.avatar-img.large {
  width: 64px;
  height: 64px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.profile-head h3 {
  margin-bottom: 8px;
}

.detail-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 14px;
}

.detail-section h4 {
  margin-bottom: 12px;
}

.detail-section dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px;
  margin: 0 0 8px;
}

.detail-section dt {
  color: var(--muted);
  font-size: 13px;
}

.detail-section dd {
  margin: 0;
  font-weight: 700;
}

.identity-grid {
  display: grid;
  gap: 10px;
}

.identity-grid div,
.empty-state {
  border: 1px dashed #c7d4e2;
  border-radius: 8px;
  padding: 14px;
  background: #f8fafc;
  color: var(--muted);
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.activity-list strong,
.activity-list span {
  display: block;
}

.activity-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.placeholder {
  min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 10px;
}

.placeholder h2 {
  margin-bottom: 0;
}

.placeholder p {
  max-width: 560px;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .content-grid,
  .split-grid,
  .employees-grid {
    grid-template-columns: 1fr;
  }

  .employee-form,
  .employee-toolbar,
  .mapping-grid,
  .reconciliation-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 860px) {
  .login-view,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: auto;
    padding: 28px 24px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    grid-template-areas: "logo eyebrow" "logo title" "logo description";
    column-gap: 20px;
    row-gap: 6px;
    align-content: center;
  }

  .login-view { align-content: start; }
  .login-brand .logo-panel { grid-area: logo; width: 112px; aspect-ratio: 1; align-self: center; padding: 8px; margin: 0; }
  .login-brand .eyebrow { grid-area: eyebrow; margin: 0; align-self: end; }
  .login-brand h1 { grid-area: title; font-size: 40px; line-height: 1.1; margin: 0; }
  .login-brand p:not(.eyebrow) { grid-area: description; font-size: 14px; line-height: 1.5; margin: 0; }
  .login-card { width: min(440px, calc(100% - 32px)); margin: 24px auto 32px; padding: 26px; }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar,
  .page-header,
  .section-header,
  .topbar-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .content {
    padding: 18px;
  }

  .toolbar,
  .employee-form,
  .employee-toolbar,
  .mapping-grid,
  .reconciliation-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .login-brand { grid-template-columns: 88px minmax(0, 1fr); gap: 6px 16px; padding: 24px; }
  .login-brand .logo-panel { width: 88px; padding: 6px; }
  .login-brand h1 { font-size: 36px; }
  .login-card { padding: 22px; }
  .login-card h2 { font-size: 28px; }
}

:where(button, input, select, textarea, summary, a):focus-visible {
  outline: 3px solid var(--corporate-gold);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .login-view *, .login-view *::before, .login-view *::after {
    animation: none !important;
    transition: none !important;
  }
}
