:root {
  color-scheme: light;
  font: 15px/1.5 "Inter", system-ui, sans-serif;
  --ink: #14233a;
  --muted: #566680;
  --line: #dce4ed;
  --paper: #f4f7fb;
  --white: #fff;
  --navy: #111d30;
  --blue: #124fca;
  --sky: #62dde3;
  --radius: 14px;
}
*, *::before, *::after { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--paper); color: var(--ink) }
a { color: inherit; text-decoration: none }
button, input, select, textarea { font: inherit; color: inherit }
button, select { cursor: pointer }
:focus-visible { outline: 3px solid #3874e8; outline-offset: 3px }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(1.85rem, 3vw, 2.7rem); line-height: 1.11; letter-spacing: -.045em }
h2 { font-size: 1.2rem; letter-spacing: -.025em }
h3 { font-size: .94rem }
.muted { color: var(--muted) }
.eyebrow, .nav-label { font-size: .68rem; font-weight: 750; letter-spacing: .13em }
.eyebrow { color: #487192; margin-bottom: .55rem }
.primary, .button, .icon-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem .95rem; border-radius: 8px; border: 1px solid var(--line);
  background: var(--white); font-size: .88rem; font-weight: 700; white-space: nowrap;
}
.primary { background: var(--blue); color: white; border-color: var(--blue) }
.primary:hover { background: #0b3da4 }
.button:hover, .icon-button:hover { background: #edf3fd }
button:disabled { opacity: .55; cursor: wait }
.skip { position: fixed; top: -999px; left: -999px; z-index: 5; padding: .5rem .8rem; background: white; border-radius: 8px }
.skip:focus { top: 6px; left: 6px }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap }
.wordmark { display: flex; align-items: center; gap: 11px; color: white; font-size: 1.08rem; line-height: 1.15; font-weight: 780; letter-spacing: -.035em }
.wordmark small { display: block; font-size: .65rem; margin-top: 4px; letter-spacing: .075em; color: #c4d5df; font-weight: 650 }
.brand-symbol { display: block; width: 37px; height: 37px; padding: 6px; border-radius: 9px; background: #f5f8f4; flex: none }
.access { min-height: 100svh; display: grid; grid-template-columns: 1.08fr 1fr }
.access-brand {
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: clamp(32px, 7vh, 78px);
  position: relative; overflow: hidden; padding: clamp(26px, 5vw, 76px); min-height: 510px;
  background: radial-gradient(ellipse at 0 100%, #213f39, transparent 65%), var(--navy); color: white;
}
.access-brand::before {
  content: ""; position: absolute; pointer-events: none; width: 540px; aspect-ratio: 1; right: -230px; bottom: -255px;
  border-radius: 50%; background: repeating-radial-gradient(circle, #a9d8b324 0 1px, transparent 1px 28px);
  mask-image: radial-gradient(circle, #000 25%, transparent 71%);
}
.hero::before {
  content: ""; position: absolute; pointer-events: none; width: 520px; aspect-ratio: 1;
  right: -160px; top: -180px; rotate: -22deg;
  background: repeating-linear-gradient(90deg, transparent 0 28px, #70b9e329 28px 29px);
  mask-image: radial-gradient(ellipse, black, transparent 70%);
}
.access-logo { position: relative; width: 176px; padding: 14px 16px; border-radius: 14px; background: #f9fbf8 }
.access-logo img { display: block; width: 100%; height: auto }
.access-copy { position: relative; max-width: 500px }
.access-copy .eyebrow { color: #a9e5b1; text-transform: uppercase }
.access-copy h1 { font-size: clamp(2.55rem, 5.5vw, 5rem); line-height: 1.02; margin: .6rem 0 1rem }
.access-copy > p:last-child { color: #d0dde2; max-width: 31ch; font-size: 1.02rem }
.access-panel { display: grid; place-items: center; padding: 32px }
.access-panel form { width: min(100%, 390px); border: 1px solid var(--line); background: white; border-radius: 20px; padding: clamp(22px, 4vw, 40px); box-shadow: 0 16px 55px #1833530b }
.access-panel h2 { font-size: 1.75rem }
.access-panel .muted { margin: .25rem 0 1.5rem }
.access-panel label { margin-bottom: 13px }
.access-panel .primary { width: 100%; justify-content: space-between }
.workspace { min-height: 100vh; display: grid; grid-template-columns: 226px minmax(0,1fr) }
.rail { position: sticky; top: 0; height: 100svh; display: flex; flex-direction: column; padding: 26px 16px 16px; background: var(--navy); color: #ccd8ea; z-index: 2 }
.rail .wordmark { margin-left: 9px }
.rail nav { margin-top: 45px }
.nav-label { color: #9caec8; margin: 0 10px 11px }
.rail nav a { display: flex; align-items: center; min-height: 44px; padding: 7px 11px; border-radius: 8px; gap: 10px; font-weight: 600; font-size: .91rem }
.rail nav a:hover { background: #192b43 }
.rail nav a[aria-current] { color: #fff; background: #233b5a; box-shadow: inset 3px 0 var(--sky) }
.nav-icon { color: #9fbce5; width: 20px; font-size: 1.08rem; text-align: center }
.account { margin-top: auto; border-top: 1px solid #2c3c54; padding: 14px 0 0; display: flex; align-items: center; gap: 8px; min-width: 0 }
.avatar { width: 33px; height: 33px; display: grid; place-items: center; flex: none; color: #d1fdff; background: #2b4663; border-radius: 50%; font-size: .72rem; font-weight: 750 }
.account div:nth-child(2) { flex: 1; min-width: 0 }
.account strong, .account small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.account strong { color: white; font-size: .78rem }
.account small { font-size: .69rem }
.account .icon-button { min-height: 34px; min-width: 34px; padding: 0; border-color: #41536a; color: white; background: transparent }
.account .icon-button:hover { background: #233b5a }
.body { min-width: 0 }
.top { border-bottom: 1px solid var(--line); background: white; min-height: 63px; padding: 10px clamp(16px,3vw,40px); display: flex; align-items: center; justify-content: space-between; gap: 12px }
.crumb { display: flex; gap: .6rem; color: var(--muted); font-size: .85rem }
.crumb strong { color: var(--ink) }
#search { width: min(100%,260px); position: relative }
#search input { padding-right: 37px; background: #f6f8fc; min-height: 37px }
kbd { position: absolute; right: 8px; top: 7px; border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; color: var(--muted); pointer-events: none }
#main { max-width: 1510px; padding: clamp(18px,3vw,40px); margin: auto }
.titlebar, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem }
.titlebar { margin-bottom: 23px }
.titlebar .muted { margin-top: .55rem }
.hero { position: relative; overflow: hidden; background: #122842; color: white; border-radius: var(--radius); padding: 27px 29px; margin-bottom: 18px }
.hero > * { position: relative }
.hero .eyebrow { color: var(--sky) }
.hero h2 { font-size: clamp(1.5rem,3vw,2.3rem); line-height: 1.1 }
.hero p:last-child { color: #c1d2e7; margin-top: 9px }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border: 1px solid var(--line); background: white; border-radius: var(--radius); margin-bottom: 21px }
.metric { display: grid; gap: 5px; padding: 17px 19px; border-right: 1px solid var(--line); min-width: 0 }
.metric:last-child { border-right: 0 }
.metric:hover { background: #f3f7ff }
.metric span { color: var(--muted); font-weight: 650; font-size: .79rem }
.metric strong { font-size: 1.95rem; line-height: 1.17; letter-spacing: -.05em }
.metric small { color: var(--blue); font-weight: 650 }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(180px,1fr); gap: 17px; align-items: start }
.panel { background: white; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0 }
.section-head { padding: 16px 18px; border-bottom: 1px solid var(--line) }
.section-head a { color: var(--blue); font-size: .82rem; font-weight: 700 }
.section-head a:hover, .item-title:hover, .link:hover { text-decoration: underline }
.status-list { list-style: none; margin: 0; padding: 7px 17px 12px }
.status-list a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem; padding: 7px 1px }
.status-list strong { font-variant-numeric: tabular-nums }
.panel-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .6rem; padding: 12px 18px; border-bottom: 1px solid #edf1f6; align-items: center }
.panel-row:last-child { border-bottom: 0 }
.panel-row small { display: block; color: var(--muted) }
.item-title { font-weight: 730; overflow-wrap: anywhere }
.code { color: var(--muted); font: .75rem ui-monospace,monospace; white-space: nowrap }
.badge { display: inline-flex; align-items: center; gap: 6px; background: #ecf1f7; color: #425470; font-size: .73rem; line-height: 1.2; padding: 5px 8px; border-radius: 6px; font-weight: 700; white-space: nowrap }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor }
.badge.new, .badge.triage, .badge.planned, .badge.progress { color: #1d4ca7; background: #eaf1ff }
.badge.blocked, .badge.high { color: #945000; background: #fff2d9 }
.badge.urgent { color: #a12a40; background: #fce9ee }
.badge.validation, .badge.acceptance { color: #6745ad; background: #f2eafa }
.badge.resolved { color: #126449; background: #def5ec }
.filters { padding: 12px; display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 13px }
.filters label { flex: 1 0 125px; white-space: nowrap; min-width: 0 }
.filters label:first-child { flex-basis: 170px }
.field { margin-bottom: 13px }
label { display: grid; min-width: 0; gap: 4px; font-size: .83rem; font-weight: 690 }
input, select, textarea { width: 100%; min-width: 0; min-height: 41px; padding: .5rem .65rem; border: 1px solid #c7d3e2; border-radius: 8px; background: white; font-size: .9rem }
textarea { min-height: 82px; resize: vertical }
input[type=file] { padding: 8px }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px }
.segment { display: inline-flex; gap: 2px; background: #e8eff7; padding: 3px; border-radius: 9px }
.segment a { font-size: .83rem; padding: 5px 10px; border-radius: 6px; font-weight: 700 }
.segment a[aria-current] { background: white; box-shadow: 0 1px 3px #14233a1d; color: var(--blue) }
.table-wrap { overflow: auto }
table { border-collapse: collapse; width: 100%; text-align: left }
th { font-weight: 700; font-size: .72rem; color: var(--muted); background: #f7f9fc }
th, td { padding: 11px 13px; border-bottom: 1px solid #e9eef5 }
td { font-size: .84rem; vertical-align: top }
tr:last-child td { border-bottom: 0 }
tr:hover td { background: #fafcff }
td small { display: block; color: var(--muted) }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(225px, 1fr); gap: 12px; overflow: auto; padding: 2px 2px 15px; align-items: start }
.lane { background: #eaf0f7; border: 1px solid #dae4ef; border-radius: 12px; min-height: 180px; padding: 9px }
.lane h3 { display: flex; align-items: center; justify-content: space-between; padding: 2px 0 9px }
.card { display: grid; gap: 6px; background: white; border: 1px solid var(--line); padding: 12px; border-radius: 9px; margin-bottom: 8px; box-shadow: 0 2px 4px #1833530b }
.card:hover { border-color: #8baee4 }
.card .badge { justify-self: start }
.empty { padding: 17px; color: var(--muted) }
.lane .empty { padding: 6px 3px; font-size: .81rem }
.pagination { display: flex; gap: .6rem; margin-top: 13px }
dialog { width: min(690px,calc(100% - 24px)); max-height: 92svh; padding: 0; border-radius: 17px; border: 1px solid var(--line); color: var(--ink); box-shadow: 0 19px 90px #09193152 }
dialog::backdrop { background: #121e35a6 }
.modal-head { position: sticky; top: 0; background: white; z-index: 1; display: flex; justify-content: space-between; align-items: start; gap: 1rem; padding: 18px 22px; border-bottom: 1px solid var(--line) }
.modal-body { padding: 18px 22px }
.modal-head .icon-button { padding: 0; min-width: 39px; min-height: 39px; font-size: 1.3rem }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.form-grid .field { margin-bottom: 11px }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 15px }
.error { color: #a12a40; margin: 9px 0; font-size: .86rem }
.error:empty { display: none }
.hint, .detail-meta { color: var(--muted); font-size: .83rem }
.detail-meta { margin: 8px 0 14px }
.detail-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; margin: 5px 0 13px }
.detail-section { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 13px }
.detail-section h3 { margin-bottom: 8px }
.history { list-style: none; padding: 0; margin: 0 }
.history li { padding: 8px 12px; border-left: 2px solid #c4d6f1; margin: 5px 0; overflow-wrap: anywhere }
.history p { margin: 3px 0 }
.preview { display: block; max-width: 100%; max-height: 280px; object-fit: contain; margin: 7px 0; border: 1px solid var(--line); border-radius: 8px }
.link { color: var(--blue); font-weight: 650 }
#toast { position: fixed; z-index: 5; bottom: 15px; right: 15px; padding: 12px 17px; color: white; background: var(--navy); border-radius: 9px; max-width: calc(100vw - 30px) }
#toast:empty { display: none }
#startup { padding: 30px }
@media (max-width: 1040px) { .dashboard-grid { grid-template-columns: 1fr } }
@media (max-width: 760px) {
  .workspace { display: block }
  .rail { height: auto; padding: 10px 12px 4px; position: relative }
  .rail .wordmark { margin: 0; max-width: 60% }
  .rail nav { display: flex; gap: 3px; margin-top: 10px; overflow: auto }
  .nav-label, .nav-icon { display: none }
  .rail nav a { white-space: nowrap; font-size: .78rem; min-height: 36px }
  .account { position: absolute; border: 0; padding: 0; top: 10px; right: 12px; max-width: 36% }
  .account .avatar { display: none }
  .top { min-height: 51px }
  .crumb span { display: none }
  .metrics { grid-template-columns: 1fr 1fr }
  .metric:nth-child(2) { border-right: 0 }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line) }
  .access { display: block }
  .access-brand { min-height: auto; padding: 25px; gap: 20px }
  .access-logo { width: 112px; padding: 8px 10px; border-radius: 9px }
  .access-copy h1 { font-size: clamp(1.8rem, 6vw, 2.5rem); margin: .35rem 0 .45rem }
  .access-copy > p:last-child { max-width: 40ch; font-size: .9rem }
}
@media (max-width: 480px) {
  .top #search { width: 165px }
  .titlebar { align-items: start; flex-direction: column }
  .form-grid { grid-template-columns: 1fr; gap: 0 }
  .modal-head, .modal-body { padding: 14px }
}
.crm-day { margin-bottom: 16px }
.text-button { border: 0; background: none; padding: 0; font-size: inherit; text-align: left }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px }
.check input { width: 18px; height: 18px; min-height: 18px; accent-color: var(--blue) }
.project-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 10px }
.project-stats > div { display: grid; gap: 3px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #f7faff }
.project-stats small { color: var(--muted) }
.phase { border: 1px solid var(--line); padding: 10px 12px; margin-top: 8px; border-radius: 8px }
.phase-head { display: flex; justify-content: space-between; gap: 8px }
.phase .panel-row { padding: 8px 0 }
.release-reference { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; padding: 12px; background: #f4f7fb; border-radius: 8px; font-size: .81rem }
.release-reference dt { color: var(--muted); font-weight: 700 }
.release-reference dd { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace,monospace }
.forecast-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(145px,1fr)); gap: 8px; padding: 12px 18px }
.forecast-grid > div { display: grid; gap: 3px }
.forecast-grid small { color: var(--muted); font-size: .75rem }
.forecast-grid strong { font-variant-numeric: tabular-nums; font-size: 1.1rem }
.forecast-note { padding: 0 18px 12px }
.compact { margin-bottom: 8px }
.context-fields { border: 1px solid var(--line); padding: 8px 11px; border-radius: 8px }
.context-fields summary { cursor: pointer; font-size: .84rem; font-weight: 700; color: var(--blue) }
.context-fields[open] summary { margin-bottom: 9px }
progress { width: 96px; max-width: 100%; height: 9px; accent-color: var(--blue) }

/* Commercial workspace */
:root { --ink:#15263b; --muted:#52647b; --line:#dce5ef; --paper:#f3f7fb; --blue:#1457c3 }
.top-actions { display:flex; align-items:center; gap:10px; justify-content:flex-end; width:min(100%,390px) }
.device-link { min-height:37px; font-size:.8rem }
.access-panel .trust-check { margin:3px 0 }
.access-panel #mfa-fields .hint { margin:0 0 12px }
.rail nav { overflow:auto; min-height:0 }
.crm-intro { display:flex; align-items:end; justify-content:space-between; gap:18px; padding:27px; margin-bottom:19px; border-radius:17px; background:#112e4d; color:#fff; box-shadow:0 8px 18px #17304f12 }
.crm-intro .eyebrow { color:#8be5ec }
.crm-intro > div > p:last-child { margin-top:8px; color:#c3d7ea }
.crm-intro .primary { border-color:#a4d5ff; background:#e5f3ff; color:#143a68 }
.crm-intro .primary:hover { background:#fff }
.daily-counts { display:flex; flex-wrap:wrap; padding:12px 18px; gap:8px 18px; color:var(--muted); border-bottom:1px solid var(--line) }
.daily-counts strong { margin-right:3px; color:var(--ink); font-variant-numeric:tabular-nums }
.form-title .link { display:inline-block; margin-bottom:7px; font-size:.84rem }
.workspace-form { display:flex; align-items:flex-start; gap:18px; margin-bottom:30px }
.workspace-form-fields { min-width:0; max-width:880px; flex:1 }
.workspace-form > aside { flex:0 0 195px; position:sticky; top:18px }
.form-index { padding:9px; display:grid; gap:2px }
.form-index button { border:0; border-radius:7px; background:transparent; color:var(--blue); text-align:left; padding:9px; font-weight:650 }
.form-index button:hover { background:#eaf2fc }
.form-section { margin:0 0 19px; padding:8px 21px 17px; min-width:0; scroll-margin-top:18px }
.form-section legend { font-weight:750; font-size:1.04rem; padding:0 7px }
.form-section > .hint { margin-bottom:13px }
.form-section .form-grid { margin:8px 0; align-items:start }
.form-section .form-grid > label { margin-bottom:8px }
.form-sticky { position:sticky; bottom:0; padding:10px 14px; border:1px solid var(--line); border-radius:11px; background:#fff; box-shadow:0 -8px 22px #18335313 }
.form-sticky .actions { margin-top:0 }
.repeat-row { padding:11px; margin:9px 0; border:1px solid var(--line); border-radius:10px; background:#f7faff }
.repeat-row [data-remove] { min-height:34px; padding:3px 8px }
.proposal-customer { margin:2px 0 6px }
.record-grid { display:grid; grid-template-columns:minmax(96px,auto) 1fr; gap:8px 13px; padding:4px 18px 17px }
.record-grid dt { color:var(--muted); font-weight:700; font-size:.83rem }
.record-grid dd { margin:0; overflow-wrap:anywhere }
.permission-grid { border:1px solid var(--line); border-radius:9px; display:grid; grid-template-columns:1fr 1fr; gap:5px; margin:13px 0; padding:10px }
.permission-grid legend { font-weight:700 }
.admin-section { margin-top:17px }
.go-live-note { margin:12px 0; padding:11px; border:1px solid #c8e2d5; border-radius:8px; background:#edf8f2 }
@media (max-width:850px) { .workspace-form > aside { flex-basis:150px } }
@media (max-width:690px) {
  .workspace-form { display:block }
  .workspace-form > aside { position:static; margin-bottom:16px }
  .form-index { display:flex; flex-wrap:wrap }
  .top-actions { width:auto }
  .top #search { width:min(155px,34vw) }
  .top .device-link { padding:4px 7px }
  .crm-intro { padding:19px; align-items:start; flex-wrap:wrap }
  .form-section { padding:5px 12px 12px }
}
@media (prefers-reduced-motion:no-preference) {
  button,a,input,select,textarea { transition:background-color 150ms,color 150ms,border-color 150ms,box-shadow 150ms }
  dialog[open] { animation:dialog-in 160ms ease-out both }
  #main > .crm-intro, #main > .form-title { animation:dialog-in 180ms ease-out both }
  @keyframes dialog-in { from { opacity:0; transform:translateY(5px) } to { opacity:1; transform:none } }
  html { scroll-behavior:smooth }
}
.stack-gap { margin-top: 14px }
.metrics.metrics-3 { grid-template-columns: repeat(3,minmax(0,1fr)) }
.actions.flush { margin: 0 }
