:root {
  --navy: #072b68;
  --navy-2: #0b3f8a;
  --blue: #116ed2;
  --blue-soft: #eaf3ff;
  --green: #247b3f;
  --green-soft: #eaf7ed;
  --orange: #c66a1a;
  --violet: #7357c7;
  --ink: #15243a;
  --muted: #64748b;
  --line: #dce5ef;
  --surface: #ffffff;
  --background: #f4f7fb;
  --danger: #b42f41;
  --shadow: 0 15px 45px rgba(17, 40, 80, .08);
  --radius: 16px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--background); }
body { margin: 0; min-width: 320px; color: var(--ink); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.logo { width: 180px; height: auto; object-fit: contain; }
.eyebrow { margin: 0 0 5px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(24px, 3vw, 34px); line-height: 1.15; letter-spacing: -.025em; }
h2 { margin-bottom: 6px; font-size: 18px; line-height: 1.3; }
h3 { margin-bottom: 5px; font-size: 15px; }
small { color: var(--muted); }
hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.primary, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 15px; border: 0; border-radius: 10px; font-weight: 750; transition: .18s ease; }
.primary { color: white; background: linear-gradient(135deg, var(--navy-2), var(--blue)); box-shadow: 0 7px 18px rgba(17, 110, 210, .2); }
.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(17, 110, 210, .25); }
.button.secondary { color: var(--navy-2); background: var(--blue-soft); border: 1px solid #cfe1f7; }
.button.ghost { color: var(--ink); background: transparent; }
.button.danger { min-height: 34px; color: var(--danger); background: #fff0f2; border: 1px solid #f3cbd1; font-size: 10px; }
.wide { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.panel > header h2, .panel > header p { margin-bottom: 0; }
.panel > header > span { display: grid; place-items: center; min-width: 32px; min-height: 28px; padding: 0 8px; color: var(--navy-2); background: var(--blue-soft); border-radius: 9px; font-weight: 800; }
.empty-state { display: grid; justify-items: center; padding: 80px 24px; color: var(--muted); text-align: center; }
.empty-state > span { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 16px; color: var(--blue); background: var(--blue-soft); border-radius: 20px; font-size: 28px; }
.empty-state.small { padding: 30px 20px; }
.empty-line { margin: 0; padding: 28px; color: var(--muted); text-align: center; }

/* Login */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(380px, 1.15fr) minmax(420px, .85fr); background: linear-gradient(135deg, #f8fbff 0 58%, #e9f2ff 58%); }
.login-brand { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 8vw, 120px); background: radial-gradient(circle at 10% 90%, rgba(23, 110, 210, .18), transparent 36%); }
.login-brand::after { content: ""; position: absolute; right: -220px; bottom: -250px; width: 560px; height: 560px; border: 90px solid rgba(10, 68, 145, .06); border-radius: 50%; }
.login-brand > div { display: flex; align-items: center; gap: 20px; margin-bottom: 58px; }
.login-brand h1 { max-width: 700px; color: var(--navy); font-size: clamp(42px, 6vw, 78px); }
.login-brand > p:not(.eyebrow) { max-width: 630px; color: var(--muted); font-size: 19px; }
.secure-chip { padding: 7px 12px; color: var(--green); background: var(--green-soft); border-radius: 999px; font-size: 11px; font-weight: 800; }
.login-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.login-points span { padding: 9px 13px; color: var(--navy-2); background: white; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; }
.login-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 34px; }
.login-panel > header { position: absolute; top: 24px; right: 30px; }
.login-card { width: min(440px, 100%); padding: 38px; background: white; border: 1px solid rgba(255,255,255,.8); border-radius: 22px; box-shadow: 0 24px 70px rgba(11, 54, 113, .15); }
.login-card .logo { width: 145px; margin: 0 auto 35px; }
.login-card h2 { font-size: 27px; }
.login-card form { display: grid; gap: 18px; margin-top: 28px; }
label { display: grid; gap: 7px; color: #36465c; font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #cfdbe8; border-radius: 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17,110,210,.11); }
textarea { resize: vertical; }
.login-help { margin: 24px 0 0; color: var(--muted); text-align: center; }
.login-help a { color: var(--blue); font-weight: 700; }
.language-switch { display: inline-flex; padding: 3px; background: #edf3fa; border-radius: 9px; }
.language-switch button { min-width: 35px; height: 30px; padding: 0 8px; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 11px; font-weight: 850; }
.language-switch button.active { color: var(--navy); background: white; box-shadow: 0 2px 8px rgba(20,45,80,.11); }

/* Recruiter shell */
.crm-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; z-index: 20; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; color: #d8e8ff; background: linear-gradient(180deg, #06265f, #041b46); }
.brand { display: block; padding: 0 12px 23px; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand .logo { width: 165px; padding: 7px; background: white; border-radius: 10px; }
.brand small { display: block; margin-top: 9px; color: #8fb5e9; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 3px; margin-top: 20px; overflow: auto; }
.sidebar nav a { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; min-height: 42px; padding: 0 10px; border-radius: 9px; color: #b9cee9; font-size: 13px; font-weight: 650; }
.sidebar nav a i { font-style: normal; font-size: 17px; text-align: center; }
.sidebar nav a b { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; background: rgba(255,255,255,.1); border-radius: 7px; font-size: 10px; }
.sidebar nav a:hover, .sidebar nav a.active { color: white; background: linear-gradient(90deg, rgba(30,125,232,.95), rgba(32,111,205,.7)); }
.sidebar-foot { display: grid; gap: 9px; margin-top: auto; padding: 18px 10px 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 11px; }
.sidebar-foot span { color: #7bd29a; font-weight: 750; }
.sidebar-foot a { color: #91acd0; }
.workspace { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 15; min-height: 92px; display: flex; align-items: center; gap: 22px; padding: 17px clamp(20px, 3vw, 40px); background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.topbar > div:first-of-type { min-width: 0; }
.topbar h1 { margin-bottom: 0; font-size: 25px; }
.topbar > div > p:last-child { margin: 3px 0 0; color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.user-pill { display: grid; grid-template-columns: 38px auto; grid-template-rows: auto auto; align-items: center; column-gap: 9px; min-width: 170px; padding: 7px 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.user-pill > span { grid-row: 1 / 3; display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--navy-2); border-radius: 10px; font-weight: 850; }
.user-pill b { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-pill small { font-size: 10px; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }
.content { padding: 28px clamp(18px, 3vw, 40px) 60px; }
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.page-actions p { margin: 0; color: var(--muted); }

/* Dashboard and tables */
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; margin-bottom: 18px; }
.stat-card { position: relative; overflow: hidden; min-height: 126px; display: flex; flex-direction: column; padding: 20px; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat-card::after { content: ""; position: absolute; right: -16px; bottom: -22px; width: 70px; height: 70px; background: var(--blue-soft); border-radius: 50%; }
.stat-card.green::after { background: var(--green-soft); }
.stat-card.violet::after { background: #f0ecff; }
.stat-card.orange::after { background: #fff0df; }
.stat-card > span { color: var(--muted); font-weight: 700; }
.stat-card strong { margin-top: 8px; color: var(--navy); font-size: 30px; line-height: 1; }
.stat-card small { margin-top: auto; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, .8fr); gap: 18px; }
.notification-box { padding: 24px; }
.notification-box b { display: block; color: var(--orange); font-size: 40px; }
.notification-box > span { color: var(--muted); font-weight: 700; }
.notification-box p { margin: 24px 0; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 16px; color: var(--muted); background: #f8fafc; border-bottom: 1px solid var(--line); font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 13px 16px; border-bottom: 1px solid #eaf0f6; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td b, td small { display: block; }
td .button { min-height: 34px; margin: 2px; padding: 0 10px; font-size: 11px; }
.link-button { padding: 0; color: var(--navy-2); background: transparent; border: 0; font-weight: 800; }
.avatar { display: inline-grid; place-items: center; flex: 0 0 auto; width: 46px; height: 46px; color: white; background: linear-gradient(135deg, var(--navy-2), var(--blue)); border-radius: 13px; font-weight: 850; }
.avatar.small { float: left; width: 34px; height: 34px; margin-right: 10px; border-radius: 10px; font-size: 11px; }
.progress-mini { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.progress-mini > span { overflow: hidden; flex: 1; height: 6px; background: #e4ebf3; border-radius: 999px; }
.progress-mini i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), #5a9ce8); border-radius: inherit; }
.progress-mini b { min-width: 32px; color: var(--navy); font-size: 10px; }

/* Pipeline */
.pipeline-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.4fr) auto; align-items: end; gap: 20px; margin-bottom: 18px; padding: 18px; }
.candidate-picker { display: grid; grid-template-columns: 1fr; gap: 7px; }
.candidate-picker label { grid-template-columns: 1fr; }
.candidate-picker input { padding: 8px 10px; }
.candidate-picker select { font-weight: 700; }
.candidate-summary { display: flex; align-items: center; gap: 12px; }
.candidate-summary h2, .candidate-summary p { margin-bottom: 2px; }
.candidate-summary > .progress-mini { margin-left: auto; }
.share-summary { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.share-summary b { color: var(--green); font-size: 12px; }
.pipeline-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; align-items: start; gap: 18px; }
.process-map { display: grid; gap: 14px; }
.phase { overflow: hidden; background: white; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.phase > header { display: flex; align-items: center; gap: 14px; padding: 15px 18px; color: var(--navy); background: #f5f9ff; border-bottom: 1px solid #d8e8fa; }
.phase > header > span { display: grid; place-items: center; min-width: 48px; height: 34px; color: white; background: var(--navy-2); border-radius: 10px; font-size: 12px; font-weight: 850; }
.phase > header p, .phase > header h2 { margin: 0; }
.phase-client > header { color: var(--green); background: #f4fbf6; border-bottom-color: #d7eddd; }
.phase-client > header > span { background: var(--green); }
.phase-arrival > header { color: var(--violet); background: #f7f5fd; border-bottom-color: #e5def7; }
.phase-arrival > header > span { background: var(--violet); }
.phase-stages { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1px; background: var(--line); }
.stage-card { min-height: 78px; display: flex; align-items: center; gap: 13px; padding: 12px 14px; color: var(--ink); background: white; border: 0; text-align: left; }
.stage-card:hover { position: relative; z-index: 1; background: #f9fbfe; box-shadow: inset 0 0 0 2px rgba(17,110,210,.2); }
.stage-number { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; color: var(--muted); background: #edf1f5; border-radius: 50%; font-size: 12px; font-weight: 850; }
.stage-copy { min-width: 0; display: grid; gap: 3px; }
.stage-copy b { font-size: 12px; line-height: 1.3; }
.stage-copy small { font-size: 10px; }
.stage-arrow { margin-left: auto; color: #a4b0bf; font-size: 22px; }
.stage-card.completed .stage-number { color: white; background: var(--green); }
.stage-card.completed .stage-copy b { color: #43624c; }
.stage-card.current { background: linear-gradient(90deg, #edf5ff, white); box-shadow: inset 4px 0 0 var(--blue); }
.stage-card.current .stage-number { color: white; background: var(--blue); box-shadow: 0 0 0 5px rgba(17,110,210,.1); }
.stage-card.current .stage-copy b { color: var(--navy); }
.sticky { position: sticky; top: 112px; padding: 22px; }
.big-stage { display: block; color: var(--blue); font-size: 52px; font-weight: 850; line-height: 1; }
.big-stage small { margin-left: 4px; font-size: 16px; }
.sticky > p:not(.eyebrow) { color: var(--muted); }
.mini-history { display: grid; gap: 13px; margin: 14px 0 0; padding: 0; list-style: none; }
.mini-history li { display: flex; gap: 10px; }
.mini-history li > span { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; color: white; background: var(--navy-2); border-radius: 8px; font-size: 10px; font-weight: 850; }
.mini-history li b, .mini-history li small { display: block; font-size: 11px; }

/* Clients */
.clients-layout { display: grid; grid-template-columns: 350px minmax(0, 1fr); gap: 18px; }
.client-list, .client-management { display: grid; align-content: start; gap: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; padding: 4px 3px; }
.section-heading h2 { margin: 0; }
.section-heading span { display: grid; place-items: center; min-width: 28px; height: 26px; color: var(--navy-2); background: var(--blue-soft); border-radius: 8px; font-weight: 800; }
.client-card { display: grid; grid-template-columns: 45px 1fr auto; align-items: center; gap: 12px; padding: 15px; background: white; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 5px 18px rgba(20,40,70,.05); cursor: pointer; }
.client-card:hover, .client-card.selected { border-color: #9fc4ed; box-shadow: 0 8px 28px rgba(17,110,210,.1); }
.company-mark, .client-company > span { display: grid; place-items: center; width: 44px; height: 44px; color: white; background: linear-gradient(135deg, var(--navy), var(--blue)); border-radius: 12px; font-weight: 850; }
.client-card h3, .client-card p { margin: 0; }
.client-card p { color: var(--muted); font-size: 11px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; color: var(--orange); background: #fff2df; border-radius: 8px; font-size: 9px; font-style: normal; font-weight: 850; text-transform: uppercase; }
.status.active { color: var(--green); background: var(--green-soft); }
.client-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px; }
.client-head p { margin-bottom: 0; color: var(--muted); }
.client-head > div:last-child { display: flex; align-items: center; gap: 10px; }
.document-share-list { padding: 10px 20px 20px; }
.document-share-row { grid-template-columns: 20px 1fr auto; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf1f5; }
.document-share-row input, .client-share-toggle { width: 17px; height: 17px; accent-color: var(--blue); }
.document-share-row b, .document-share-row small { display: block; }
.document-share-row em { color: var(--muted); font-size: 10px; }

/* Integrations */
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.integration-card { position: relative; padding: 26px; }
.integration-card > .status { position: absolute; top: 24px; right: 24px; }
.integration-card > p:not(.eyebrow) { margin: 24px 0 3px; color: var(--navy); font-size: 28px; font-weight: 800; }
.integration-icon { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 25px; color: var(--blue); background: var(--blue-soft); border-radius: 14px; font-size: 25px; }

/* Calendar */
.calendar-actions { align-items: center; }
.calendar-nav { display: flex; align-items: center; gap: 8px; }
.calendar-nav h2 { margin: 0 0 0 10px; color: var(--navy); text-transform: capitalize; }
.calendar-layout { display: grid; grid-template-columns: minmax(0,1fr) 360px; align-items: start; gap: 18px; }
.calendar-panel { overflow: hidden; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); background: #f7f9fc; border-bottom: 1px solid var(--line); }
.calendar-weekdays b { padding: 11px 8px; color: var(--muted); font-size: 10px; text-align: center; text-transform: uppercase; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-day { min-width: 0; min-height: 118px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: white; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day > span { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 5px; color: var(--muted); border-radius: 8px; font-size: 11px; font-weight: 800; }
.calendar-day.outside { background: #f9fbfd; opacity: .5; }
.calendar-day.today > span { color: white; background: var(--blue); }
.calendar-day > div { display: grid; gap: 4px; }
.calendar-event { overflow: hidden; display: block; width: 100%; padding: 5px 6px; color: var(--navy-2); background: var(--blue-soft); border: 0; border-left: 3px solid var(--blue); border-radius: 5px; font-size: 9px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event b { margin-right: 4px; }
.calendar-agenda { overflow: hidden; }
.agenda-item { display: grid; grid-template-columns: 86px 1fr auto auto; align-items: center; gap: 9px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.agenda-item > span { color: var(--blue); font-size: 10px; font-weight: 800; }
.agenda-item b, .agenda-item small { display: block; }
.agenda-item .button { min-height: 32px; padding: 0 8px; font-size: 9px; }

/* Backups */
.backup-grid { display: grid; grid-template-columns: minmax(0,1fr) 320px; align-items: start; gap: 18px; margin-bottom: 18px; }
.backup-settings > header { align-items: flex-start; }
.backup-settings > header p:last-child { margin-top: 5px; color: var(--muted); }
.backup-settings > .form-grid, .backup-settings > label, .backup-settings > .modal-note { margin: 20px 22px 0; }
.backup-settings > label { margin-top: 15px; }
.toggle { grid-template-columns: auto 34px auto; align-items: center; gap: 8px; white-space: nowrap; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { position: relative; width: 34px; height: 20px; background: #cbd5e1; border-radius: 999px; transition: .2s; }
.toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: white; border-radius: 50%; transition: .2s; }
.toggle input:checked + span { background: var(--green); }
.toggle input:checked + span::after { transform: translateX(14px); }
.backup-form-actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 20px 22px 24px; }
.backup-status-card { display: grid; justify-items: center; padding: 24px; text-align: center; }
.backup-status-card .eyebrow { justify-self: start; }
.backup-status-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 18px 0 12px; color: var(--muted); background: #eef2f6; border-radius: 22px; font-size: 30px; }
.backup-status-icon.success { color: var(--green); background: var(--green-soft); }
.backup-status-icon.failed { color: var(--danger); background: #fff0f2; }
.backup-status-icon.queued, .backup-status-icon.running { color: var(--orange); background: #fff3e5; }
.backup-status-card b { overflow-wrap: anywhere; color: var(--navy); font-size: 11px; }
.backup-status-card > small { margin: 6px 0 18px; }
.backup-error { margin: 8px 0 15px; padding: 9px; color: var(--danger); background: #fff0f2; border-radius: 8px; font-size: 10px; }
.backup-history { overflow: hidden; }

/* Portals */
.portal-shell { min-height: 100vh; background: var(--background); }
.portal-header { position: sticky; top: 0; z-index: 20; min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px clamp(20px, 5vw, 72px); background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.portal-header nav { display: flex; align-items: center; gap: 14px; }
.portal-header nav > span { color: var(--green); font-size: 10px; font-weight: 750; }
.user-pill.compact { min-width: 160px; }
.portal-main { width: min(1420px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 70px; }
.portal-hero { overflow: hidden; position: relative; display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 22px; padding: 28px 32px; color: white; background: linear-gradient(120deg, #092e6e, #145fc0); border-radius: 20px; box-shadow: 0 20px 50px rgba(9,46,110,.18); }
.portal-hero::after { content: ""; position: absolute; right: -70px; bottom: -130px; width: 340px; height: 340px; border: 60px solid rgba(255,255,255,.06); border-radius: 50%; }
.portal-hero .eyebrow { color: #9fd0ff; }
.portal-hero p { margin-bottom: 0; color: #cfe2fb; }
.progress-ring { position: relative; z-index: 1; flex: 0 0 auto; display: grid; place-items: center; width: 108px; height: 108px; background: conic-gradient(#79c2ff var(--progress), rgba(255,255,255,.16) 0); border-radius: 50%; }
.progress-ring::after { content: ""; position: absolute; inset: 9px; background: #124d9b; border-radius: 50%; }
.progress-ring span { position: relative; z-index: 1; display: grid; text-align: center; }
.progress-ring b { font-size: 23px; }
.progress-ring small { color: #d8eaff; font-size: 9px; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 2fr) 300px; align-items: start; gap: 18px; }
.portal-grid > aside { display: grid; gap: 18px; }
.portal-progress { padding-bottom: 20px; }
.stage-pill { padding: 7px 10px; color: var(--blue); background: var(--blue-soft); border-radius: 9px; font-size: 11px; font-weight: 800; }
.portal-timeline { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 20px; padding: 20px 24px 0; }
.portal-step { position: relative; min-height: 68px; display: grid; grid-template-columns: 34px 1fr; gap: 11px; }
.portal-step::after { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: #e1e8f0; }
.portal-step:nth-last-child(-n+2)::after { display: none; }
.portal-step > span { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); background: #edf1f5; border-radius: 50%; font-size: 11px; font-weight: 850; }
.portal-step b, .portal-step small { display: block; }
.portal-step b { font-size: 12px; }
.portal-step small { font-size: 10px; }
.portal-step p { margin: 5px 0; color: var(--muted); font-size: 11px; }
.portal-step a { color: var(--blue); font-size: 11px; font-weight: 750; }
.portal-step.completed > span { color: white; background: var(--green); }
.portal-step.current > span { color: white; background: var(--blue); box-shadow: 0 0 0 5px var(--blue-soft); }
.portal-step.current b { color: var(--blue); }
.profile-card { display: grid; justify-items: center; padding: 22px; text-align: center; }
.profile-card h3 { margin: 12px 0 2px; }
.profile-card p { margin-bottom: 3px; color: var(--muted); }
.portal-doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; margin-top: 18px; }
.request-card { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.request-card:last-child { border-bottom: 0; }
.request-card p { margin: 2px 0; color: var(--muted); font-size: 11px; }
.request-icon { display: grid; place-items: center; width: 40px; height: 40px; color: var(--orange); background: #fff3e5; border-radius: 11px; }
.request-icon.approved { color: var(--green); background: var(--green-soft); }
.doc-row { display: grid; grid-template-columns: 38px 1fr 30px; align-items: center; gap: 11px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
.doc-row > span { display: grid; place-items: center; width: 36px; height: 36px; color: var(--blue); background: var(--blue-soft); border-radius: 10px; }
.doc-row b, .doc-row small { display: block; }
.doc-row a { color: var(--blue); font-size: 20px; }
.portal-doc-grid .wide { width: calc(100% - 40px); margin: 18px 20px; }
.file-field { min-height: 130px; place-items: center; align-content: center; color: var(--blue); background: var(--blue-soft); border: 1px dashed #92bce9; border-radius: 12px; text-align: center; }
.file-field input { max-width: 280px; background: transparent; border: 0; }

/* Client portal */
.portal-hero.client { background: linear-gradient(120deg, #0b376f, #17664a); }
.client-company { position: relative; z-index: 1; display: grid; grid-template-columns: 52px auto auto; grid-template-rows: auto auto; align-items: center; gap: 0 12px; min-width: 360px; padding: 13px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.15); border-radius: 15px; }
.client-company > span { grid-row: 1 / 3; background: white; color: var(--navy); }
.client-company small { color: #d6f1e4; }
.client-company .button.light { grid-column: 3; grid-row: 1 / 3; min-height: 34px; color: white; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); font-size: 10px; }
.client-portal-grid { display: grid; grid-template-columns: 330px minmax(0,1fr); align-items: start; gap: 18px; }
.portal-candidate-list { display: grid; gap: 9px; }
.portal-candidate-card { width: 100%; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 12px; text-align: left; }
.portal-candidate-card:hover, .portal-candidate-card.selected { border-color: #8bb7e6; box-shadow: 0 7px 20px rgba(17,110,210,.1); }
.portal-candidate-card .avatar { width: 42px; height: 42px; font-size: 11px; }
.portal-candidate-card b, .portal-candidate-card small { display: block; }
.portal-candidate-card i { color: var(--blue); font-size: 20px; font-style: normal; }
.portal-candidate-card .progress-mini { margin-top: 6px; }
.client-portal-grid > div { display: grid; gap: 18px; }
.client-candidate-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; }
.client-candidate-head > div { display: flex; align-items: center; gap: 12px; }
.client-candidate-head h2, .client-candidate-head p { margin-bottom: 1px; }

/* Modal and toast */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(7,25,55,.62); backdrop-filter: blur(4px); }
.modal { width: min(660px,100%); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 18px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.modal > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: white; border-bottom: 1px solid var(--line); }
.modal > header h2 { margin-bottom: 0; }
.modal > header button { width: 34px; height: 34px; color: var(--muted); background: #eef2f6; border: 0; border-radius: 9px; font-size: 22px; }
.modal-body { display: grid; gap: 17px; padding: 24px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; background: #f8fafc; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.modal-note { padding: 12px 14px; color: var(--navy-2); background: var(--blue-soft); border-radius: 10px; font-size: 12px; }
.toast-root { position: fixed; z-index: 200; right: 24px; bottom: 24px; display: grid; gap: 8px; }
.toast { width: min(380px,calc(100vw - 40px)); padding: 13px 15px; color: #145a2c; background: #e7f7ec; border: 1px solid #bce6c8; border-radius: 11px; box-shadow: var(--shadow); font-weight: 650; }
.toast.error { color: #8e2330; background: #fff0f2; border-color: #f0c3c9; }
.row-completed { opacity: .58; }
.row-completed td:first-child { text-decoration: line-through; }

/* Processing reports */
.report-controls { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 18px 20px; }
.report-filters { flex: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.report-sheet { padding: 30px; color: #14243a; }
.report-header { display: flex; align-items: center; justify-content: flex-start; gap: 26px; padding-bottom: 20px; border-bottom: 2px solid var(--navy); }
.report-header .logo { width: 160px; }
.report-header h2 { margin: 2px 0 3px; color: var(--navy); font-size: 24px; }
.report-header small { color: var(--muted); }
.report-parties { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 22px 0; }
.report-parties > div { display: grid; gap: 3px; padding: 15px; background: #f5f8fc; border: 1px solid var(--line); border-radius: 11px; }
.report-parties small { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.report-parties b { color: var(--navy); font-size: 15px; }
.report-parties span { color: var(--muted); font-size: 11px; }
.report-progress { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 22px; margin-bottom: 20px; padding: 15px 18px; color: white; background: linear-gradient(120deg,var(--navy),#145fc0); border-radius: 12px; }
.report-progress > div:first-child { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; }
.report-progress small { color: #cfe2fb; font-size: 10px; }
.report-progress b { grid-row: 1 / 3; grid-column: 2; font-size: 25px; }
.report-progress span { color: white; font-size: 11px; font-weight: 700; }
.report-progress-bar { height: 10px; overflow: hidden; background: rgba(255,255,255,.18); border-radius: 999px; }
.report-progress-bar i { display: block; width: 0; height: 100%; background: #79c2ff; border-radius: inherit; transition: width .25s ease; }
.report-table table { table-layout: fixed; }
.report-table th:first-child { width: 64px; }
.report-table th:nth-child(3) { width: 145px; }
.report-table th:nth-child(4) { width: 165px; }
.report-table td { vertical-align: middle; }
.report-step-number { display: grid; place-items: center; width: 30px; height: 30px; color: var(--muted); background: #edf1f5; border-radius: 50%; font-size: 10px; font-weight: 850; }
.report-step-number.current { color: white; background: var(--blue); }
.report-step-number.completed { color: white; background: var(--green); }
.report-sheet > footer { display: flex; justify-content: space-between; gap: 20px; margin-top: 24px; padding-top: 14px; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .pipeline-toolbar { grid-template-columns: 1fr 1fr; }
  .share-summary { grid-column: 1 / -1; flex-direction: row; align-items: center; }
  .pipeline-layout { grid-template-columns: 1fr; }
  .pipeline-layout aside .sticky { position: static; }
  .clients-layout { grid-template-columns: 300px minmax(0,1fr); }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-agenda { order: -1; }
  .portal-timeline { grid-template-columns: 1fr; }
  .portal-step:nth-last-child(-n+2)::after { display: block; }
  .portal-step:last-child::after { display: none; }
}
@media (max-width: 900px) {
  .login-page { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100vh; }
  .crm-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -250px; width: 232px; transition: left .2s ease; }
  .sidebar.open { left: 0; box-shadow: 20px 0 50px rgba(0,0,0,.3); }
  .mobile-menu { display: block; }
  .topbar { min-height: 78px; }
  .topbar .language-switch { display: none; }
  .user-pill { min-width: 54px; grid-template-columns: 36px; }
  .user-pill b, .user-pill small { display: none; }
  .dashboard-grid, .clients-layout, .portal-grid, .client-portal-grid, .backup-grid { grid-template-columns: 1fr; }
  .report-controls { align-items: stretch; flex-direction: column; }
  .report-filters, .report-parties { grid-template-columns: 1fr; }
  .client-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .portal-doc-grid { grid-template-columns: 1fr; }
  .portal-header nav > span { display: none; }
}

.training-banner { display: flex; align-items: flex-start; gap: 18px; margin: 0 0 18px; padding: 22px 26px; color: #0b315f; background: linear-gradient(120deg,#fff7d9,#eaf3ff); border: 1px solid #f0d994; border-radius: 16px; box-shadow: var(--shadow); }
.training-banner > span { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; color: #ffd21f; background: #171717; border-radius: 13px; font-weight: 900; }
.training-banner h2 { margin-bottom: 5px; color: var(--navy); }
.training-banner p { margin: 0; color: #50627a; }
.candidate-contract { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 18px; margin-bottom: 18px; padding: 22px; }
.contract-icon { display: grid; place-items: center; width: 54px; height: 54px; color: var(--blue); background: var(--blue-soft); border-radius: 15px; font-size: 24px; }
.candidate-contract p { margin-bottom: 10px; color: var(--muted); }
.client-full-timeline { grid-template-columns: 1fr; gap: 0; padding-bottom: 8px; }
.client-full-timeline .portal-step:nth-last-child(-n+2)::after { display: block; }
.client-full-timeline .portal-step:last-child::after { display: none; }
.client-action-step { min-height: 82px; padding-bottom: 14px; }
.stage-action-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.stage-action-row:empty { display: none; }
.stage-action-row .button { min-height: 33px; padding: 0 11px; font-size: 10px; }
.meeting-join { display: inline-flex; margin-top: 5px; padding: 6px 9px; background: var(--green-soft); border-radius: 7px; }
.stage-comments { display: grid; gap: 6px; margin-top: 10px; }
.stage-comments > small, .stage-documents > small { color: var(--navy); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stage-comments blockquote { margin: 0; padding: 9px 11px; background: #f7f9fc; border-left: 3px solid var(--blue); border-radius: 7px; }
.stage-comments blockquote b { font-size: 10px; }
.stage-comments blockquote p { margin: 2px 0; }
.stage-comments time { color: var(--muted); font-size: 9px; }
.stage-documents { display: grid; gap: 6px; margin-top: 10px; }
.stage-documents > a { display: grid; grid-template-columns: 24px minmax(0,1fr) 20px; align-items: center; gap: 7px; padding: 8px 10px; color: var(--navy); background: var(--blue-soft); border-radius: 8px; }
.stage-documents > a b { font-size: 10px; }
.stage-documents > a em { color: var(--blue); font-size: 15px; font-style: normal; }
.modal-feature { display: grid; gap: 12px; margin-top: 16px; padding: 16px; background: linear-gradient(120deg,#eef6ff,#f7fbff); border: 1px solid #cfe1f7; border-radius: 12px; }
.modal-feature p, .modal-copy { margin: 4px 0 0; color: var(--muted); }
.modal-feature .button-row { margin-top: 0; }
.processed-dossier-feature { background: linear-gradient(135deg,#edf6ff,#f8fbff); border-color: #9fc7ef; }
.processed-dossier-file { min-height: 92px; margin: 2px 0; }
.processed-dossier-current { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 12px; background: #fff; border: 1px solid #cfe1f7; border-radius: 10px; }
.processed-dossier-current > div:first-child { display: grid; gap: 3px; min-width: 0; }
.processed-dossier-current small { color: var(--blue); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.processed-dossier-current b { overflow: hidden; color: var(--navy); text-overflow: ellipsis; white-space: nowrap; }
.processed-dossier-current time { color: var(--muted); font-size: 12px; }
.automatic-pdf-feature { grid-template-columns: minmax(0,1fr) auto; align-items: center; background: #f8fafc; border-color: var(--line); }
@media (max-width: 680px) {
  .processed-dossier-current, .automatic-pdf-feature { display: grid; grid-template-columns: 1fr; }
  .processed-dossier-current .button-row { justify-content: stretch; }
  .processed-dossier-current .button-row > * { width: 100%; }
}

@media print {
  @page { size: A4; margin: 11mm; }
  body { background: white; }
  body * { visibility: hidden !important; }
  #report-sheet, #report-sheet * { visibility: visible !important; }
  #report-sheet { position: absolute; inset: 0 auto auto 0; width: 100%; padding: 0; border: 0; box-shadow: none; }
  .report-header { padding-bottom: 12px; }
  .report-header .logo { width: 130px; }
  .report-header h2 { font-size: 19px; }
  .report-parties { margin: 12px 0; gap: 8px; }
  .report-parties > div { padding: 9px; }
  .report-progress { margin-bottom: 10px; padding: 10px 13px; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-table table { font-size: 9px; }
  .report-table th, .report-table td { padding: 7px 6px; }
  .report-step-number, .status { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .report-sheet > footer { margin-top: 12px; }
}
@media (max-width: 680px) {
  .content { padding: 18px 12px 45px; }
  .topbar { padding: 12px; }
  .topbar h1 { font-size: 20px; }
  .topbar .eyebrow, .topbar > div > p:last-child { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { min-height: 105px; padding: 14px; }
  .stat-card strong { font-size: 24px; }
  .pipeline-toolbar { grid-template-columns: 1fr; }
  .candidate-summary > .progress-mini { display: none; }
  .phase-stages { grid-template-columns: 1fr; }
  .stage-card { min-height: 68px; }
  .client-list { grid-template-columns: 1fr; }
  .client-head { align-items: flex-start; flex-direction: column; }
  .client-head > div:last-child { width: 100%; justify-content: space-between; }
  .integration-grid { grid-template-columns: 1fr; }
  .portal-header { padding: 10px 14px; }
  .portal-header .logo { width: 120px; }
  .portal-header .language-switch { display: none; }
  .portal-main { width: calc(100% - 20px); padding-top: 15px; }
  .portal-hero { align-items: flex-start; padding: 22px; }
  .progress-ring { width: 80px; height: 80px; }
  .progress-ring b { font-size: 18px; }
  .portal-progress > header { align-items: flex-start; flex-direction: column; }
  .portal-timeline { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .request-card { grid-template-columns: 38px 1fr; }
  .request-card button { grid-column: 2; }
  .client-company { display: none; }
  .training-banner { padding: 18px; }
  .training-banner > span { display: none; }
  .candidate-contract { grid-template-columns: 46px 1fr; padding: 18px; }
  .candidate-contract > div:last-child { grid-column: 1 / -1; }
  .candidate-contract .button, .candidate-contract .primary { width: 100%; }
  .page-actions { align-items: flex-start; flex-direction: column; }
  .calendar-nav { flex-wrap: wrap; }
  .calendar-nav h2 { width: 100%; margin: 6px 0 0; }
  .calendar-panel { overflow-x: auto; }
  .calendar-weekdays, .calendar-grid { min-width: 760px; }
}
