:root {
  --ink: #13231c;
  --muted: #637068;
  --paper: #f4f5f0;
  --white: #ffffff;
  --line: #dfe3dc;
  --green: #1f704d;
  --green-dark: #155039;
  --mint: #dcefe4;
  --amber: #b26b17;
  --amber-soft: #fff3dc;
  --red: #b5483f;
  --shadow: 0 16px 50px rgba(24, 43, 34, .07);
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% -10%, rgba(104, 174, 133, .16), transparent 28rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }

.topbar {
  min-height: 82px;
  padding: 0 clamp(20px, 4vw, 64px);
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid rgba(19, 35, 28, .08);
  background: rgba(244, 245, 240, .88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo-shell {
  width: 154px;
  height: 48px;
  padding: 8px 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(19, 35, 28, .08);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(24, 43, 34, .06);
}
.logo-shell img { width: 100%; height: 100%; object-fit: contain; }
.product-name strong, .product-name small { display: block; }
.product-name strong { font: 600 17px/1.1 Georgia, serif; }
.product-name small { margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  color: white; background: var(--green);
  font-family: Georgia, serif; font-size: 22px;
}
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
nav { display: flex; justify-content: center; gap: 6px; }
nav a { padding: 9px 14px; border-radius: 10px; color: var(--muted); font-size: 14px; font-weight: 650; }
nav a.active, nav a:hover { color: var(--green-dark); background: var(--mint); }
.nav-icon { margin-right: 4px; font-size: 14px; }
.user-menu {
  justify-self: end;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 7px 6px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.74);
}
.avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, var(--green), #58ad56);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
}
.avatar.large { width: 54px; height: 54px; border-radius: 15px; font-size: 15px; }
.user-copy { min-width: 0; }
.user-copy strong, .user-copy small { max-width: 160px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-copy strong { font-size: 11px; }
.user-copy small { color: var(--muted); font-size: 9px; }
.logout {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: #f1f3ef;
  font-size: 13px;
}
.logout:hover { color: var(--red); background: #f9e9e7; }

.page { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 64px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.hero.compact { margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green); text-transform: uppercase; letter-spacing: .13em; font-size: 11px; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 900px; margin-bottom: 12px; font: 500 clamp(36px, 5vw, 62px)/1.03 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.hero.compact h1 { font-size: clamp(34px, 4vw, 48px); }
.lede { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 17px; }
.hero-actions { display: flex; align-items: center; gap: 9px; }
.hero-actions form { margin: 0; }

.button {
  min-height: 42px; border: 0; border-radius: 11px; padding: 10px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 750; cursor: pointer;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--green); box-shadow: 0 9px 24px rgba(31, 112, 77, .22); }
.button.primary:hover { background: var(--green-dark); }
.button.dark { color: white; background: var(--ink); }
.button.subtle { border: 1px solid var(--line); background: var(--white); }
.button.full { width: 100%; margin-top: 10px; }
.button-icon { font-size: 19px; line-height: 1; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 18px; }
.stat {
  min-height: 104px; padding: 20px;
  display: flex; flex-direction: column; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.72);
}
a.stat:hover { border-color: #b8c7bd; }
.stat.accent { color: white; border-color: var(--green); background: var(--green); }
.stat span { color: var(--muted); font-size: 12px; font-weight: 700; }
.stat.accent span { color: rgba(255,255,255,.75); }
.stat strong { font: 500 32px/1 Georgia, serif; }
.stat small { margin-top: 9px; color: #859089; font-size: 10px; }
.stat.accent small { color: rgba(255,255,255,.68); }
.stat.urgent strong { color: var(--amber); }

.analysis-progress {
  min-height: 58px;
  margin-bottom: 18px;
  padding: 12px 17px;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 18px;
  border: 1px solid #cae2d4;
  border-radius: 15px;
  background: rgba(232, 244, 235, .72);
}
.analysis-progress > div:first-child { display: flex; align-items: center; gap: 10px; }
.analysis-progress p { margin: 0; }
.analysis-progress p strong, .analysis-progress p small { display: block; }
.analysis-progress p strong { font-size: 12px; }
.analysis-progress p small { margin-top: 1px; color: var(--muted); font-size: 10px; }
.analysis-progress > strong { color: var(--green-dark); font-size: 12px; }
.pulse-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(31,112,77,.12); }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: rgba(31,112,77,.12); }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--green), #64b95e); transition: width .4s; }

