/* ATS Express Legalization System — interface styles
   Brand colours come from the ATS Express logo: red #ED3237, blue #00AFEF. */
:root {
  --ats-red: #ED3237;
  --ats-red-dark: #C9242A;
  --ats-red-soft: #FDECEC;
  --ats-blue: #00AFEF;
  --ats-blue-ink: #0679B0;          /* darker blue for readable text and links */
  --ats-blue-soft: #E5F6FD;
  --ats-navy: #0F1E33;
  --ats-navy-2: #172A45;
  --ats-ink: #1B2433;
  --ats-muted: #667085;
  --ats-line: #E4E8EE;
  --ats-bg: #F4F6F9;
  --sidebar-w: 248px;
  --sidebar-w-collapsed: 70px;
  --topbar-h: 60px;

  --bs-body-font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-color: var(--ats-ink);
  --bs-body-bg: var(--ats-bg);
  --bs-link-color: var(--ats-blue-ink);
  --bs-link-color-rgb: 6, 121, 176;
  --bs-link-hover-color: #045680;
  --bs-border-color: var(--ats-line);
  --bs-primary: var(--ats-red);
  --bs-primary-rgb: 237, 50, 55;
}

body { font-size: .9rem; background: var(--ats-bg); }
h1, .h1, h2, .h2, h3, .h3, h4, .h4 { font-weight: 650; letter-spacing: -.01em; color: var(--ats-ink); }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.text-muted { color: var(--ats-muted) !important; }
.fw-semibold { font-weight: 600 !important; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .85em; letter-spacing: .02em; }

