@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700;800&family=Mulish:wght@400;500;600;700;800&display=swap");

* { box-sizing: border-box; }

:root {
  --ink: #16273F;
  --body: #33404F;
  --doc-body: #3A4757;
  --muted: #8791A0;
  --muted2: #5B6675;
  --muted3: #98A2B0;
  --teal: #1B7FB0;
  --teal-dark: #1B5E86;
  --teal-hover: #166B94;
  --card-border: #EAEDF3;
  --line: #E7EBF1;
  --line2: #EEF1F6;
  --btn-border: #E4E8EF;
  --input-border: #E4E9F1;
  --table-head: #F8FAFD;
  --label-cell: #FAFBFD;
  --red: #E8402A;
  --link: #2F6FE0;
  --link-hover: #1E56C0;
}

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  font-family: "Mulish", system-ui, sans-serif;
  color: var(--body);
  background: linear-gradient(180deg, #F6F4FB 0%, #F1F6F6 100%);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; cursor: pointer; }
body.modal-open { overflow: hidden; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
body.auth-pending .app-shell { display: none; }

.app-shell .rm-header-inner,
.app-shell .rm-footer-inner { max-width: 90%; }

@keyframes dcFadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
/* Aliases referenced by the ported governance inline styles */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ------------------------------- Hero ------------------------------- */
.dc-hero-inner { max-width: 90%; margin: 0 auto; padding: 32px 32px 8px; }
.dc-title {
  font-family: "Lexend", sans-serif;
  font-weight: 700;
  font-size: 38px;
  line-height: 1.05;
  letter-spacing: -0.5px;
  color: var(--ink);
  margin: 0 0 4px;
}
.dc-domain-url { font-size: 15px; color: var(--link); font-weight: 600; text-decoration: none; }
.dc-domain-url:hover { color: var(--link-hover); text-decoration: underline; }

/* Profile chips beneath the org/domain name */
.dc-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.dc-chip { display: inline-flex; align-items: center; gap: 7px; font-family: "Lexend", sans-serif; font-weight: 600; font-size: 12.5px; color: #3A4757; background: #fff; border: 1px solid #E4E8EF; border-radius: 999px; padding: 6px 13px; }
.dc-chip-k { font-weight: 700; color: #98A2B0; }
.dc-chip-change { display: inline-flex; align-items: center; gap: 6px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--teal); background: #EAF4F9; border: 1px solid #CFE5F0; border-radius: 999px; padding: 6px 13px; cursor: pointer; }
.dc-chip-change:hover { background: #DDEDF5; }

/* Full-width tab band (standard suite treatment) */
.dc-tabbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(18, 38, 63, 0.03); margin-top: 20px; }
.dc-tabbar-inner { max-width: 90%; margin: 0 auto; padding: 0 32px; display: flex; gap: 32px; flex-wrap: wrap; }
.dc-tabbar-inner button:focus-visible { outline: 3px solid rgba(27, 127, 176, 0.35); outline-offset: 2px; border-radius: 4px; }

/* Right-aligned action row */
.dc-actionbar-inner { max-width: 90%; margin: 0 auto; padding: 20px 32px 0; display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ------------------------------- Tab + action bar ------------------------------- */
.dc-bar-inner {
  max-width: 90%;
  margin: 0 auto;
  padding: 24px 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dc-tabs {
  display: inline-flex;
  background: #fff;
  border: 1px solid var(--btn-border);
  border-radius: 13px;
  padding: 5px;
  box-shadow: 0 1px 2px rgba(18, 38, 63, 0.05);
}
.dc-tab {
  appearance: none;
  border: none;
  background: transparent;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  border-radius: 9px;
  padding: 11px 20px;
}
.dc-tab.active { font-weight: 700; color: #fff; background: var(--teal); }
.dc-tab:not(.active):hover { color: var(--teal-dark); }

.dc-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dc-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Lexend", sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--btn-border);
  border-radius: 11px;
  padding: 11px 18px;
}
.dc-action svg { stroke: currentColor; }
.dc-action:hover { border-color: var(--teal-dark); color: var(--teal-dark); }

/* ------------------------------- Document card ------------------------------- */
.dc-main { flex: 1; max-width: 90%; width: 100%; margin: 0 auto; padding: 20px 32px 56px; }
.dc-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(18, 38, 63, 0.06);
  padding: 46px 52px;
  animation: dcFadeUp 0.3s ease both;
}
.dc-empty { text-align: center; color: var(--muted); font-size: 15px; padding: 40px 0; }

/* Document head */
.doc-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 30px; color: var(--teal-dark); margin: 0 0 6px; letter-spacing: -0.4px; }
.doc-generated { font-size: 14px; color: var(--muted); }
.doc-divider { height: 1px; background: var(--card-border); margin: 24px 0 28px; }

/* Shared document typography */
.doc-body p { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--doc-body); }
.doc-body ul { margin: 0 0 16px; padding-left: 22px; }
.doc-body li { font-size: 15px; line-height: 1.7; color: var(--doc-body); margin-bottom: 9px; }
.doc-body h3 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 20px; color: var(--teal-dark); margin: 30px 0 12px; letter-spacing: -0.2px; }
.doc-body h4 { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 15.5px; color: var(--ink); margin: 20px 0 8px; }
.doc-body strong { color: var(--ink); }
.doc-body a { color: var(--link); text-decoration: none; }
.doc-body a:hover { color: var(--link-hover); text-decoration: underline; }
.doc-muted { color: var(--muted); font-size: 14px; }

/* Stat tiles */
.doc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 26px 0 8px; }
.doc-stat { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.doc-stat-label { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--teal-dark); }
.doc-stat-value { font-family: "Lexend", sans-serif; font-weight: 800; font-size: 28px; color: var(--ink); margin-top: 6px; line-height: 1; }
.doc-stats--vpat { margin: 0; }
.doc-stats--vpat .doc-stat { padding: 18px 20px; }
.doc-stats--vpat .doc-stat-value { font-size: 30px; }

/* VPAT product info block */
.doc-info { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 4px; }
.doc-info-row { display: flex; border-bottom: 1px solid var(--line2); }
.doc-info-row:last-child { border-bottom: none; }
.doc-info-label { width: 200px; flex: 0 0 auto; padding: 14px 18px; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14px; color: var(--teal-dark); background: var(--label-cell); border-right: 1px solid var(--line2); }
.doc-info-value { flex: 1; padding: 14px 18px; font-family: "Mulish", sans-serif; font-size: 14.5px; color: var(--doc-body); word-break: break-word; }

/* VPAT conformance table */
.doc-table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; overflow-x: auto; }
.doc-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.doc-table thead tr { background: var(--table-head); border-bottom: 1px solid var(--card-border); }
.doc-table th { text-align: left; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: 0.3px; color: var(--teal-dark); padding: 13px 18px; }
.doc-table td { padding: 15px 18px; font-family: "Mulish", sans-serif; font-size: 14px; color: var(--doc-body); }
.doc-table tbody tr { border-bottom: 1px solid #F1F4F8; }
.doc-table tbody tr:last-child { border-bottom: none; }
.doc-table .doc-td-criterion { font-family: "Lexend", sans-serif; font-weight: 600; color: var(--ink); }
.doc-table .doc-td-level { color: var(--muted); }
.doc-conf-pill { display: inline-block; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12.5px; color: #3B5678; background: #EEF2FA; border-radius: 7px; padding: 5px 12px; }
.doc-conf-pill.supports { color: #1F8A5B; background: #E7F7F1; }
.doc-empty-cell { text-align: center; color: var(--muted); padding: 28px 18px; }

/* ------------------------------- Shared buttons ------------------------------- */
.dc-btn-ghost { font-family: "Lexend", sans-serif; font-weight: 600; font-size: 14.5px; color: var(--muted2); background: #fff; border: 1px solid var(--btn-border); border-radius: 11px; padding: 11px 22px; }
.dc-btn-ghost:hover { border-color: #C7D0DE; }
.dc-btn-ghost:disabled { opacity: 0.5; cursor: default; }
.dc-btn-primary { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 14.5px; color: #fff; background: var(--teal); border: none; border-radius: 11px; padding: 11px 22px; box-shadow: 0 4px 12px rgba(27, 127, 176, 0.28); }
.dc-btn-primary:hover { background: var(--teal-hover); }
.dc-btn-primary:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ------------------------------- Document lifecycle ------------------------------- */
.doc-life { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--card-border); }
.doc-life-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.doc-life-badge { display: inline-flex; align-items: center; font-family: "Lexend", sans-serif; font-weight: 700; font-size: 12px; border-radius: 999px; padding: 5px 13px; border: 1px solid; }
.doc-life-meta { font-size: 13px; color: var(--muted); }
.doc-life-input {
  font-family: "Mulish", sans-serif;
  font-size: 14px;
  padding: 10px 13px;
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  min-width: 220px;
}
.doc-life-input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(27, 127, 176, 0.14); }
.doc-life-blocked { background: #FCECEC; border: 1px solid #F5D5D5; border-radius: 11px; padding: 12px 16px; margin-bottom: 14px; }
.doc-life-blocked-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 13px; color: #C0392B; margin-bottom: 6px; }
.doc-life-blocked ul { margin: 0; padding-left: 18px; }
.doc-life-blocked li { font-size: 13.5px; color: #8A3229; line-height: 1.6; }
.doc-unsupported { background: #FCF6E4; border: 1px solid #F1E7C4; border-radius: 12px; padding: 16px 20px; font-size: 14px; color: #8A5A12; line-height: 1.6; }

/* ------------------------------- Responsive ------------------------------- */
@media (max-width: 900px) {
  .doc-stats { grid-template-columns: repeat(2, 1fr); }
  .dc-card { padding: 32px 26px; }
}
@media (max-width: 640px) {
  .dc-hero-inner, .dc-tabbar-inner, .dc-actionbar-inner, .dc-main { padding-left: 20px; padding-right: 20px; }
  .dc-tabbar-inner { gap: 20px; overflow-x: auto; flex-wrap: nowrap; }
  .doc-stats { grid-template-columns: 1fr 1fr; }
  .doc-info-label { width: 130px; }
}

@media (prefers-reduced-motion: reduce) {
  .dc-card { animation: none; }
}

/* ------------------------------- Print ------------------------------- */
@media print {
  body { background: #fff !important; }
  .no-print { display: none !important; }
  .dc-main { padding: 0 !important; max-width: none !important; }
  .dc-card { box-shadow: none !important; border: none !important; padding: 0 !important; animation: none !important; }
}

/* Page heading + subtitle — identical to the Dashboard's .db-greeting / .db-subtitle, suite-wide. */
.dc-title { font-family: "Lexend", sans-serif; font-weight: 700; font-size: 38px; line-height: 1.05; letter-spacing: -0.5px; color: #16273F; margin: 0 0 6px; }