.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--white); box-shadow: var(--shadow); }
.filters-panel { padding: 15px; margin-bottom: 18px; box-shadow: none; }
.filter-heading { margin: 0 3px 13px; display: flex; align-items: center; justify-content: space-between; }
.filter-heading strong, .filter-heading span { display: block; }
.filter-heading strong { font-size: 13px; }
.filter-heading span { color: var(--muted); font-size: 10px; }
.clear-filters { color: var(--green); font-size: 11px; font-weight: 750; }
.filters { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(6, minmax(115px, .7fr)) auto auto; align-items: end; gap: 10px; }
label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; color: var(--ink); background: #fbfcfa; font: inherit; font-size: 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 112, 77, .1); }
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; white-space: nowrap; }
.check input { width: 17px; height: 17px; accent-color: var(--green); }
.check span { margin: 0; color: var(--ink); text-transform: none; letter-spacing: 0; }
.check.boxed { margin-top: 14px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.list-panel, .activity { overflow: hidden; }
.panel-heading { padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font: 500 23px Georgia, serif; }
.muted { color: var(--muted); }
.tender-list { display: flex; flex-direction: column; }
.tender-row {
  padding: 20px 22px; display: grid; grid-template-columns: 66px minmax(0, 1fr) 110px 20px;
  gap: 17px; align-items: center; border-bottom: 1px solid var(--line);
  transition: background .15s;
}
.tender-row:hover { background: #f8faf7; }
.tender-row { scroll-margin-block: 24px; }
.tender-row:target {
  border-color: #9cc5ac;
  background: #f3f9f5;
  box-shadow: 0 0 0 3px rgba(29,104,70,.08);
}
.score {
  width: 62px; height: 62px; border-radius: 16px; display: grid; place-content: center; text-align: center;
  color: var(--muted); background: #eef0ec;
}
.score strong { font: 600 23px/1 Georgia, serif; }
.score small { margin-top: 4px; font-size: 9px; text-transform: uppercase; }
.score-alta { color: var(--green-dark); background: var(--mint); }
.score-media { color: var(--amber); background: var(--amber-soft); }
.score-bassa { color: #6d7470; background: #eceeeb; }
.score.large { width: 88px; height: 88px; border-radius: 22px; flex: 0 0 auto; }
.score.large strong { font-size: 34px; }
.row-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; color: var(--muted); font-size: 11px; font-weight: 700; }
.pill { padding: 4px 7px; border-radius: 6px; color: var(--green-dark); background: var(--mint); }
.source-pill { padding: 4px 7px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: #fff; }
.source-anac { color: #245b88; border-color: #cfe0ee; background: #edf5fb; }
.source-eu_ft { color: #174ea6; border-color: #c8d9f3; background: #eef4ff; }
.source-mepa { color: #704d12; border-color: #ead7aa; background: #fff8e8; }
.source-incentivi { color: #206a45; border-color: #b9dcc8; background: #edf8f1; }
.source-invitalia { color: #75520b; border-color: #e8d49a; background: #fff9e7; }
.source-mase { color: #17615c; border-color: #b9dbd7; background: #edf8f7; }
.saved { color: var(--amber); }
.tender-main h3 { margin: 7px 0 4px; font-size: 16px; line-height: 1.35; letter-spacing: -.01em; }
.tender-main p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.tender-main p.summary { margin-top: 7px; color: #3d4942; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tender-dates span, .tender-dates strong { display: block; }
.tender-dates span { margin-top: 8px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.tender-dates span:first-child { margin-top: 0; }
.tender-dates strong { font-size: 12px; }
.tender-dates small { display: block; margin-top: 3px; color: var(--green); font-size: 9px; }
.expired { color: var(--red); }
.chevron { color: #9aa49e; font-size: 28px; }
.pagination { padding: 16px 22px; display: flex; align-items: center; justify-content: center; gap: 18px; }
.pagination span { color: var(--muted); font-size: 12px; }
.empty { padding: 70px 20px; text-align: center; }
.empty > span { font-size: 44px; color: var(--green); }
.empty h3 { margin: 10px 0 4px; }
.empty p { color: var(--muted); }

.activity { box-shadow: none; }
.job-list { padding: 8px 20px; }
.job { padding: 14px 0; display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; border-bottom: 1px solid var(--line); }
.job:last-child { border-bottom: 0; }
.job-dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #99a29d; }
.job-dot.completed { background: var(--green); }
.job-dot.running { background: #278bd1; box-shadow: 0 0 0 5px rgba(39,139,209,.12); }
.job-dot.failed { background: var(--red); }
.job strong, .job span, .job small { display: block; }
.job strong { font-size: 12px; }
.job span, .job small { color: var(--muted); font-size: 10px; }
.job-status { text-transform: uppercase; letter-spacing: .05em; }
.text-link { display: inline-block; margin: 12px 20px 20px; color: var(--green); font-size: 13px; font-weight: 750; }

.back { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 13px; font-weight: 700; }
.detail-hero { margin-bottom: 22px; display: flex; align-items: center; gap: 22px; }
.detail-title { flex: 1; }
.detail-title h1 { margin: 8px 0; font-size: clamp(28px, 4vw, 44px); }
.detail-title p { margin: 0; color: var(--muted); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 18px; }
.prose { padding: 26px; }
.prose h2, .facts h2, .action-card h2, .history h2, .system-config h2 { font: 500 25px Georgia, serif; }
.prose h3 { margin: 24px 0 10px; font-size: 14px; }
.big-copy { color: #33423a; font-size: 18px; line-height: 1.65; }
.evidence-list { padding: 0; list-style: none; }
.evidence-list li { margin: 9px 0; padding-left: 24px; position: relative; }
.evidence-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag { padding: 6px 9px; border-radius: 8px; color: var(--green-dark); background: var(--mint); font-size: 12px; font-weight: 650; }
.warning-panel { background: #fffcf5; border-color: #eadabd; }
.enrichment-card { border-color: #bcd8c7; background: #fbfefc; }
.enrichment-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.enrichment-heading h2 { margin-top: 5px; }
.pilot-badge { flex: none; padding: 6px 9px; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 10px; font-weight: 800; }
.pilot-badge.partial { color: #735514; background: #f5edd7; }
.enrichment-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; margin: 18px 0 24px; }
.enrichment-facts > div { grid-template-columns: 34% 66%; }
.enrichment-lots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.enrichment-lots > div { padding: 15px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.enrichment-lots span, .enrichment-lots strong, .enrichment-lots small { display: block; }
.enrichment-lots span, .enrichment-lots small { color: var(--muted); font-size: 10px; }
.enrichment-lots strong { margin-top: 3px; color: var(--green-dark); font-size: 15px; }
.enrichment-lots p { margin: 8px 0; font-size: 12px; line-height: 1.5; }
.enrichment-source { margin-top: 18px; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.enrichment-source .text-link { margin: 0; }
.source-text { max-height: 450px; overflow: auto; white-space: pre-wrap; color: #465149; font-size: 14px; line-height: 1.7; }
.facts, .action-card, .history, .system-config { padding: 22px; box-shadow: none; }
dl { margin: 0; }
dl > div { padding: 11px 0; display: grid; grid-template-columns: 42% 58%; gap: 10px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 11px; }
dd { margin: 0; font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.action-card form + form { margin-top: 5px; }
.history > div { padding: 11px 0; border-top: 1px solid var(--line); }
.history strong, .history span, .history small { display: block; }
.history strong { font-size: 12px; }
.history span, .history small { color: var(--muted); font-size: 10px; }

.alert { margin: 0 0 18px; padding: 14px 18px; display: flex; gap: 10px; border-radius: 12px; font-size: 13px; }
.alert.error { color: #7f2c28; background: #f9e3e1; }
.alert.pending { color: #155b83; background: #e1f0f8; }
.alert.success { color: var(--green-dark); background: var(--mint); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; }
.settings-form { padding: 26px; display: flex; flex-direction: column; gap: 20px; }
.settings-form small { display: block; margin-top: 6px; color: var(--muted); }
.note { margin-top: 20px; padding: 15px; border-radius: 12px; background: var(--mint); }
.note strong { font-size: 13px; }
.note p { margin: 5px 0 0; color: var(--green-dark); font-size: 12px; }
footer { padding: 24px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); text-align: center; font-size: 11px; }
footer img { width: 22px; height: 22px; }

.team-hero { align-items: center; }
.team-count { padding: 10px 14px; border-radius: 999px; color: var(--green-dark); background: var(--mint); font-size: 12px; font-weight: 750; }
.people-panel { padding: 20px; }
.people-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.person-card { position: relative; padding: 20px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfa; }
.person-card > div { margin: 14px 0; }
.person-card h2 { margin-bottom: 2px; font: 500 19px Georgia, serif; }
.person-card p { margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.person-card dl > div { grid-template-columns: 42% 58%; padding: 7px 0; }
.active-badge { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; font-weight: 750; }
.active-badge i { width: 7px; height: 7px; border-radius: 50%; background: #48a75e; }

.login-body { min-height: 100vh; background: #eef1eb; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(420px, .75fr); }
.login-story {
  min-height: 100vh;
  padding: clamp(34px, 6vw, 84px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 83% 18%, rgba(125,205,117,.29), transparent 28rem),
    linear-gradient(145deg, #102a20 0%, #164f37 55%, #297448 100%);
}
.login-story::after {
  content: "";
  width: 520px;
  height: 520px;
  position: absolute;
  right: -190px;
  bottom: -250px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 48% 52% 55% 45%;
  transform: rotate(24deg);
  box-shadow: 0 0 0 60px rgba(255,255,255,.025), 0 0 0 120px rgba(255,255,255,.018);
}
.large-logo { width: 220px; height: 72px; padding: 12px 18px; border-radius: 18px; box-shadow: 0 18px 45px rgba(0,0,0,.17); }
.login-message { position: relative; z-index: 1; }
.eyebrow.light { color: #9fd6ac; }
.login-message h1 { max-width: 780px; margin-bottom: 20px; font-size: clamp(48px, 6vw, 82px); }
.login-message > p:last-child { max-width: 650px; color: rgba(255,255,255,.72); font-size: 18px; }
.login-feature-row { position: relative; z-index: 1; display: flex; gap: 28px; color: rgba(255,255,255,.62); font-size: 11px; }
.login-feature-row b { color: #fff; }
.login-copyright { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.62); font-size: 11px; }
.login-panel { padding: 40px; display: grid; place-items: center; align-content: center; }
.login-card { width: min(100%, 440px); padding: 38px; border: 1px solid rgba(19,35,28,.08); border-radius: 24px; background: #fff; box-shadow: 0 28px 80px rgba(24,43,34,.12); }
.login-icon { width: 54px; height: 54px; margin-bottom: 22px; display: block; }
.login-icon img { width: 100%; height: 100%; }
.login-card h2 { margin-bottom: 10px; font: 500 32px/1.08 Georgia, serif; letter-spacing: -.02em; }
.login-intro { margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.engea-auth-button {
  min-height: 68px;
  padding: 12px 15px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 13px;
  border-radius: 14px;
  color: #fff;
  background: var(--green);
  box-shadow: 0 14px 28px rgba(31,112,77,.2);
  transition: transform .15s, background .15s;
}
.engea-auth-button:hover { transform: translateY(-2px); background: var(--green-dark); }
.engea-auth-button strong, .engea-auth-button small { display: block; }
.engea-auth-button strong { font-size: 14px; }
.engea-auth-button small { color: rgba(255,255,255,.68); font-size: 10px; }
.microsoft-mark { width: 24px; height: 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.microsoft-mark i:nth-child(1) { background: #f25022; }
.microsoft-mark i:nth-child(2) { background: #7fba00; }
.microsoft-mark i:nth-child(3) { background: #00a4ef; }
.microsoft-mark i:nth-child(4) { background: #ffb900; }
.security-note { margin-top: 20px; display: flex; align-items: flex-start; gap: 8px; color: var(--muted); }
.security-note > span { color: var(--green); font-weight: 900; }
.security-note p { margin: 0; font-size: 11px; }
.login-help { margin-top: 20px; color: var(--muted); font-size: 10px; text-align: center; }

@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar nav { grid-row: 2; grid-column: 1 / -1; padding-bottom: 10px; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: 2fr 1fr 1fr; }
  .content-grid, .detail-grid { grid-template-columns: 1fr; }
  .activity { order: -1; }
  .people-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .topbar { height: auto; padding: 12px 16px; align-items: center; gap: 10px; }
  nav { margin-top: 3px; }
  nav a { padding: 8px; font-size: 11px; }
  .nav-icon { display: none; }
  .logo-shell { width: 116px; height: 40px; }
  .product-name, .user-copy { display: none; }
  .user-menu { min-width: auto; border: 0; background: transparent; }
  .brand small { display: none; }
  .page { width: min(100% - 24px, 1480px); padding-top: 28px; }
  .hero, .detail-hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; }
  .hero-actions .button, .hero-actions form { flex: 1; }
  .hero .button, .detail-hero .button { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .analysis-progress { grid-template-columns: 1fr auto; }
  .analysis-progress .progress-track { grid-row: 2; grid-column: 1 / -1; }
  .filters { grid-template-columns: 1fr; }
  .tender-row { grid-template-columns: 54px minmax(0, 1fr); padding: 16px; }
  .score { width: 52px; height: 52px; }
  .tender-dates, .chevron { display: none; }
  .two-columns, .settings-grid { grid-template-columns: 1fr; }
  .people-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 20px; }
  .login-card { padding: 28px 22px; }
}

/* Minimal ENGEA dashboard */
:root {
  --ink: #17241d;
  --muted: #68746d;
  --paper: #f5f7f4;
  --line: #dfe6e0;
  --green: #1d6846;
  --green-dark: #154c34;
  --mint: #e7f1ea;
  --shadow: none;
}

.app-body {
  min-height: 100vh;
  background: var(--paper);
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
.sidebar {
  height: 100vh;
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  z-index: 30;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}
.sidebar .brand {
  padding: 0 5px 27px;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}
.sidebar .logo-shell {
  width: 112px;
  height: 39px;
  padding: 7px 9px;
  border-radius: 8px;
  box-shadow: none;
}
.sidebar .product-name strong {
  font: 650 14px/1.1 Inter, ui-sans-serif, system-ui, sans-serif;
}
.sidebar .product-name small {
  margin-top: 4px;
  font-size: 8px;
  letter-spacing: .09em;
}
.nav-label {
  margin: 27px 10px 9px;
  color: #9aa39d;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}
.sidebar nav a {
  min-height: 43px;
  padding: 0 11px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  border-radius: 8px;
  color: #5e6a63;
  font-size: 13px;
  font-weight: 600;
}
.sidebar nav a:hover {
  color: var(--green-dark);
  background: #f0f5f1;
}
.sidebar nav a.active {
  color: var(--green-dark);
  background: var(--mint);
}
.sidebar .nav-icon {
  margin: 0;
  color: #9aa59e;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}
.sidebar nav a.active .nav-icon { color: var(--green); }
.sidebar-note {
  margin: auto 4px 14px;
  padding: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.sidebar-note strong,
.sidebar-note small { display: block; }
.sidebar-note strong { font-size: 10px; }
.sidebar-note small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4a9b68;
  box-shadow: 0 0 0 4px #e7f3eb;
}
.sidebar .user-menu {
  width: 100%;
  padding: 9px 7px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.sidebar .avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--green);
  font-size: 9px;
}
.sidebar .user-copy { flex: 1; }
.sidebar .user-copy strong { font-size: 10px; }
.sidebar .user-copy small { font-size: 8px; }
.sidebar .logout {
  width: 27px;
  height: 27px;
  background: transparent;
}
.workspace { min-width: 0; }
.workspace-bar {
  height: 58px;
  padding: 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.82);
}
.workspace-bar div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.workspace-bar div span {
  color: var(--green);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .12em;
}
.workspace-bar div strong {
  padding-left: 10px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 550;
}
.workspace-date { color: var(--muted); font-size: 10px; }
.workspace .page {
  width: min(1460px, calc(100% - 64px));
  margin: 0 auto;
  padding: 34px 0 48px;
}
.workspace .hero {
  margin-bottom: 27px;
  align-items: center;
}
.workspace .eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
  letter-spacing: .12em;
}
.workspace h1 {
  max-width: none;
  margin-bottom: 7px;
  font: 620 clamp(28px, 3vw, 38px)/1.12 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.035em;
}
.workspace .hero.compact h1 {
  font-size: clamp(27px, 3vw, 36px);
}
.workspace .lede { font-size: 13px; }
.button {
  min-height: 39px;
  padding: 9px 14px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 680;
  box-shadow: none !important;
}
.button:hover { transform: none; }
.button.subtle { background: transparent; }
.button.dark { background: #243029; }
.stats {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 11px;
}
.stat {
  min-height: 112px;
  padding: 16px 17px;
  border-radius: 10px;
  background: #fff;
}
.stat:hover { background: #fcfdfc; }
.stat.accent {
  color: var(--green-dark);
  border-color: #bfd6c7;
  background: #eaf3ed;
}
.stat span {
  color: #69746d;
  font-size: 10px;
  font-weight: 650;
}
.stat.accent span { color: #52705e; }
.stat strong {
  margin: 7px 0 2px;
  font: 620 29px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.04em;
}
.stat small,
.stat.accent small {
  margin-top: 0;
  color: #98a19b;
  font-size: 9px;
}
.analysis-progress {
  min-height: 51px;
  margin-bottom: 18px;
  padding: 10px 15px;
  gap: 15px;
  border-color: var(--line);
  border-radius: 9px;
  background: #fff;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  box-shadow: 0 0 0 4px #e7f3eb;
}
.progress-track { height: 4px; background: #e8ede9; }
.progress-track span { background: var(--green); }
.panel {
  border-radius: 11px;
  box-shadow: none;
}
.filters-panel { padding: 14px; }
.filter-heading { margin-bottom: 11px; }
.filter-heading strong { font-size: 11px; }
.filter-heading span { font-size: 9px; }
label > span {
  margin-bottom: 5px;
  font-size: 9px;
  letter-spacing: .05em;
}
input, select, textarea {
  border-radius: 7px;
  padding: 9px 11px;
  background: #fcfdfc;
  font-size: 12px;
}
.content-grid {
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 14px;
}
.panel-heading { padding: 17px 19px; }
.panel-heading h2,
.prose h2,
.facts h2,
.action-card h2,
.history h2,
.system-config h2 {
  font: 620 17px Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.02em;
}
.tender-row {
  padding: 16px 18px;
  grid-template-columns: 56px minmax(0, 1fr) 105px 16px;
  gap: 14px;
}
.score {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}
.score strong { font: 650 19px/1 Inter, ui-sans-serif, system-ui, sans-serif; }
.score small { font-size: 7px; }
.score-alta { background: #e5f0e8; }
.tender-main h3 { margin-top: 6px; font-size: 13px; font-weight: 650; }
.tender-main p { font-size: 11px; }
.row-meta { font-size: 9px; }
.pill { border-radius: 4px; }
.tender-dates strong { font-size: 10px; }
.chevron { font-size: 20px; }
.activity .panel-heading h2 { font-size: 15px; }
.job-list { padding: 6px 17px; }
.job { grid-template-columns: 8px 1fr auto; }
.job strong { font-size: 10px; }
.job span, .job small { font-size: 8px; }
.text-link { margin-left: 17px; font-size: 10px; }
.person-card,
.settings-form,
.system-config,
.facts,
.action-card,
.history,
.prose { border-radius: 10px; }
.person-card h2 { font: 620 16px Inter, ui-sans-serif, system-ui, sans-serif; }
.team-count { border: 1px solid #cbded1; border-radius: 7px; background: #edf5ef; }
.login-body { background: #f6f8f5; }
.login-story {
  color: var(--ink);
  background: #e8f0e9;
}
.login-story::after { display: none; }
.eyebrow.light { color: var(--green); }
.login-message h1 {
  max-width: 680px;
  font: 600 clamp(44px, 5vw, 68px)/1.03 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.05em;
}
.login-message > p:last-child { color: #607067; }
.login-feature-row { color: #66736b; }
.login-feature-row b { color: var(--green-dark); }
.login-copyright { color: #66736b; }
.login-panel { background: #fbfcfa; }
.login-card {
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(28,57,40,.06);
}
.login-card h2 {
  font: 620 28px/1.1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -.035em;
}
.engea-auth-button {
  border-radius: 8px;
  box-shadow: none;
}
footer { border-top: 1px solid var(--line); }
footer img { display: none; }

@media (max-width: 1500px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .filters .search-field { grid-column: 1 / -1; }
  .content-grid { grid-template-columns: minmax(0, 1fr) 268px; }
}
@media (max-width: 1400px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .tender-row { grid-template-columns: 52px minmax(0, 1fr) 96px 14px; gap: 12px; }
}
@media (max-width: 1220px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters .search-field { grid-column: 1 / -1; }
}
@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar {
    height: 70px;
    padding: 9px 18px;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .sidebar .brand {
    padding: 0 18px 0 0;
    border: 0;
    border-right: 1px solid var(--line);
  }
  .sidebar .product-name,
  .sidebar .nav-label,
  .sidebar-note { display: none; }
  .sidebar nav {
    flex: 1;
    flex-direction: row;
  }
  .sidebar nav a {
    min-height: 38px;
    display: flex;
    gap: 7px;
  }
  .sidebar .user-menu {
    width: auto;
    padding: 0;
    border: 0;
  }
  .workspace-bar { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .activity { order: 0; }
}
@media (max-width: 680px) {
  .enrichment-facts, .enrichment-lots { grid-template-columns: 1fr; }
  .enrichment-heading, .enrichment-source { align-items: flex-start; flex-direction: column; }
  .app-body { padding-bottom: 66px; }
  .sidebar {
    width: 100%;
    height: 66px;
    padding: 6px max(8px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    position: fixed;
    inset: auto 0 0;
    align-items: stretch;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(251,252,250,.96);
    backdrop-filter: blur(15px);
  }
  .sidebar .brand,
  .sidebar .user-menu { display: none; }
  .sidebar nav {
    width: 100%;
    justify-content: stretch;
    gap: 4px;
  }
  .sidebar nav a {
    min-height: 52px;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 4px 6px;
    font-size: 10px;
  }
  .sidebar nav .nav-icon {
    display: block;
    font-size: 8px;
  }
  .workspace .page {
    width: calc(100% - 20px);
    padding: 20px 0 30px;
  }
  .workspace .hero {
    margin-bottom: 20px;
    align-items: flex-start;
    gap: 16px;
  }
  .workspace h1 { font-size: 27px; }
  .workspace .lede { max-width: 330px; font-size: 12px; }
  .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .hero-actions form,
  .hero-actions .button { width: 100%; }
  .stats {
    width: calc(100% + 10px);
    padding: 0 10px 5px 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .stats::-webkit-scrollbar { display: none; }
  .stat {
    min-width: 145px;
    min-height: 98px;
    scroll-snap-align: start;
  }
  .analysis-progress {
    grid-template-columns: 1fr auto;
    margin-bottom: 12px;
  }
  .analysis-progress .progress-track {
    grid-row: 2;
    grid-column: 1 / -1;
  }
  .filters-panel { padding: 12px; }
  .filter-heading { align-items: flex-start; }
  .filters { gap: 9px; }
  .filters .button { width: 100%; }
  .check { min-height: 34px; }
  .panel-heading { padding: 14px; }
  .panel-heading h2 { font-size: 15px; }
  .panel-heading > .muted { font-size: 9px; }
  .tender-list {
    gap: 8px;
    padding: 8px;
    background: var(--paper);
  }
  .tender-row {
    padding: 13px;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
  }
  .score {
    width: 44px;
    height: 44px;
  }
  .tender-main h3 {
    margin-top: 5px;
    font-size: 12px;
  }
  .tender-main p.summary { -webkit-line-clamp: 3; }
  .tender-dates {
    grid-column: 2;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: 2px 8px;
  }
  .tender-dates span { margin: 0; }
  .tender-dates small { grid-column: 2; }
  .chevron { display: none; }
  .pagination {
    padding: 14px 8px;
    gap: 8px;
  }
  .pagination span { display: none; }
  .pagination .button { flex: 1; }
  .activity { margin-top: 4px; }
  .back { margin-bottom: 16px; }
  .detail-hero {
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 12px;
  }
  .score.large {
    width: 58px;
    height: 58px;
    border-radius: 10px;
  }
  .score.large strong { font-size: 23px; }
  .detail-title h1 {
    margin: 6px 0;
    font-size: 22px;
  }
  .detail-hero > .button {
    grid-column: 1 / -1;
    width: 100%;
  }
  .detail-grid,
  .two-columns,
  .settings-grid { grid-template-columns: 1fr; }
  .detail-main,
  .detail-side { gap: 10px; }
  .prose,
  .facts,
  .action-card,
  .history,
  .system-config,
  .settings-form { padding: 17px; }
  .big-copy { font-size: 15px; line-height: 1.55; }
  .source-text { max-height: 320px; font-size: 12px; }
  dl > div { grid-template-columns: 38% 62%; }
  .people-panel { padding: 10px; }
  .people-grid { grid-template-columns: 1fr; }
  .person-card { padding: 16px; }
  footer {
    padding: 18px 16px;
    font-size: 9px;
  }
  .login-panel { padding: 14px; }
  .login-card { padding: 25px 20px; }
  .login-card h2 { font-size: 25px; }
}
