:root {
  --navy: #102a43;
  --navy-2: #183b56;
  --teal: #128c7e;
  --teal-soft: #e8f6f3;
  --blue: #2374ab;
  --amber: #d38413;
  --paper: #f4f7f9;
  --surface: #ffffff;
  --line: #d9e2e8;
  --muted: #657786;
  --ink: #172b3a;
  --danger: #b64040;
  --shadow: 0 12px 30px rgba(16, 42, 67, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.shell { width: min(1480px, calc(100% - 40px)); margin: 0 auto; }
.topbar {
  color: white;
  background:
    linear-gradient(110deg, rgba(18, 140, 126, 0.28), transparent 44%),
    linear-gradient(135deg, #0c2338 0%, #173b56 100%);
  border-bottom: 4px solid var(--teal);
}
.topbar__content { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar__actions { display: flex; align-items: center; gap: 9px; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand__mark {
  width: 48px; height: 48px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.34); background: rgba(255,255,255,.1);
  font-size: 25px; font-weight: 900; border-radius: 12px;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.035em; }
h2 { font-size: 23px; letter-spacing: -.025em; color: var(--navy); }
.eyebrow { margin-bottom: 3px; color: #9de4d7; font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.eyebrow--dark { color: var(--teal); }
.primary-button, .secondary-button, .page-button {
  border-radius: 9px; cursor: pointer; font-weight: 750; text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.ghost-button { border: 1px solid rgba(255,255,255,.32); border-radius: 9px; background: transparent; color: white; padding: 11px 13px; cursor: pointer; font-weight: 700; }
.ghost-button:hover { background: rgba(255,255,255,.09); }
.primary-button {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid #73d1c2;
  background: var(--teal); color: white; padding: 12px 17px; box-shadow: 0 8px 20px rgba(0,0,0,.18);
}
.primary-button:hover { background: #0e786c; transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; opacity: .65; transform: none; }
.button-icon { font-size: 19px; line-height: 1; }
.main-content { padding: 24px 0 40px; }
.sync-panel {
  display: grid; grid-template-columns: 1fr minmax(230px, 340px); align-items: center; gap: 28px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--teal);
  border-radius: 12px; padding: 15px 18px; box-shadow: var(--shadow);
}
.sync-panel strong { color: var(--navy); }
.sync-panel p { margin: 3px 0 0 19px; color: var(--muted); font-size: 13px; }
.status-dot { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: #aab8c2; }
.status-dot.running { background: var(--amber); box-shadow: 0 0 0 5px rgba(211,132,19,.12); }
.status-dot.succeeded { background: var(--teal); }
.status-dot.failed { background: var(--danger); }
.progress-wrap { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 10px; color: var(--navy); font-size: 12px; font-weight: 800; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e8eef2; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--teal), #49c4b2); transition: width .3s ease; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric { position: relative; overflow: hidden; min-height: 128px; background: white; border: 1px solid var(--line); border-radius: 12px; padding: 19px; box-shadow: var(--shadow); }
.metric::after { content: ""; position: absolute; top: 0; right: 0; width: 7px; height: 100%; background: var(--navy); }
.metric--teal::after { background: var(--teal); }
.metric--amber::after { background: var(--amber); }
.metric--blue::after { background: var(--blue); }
.metric span { display: block; color: var(--muted); font-size: 12px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.metric strong { display: block; margin: 8px 0 3px; color: var(--navy); font-size: 32px; letter-spacing: -.035em; }
.metric small { color: var(--muted); }
.workspace { background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.workspace__heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 24px 18px; }
.workspace__heading > div > p:last-child { margin-top: 5px; color: var(--muted); font-size: 13px; }
.export-actions { display: flex; gap: 8px; }
.secondary-button, .page-button { border: 1px solid #b9cad5; background: white; color: var(--navy); padding: 9px 12px; }
.secondary-button:hover, .page-button:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.filters { display: grid; grid-template-columns: minmax(230px, 1.7fr) repeat(5, minmax(130px, 1fr)); gap: 10px; padding: 16px 24px; background: #f7f9fa; border-block: 1px solid var(--line); }
.filters label { display: grid; gap: 5px; }
.filters label > span { color: #536b7a; font-size: 10px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.filters input, .filters select { width: 100%; height: 40px; border: 1px solid #cbd7de; border-radius: 8px; background: white; color: var(--ink); padding: 0 10px; outline: none; }
.filters input:focus, .filters select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18,140,126,.1); }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 1190px; border-collapse: collapse; }
th { padding: 11px 12px; background: #eef3f5; color: #4a6474; font-size: 10px; letter-spacing: .055em; text-align: left; text-transform: uppercase; }
td { padding: 13px 12px; border-top: 1px solid #e5ebef; vertical-align: top; font-size: 12px; }
tbody tr:hover { background: #f8fbfb; }
tbody tr.reviewed { background: #f5f8f7; opacity: .78; }
.entity-name { display: block; max-width: 270px; color: var(--navy); font-weight: 800; }
.contract-code { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.description { max-width: 390px; min-width: 280px; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 850; white-space: nowrap; }
.pill--core { background: var(--teal-soft); color: #087367; }
.pill--adjacent { background: #edf4fb; color: #1e6593; }
.pill--explore { background: #f2f2f4; color: #626775; }
.pill--urgent { background: #fdeaea; color: #a53333; }
.pill--high { background: #fff2dc; color: #9b620d; }
.pill--normal { background: #edf4fb; color: #2b648c; }
.review-button { width: 105px; border: 1px solid #b9cad5; border-radius: 8px; background: white; color: var(--navy); padding: 7px 8px; cursor: pointer; font-size: 10px; font-weight: 850; }
.review-button.done { border-color: #8bcabd; background: var(--teal-soft); color: #087367; }
.detail-link { color: var(--teal); font-weight: 850; text-decoration: none; white-space: nowrap; }
.detail-link:hover { text-decoration: underline; }
.empty-state { padding: 55px 20px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; color: var(--navy); font-size: 17px; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 15px 24px; border-top: 1px solid var(--line); }
.pagination span { color: var(--muted); font-size: 12px; }
.page-button:disabled { cursor: not-allowed; opacity: .45; }
.toast { position: fixed; right: 22px; bottom: 22px; max-width: min(400px, calc(100% - 44px)); transform: translateY(20px); opacity: 0; pointer-events: none; background: var(--navy); color: white; border-radius: 10px; padding: 12px 15px; box-shadow: 0 12px 35px rgba(0,0,0,.25); transition: .2s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: var(--danger); }

@media (max-width: 1050px) {
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: repeat(3, 1fr); }
  .search-field { grid-column: span 2; }
}
@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 1480px); }
  .topbar__content { min-height: 142px; align-items: flex-start; flex-direction: column; justify-content: center; }
  .primary-button { width: 100%; justify-content: center; }
  .topbar__actions { width: 100%; }
  .topbar__actions .primary-button { flex: 1; }
  .sync-panel { grid-template-columns: 1fr; gap: 14px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 112px; padding: 15px; }
  .metric strong { font-size: 27px; }
  .workspace__heading { align-items: flex-start; flex-direction: column; }
  .export-actions { width: 100%; }
  .export-actions a { flex: 1; text-align: center; }
  .filters { grid-template-columns: 1fr 1fr; padding-inline: 16px; }
  .search-field { grid-column: 1 / -1; }
  .pagination { justify-content: center; padding-inline: 12px; }
}
@media (max-width: 440px) {
  .metrics, .filters { grid-template-columns: 1fr; }
  .search-field { grid-column: auto; }
  .brand__mark { display: none; }
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(120deg, rgba(18, 140, 126, .11), transparent 42%),
    #0d263c;
}
.login-layout {
  width: min(930px, calc(100% - 32px));
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.32);
}
.login-intro {
  min-height: 500px;
  padding: 54px;
  color: white;
  background:
    linear-gradient(145deg, rgba(11,38,59,.88), rgba(19,85,91,.92)),
    #173b56;
}
.brand--login { margin-bottom: 50px; }
.login-intro > p { max-width: 520px; color: #d5e4eb; font-size: 18px; }
.login-intro ul { display: grid; gap: 13px; margin: 34px 0 0; padding: 0; list-style: none; color: #e6f1f4; }
.login-intro li::before { content: "✓"; margin-right: 10px; color: #83dfcf; font-weight: 900; }
.login-card { display: flex; flex-direction: column; justify-content: center; background: white; padding: 46px; }
.login-card__copy { margin: 9px 0 25px; color: var(--muted); font-size: 13px; }
.login-card form { display: grid; gap: 16px; }
.login-card label { display: grid; gap: 6px; color: #506978; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.login-card input { height: 44px; border: 1px solid #c6d4dc; border-radius: 8px; padding: 0 11px; outline: none; }
.login-card input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(18,140,126,.1); }
.login-card .primary-button { justify-content: center; margin-top: 4px; }
.login-error { padding: 10px 12px; border-radius: 8px; background: #fdeaea; color: #9f3434; font-size: 12px; }
@media (max-width: 760px) {
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: auto; padding: 32px; }
  .brand--login { margin-bottom: 25px; }
  .login-intro ul { display: none; }
  .login-card { padding: 32px; }
}
