:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #101828;
  --muted: #667085;
  --border: #d9dee7;
  --black: #111827;
  --success: #16803c;
  --warning: #b7791f;
  --danger: #c92a2a;
  --info: #1d4ed8;
  --shadow: 0 18px 40px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(29, 78, 216, .35); outline-offset: 2px; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.brand img { width: 34px; height: 34px; }
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; justify-content: space-between; padding: 16px clamp(18px, 4vw, 56px); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.site-nav { display: flex; align-items: center; gap: 18px; color: var(--muted); font-weight: 650; }
.site-nav a:hover, .site-nav a:focus { color: var(--black); }
.site-footer { display: flex; justify-content: space-between; gap: 24px; padding: 36px clamp(18px, 4vw, 56px); border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.site-footer nav { display: flex; gap: 16px; align-items: center; }

.hero { min-height: 82svh; display: grid; align-items: center; padding: clamp(46px, 8vw, 96px) clamp(18px, 4vw, 56px); position: relative; overflow: hidden; background: #ffffff; border-bottom: 1px solid var(--border); }
.hero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(90deg, rgba(255,255,255,.96) 0%, rgba(255,255,255,.88) 42%, rgba(255,255,255,.62) 100%), url("/assets/img/logo.svg"); background-repeat: no-repeat; background-position: right 10vw center; background-size: min(48vw, 520px); opacity: .95; }
.hero-content { position: relative; max-width: 760px; z-index: 1; }
.eyebrow { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .86rem; color: var(--muted); background: var(--surface); }
h1 { font-size: clamp(2.2rem, 5vw, 4.8rem); line-height: 1.02; margin: 18px 0; letter-spacing: 0; }
h2 { font-size: clamp(1.35rem, 2vw, 2rem); line-height: 1.18; margin: 0 0 10px; letter-spacing: 0; }
h3 { margin: 0 0 8px; letter-spacing: 0; }
p { color: var(--muted); line-height: 1.65; }
.hero p { font-size: clamp(1.05rem, 1.7vw, 1.35rem); max-width: 680px; }
.hero-actions, .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 12px; max-width: 640px; margin-top: 34px; }
.metric { border: 1px solid var(--border); border-radius: 8px; padding: 14px; background: rgba(255,255,255,.92); box-shadow: 0 8px 24px rgba(16,24,40,.05); }
.metric strong { display: block; font-size: 1.4rem; }