/* ---------- Buttons ---------- */
.btn { font-weight: 550; border-radius: 7px; font-size: .875rem; }
.btn-sm { font-size: .8rem; border-radius: 6px; }
.btn-primary { --bs-btn-bg: var(--ats-red); --bs-btn-border-color: var(--ats-red); --bs-btn-hover-bg: var(--ats-red-dark);
  --bs-btn-hover-border-color: var(--ats-red-dark); --bs-btn-active-bg: #B01E24; --bs-btn-active-border-color: #B01E24;
  --bs-btn-disabled-bg: #f19a9c; --bs-btn-disabled-border-color: #f19a9c; --bs-btn-focus-shadow-rgb: 237,50,55; }
.btn-outline-primary { --bs-btn-color: var(--ats-red); --bs-btn-border-color: var(--ats-red); --bs-btn-hover-bg: var(--ats-red);
  --bs-btn-hover-border-color: var(--ats-red); --bs-btn-active-bg: var(--ats-red-dark); }
.btn-blue { --bs-btn-color: #fff; --bs-btn-bg: var(--ats-blue-ink); --bs-btn-border-color: var(--ats-blue-ink);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #045680; --bs-btn-hover-border-color: #045680; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--ats-line); --bs-btn-hover-bg: #F1F3F6; --bs-btn-hover-border-color: #D5DAE1; }
.btn-danger-outline { color: #B42318; border: 1px solid #F4C7C3; background: #fff; }
.btn-danger-outline:hover { background: #FEF3F2; color: #912018; border-color: #F0A9A3; }
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: #344054; margin-bottom: .3rem; }
.form-control, .form-select { font-size: .875rem; border-radius: 7px; border-color: #D0D5DD; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--ats-blue); box-shadow: 0 0 0 3px rgba(0,175,239,.18); }
.form-check-input:checked { background-color: var(--ats-red); border-color: var(--ats-red); }
.form-text { font-size: .76rem; }
.req::after { content: " *"; color: var(--ats-red); }
.form-section { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ats-muted);
  border-bottom: 1px solid var(--ats-line); padding-bottom: .4rem; margin: 1.25rem 0 .9rem; }
.form-section:first-child { margin-top: 0; }

/* ---------- App shell ---------- */
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w); background: var(--ats-navy); color: #C5CEDB;
  display: flex; flex-direction: column; z-index: 1040; transition: width .18s ease, transform .2s ease; }
.sidebar-brand { height: 76px; display: flex; align-items: center; gap: .6rem; padding: 0 1rem; border-bottom: 1px solid rgba(255,255,255,.06); }
.brand-tile { background: #fff; border-radius: 9px; padding: 5px 8px; display: flex; align-items: center; flex-shrink: 0; }
.brand-tile img { height: 36px; width: auto; display: block; }
.brand-text { line-height: 1.15; overflow: hidden; white-space: nowrap; }
.brand-text strong { color: #fff; font-size: .92rem; display: block; }
.brand-text span { font-size: .7rem; color: #8E9BB0; letter-spacing: .04em; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .6rem .6rem 1rem; scrollbar-width: thin; scrollbar-color: #2B3F5E transparent; }
.nav-group { font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #6E7F99; padding: .9rem .75rem .35rem; white-space: nowrap; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; margin: 1px 0; border-radius: 7px; color: #C5CEDB;
  font-weight: 500; white-space: nowrap; position: relative; text-decoration: none; }
.sidebar-nav a i { font-size: 1.05rem; width: 20px; text-align: center; flex-shrink: 0; color: #8E9BB0; }
.sidebar-nav a:hover { background: var(--ats-navy-2); color: #fff; }
.sidebar-nav a:hover i { color: #fff; }
.sidebar-nav a.active { background: rgba(237,50,55,.14); color: #fff; }
.sidebar-nav a.active i { color: var(--ats-red); }
.sidebar-nav a.active::before { content: ""; position: absolute; left: -.6rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ats-red); }
.sidebar-nav .nav-count { margin-left: auto; background: var(--ats-red); color: #fff; font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.sidebar-foot { padding: .75rem 1rem; border-top: 1px solid rgba(255,255,255,.06); font-size: .72rem; color: #6E7F99; white-space: nowrap; overflow: hidden; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left .18s ease; }
.topbar { height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--ats-line); display: flex; align-items: center; gap: .75rem;
  padding: 0 1.25rem; position: sticky; top: 0; z-index: 1030; }
.topbar .search { max-width: 460px; flex: 1; position: relative; }
.topbar .search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: #98A2B3; }
.topbar .search input { padding-left: 34px; background: #F6F7F9; border-color: transparent; }
.topbar .search input:focus { background: #fff; }
.icon-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 0;
  background: transparent; color: #475467; position: relative; font-size: 1.15rem; }
.icon-btn:hover { background: #F2F4F7; }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ats-red);
  color: #fff; font-size: .62rem; font-weight: 700; line-height: 16px; text-align: center; }
.user-chip { display: flex; align-items: center; gap: .55rem; padding: 4px 8px 4px 4px; border-radius: 9px; border: 0; background: transparent; }
.user-chip:hover { background: #F2F4F7; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ats-blue-soft); color: var(--ats-blue-ink); font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.user-chip .who { line-height: 1.1; text-align: left; }
.user-chip .who small { color: var(--ats-muted); font-size: .7rem; }
.content { padding: 1.4rem 1.5rem 2rem; flex: 1; }
.app-footer { padding: .9rem 1.5rem; font-size: .75rem; color: var(--ats-muted); border-top: 1px solid var(--ats-line); background: #fff; }

/* collapsed sidebar (desktop) */
body.sb-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sb-collapsed .main { margin-left: var(--sidebar-w-collapsed); }
body.sb-collapsed .brand-text, body.sb-collapsed .nav-group, body.sb-collapsed .sidebar-nav a span,
body.sb-collapsed .sidebar-nav .nav-count, body.sb-collapsed .sidebar-foot { display: none; }
body.sb-collapsed .sidebar-brand { justify-content: center; padding: 0; }
body.sb-collapsed .brand-tile img { height: 28px; }
body.sb-collapsed .sidebar-nav a { justify-content: center; padding: .6rem; }
body.sb-collapsed .sidebar-nav .nav-group + a { margin-top: .5rem; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; }
  body.sb-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.sb-open .sb-backdrop { display: block; }
  .main { margin-left: 0 !important; }
  .content { padding: 1rem; }
  body.sb-collapsed .brand-text, body.sb-collapsed .nav-group, body.sb-collapsed .sidebar-nav a span { display: initial; }
  .user-chip .who { display: none; }
}
.sb-backdrop { display: none; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background: rgba(15,30,51,.45); z-index: 1035; }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; }
.page-head h1 { font-size: 1.35rem; margin: 0; }
.page-head .sub { color: var(--ats-muted); font-size: .85rem; margin-top: .15rem; }
.crumbs { font-size: .76rem; color: var(--ats-muted); margin-bottom: .2rem; }
.crumbs a { color: var(--ats-muted); }
.crumbs i { font-size: .65rem; margin: 0 .25rem; }

/* ---------- Cards / panels ---------- */
.card { border: 1px solid var(--ats-line); border-radius: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card-header { background: #fff; border-bottom: 1px solid var(--ats-line); padding: .8rem 1rem; font-weight: 650; display: flex;
  align-items: center; justify-content: space-between; gap: .5rem; border-radius: 10px 10px 0 0 !important; }
.card-header .title { display: flex; align-items: center; gap: .5rem; }
.card-header .title i { color: var(--ats-muted); }
.card-body { padding: 1rem; }
.card-footer { background: #FAFBFC; border-top: 1px solid var(--ats-line); }

/* KPI tiles */
.kpi { background: #fff; border: 1px solid var(--ats-line); border-radius: 10px; padding: .85rem 1rem; height: 100%; display: block; color: inherit; }
a.kpi:hover { text-decoration: none; border-color: #CDD4DE; }
.kpi .k-label { font-size: .74rem; color: var(--ats-muted); font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.kpi .k-label i { font-size: .9rem; }
.kpi .k-value { font-size: 1.4rem; font-weight: 700; margin-top: .2rem; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-sub { font-size: .74rem; color: var(--ats-muted); }
.kpi.k-alert .k-value { color: #B42318; }
.kpi.k-good .k-value { color: #067647; }
.ic-red { color: var(--ats-red); } .ic-blue { color: var(--ats-blue-ink); } .ic-green { color: #079455; } .ic-amber { color: #DC6803; } .ic-slate { color: #475467; }

/* Definition lists on detail pages */
.dl-grid { display: grid; grid-template-columns: 150px 1fr; gap: .45rem .9rem; margin: 0; font-size: .86rem; }
.dl-grid dt { color: var(--ats-muted); font-weight: 500; }
.dl-grid dd { margin: 0; font-weight: 500; word-break: break-word; }
@media (max-width: 575.98px) { .dl-grid { grid-template-columns: 1fr; gap: .1rem; } .dl-grid dd { margin-bottom: .45rem; } }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .855rem; }
.table > thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ats-muted); font-weight: 700;
  background: #F9FAFB; border-bottom: 1px solid var(--ats-line); white-space: nowrap; padding: .6rem .75rem; }
.table > tbody td { padding: .62rem .75rem; vertical-align: middle; border-color: #EEF1F4; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #F8FAFC; }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: #F9FAFB; border-top: 1px solid var(--ats-line); }
.th-sort { color: inherit; } .th-sort:hover { color: var(--ats-ink); text-decoration: none; }
.table-card .table > :not(caption) > * > *:first-child { padding-left: 1rem; }
.table-card .table > :not(caption) > * > *:last-child { padding-right: 1rem; }
.row-link { font-weight: 600; color: var(--ats-ink); }
.row-link:hover { color: var(--ats-blue-ink); }
.cell-sub { font-size: .76rem; color: var(--ats-muted); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.filters .form-control, .filters .form-select { min-width: 150px; }
.filters .grow { flex: 1 1 220px; }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ats-muted); }
.empty i { font-size: 2rem; display: block; margin-bottom: .5rem; color: #B5BDC9; }
.empty .btn { margin-top: .75rem; }

/* ---------- Status badges ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 650; padding: .2rem .55rem;
  border-radius: 20px; white-space: nowrap; line-height: 1.35; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.sb-secondary { background: #F2F4F7; color: #475467; }
.sb-info { background: var(--ats-blue-soft); color: var(--ats-blue-ink); }
.sb-brand-blue { background: #EEF4FF; color: #3538CD; }
.sb-success { background: #ECFDF3; color: #067647; }
.sb-warning { background: #FFFAEB; color: #B54708; }
.sb-danger { background: #FEF3F2; color: #B42318; }
.sb-dark { background: #E9EBEF; color: #1B2433; }
.chip { display: inline-block; font-size: .7rem; font-weight: 600; padding: .12rem .45rem; border-radius: 5px; background: #F2F4F7; color: #475467; }
.chip-red { background: var(--ats-red-soft); color: #B42318; }
.chip-blue { background: var(--ats-blue-soft); color: var(--ats-blue-ink); }

/* ---------- Timeline (status history / custody) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: -6px; width: 2px; background: var(--ats-line); }
.timeline li:last-child::before { display: none; }
.timeline li .tl-dot { position: absolute; left: 0; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--ats-blue); }
.timeline li.tl-first .tl-dot { border-color: var(--ats-red); }
.timeline .tl-title { font-weight: 600; }
.timeline .tl-meta { font-size: .75rem; color: var(--ats-muted); }
.timeline .tl-note { font-size: .82rem; margin-top: .2rem; }
.timeline .tl-internal { font-size: .8rem; margin-top: .25rem; background: #FFFAEB; border: 1px solid #FEDF89; padding: .3rem .5rem; border-radius: 6px; }

/* Stage pipeline */
.pipeline { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.pipeline .step { font-size: .72rem; font-weight: 600; padding: .2rem .55rem; border-radius: 5px; background: #F2F4F7; color: #475467; }
.pipeline .step.done { background: #ECFDF3; color: #067647; }
.pipeline .step.active { background: var(--ats-blue-soft); color: var(--ats-blue-ink); }
.pipeline .arrow { color: #B5BDC9; font-size: .7rem; }

/* Money summary */
.money-box { display: grid; grid-template-columns: 1fr auto; gap: .35rem 1rem; font-size: .86rem; }
.money-box .lbl { color: var(--ats-muted); }
.money-box .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.money-box .total { border-top: 1px solid var(--ats-line); padding-top: .4rem; font-weight: 700; font-size: .95rem; }
.money-box .due { color: #B42318; }

/* ---------- Tabs ---------- */
.nav-tabs { border-bottom: 1px solid var(--ats-line); gap: .25rem; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ats-muted); font-weight: 600; padding: .6rem .9rem; font-size: .86rem; }
.nav-tabs .nav-link:hover { color: var(--ats-ink); border-bottom-color: #D0D5DD; }
.nav-tabs .nav-link.active { color: var(--ats-ink); border-bottom-color: var(--ats-red); background: transparent; }
.nav-tabs .nav-link .chip { margin-left: .3rem; }

/* ---------- Alerts / flashes ---------- */
.alert { border-radius: 8px; font-size: .86rem; border-width: 1px; }
.flash-stack .alert { display: flex; gap: .6rem; align-items: flex-start; }
.flash-stack .alert i { font-size: 1.05rem; line-height: 1.3; }

/* ---------- Modals ---------- */
.modal-content { border-radius: 12px; border: 0; }
.modal-header { border-bottom: 1px solid var(--ats-line); }
.modal-title { font-weight: 650; font-size: 1.05rem; }
.modal-footer { border-top: 1px solid var(--ats-line); }

/* ---------- Guest pages (login, setup) ---------- */
.guest-body { background: var(--ats-bg); min-height: 100vh; }
.guest-wrap { max-width: 420px; margin: 0 auto; padding: 48px 16px; }
.login-split { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-side { background: var(--ats-navy); color: #C5CEDB; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side h2 { color: #fff; font-size: 1.7rem; max-width: 420px; line-height: 1.25; }
.login-side .swoosh { position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 50px solid rgba(237,50,55,.12); }
.login-side .swoosh2 { position: absolute; right: 60px; bottom: 120px; width: 120px; height: 120px; border-radius: 50%; border: 18px solid rgba(0,175,239,.14); }
.login-side ul { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.login-side li { padding: .35rem 0; display: flex; gap: .6rem; align-items: center; }
.login-side li i { color: var(--ats-blue); }
.login-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: #fff; }
.login-box { width: 100%; max-width: 380px; }
@media (max-width: 991.98px) { .login-split { grid-template-columns: 1fr; } .login-side { display: none; } }

/* ---------- Misc ---------- */
.search-hit { padding: .7rem 1rem; border-bottom: 1px solid #EEF1F4; display: flex; gap: .75rem; align-items: center; }
.search-hit:last-child { border-bottom: 0; }
.search-hit .type { width: 92px; flex-shrink: 0; }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--ats-line); padding: .75rem 1rem; margin: 1rem -1rem -1rem; border-radius: 0 0 10px 10px; }
.chart-box { position: relative; height: 240px; }
.notif-item { display: block; padding: .6rem .9rem; border-bottom: 1px solid #EEF1F4; color: inherit; font-size: .82rem; }
.notif-item:hover { background: #F8FAFC; text-decoration: none; }
.notif-item.unread { background: #F5FBFF; }
.dropdown-menu { border-color: var(--ats-line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16,24,40,.12); font-size: .86rem; }
.small-caps { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--ats-muted); }

@media print {
  .sidebar, .topbar, .app-footer, .no-print, .page-head .btn, .filters { display: none !important; }
  .main { margin: 0 !important; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* Document-type ↔ service grid */
.matrix input.form-control { min-width: 78px; }
.matrix-off td:not(:first-child) { opacity: .5; }
.matrix-off td:not(:first-child) input { background: #F9FAFB; }

/* ---------- New case screen ---------- */
.cc .cc-head { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem 1rem .75rem; }
.cc .cc-head h2 { font-size: 1.02rem; margin: 2px 0 0; }
.cc .cc-head p { margin: .1rem 0 0; color: var(--ats-muted); font-size: .8rem; }
.cc-num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--ats-navy); color: #fff; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; box-shadow: 0 0 0 4px rgba(0,175,239,.18); }
.cc-step-plain .cc-head { padding: .25rem 0 .75rem; }
.cc-search { position: relative; }
.cc-search > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #98A2B3; pointer-events: none; }
.cc-search > input { padding-left: 36px; }
.cc-dropdown { z-index: 30; max-height: 300px; overflow: auto; }
.cc-customer { display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem; border: 1px solid #BFE9F9; background: var(--ats-blue-soft); border-radius: 10px; }

.cc-doc { border-left: 4px solid var(--ats-blue); }
.cc-doc.cc-doc-empty { border-left-color: #D0D5DD; }
.cc-doc.cc-doc-error { border-left-color: var(--ats-red); box-shadow: 0 0 0 3px rgba(237,50,55,.12); }
.cc-doc-head { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--ats-line); background: #FAFBFC; border-radius: 10px 10px 0 0; }
.cc-doc-no { width: 26px; height: 26px; border-radius: 7px; background: var(--ats-navy); color: #fff; font-weight: 700; font-size: .8rem; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cc-doc-title { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-doc-sub { color: var(--ats-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.min-w-0 { min-width: 0; }
.cc-doc-foot { padding: .55rem 1rem; border-top: 1px solid var(--ats-line); background: #FAFBFC; border-radius: 0 0 10px 10px; text-align: right; color: var(--ats-muted); }
.cc-doc-foot:empty, .cc-doc-foot .cc-doc-total:empty { display: none; }
.cc-more summary { color: var(--ats-blue-ink); cursor: pointer; }

.cc-lines { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .6rem; }
.cc-lines-empty { border: 1px dashed #D0D5DD; border-radius: 9px; padding: .75rem; color: var(--ats-muted); font-size: .84rem; text-align: center; }
.cc-line { display: grid; grid-template-columns: 96px 1fr auto auto 34px; gap: .6rem; align-items: center; padding: .6rem .7rem; border: 1px solid var(--ats-line);
  border-radius: 9px; background: #fff; }
.cc-line-main { min-width: 0; }
.cc-line-money { text-align: right; min-width: 128px; }
.cc-line-money .cc-price { margin-top: .25rem; max-width: 128px; margin-left: auto; }
.cc-urgent { white-space: nowrap; }
.cc-reason { grid-column: 2 / -1; display: flex; flex-direction: column; gap: .2rem; }
.cc-req { margin-top: .15rem; }
.cc-picker { border: 1px solid var(--ats-line); border-radius: 10px; padding: .6rem; background: #F9FAFB; }
.cc-options { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; max-height: 230px; overflow: auto; }
.cc-opt { display: flex; align-items: center; gap: .45rem; width: 100%; text-align: left; border: 1px solid transparent; background: #fff; border-radius: 8px; padding: .45rem .6rem; font-size: .86rem; color: var(--ats-ink); }
.cc-opt:hover, .cc-opt:focus { border-color: var(--ats-blue); background: var(--ats-blue-soft); outline: none; }
.cc-opt i { color: var(--ats-blue-ink); }

.cc-summary { position: sticky; top: calc(var(--topbar-h) + 16px); overflow: hidden; }
.cc-summary-head { background: var(--ats-navy); color: #C5CEDB; padding: 1rem; }
.cc-summary-head .small-caps { color: #8E9BB0; }
.cc-total { color: #fff; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cc-summary-head b { color: #fff; }
.cc-sum-docs { display: flex; flex-direction: column; gap: .5rem; }
.cc-sum-doc { padding: .5rem .6rem; border-radius: 8px; background: #F6F8FA; font-size: .85rem; }
.cc-mobilebar { position: sticky; bottom: 0; z-index: 1020; margin: 1rem -1rem -1rem; padding: .7rem 1rem; background: #fff; border-top: 1px solid var(--ats-line);
  display: flex; align-items: center; justify-content: space-between; box-shadow: 0 -6px 20px rgba(16,24,40,.06); }
@media (max-width: 767.98px) {
  .cc-line { grid-template-columns: 1fr 34px; }
  .cc-line .cc-step-sel { grid-column: 1 / 2; max-width: 120px; }
  .cc-line .cc-line-main, .cc-line .cc-urgent, .cc-line .cc-line-money { grid-column: 1 / -1; text-align: left; }
  .cc-line .cc-line-money .cc-price { margin-left: 0; }
  .cc-line .cc-l-rm { grid-row: 1; grid-column: 2; }
  .cc-summary { position: static; }
}
.pipe-group { display: inline-flex; align-items: center; gap: .2rem; padding: .1rem; border-radius: 6px; }
.pipe-plus { color: var(--ats-muted); font-weight: 700; font-size: .7rem; }
.pipeline .step.hold { background: #FFFAEB; color: #B54708; }
.step-no { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--ats-navy); color: #fff; font-size: .75rem; font-weight: 700; align-items: center; justify-content: center; }
