/* Workspace shell. Report typography stays in style.css. */
[hidden] { display: none !important; }
.signed-out .topbar, .signed-out .layout, .signed-out #syncBanner { display: none !important; }
#authScreen:empty { display: none; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: #f6f9fc; }
.login-intro { background: linear-gradient(145deg, #062d48, #087ca2); color: white; padding: 12vh 10%; display: flex; flex-direction: column; justify-content: center; }
.login-intro .eyebrow { color: #88d9ee; }
.login-intro h1 { font-size: clamp(2.4rem, 4vw, 4rem); line-height: 1.15; letter-spacing: -.035em; margin: 1.5rem 0; }
.login-intro p { color: #d6eaf1; max-width: 370px; }
.login-tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 2.5rem; }
.login-tags span { border: 1px solid #ffffff40; border-radius: 30px; padding: .4rem .8rem; font-size: .8rem; }
.login-panel { align-self: center; width: min(430px, 85%); margin: 3rem auto; }
.login-panel h2 { font-size: 1.9rem; color: #16354b; }
.login-panel form { margin: 2rem 0; }
.login-panel .fld { margin-bottom: 1.15rem; }
.login-panel input { padding: .8rem; }
.login-panel .btn-primary { width: 100%; justify-content: center; padding: .8rem; background: #087da3; }
.password-panel { margin-top: 10vh; }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .12em; color: #1984a6; }
.hub-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.8rem; }
.hub-heading h1 { color: #173c51; font-size: 1.9rem; letter-spacing: -.03em; margin: .3rem 0; }
.hub-heading p { font-size: .92rem; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .85rem; margin-bottom: 2rem; }
.service-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; gap: .65rem; padding: 1.1rem; background: white; border: 1px solid #dfe8ee; border-radius: 10px; font-family: inherit; color: #193a4e; cursor: pointer; min-height: 165px; transition: border-color .15s, box-shadow .15s; }
.service-card:hover, .service-card.selected { border-color: #0c94be; box-shadow: 0 3px 14px #0c94be15; }
.service-card.selected { background: #eefaff; }
.service-card strong { font-size: .95rem; line-height: 1.35; }
.service-icon { display: grid; place-items: center; width: 36px; height: 36px; background: #eaf6fb; border-radius: 9px; color: #1586ab; }
.service-icon svg { width: 21px; height: 21px; }
.service-count { position: absolute; right: 1rem; top: 1rem; background: #f2f6f8; border-radius: 20px; min-width: 25px; padding: .1rem .45rem; font-size: .78rem; }
.report-register h2 { font-size: 1.1rem; color: #173c51; }
.report-filters { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1fr; gap: .8rem; padding: .8rem 0; }
.report-filters .fld span, .hub-form .fld span { font-size: .8rem; color: #476173; }
.report-register table td { padding: .9rem .6rem; }
.hub-empty { padding: 3rem 1rem; text-align: center; color: #647c8d; }
.hub-empty p { margin: .5rem 0 1.2rem; }
.hub-form { max-width: 850px; padding: 1.6rem; }
.form-step { font-weight: 650; font-size: .95rem; margin: .5rem 0 .85rem; padding-bottom: .5rem; border-bottom: 1px solid #e7edf2; color: #1a7492; }
.hub-form .form-step:not(:first-child) { margin-top: 1.5rem; }
.hub-form > p { margin: 1rem 0; }
.form-error { color: #b42318; font-size: .9rem; margin-top: .8rem; }
.workflow-panel {
  border-left: 3px solid var(--sky); padding: 1.5rem 1.6rem;
}
.workflow-panel > .toolbar:first-child {
  margin-bottom: .6rem; padding-bottom: .6rem; border-bottom: 1.5px solid var(--border);
}
.workflow-panel > .toolbar:first-child strong {
  font-size: 1rem; color: var(--txt); letter-spacing: .01em;
}
.workflow-people {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem;
  margin: 1rem 0; padding: .85rem 1rem;
  background: var(--bg2); border-radius: var(--radius); border: 1px solid var(--border);
}
.workflow-people span { display: flex; flex-direction: column; gap: .2rem; }
.workflow-people small { display: block; color: var(--txt3); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.workflow-people strong { display: block; font-size: .9rem; color: var(--txt); }
.workflow-assignment { margin: 1rem 0; }
.workflow-assignment summary { font-size: .88rem; }
.workflow-assignment .grid2 { margin-top: .8rem; }
.workflow-panel .toolbar { margin-top: .8rem; gap: .5rem; }
.workflow-history {
  border-top: 1.5px solid var(--border); padding-top: .8rem; margin-top: .6rem;
}
.workflow-history p { overflow-wrap: anywhere; }
.launch-guide { padding: 1rem; border: 1px solid var(--border); border-radius: 8px; margin: 1.5rem 0; }
.launch-guide p { margin-bottom: .8rem; }
.launch-guide code { font-size: .85rem; }
.nav-context { padding: 1rem; margin: .7rem; border-radius: 7px; background: #edf7fc; font-size: .8rem; }
.nav-context strong, .nav-context span { display: block; overflow-wrap: anywhere; }
.nav-context span { color: #557083; margin-top: .3rem; }
.sync-banner { position: sticky; top: 60px; z-index: 20; margin: 0; }
.topbar #saveStatus { margin-left: auto; font-size: .72rem; }
.topbar #reportsHome { color: white; background: #ffffff18; }
#main { max-width: none; min-width: 0; }
.btn.primary { background: var(--sky-d); color: white; }
.btn.sm { padding: .25rem .65rem; font-size: .8rem; }
/* ---- Client grid (Reports landing) ---- */
.client-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.client-card { background: white; border: 1px solid #dfe8ee; border-radius: 10px; padding: 1.1rem 1.2rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.client-card:hover { border-color: #0c94be; box-shadow: 0 3px 14px #0c94be15; }
.client-card-head { margin-bottom: .4rem; }
.client-card-head strong { font-size: 1rem; color: #173c51; display: block; }
.client-card-head .small { display: block; }
.client-card-meta { display: flex; gap: .6rem; flex-wrap: wrap; font-size: .8rem; color: #647c8d; margin-bottom: .6rem; }
.client-card-stats { display: flex; gap: 1rem; align-items: center; font-size: .82rem; color: #476173; }
.client-card-stats strong { color: #173c51; }
.client-card-years { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.year-chip { background: #eaf6fb; color: #1586ab; font-size: .75rem; font-weight: 600; padding: .15rem .5rem; border-radius: 12px; }

/* ---- Client detail — FY cards ---- */
.fy-card { margin-bottom: .8rem; }
.fy-summary { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; cursor: pointer; user-select: none; }
.fy-summary strong { font-size: 1rem; }
.fy-report-list { padding: 0 1rem .5rem; }
.fy-report-item { display: flex; align-items: center; gap: .7rem; padding: .55rem 0; border-bottom: 1px solid #f0f3f6; }
.fy-report-item:last-child { border-bottom: none; }
.fy-report-icon { flex-shrink: 0; width: 28px; height: 28px; display: grid; place-items: center; background: #eaf6fb; border-radius: 6px; font-size: .85rem; }
.fy-report-icon svg { width: 18px; height: 18px; }
.fy-report-info { flex: 1; min-width: 0; }
.fy-report-info strong { font-size: .9rem; display: block; }

/* ---- Document cover page, TOC, body ---- */
.doc-print { font-family: var(--serif); color: var(--txt); }
.doc-cover { break-after: page; padding: 12vh 2rem 4rem; text-align: center; display: flex; flex-direction: column; align-items: center; min-height: 80vh; }
.doc-cover-firm { font-size: 1.6rem; font-weight: 700; color: #062d48; letter-spacing: -.02em; }
.doc-cover-ca { font-size: .95rem; font-weight: 400; color: #476173; margin-top: .2rem; letter-spacing: .04em; }
.doc-cover-divider { width: 60px; height: 3px; background: linear-gradient(90deg, #087ca2, #38bdf8); margin: 2.5rem 0; border-radius: 2px; }
.doc-cover-title { font-size: 1.7rem; font-weight: 700; color: #0a3e5a; line-height: 1.3; margin-bottom: 2.5rem; max-width: 500px; }
.doc-cover-meta { margin-top: auto; }
.doc-cover-client { font-size: .85rem; color: #647c8d; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.doc-cover-client-name { font-size: 1.4rem; font-weight: 600; color: #173c51; }
.doc-cover-addr { font-size: .9rem; color: #647c8d; margin-top: .25rem; }
.doc-cover-footer { display: flex; gap: 2rem; justify-content: center; margin-top: 3rem; font-size: .82rem; color: #647c8d; }
.doc-toc { break-after: page; padding: 3rem 2rem; max-width: 500px; margin: 0 auto; }
.doc-toc-title { font-size: 1.2rem; margin-bottom: 1.5rem; color: #0a3e5a; border-bottom: 2px solid #dfe8ee; padding-bottom: .5rem; }
.doc-toc-item { display: flex; gap: .6rem; padding: .45rem 0; border-bottom: 1px dotted #dfe8ee; font-size: .92rem; }
.doc-toc-num { color: #087ca2; font-weight: 600; min-width: 1.5rem; }
.doc-body { padding: 2rem; }
.doc-section { margin-bottom: 1.5rem; }
.doc-section h3 { font-size: 1rem; color: #0a3e5a; margin-bottom: .5rem; display: flex; gap: .4rem; }
.doc-sec-num { color: #087ca2; font-weight: 700; }
.doc-section p { margin-bottom: .4rem; line-height: 1.65; font-size: .9rem; text-align: justify; text-justify: inter-word; }

/* ---- Document editor toolbar ---- */
.doc-toolbar {
  position: sticky; top: 0; z-index: 15;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
  padding: .35rem .5rem; margin-bottom: .5rem;
  background: #f8fafc; border: 1px solid #dfe8ee; border-radius: 8px;
  box-shadow: 0 2px 8px #0001;
  opacity: .6; transition: opacity .2s;
}
.doc-toolbar:hover, .doc-toolbar-active { opacity: 1; }
.doc-tb {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; padding: 0 5px;
  border: 1px solid transparent; border-radius: 4px;
  background: none; color: #1e293b; font-size: .8rem; font-family: inherit;
  cursor: pointer; transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.doc-tb:hover { background: #e0f2fe; border-color: #bae6fd; }
.doc-tb:active { background: #bae6fd; }
.doc-tb b { font-weight: 800; }
.doc-tb i { font-style: italic; }
.doc-tb u { text-decoration: underline; }
.doc-tb s { text-decoration: line-through; }
.doc-tb-sep { width: 1px; height: 20px; background: #cbd5e1; margin: 0 3px; }
.doc-tb-danger { color: #dc2626; }
.doc-tb-danger:hover { background: #fee2e2; border-color: #fca5a5; }

/* Table context menu */
.doc-table-menu {
  position: absolute; z-index: 16;
  display: flex; gap: 2px; padding: .25rem .4rem;
  background: white; border: 1px solid #cbd5e1; border-radius: 6px;
  box-shadow: 0 4px 12px #0002;
}

/* Editable sections */
.doc-editable { min-height: 1.5em; outline: none; border-radius: 3px; transition: box-shadow .15s; padding: 2px 4px; margin: -2px -4px; }
.doc-editable:focus { box-shadow: 0 0 0 2px #bae6fd; background: #fafeff; }
.doc-editable:hover:not(:focus) { box-shadow: 0 0 0 1px #e2e8f0; }
.doc-cover-title[contenteditable] { outline: none; border-radius: 4px; padding: 4px 8px; margin: -4px -8px; }
.doc-cover-title[contenteditable]:focus { box-shadow: 0 0 0 2px #bae6fd; background: #fafeff; }
h3[contenteditable] { outline: none; border-radius: 3px; padding: 2px 4px; margin: -2px -4px; }
h3[contenteditable]:focus { box-shadow: 0 0 0 2px #bae6fd; background: #fafeff; }

/* In-document tables */
.doc-table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .88rem; }
.doc-table td, .doc-table th { border: 1px solid #cbd5e1; padding: .4rem .6rem; min-width: 60px; vertical-align: top; }
.doc-table th { background: #f1f5f9; font-weight: 600; text-align: left; }
.doc-table td:focus { outline: 2px solid #38bdf8; outline-offset: -2px; }

@media (max-width: 1100px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-filters { grid-template-columns: 1fr 1fr; } .client-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } }
@media (max-width: 650px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { padding: 2rem; }
  .login-intro h1 { font-size: 2.2rem; }
  .login-intro h1 br { display: none; }
  .login-tags { margin-top: 1rem; }
  .hub-heading { align-items: flex-start; flex-direction: column; }
  .service-card { padding: .8rem; min-height: 155px; }
  .report-filters { grid-template-columns: 1fr; }
  .topbar #saveStatus { margin-left: 0; }
  .client-grid { grid-template-columns: 1fr; }
  .doc-cover { padding: 6vh 1rem 2rem; }
  .doc-cover-title { font-size: 1.3rem; }
}
@media print {
  #authScreen, #syncBanner { display: none !important; }
  .doc-toolbar, .doc-table-menu { display: none !important; }
  .doc-editable, .doc-cover-title[contenteditable], h3[contenteditable] { box-shadow: none !important; background: transparent !important; padding: 0; margin: 0; }
  [contenteditable] { -webkit-user-modify: read-only !important; }
  .doc-cover { min-height: 100vh; justify-content: center; }
  .doc-cover-footer { position: absolute; bottom: 3rem; left: 0; right: 0; }
  .doc-toc { break-before: page; }
  .doc-section { break-inside: avoid; }
  .doc-table { break-inside: avoid; }
  .doc-table td, .doc-table th { border-color: #999; }
}