.section { padding: clamp(42px, 7vw, 84px) clamp(18px, 4vw, 56px); }
.section-head { max-width: 760px; margin-bottom: 24px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 22px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #aab2c0; }
.card .icon { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: #111827; color: #fff; font-weight: 800; margin-bottom: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; gap: 8px; padding: 10px 15px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--black); font-weight: 750; transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease; }
.btn:hover { background: var(--black); color: #fff; border-color: var(--black); transform: translateY(-1px); }
.btn.primary { background: var(--black); color: #fff; border-color: var(--black); }
.btn.primary:hover { background: #000; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 32px; padding: 6px 10px; font-size: .86rem; }
.btn.danger:hover, .btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; }

.auth-page { min-height: calc(100svh - 76px); display: grid; place-items: center; padding: 28px; }
.auth-box { width: min(100%, 440px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 28px; box-shadow: var(--shadow); }

.app-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; align-self: start; height: 100vh; overflow: auto; background: #111827; color: #e5e7eb; padding: 20px 14px; }
.app-brand { margin: 0 8px 22px; color: #fff; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar a { display: flex; align-items: center; min-height: 36px; padding: 9px 10px; border-radius: 8px; color: #d1d5db; font-weight: 650; }
.sidebar a:hover, .sidebar a.active { background: #ffffff; color: #111827; }
.nav-group { margin: 18px 10px 6px; color: #9ca3af; text-transform: uppercase; font-size: .72rem; font-weight: 800; }
.app-workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 10; min-height: 72px; display: flex; justify-content: space-between; gap: 18px; align-items: center; padding: 14px 24px; background: rgba(247,248,250,.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar span { display: block; color: var(--muted); font-size: .9rem; margin-top: 3px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-search { flex: 1; max-width: 440px; }
.topbar-search input { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; background: #fff; }
.app-main { padding: 24px; max-width: 1440px; margin: 0 auto; }

.module-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.module-head h1 { font-size: clamp(1.9rem, 3vw, 3rem); margin: 0 0 8px; }
.module-head small { display: inline-block; color: var(--muted); background: #eef2f7; border: 1px solid var(--border); padding: 8px 10px; border-radius: 8px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin: 16px 0; box-shadow: 0 8px 24px rgba(16,24,40,.04); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
.field { display: grid; gap: 7px; color: var(--muted); font-weight: 700; font-size: .9rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fff; color: var(--text); }
.field textarea { min-height: 110px; resize: vertical; }
.span-2 { grid-column: span 2; }
.check { display: flex; gap: 9px; align-items: center; min-height: 42px; color: var(--text); font-weight: 650; }
.check input { width: 18px; height: 18px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; }
.table-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 12px; }
.responsive-table { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .82rem; text-transform: uppercase; background: #f9fafb; }
tr:hover td { background: #fbfcfe; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 8px; font-size: .82rem; font-weight: 800; border: 1px solid transparent; white-space: nowrap; }
.badge.success { color: var(--success); background: #eaf7ef; border-color: #b8e5c8; }
.badge.warning { color: var(--warning); background: #fff7e6; border-color: #f6d28b; }
.badge.danger { color: var(--danger); background: #fff1f1; border-color: #f2b8b8; }
.badge.neutral { color: #475467; background: #f2f4f7; border-color: #d0d5dd; }
.notice { border-radius: 8px; padding: 12px 14px; margin: 12px 0; border: 1px solid var(--border); background: #f9fafb; color: var(--text); }
.notice.success { border-color: #b8e5c8; background: #eefbf3; color: var(--success); }
.notice.warning { border-color: #f6d28b; background: #fff8e8; color: var(--warning); }
.notice.danger { border-color: #f2b8b8; background: #fff1f1; color: var(--danger); }
.empty-state, .module-empty { border: 1px dashed var(--border); border-radius: 8px; padding: 24px; background: #fbfcfe; color: var(--muted); }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.score-grid { display: grid; grid-template-columns: minmax(280px, 390px) minmax(0, 1fr); gap: 16px; }
.score-card { display: flex; align-items: center; gap: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 22px; box-shadow: var(--shadow); }
.score-ring { width: 148px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--success) var(--score-angle, 0deg), #e5e7eb 0); position: relative; flex: 0 0 auto; }
.score-ring::after { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--surface); }
.score-ring span { position: relative; z-index: 1; font-size: 2rem; font-weight: 900; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 16px; }
.kpi strong { font-size: 1.8rem; display: block; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.view-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.view-tabs a { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; background: var(--surface); color: var(--muted); font-weight: 800; }
.view-tabs a.active, .view-tabs a:hover { background: var(--black); border-color: var(--black); color: #fff; }
.requirement-list { display: grid; gap: 12px; }
.requirement-card { display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.progress { height: 10px; background: #e5e7eb; border-radius: 8px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--success); }
.list-row { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
.list-row span { color: var(--muted); }
.split-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #eef7f2; border-top: 1px solid #c9ead8; border-bottom: 1px solid #c9ead8; }
.dashboard-grid { align-items: start; }
.hp-field { position: absolute; left: -9999px; opacity: 0; width: 1px; height: 1px; }
.signature-pad { width: 100%; min-height: 180px; border: 1px solid var(--border); border-radius: 8px; background: #fff; touch-action: none; }

.bottom-nav { display: none; }

@media (max-width: 980px) {
  .site-nav { display: none; }
  .grid, .hero-metrics, .kpi-grid, .score-grid { grid-template-columns: 1fr; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-main { padding: 18px 14px 84px; }
  .topbar { padding: 12px 14px; align-items: flex-start; }
  .topbar-search { display: none; }
  .topbar-actions { display: none; }
  .split-band { display: block; }
  .bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: #111827; color: #fff; border-top: 1px solid #000; }
  .bottom-nav a { display: grid; place-items: center; min-height: 58px; font-size: .78rem; font-weight: 800; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2, .form-actions { grid-column: auto; }
  .responsive-table table, .responsive-table thead, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table thead { display: none; }
  .responsive-table tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 12px; overflow: hidden; background: var(--surface); }
  .responsive-table td { border: 0; border-bottom: 1px solid var(--border); }
  .responsive-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; font-weight: 800; margin-bottom: 4px; }
}

@media (max-width: 560px) {
  .site-header { gap: 12px; }
  .site-header .btn { display: none; }
  .hero { min-height: 76svh; }
  h1 { font-size: 2.35rem; }
  .score-card { align-items: flex-start; flex-direction: column; }
  .score-ring { width: 128px; }
}
