:root {
  color-scheme: light;
  --ink: #161916;
  --muted: #656c67;
  --line: #dfe3df;
  --soft: #f5f7f4;
  --surface: #ffffff;
  --accent: #e85f2a;
  --accent-soft: #fff1ea;
  --success: #18794e;
  --success-soft: #eaf7f0;
  --warning: #8a5a00;
  --warning-soft: #fff7dc;
  --danger: #a33232;
  --danger-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(21, 28, 23, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #eef1ed; }
body { min-height: 100vh; margin: 0; background: var(--surface); color: var(--ink); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: #000;
  color: #fff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  min-height: 76px;
  padding: 10px max(24px, calc((100vw - 1160px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; width: max-content; align-items: center; text-decoration: none; }
.brand img { display: block; width: auto; height: 42px; max-width: 128px; object-fit: contain; }

.desktop-nav { display: flex; align-items: center; gap: 5px; }
.desktop-nav a {
  padding: 9px 14px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}
.desktop-nav a:hover { background: var(--soft); color: var(--ink); }
.desktop-nav a.active { background: var(--ink); color: #fff; }

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 13px; }
.language-picker { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 9px; }
.language-picker button {
  min-width: 34px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.language-picker button.active { background: var(--ink); color: #fff; }
.avatar {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: #9b3e19;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.environment-banner { padding: 8px 20px; background: var(--warning-soft); color: var(--warning); font-size: 12px; font-weight: 750; text-align: center; }

main { width: min(calc(100% - 40px), 1120px); min-height: calc(100vh - 158px); margin: 0 auto; padding: 54px 0 70px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 28px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(31px, 5vw, 49px); line-height: 1.05; letter-spacing: -.045em; }
.lead { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.employee-context { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); font-size: 12px; text-align: right; }
.employee-context strong { display: block; margin-bottom: 3px; font-size: 13px; }
.employee-context span { color: var(--muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.card, .panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.card { min-height: 168px; padding: 21px; }
.card.featured { border-color: var(--ink); background: var(--ink); color: #fff; }
.card-label { margin-bottom: 20px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.featured .card-label, .featured .card-note { color: #bbc0bb; }
.card-value { margin-bottom: 7px; font-size: 28px; font-weight: 820; letter-spacing: -.035em; }
.card-note { margin-bottom: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; padding: 6px 9px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 800; }
.status-pill.warning { background: var(--warning-soft); color: var(--warning); }
.status-pill.open { background: var(--accent-soft); color: #a43f18; }
.featured .status-pill { background: rgba(255, 255, 255, .12); color: #fff; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.content-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; margin-top: 16px; }
.panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin-bottom: 4px; font-size: 18px; letter-spacing: -.025em; }
.panel-head p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.text-link { color: var(--accent); font-size: 12px; font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.panel-body { padding: 8px 22px; }

.activity-row, .detail-row, .readiness-row { display: grid; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #ecefeb; }
.activity-row:last-child, .detail-row:last-child, .readiness-row:last-child { border-bottom: 0; }
.activity-row { grid-template-columns: 44px 1fr auto; }
.date-box { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; background: var(--soft); font-size: 10px; font-weight: 800; line-height: 1.1; text-align: center; text-transform: uppercase; }
.activity-row strong, .detail-row strong { font-size: 13px; }
.activity-row small, .detail-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.activity-hours { font-size: 13px; font-weight: 800; }

.quick-links { display: grid; gap: 9px; padding: 18px; }
.quick-link { display: flex; justify-content: space-between; align-items: center; min-height: 58px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.quick-link:hover { border-color: #bfc5bf; background: var(--soft); }
.quick-link strong { display: block; font-size: 13px; }
.quick-link span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.quick-link i { font-style: normal; }

.notice { margin-bottom: 16px; padding: 15px 17px; border: 1px solid #eadcae; border-radius: 13px; background: var(--warning-soft); color: #684600; font-size: 12px; line-height: 1.5; }
.notice strong { display: block; margin-bottom: 3px; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 17px 15px; border-bottom: 1px solid #ecefeb; font-size: 13px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .amount { font-variant-numeric: tabular-nums; font-weight: 760; }
.table-wrap { overflow-x: auto; }

.empty-state { padding: 52px 25px; text-align: center; }
.empty-icon { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 16px; border-radius: 15px; background: var(--soft); font-size: 22px; }
.empty-state h2 { margin-bottom: 8px; font-size: 18px; }
.empty-state p { max-width: 520px; margin: 0 auto; color: var(--muted); font-size: 13px; line-height: 1.55; }

.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .panel.wide { grid-column: 1 / -1; }
.detail-list { padding: 7px 22px; }
.detail-row { grid-template-columns: 1fr auto; }
.detail-row strong { max-width: 320px; text-align: right; overflow-wrap: anywhere; }
.readiness-row { grid-template-columns: 28px 1fr auto; }
.readiness-mark { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); font-size: 12px; font-weight: 900; }
.readiness-mark.missing { background: var(--warning-soft); color: var(--warning); }
.readiness-row strong { font-size: 13px; text-transform: uppercase; }
.readiness-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.readiness-row > span:last-child { color: var(--muted); font-size: 11px; font-weight: 750; }

.document-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.record-lock { display: grid; width: 46px; height: 46px; place-items: center; margin: 18px 22px 22px; border-radius: 13px; background: var(--soft); font-size: 21px; font-weight: 850; }
.compliance-note { margin-bottom: 16px; padding: 17px 19px; border: 1px solid #cad9ce; border-radius: 14px; background: var(--success-soft); color: #235e3f; }
.compliance-note strong { display: block; margin-bottom: 5px; font-size: 13px; }
.compliance-note p { margin: 0; font-size: 12px; line-height: 1.55; }
.document-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.document-card { padding: 22px; border: 1px solid var(--line); border-radius: 18px; }
.document-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.document-card h2 { margin: 3px 0 0; font-size: 20px; }
.document-authority { margin: 0; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.document-card > p { min-height: 40px; margin: 15px 0 19px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.document-actions { display: flex; justify-content: space-between; align-items: center; gap: 13px; padding-top: 16px; border-top: 1px solid var(--line); }
.document-actions button { min-height: 38px; padding: 0 12px; border: 1px solid #d8dbd7; border-radius: 9px; background: #eff0ee; color: #7b807b; font-size: 11px; font-weight: 750; }

.loading-state, .error-state { max-width: 620px; margin: 70px auto; padding: 42px; border: 1px solid var(--line); border-radius: 20px; text-align: center; }
.loading-state h1, .error-state h1 { margin: 15px 0 8px; font-size: 25px; }
.loading-state p, .error-state p { margin-bottom: 0; color: var(--muted); line-height: 1.5; }
.spinner { display: block; width: 26px; height: 26px; margin: 0 auto; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer { display: flex; justify-content: center; gap: 4px; padding: 22px 20px 34px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.mobile-nav { display: none; }
.noscript { margin: 20px; padding: 15px; background: var(--danger-soft); color: var(--danger); text-align: center; }

@media (max-width: 900px) {
  .app-header { grid-template-columns: 1fr auto; padding-inline: 20px; }
  .desktop-nav { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  main { padding-bottom: 105px; }
  .mobile-nav {
    position: fixed;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
  }
  .mobile-nav a { display: grid; min-height: 46px; place-items: center; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 750; text-decoration: none; }
  .mobile-nav a.active { background: var(--ink); color: #fff; }
  footer { padding-bottom: 94px; }
}

@media (max-width: 650px) {
  .app-header { min-height: 68px; padding-inline: 14px; }
  .brand img { width: auto; height: 36px; max-width: 106px; }
  .header-actions { gap: 8px; }
  .language-picker button { min-width: 30px; }
  .avatar { width: 35px; height: 35px; }
  main { width: min(calc(100% - 28px), 560px); padding-top: 32px; }
  .page-heading { display: block; }
  .employee-context { margin-top: 18px; text-align: left; }
  .stat-grid, .profile-grid, .document-summary, .document-grid { grid-template-columns: 1fr; }
  .profile-grid .panel.wide { grid-column: auto; }
  .card { min-height: 145px; }
  .panel-head { align-items: flex-start; padding: 18px; }
  .panel-body, .detail-list { padding-inline: 18px; }
  .data-table thead { display: none; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table tr { padding: 12px 17px; border-bottom: 1px solid var(--line); }
  .data-table tbody tr:last-child { border-bottom: 0; }
  .data-table td { display: flex; justify-content: space-between; gap: 18px; padding: 6px 0; border: 0; text-align: right; }
  .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
  .detail-row { align-items: start; }
  .detail-row strong { max-width: 55%; }
  .document-card { padding: 18px; }
  .document-card > p { min-height: 0; }
  .document-actions { align-items: stretch; flex-direction: column; }
  footer { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

