:root {
    color-scheme: light;
    --ink: #20213b;
    --muted: #687086;
    --line: #e7e8f1;
    --paper: #f6f7fc;
    --accent: #6240c3;
    --bs-primary: #6240c3;
    --bs-link-color-rgb: 91, 57, 179;
}
body { background: var(--paper); color: var(--ink); font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif; font-size: 1rem; }
h1, h2, h3 { font-weight: 720; letter-spacing: -.025em; }
h1 { font-size: clamp(1.65rem, 2.4vw, 2.25rem); margin: 0 0 .25rem; }
h2 { font-size: 1.25rem; margin: 0; }
h3 { font-size: 1.1rem; }
a:focus-visible, button:focus-visible { outline: 3px solid #9b75eb; outline-offset: 3px; }
small { color: var(--muted); }
[hidden] { display: none !important; }
.shell { display: grid; min-height: 100vh; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 0 16px 18px; }
.brand { align-items: center; display: flex; gap: 10px; font-size: 1.06rem; color: var(--ink); text-decoration: none; font-weight: 550; min-height: 68px; white-space: nowrap; }
.brand-mark { background: #291e51; color: #fff; border-radius: 10px; display: inline-grid; place-items: center; font-weight: 800; width: 34px; height: 34px; }
.nav-label { color: var(--muted); font-size: .875rem; font-weight: 700; margin: 20px 12px 9px; }
.nav-item { align-items: center; border-radius: 9px; color: #383a58; display: flex; padding: 10px 12px; gap: 11px; margin-bottom: 4px; text-decoration: none; font-weight: 600; }
.nav-item span { width: 18px; text-align: center; font-size: 1.05rem; }
.nav-item:hover { background: #f1edfa; }
.nav-item.is-active { background: var(--accent); color: #fff; }
.sidebar-bottom { margin-top: auto; padding-top: 32px; }
.avatar { background: #eae5f8; color: #4f378e; border-radius: 50%; flex: 0 0 32px; height: 32px; display: grid; place-items: center; font-weight: 700; }
.topbar { min-height: 68px; border-bottom: 1px solid var(--line); background: #fff; padding: 12px 26px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar strong { font-size: 1rem; }
.topbar form { width: min(330px, 48%); }
.main-content { margin-inline: auto; padding: 25px 26px 42px; max-width: 1560px; }
.page-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 21px; }
.page-title p { color: var(--muted); margin: 0; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 17px; box-shadow: 0 2px 5px #1c144f06; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric { display: flex; gap: 10px; color: var(--ink); align-items: flex-start; padding: 14px 12px; }
.metric:hover { border-color: #b7a4e8; color: var(--ink); }
.metric-icon { display: grid; place-items: center; border-radius: 9px; width: 32px; height: 32px; flex: 0 0 32px; font-size: 1.14rem; font-weight: 700; }
.purple { color: #6941c6; background: #efe8ff; }
.orange { color: #ad480d; background: #fff1e5; }
.teal { color: #087a62; background: #e3f5ef; }
.blue { color: #255db5; background: #e9f1ff; }
.metric-label { font-size: .9rem; font-weight: 670; display: block; }
.metric-number { font-size: 1.7rem; display: block; line-height: 1.2; margin: 4px 0; }
.metric small { display: block; font-size: .825rem; }
.board { display: grid; grid-template-columns: 1.12fr 1fr; gap: 16px; align-items: start; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.deadline { display: grid; align-items: center; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.deadline:last-of-type { border-bottom: 0; }
.deadline small { display: block; }
.date-block { display: grid; justify-items: center; background: #f4f1fa; color: #493085; border-radius: 7px; padding: 4px; line-height: 1.15; }
.date-block small { font-size: .68rem; text-transform: uppercase; }
.tag { display: inline-block; color: #513998; background: #f0eafa; border-radius: 6px; padding: 4px 8px; font-size: .875rem; font-weight: 650; text-decoration: none; }
.tag-danger { color: #a03828; background: #fcece8; }
.chosen { background: var(--accent); color: white; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.mini-row:last-child { border-bottom: none; }
.mini-row time { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.selected-row { background: #f6f2ff; }
.empty { padding: 18px 0; color: var(--muted); }
.chart-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 20px 0; }
.donut { width: 158px; position: relative; }
.donut svg { width: 100%; transform: rotate(-90deg); }
.donut circle { stroke-width: 15; fill: none; }
.donut-track { stroke: #eceaf2; }
.donut-ok { stroke: #198b71; }
.donut-review { stroke: #e88a45; }
.donut-label { display: flex; flex-direction: column; align-items: center; justify-content: center; position: absolute; inset: 0; }
.donut-label strong { font-size: 1.55rem; }
.legend { flex: 1; min-width: 170px; }
.legend div { display: grid; grid-template-columns: 9px 1fr auto; gap: 7px; align-items: center; margin: 9px 0; font-size: .95rem; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.teal-dot { background: #198b71; }
.orange-dot { background: #e88a45; }
.sub-link { display: inline-block; font-size: .95rem; text-decoration: none; font-weight: 650; padding: 5px 0; }
.notice { border: 1px solid #ece6f6; background: #f9f6ff; border-radius: 8px; color: #4f406a; padding: 10px 12px; }
.btn-primary { --bs-btn-bg: #6240c3; --bs-btn-border-color: #6240c3; --bs-btn-hover-bg: #5134a8; --bs-btn-hover-border-color: #5134a8; --bs-btn-active-bg: #5134a8; --bs-btn-active-border-color: #5134a8; }
.btn-outline-primary { --bs-btn-color: #6240c3; --bs-btn-border-color: #c2afeb; --bs-btn-hover-bg: #6240c3; --bs-btn-hover-border-color: #6240c3; --bs-btn-active-bg: #6240c3; --bs-btn-active-border-color: #6240c3; }
.form-control, .form-select { border-color: #dbddec; font-size: 1rem; }
.table { --bs-table-color: var(--ink); --bs-table-border-color: var(--line); margin-bottom: 0; }
.table thead th { color: #5a6079; font-size: .875rem; white-space: nowrap; }
.form-panel { max-width: 750px; }
.record-notes { white-space: pre-wrap; max-width: 420px; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 18px; }
.login-card { width: min(100%, 430px); padding: 30px; }
.login-card h1 { font-size: 1.6rem; }
@media (max-width: 1150px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 850px) { .shell { grid-template-columns: 173px minmax(0, 1fr); } .board { grid-template-columns: 1fr; } .sidebar { padding-inline: 10px; } }
@media (max-width: 620px) {
    .shell { display: block; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: 0 12px 8px; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .sidebar .nav-label, .sidebar-bottom .profile, .sidebar-bottom > a { display: none; }
    .sidebar-bottom { padding-top: 0; }
    .sidebar .brand { min-height: 50px; }
    .nav-item { padding: 6px 8px; gap: 4px; font-size: .9rem; }
    .topbar { padding: 8px 12px; }
    .topbar strong { font-size: .9rem; }
    .main-content { padding: 18px 12px 32px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .metric { gap: 6px; padding: 10px 8px; }
    .metric-icon { width: 25px; height: 25px; flex-basis: 25px; }
    .candidate { flex-wrap: wrap; }
}

.document-review-tag { margin-inline-start: .5rem; }

.contract-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.contract-signing { max-width: 850px; margin: 1rem auto; }
@media print {
    .no-print, .sidebar, .topbar, .alert { display: none !important; }
    .shell { display: block; }
    .panel { border: 0; box-shadow: none; }
}

/* Shared dashboard theme */
:root {
    --ink: #182740;
    --muted: #52637a;
    --line: #dce5ef;
    --paper: #eef3f9;
    --accent: #2349a0;
    --bs-primary: #2349a0;
    --bs-link-color-rgb: 35, 73, 160;
    --bs-link-hover-color-rgb: 24, 53, 117;
}
.ui-icon { display: inline-block; flex: 0 0 auto; vertical-align: -.22em; }
.skip-link { position: fixed; z-index: 10; top: .75rem; left: .75rem; transform: translateY(-200%); background: #fff; padding: .6rem 1rem; border-radius: .5rem; }
.skip-link:focus { transform: none; }
.shell { grid-template-columns: 246px minmax(0, 1fr); --sidebar: #14223d; --sidebar-end: #101b30; --nav-active: #284785; }
.shell-platform { --sidebar: #123332; --sidebar-end: #102626; --nav-active: #20584e; }
.sidebar { background: linear-gradient(165deg, var(--sidebar), var(--sidebar-end)); border: 0; color: #eef4ff; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sidebar-content { display: flex; flex: 1; flex-direction: column; }
.brand, .brand:hover, .sidebar .sub-link, .sidebar .btn-link { color: #eef4ff; }
.brand-mark { background: #3c61b3; box-shadow: 0 0 0 1px #ffffff30 inset; }
.shell-platform .brand-mark { background: #247963; }
.nav-label { color: #aabbd1; margin: 1.15rem .7rem .5rem; font-size: .75rem; letter-spacing: .055em; text-transform: uppercase; }
.nav-item { color: #d7e3f4; padding: .58rem .7rem; font-size: .91rem; line-height: 1.3; margin-bottom: .16rem; }
.nav-item .ui-icon { color: #a8c3f1; }
.shell-platform .nav-item .ui-icon { color: #9edacb; }
.nav-item:hover { background: #ffffff14; color: #fff; }
.nav-item.is-active { background: var(--nav-active); box-shadow: inset 3px 0 #8cb5ff; }
.shell-platform .nav-item.is-active { box-shadow: inset 3px 0 #77dac0; }
.nav-item.is-active .ui-icon { color: #fff; }
.sidebar-bottom { border-top: 1px solid #ffffff24; margin-top: 1.25rem; padding-top: 1rem; }
.sidebar-bottom small { color: #aabbd1; }
.sidebar .btn-outline-primary { --bs-btn-color: #eef4ff; --bs-btn-border-color: #7893be; }
.sidebar-toggle { display: none; align-items: center; gap: .4rem; background: #ffffff12; border: 1px solid #ffffff45; color: #fff; border-radius: .5rem; padding: .4rem .65rem; }
.topbar { min-height: 72px; background: #fff; }
.topbar-title, .workspace-name, .section-title { display: inline-flex; align-items: center; gap: .6rem; }
.workspace-name { font-weight: 650; }
.topbar-icon { flex-shrink: 0; display: grid; place-items: center; background: #e8efff; color: #2349a0; width: 34px; height: 34px; border-radius: .65rem; }
.shell-platform .topbar-icon { background: #e0f3eb; color: #17604d; }
.topbar-search { position: relative; }
.topbar-search .ui-icon { position: absolute; inset: 50% auto auto .7rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.topbar-search .form-control { padding-left: 2.4rem; background: #f7f9fd; }
.page-banner { background: linear-gradient(115deg, #192d54, #274b8c); color: #fff; border-radius: 16px; padding: clamp(1.25rem, 3vw, 2.1rem); box-shadow: 0 8px 22px #1d335623; }
.shell-platform .page-banner { background: linear-gradient(115deg, #153735, #1b6656); }
.page-banner p, .page-banner .sub-link { color: #e2edff; }
.page-banner .btn-primary { --bs-btn-bg: #fff; --bs-btn-color: #183763; --bs-btn-border-color: #fff; --bs-btn-hover-bg: #e3eeff; --bs-btn-hover-border-color: #e3eeff; --bs-btn-hover-color: #183763; --bs-btn-active-bg: #dceafe; --bs-btn-active-border-color: #dceafe; --bs-btn-active-color: #183763; }
.panel { box-shadow: 0 3px 12px #1833510b; }
.metric:hover { border-color: #7694cf; box-shadow: 0 3px 14px #25487c1b; }
.metric-icon { width: 38px; height: 38px; flex-basis: 38px; }
.section-title .ui-icon, .owner-setup summary .ui-icon { color: var(--accent); }
.owner-setup { border-inline-start: 4px solid #507cca; background: #f8fbff; }
.owner-setup .list-group-item { background: transparent; }
.table thead th { --bs-table-bg: #f1f5fa; color: #435772; }
.status-pill { display: inline-block; padding: .25rem .55rem; border-radius: 1rem; font-size: .85rem; font-weight: 650; }
.status-complete { color: #145542; background: #e0f5eb; }
.status-pending { color: #754108; background: #fff0d7; }
.btn-primary { --bs-btn-bg: #2349a0; --bs-btn-border-color: #2349a0; --bs-btn-hover-bg: #193879; --bs-btn-hover-border-color: #193879; --bs-btn-active-bg: #193879; --bs-btn-active-border-color: #193879; --bs-btn-focus-shadow-rgb: 73, 113, 195; }
.btn-outline-primary { --bs-btn-color: #2349a0; --bs-btn-border-color: #839dd2; --bs-btn-hover-bg: #2349a0; --bs-btn-hover-border-color: #2349a0; --bs-btn-active-bg: #2349a0; --bs-btn-active-border-color: #2349a0; }
.shell-platform .main-content > .page-title:not(.page-banner) h1 { color: #143e35; }
@media (max-width: 1390px) { .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 940px) { .shell { grid-template-columns: 205px minmax(0, 1fr); } .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .shell { display: block; }
    .sidebar { padding: 0 .85rem; }
    .sidebar .brand { min-height: 58px; }
    .sidebar-enhanced .sidebar-toggle { display: inline-flex; }
    .sidebar-enhanced:not(.sidebar-open) .sidebar-content { display: none; }
    .sidebar nav { display: block; }
    .sidebar .nav-label, .sidebar-bottom > a { display: block; }
    .sidebar-bottom .profile { display: flex; }
    .sidebar-bottom { padding-bottom: .5rem; }
    .nav-item { gap: .65rem; }
    .topbar { min-height: 58px; }
    .page-banner { flex-wrap: wrap; }
}
@media (max-width: 420px) {
    .topbar { align-items: stretch; flex-direction: column; gap: .5rem; }
    .topbar form { width: 100%; }
    .metric-icon { width: 30px; height: 30px; flex-basis: 30px; }
    .deadline { grid-template-columns: 42px minmax(0, 1fr); }
    .deadline .tag { grid-column: 2; justify-self: start; }
}
@media print {
    .page-banner { background: none; box-shadow: none; }
    .page-banner, .page-banner p, .page-banner .sub-link { color: var(--ink); }
}

.contract-document { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.contract-document-header { background: #142744; color: #fff; padding: 1.1rem clamp(1rem, 4vw, 2rem); }
.contract-document-header span { display: block; color: #aee0d3; font-size: .875rem; font-weight: 700; margin-bottom: .35rem; }
.contract-document-header h2 { font-size: clamp(1.25rem, 3vw, 1.7rem); overflow-wrap: anywhere; }
.contract-document-body { padding: clamp(1rem, 4vw, 2rem); }
.contract-document-body h3 { color: #23477d; margin: 1.35rem 0 .45rem; break-after: avoid; }
.contract-document-body p:last-child { margin-bottom: 0; }
@media print {
    .contract-document { border: 0; }
    .contract-document-header { background: transparent; color: #000; }
    .contract-document-header span, .contract-document-body h3 { color: #000; }
}

.contract-sample { max-height: 16rem; }
