:root {
  --navy: #0b1f3a;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1eb;
  --soft: #f3f6fa;
  --white: #ffffff;
  --emerald: #087a5b;
  --emerald-soft: #e9f8f2;
  --gold: #9b6815;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 45px rgba(12, 31, 55, 0.09);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #f4f7fa;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand-mark { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex: 0 0 46px; color: var(--navy); background: white; font-weight: 900; letter-spacing: -0.04em; }
.eyebrow { margin: 0; color: #b8c9dd; font-size: 0.76rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.eyebrow.dark { color: var(--gold); }

.login-screen { min-height: 100vh; padding: 28px 16px; display: grid; place-items: center; background: radial-gradient(circle at top right, #234e79, var(--navy) 44%, #071425 100%); }
.login-card { width: min(100%, 430px); padding: 34px; border: 1px solid rgba(255,255,255,.2); border-radius: 26px; background: white; box-shadow: 0 28px 70px rgba(0,0,0,.28); }
.login-card .brand-mark { color: white; background: var(--navy); }
.login-card .eyebrow { margin-top: 22px; color: var(--gold); }
.login-card h1 { margin: 4px 0 8px; color: var(--navy); font-size: 1.8rem; }
.login-copy { margin: 0 0 22px; color: var(--muted); }
.login-card label { margin-top: 14px; display: grid; gap: 6px; }
.login-card label span { color: #344054; font-size: .9rem; font-weight: 800; }
input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd5e1; border-radius: 13px; color: var(--ink); background: white; outline: none; }
input:focus { border-color: #4b77a8; box-shadow: 0 0 0 4px rgba(75,119,168,.13); }

.primary-button, .secondary-button, .danger-button, .view-button, .document-button, .close-button {
  border: 0;
  border-radius: 12px;
  font-weight: 850;
  transition: transform .16s, filter .16s, opacity .16s;
}
.primary-button { width: 100%; min-height: 50px; margin-top: 20px; padding: 12px 18px; color: white; background: var(--emerald); }
.secondary-button { min-height: 46px; padding: 10px 15px; color: white; background: var(--navy); }
.danger-button { padding: 9px 13px; color: var(--danger); background: var(--danger-soft); }
.view-button { padding: 8px 12px; color: var(--navy); background: #e8eef5; }
.document-button { padding: 8px 11px; color: var(--emerald); background: var(--emerald-soft); text-decoration: none; font-size: .82rem; }
.close-button { width: 42px; height: 42px; color: #475467; background: var(--soft); font-size: 1.45rem; }
button:hover, .document-button:hover { filter: brightness(1.04); }
button:active, .document-button:active { transform: translateY(1px); }
button:disabled { opacity: .6; cursor: not-allowed; }
.error-box { margin: 14px 0 0; padding: 12px 13px; border: 1px solid #f4b9b3; border-radius: 12px; color: var(--danger); background: var(--danger-soft); }

.site-header { color: white; background: var(--navy); }
.header-inner { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 18px 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand-group, .account-group { display: flex; align-items: center; gap: 13px; }
.brand-group h1 { margin: 2px 0 0; font-size: 1.25rem; line-height: 1.25; }
.account-group > span { font-size: .88rem; font-weight: 800; }
.page-shell { width: min(1240px, calc(100% - 32px)); margin: 28px auto 50px; }

.summary-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.summary-grid article { min-height: 118px; padding: 22px; border: 1px solid var(--line); border-radius: 20px; display: flex; flex-direction: column; justify-content: space-between; background: white; box-shadow: var(--shadow); }
.summary-grid span { color: var(--muted); font-size: .87rem; font-weight: 750; }
.summary-grid strong { color: var(--navy); font-size: 2rem; }

.data-card { border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: white; box-shadow: var(--shadow); }
.toolbar { padding: 22px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.toolbar h2 { margin: 3px 0 0; color: var(--navy); }
.toolbar-actions { display: flex; gap: 10px; align-items: center; }
.search-box { width: min(340px, 42vw); }
.data-status { margin: 0; padding: 12px 24px; color: var(--muted); background: var(--soft); font-size: .85rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 950px; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #e8edf3; text-align: left; vertical-align: middle; }
th { color: #536174; background: #fbfcfd; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
td { font-size: .9rem; }
tbody tr:hover { background: #fbfcfe; }
.reference { color: var(--emerald); font-weight: 900; }
.pt-name { color: var(--navy); font-weight: 850; }
.muted { color: var(--muted); }
.status-badge { padding: 5px 9px; border-radius: 999px; display: inline-block; color: var(--emerald); background: var(--emerald-soft); font-size: .76rem; font-weight: 850; }
.empty-state { padding: 50px 24px; color: var(--muted); text-align: center; }

dialog { width: min(920px, calc(100% - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 24px; background: transparent; }
dialog::backdrop { background: rgba(6, 17, 31, .72); backdrop-filter: blur(4px); }
.dialog-card { max-height: calc(100vh - 30px); overflow: auto; border-radius: 24px; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.dialog-header { position: sticky; top: 0; z-index: 3; padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 20px; background: white; }
.dialog-header h2 { margin: 3px 0 0; color: var(--navy); }
.detail-content { padding: 24px; display: grid; gap: 18px; }
.detail-section { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fbfcfe; }
.detail-section h3 { margin: 0 0 14px; color: var(--navy); font-size: 1rem; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; }
.detail-item { min-width: 0; }
.detail-item.full { grid-column: 1 / -1; }
.detail-item span { display: block; color: var(--muted); font-size: .78rem; }
.detail-item strong, .detail-item p { margin: 2px 0 0; display: block; overflow-wrap: anywhere; color: var(--ink); }
.detail-table { width: 100%; min-width: 680px; }
.detail-table th, .detail-table td { padding: 10px; }
.document-list { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  .header-inner { align-items: flex-start; }
  .brand-group .eyebrow { display: none; }
  .brand-group h1 { font-size: 1rem; }
  .account-group > span { display: none; }
  .summary-grid { grid-template-columns: 1fr; }
  .summary-grid article { min-height: 96px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-actions { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full { grid-column: auto; }
  .dialog-header, .detail-content { padding: 18px; }
}

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