/* Shardhan layout layer: cli-shell — client portal shell (two-tier top nav),
   Overview dashboard and document-tree nodes. Prefix: cs-  (agent C) */

.cs-shell {
  --cs-ink: #12352B;
  --cs-forest: #0B3B2E;
  --cs-forest-2: #12523D;
  --cs-saffron: #EB7A1C;
  --cs-saffron-2: #FF9A3D;
  --cs-blue: #1F4FA8;
  --cs-line: #DCE3E0;
  --cs-line-2: #E8EEEB;
  --cs-muted: #5F6B67;
  --cs-bg: #F3F6F5;
  --cs-ok: #1FA35A;
  --cs-warn: #E39A0B;
  --cs-bad: #DC2626;
  --cs-ease: cubic-bezier(.16, 1, .3, 1);
  --cs-w: 1320px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 320px at 100% 0, rgba(235, 122, 28, .05), transparent 70%),
    var(--cs-bg);
  color: var(--cs-ink);
}
.cs-wrap { width: 100%; max-width: var(--cs-w); margin: 0 auto; padding-left: 32px; padding-right: 32px; box-sizing: border-box; }

/* The shell has no left sidebar: panels that used to start after it now span the viewport. */
.lawpanel-overlay.company-data-overlay { left: 0 !important; }

/* ------------------------------------------------------------ header tier 1 */
.cs-header { position: sticky; top: 0; z-index: 40; }
.cs-bar {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.045'%3E%3Cpath d='M22 0 44 22 22 44 0 22Z'/%3E%3Ccircle cx='22' cy='22' r='7'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(520px 140px at 12% 0, rgba(255, 154, 61, .16), transparent 70%),
    linear-gradient(90deg, #062A20 0%, #0B3B2E 55%, #0E4634 100%);
  color: #fff;
  padding-top: 4px; /* clears the fixed tricolour ribbon */
}
.cs-bar-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.cs-brand { display: flex; align-items: center; gap: 11px; cursor: pointer; flex: none; outline-offset: 4px; }
.cs-brand .brand-mark { transition: transform .45s var(--cs-ease); filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35)); }
.cs-brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.cs-brand-t { line-height: 1.15; }
.cs-brand-name { font-family: var(--font-display, Poppins, sans-serif); font-size: 15px; font-weight: 700; letter-spacing: 2px; color: #fff; }
.cs-brand-sub { font-size: 9.5px; font-weight: 600; letter-spacing: 1.4px; color: var(--cs-saffron-2); margin-top: 3px; white-space: nowrap; }
.cs-bar-divider { width: 1px; height: 30px; background: rgba(255, 255, 255, .16); flex: none; }
.cs-bar-switch { min-width: 0; flex: 0 1 auto; }
.cs-bar-switch .entity-switcher {
  background: rgba(255, 255, 255, .07) !important; border-color: rgba(255, 255, 255, .16) !important;
  transition: background .2s, border-color .2s;
}
.cs-bar-switch .entity-switcher:hover { background: rgba(255, 255, 255, .12) !important; border-color: rgba(255, 154, 61, .55) !important; }
.cs-bar-switch .entity-switcher > span:first-child { background: var(--cs-saffron) !important; color: #fff !important; }
.cs-bar-switch .entity-switcher div { color: #fff !important; }
.cs-bar-switch .entity-switcher div + div { color: rgba(255, 255, 255, .6) !important; }
.cs-bar-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: none; }
.cs-bar .sd-clock { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); color: rgba(255, 255, 255, .86); }
.cs-refresh button {
  background: rgba(255, 255, 255, .07) !important; border-color: rgba(255, 255, 255, .16) !important; color: #fff !important;
  border-radius: 999px !important; transition: background .2s, transform .35s var(--cs-ease) !important;
}
.cs-refresh button:hover:not([disabled]) { background: rgba(255, 255, 255, .14) !important; transform: rotate(-30deg); }

.cs-menu-btn {
  display: none; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: #fff;
  border-radius: 8px; cursor: pointer; font-size: 18px;
}

/* avatar menu */
.cs-user { position: relative; }
.cs-user > summary { list-style: none; }
.cs-user > summary::-webkit-details-marker { display: none; }
.cs-user-btn {
  display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  transition: background .2s, border-color .2s; color: #fff; user-select: none;
}
.cs-user-btn:hover, .cs-user[open] .cs-user-btn { background: rgba(255, 255, 255, .13); border-color: rgba(255, 154, 61, .55); }
.cs-user-btn .ri-arrow-down-s-line { font-size: 16px; opacity: .7; transition: transform .3s var(--cs-ease); }
.cs-user[open] .cs-user-btn .ri-arrow-down-s-line { transform: rotate(180deg); }
.cs-user-n { font-size: 12.5px; font-weight: 600; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cs-saffron-2), var(--cs-saffron)); color: #fff; font-size: 11.5px; font-weight: 700;
  font-family: var(--font-display, Poppins, sans-serif); letter-spacing: .5px;
}
.cs-avatar-lg { width: 42px; height: 42px; font-size: 14px; }
.cs-user-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 300px; z-index: 60;
  background: #fff; color: var(--cs-ink); border: 1px solid var(--cs-line); border-radius: 12px;
  box-shadow: 0 24px 60px -18px rgba(3, 23, 15, .38); overflow: hidden;
  animation: cs-pop .28s var(--cs-ease) both; transform-origin: top right;
}
@keyframes cs-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.cs-user-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px; background: linear-gradient(180deg, #F1F7F4, #fff); border-bottom: 1px solid var(--cs-line-2); }
.cs-user-hn { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-user-he { font-size: 11.5px; color: var(--cs-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-entity { padding: 14px 16px; }
.cs-entity-eyebrow { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--cs-saffron); font-weight: 700; }
.cs-entity-name { font-size: 13.5px; font-weight: 700; margin-top: 5px; line-height: 1.35; }
.cs-entity-sector { font-size: 11.5px; color: var(--cs-muted); margin-top: 2px; }
.cs-entity-ids { margin: 12px 0 0; display: grid; gap: 6px; }
.cs-entity-ids > div { display: flex; gap: 10px; font-size: 11px; background: #F5F8F7; border: 1px solid var(--cs-line-2); border-radius: 6px; padding: 6px 9px; }
.cs-entity-ids dt { color: var(--cs-muted); width: 30px; flex: none; }
.cs-entity-ids dd { margin: 0; color: var(--cs-ink); overflow-wrap: anywhere; }
.cs-signout {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: calc(100% - 32px); margin: 0 16px 16px;
  border: 1px solid #F3C4C4; background: #FEF3F3; color: #B91C1C; font-size: 12.5px; font-weight: 600;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.cs-signout:hover { background: #B91C1C; border-color: #B91C1C; color: #fff; }

/* ------------------------------------------------------------ header tier 2: tabs */
.cs-tabs { background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); border-bottom: 1px solid var(--cs-line); box-shadow: 0 12px 28px -24px rgba(3, 23, 15, .55); }
.cs-tabs-in { display: flex; align-items: stretch; justify-content: space-between; gap: 16px; }
.cs-tablist { position: relative; display: flex; align-items: stretch; gap: 4px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.cs-tablist::-webkit-scrollbar { display: none; }
.cs-tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 16px;
  border: 0; background: transparent; cursor: pointer; white-space: nowrap;
  font: 600 13.5px/1 var(--font-body, 'Noto Sans', sans-serif); color: #4E5D58; transition: color .2s;
}
.cs-tab i { font-size: 17px; color: #8A9792; transition: color .2s, transform .35s var(--cs-ease); }
.cs-tab::before { content: ""; position: absolute; left: 6px; right: 6px; top: 8px; bottom: 8px; border-radius: 8px; background: transparent; transition: background .2s; z-index: -1; }
.cs-tab:hover { color: var(--cs-ink); }
.cs-tab:hover::before { background: #F1F5F3; }
.cs-tab:hover i { transform: translateY(-1px); color: var(--cs-forest-2); }
.cs-tab.is-active { color: var(--cs-ink); }
.cs-tab.is-active i { color: var(--cs-saffron); }
.cs-tab:focus-visible { outline: 2px solid var(--cs-saffron); outline-offset: -6px; border-radius: 8px; }
.cs-ink {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 0; border-radius: 3px 3px 0 0; opacity: 0;
  background: linear-gradient(90deg, var(--cs-saffron-2), var(--cs-saffron));
  box-shadow: 0 -2px 12px rgba(235, 122, 28, .45);
  transition: transform .45s var(--cs-ease), width .45s var(--cs-ease), opacity .2s;
  pointer-events: none;
}
.cs-tabs-meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--cs-muted); white-space: nowrap; flex: none; }
.cs-tabs-meta i { color: var(--cs-forest-2); font-size: 15px; }
.cs-tabs-meta b { color: var(--cs-ink); font-weight: 700; }

/* ------------------------------------------------------------ title / breadcrumb row */
.cs-titlebar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 4px; flex-wrap: wrap; }
.cs-crumbs { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--cs-muted); flex-wrap: wrap; }
.cs-crumbs a { display: inline-flex; align-items: center; gap: 5px; color: var(--cs-blue); cursor: pointer; text-decoration: none; font-weight: 500; }
.cs-crumbs a:hover { text-decoration: underline; }
.cs-crumbs [aria-current] { color: var(--cs-ink); font-weight: 600; }
.cs-crumb-sep { font-size: 14px; color: #B3BFBA; }
.cs-page-t { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--cs-muted); }
.cs-page-t i { color: var(--cs-saffron); font-size: 15px; }
.cs-page-t span { font-weight: 700; color: var(--cs-ink); }
.cs-page-t em { font-style: normal; }
.cs-page-t em::before { content: "\2014"; margin-right: 8px; color: #B3BFBA; }

.cs-main { flex: 1; padding: 16px 0 72px; }
.cs-foot { border-top: 1px solid var(--cs-line); background: #fff; }
.cs-foot-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; font-size: 11.5px; color: var(--cs-muted); }

/* ------------------------------------------------------------ mobile drawer */
.cs-scrim { position: fixed; inset: 0; background: rgba(3, 23, 15, .5); z-index: 90; opacity: 0; pointer-events: none; transition: opacity .3s; }
.cs-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 300px; max-width: 86vw; z-index: 100;
  background: #fff; display: flex; flex-direction: column; overflow-y: auto;
  transform: translateX(-102%); transition: transform .4s var(--cs-ease); visibility: hidden;
  box-shadow: 24px 0 60px -30px rgba(3, 23, 15, .6);
}
.cs-drawer-head {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 16px;
  background: linear-gradient(135deg, #062A20, #0B3B2E); color: #fff; border-top: 4px solid transparent;
}
.cs-drawer-x { width: 34px; height: 34px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: #fff; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.cs-drawer-nav { padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--cs-line-2); }
.cs-dnav {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; border: 0; background: transparent;
  cursor: pointer; text-align: left; color: var(--cs-ink); font: 600 14px/1.2 var(--font-body, sans-serif); transition: background .2s;
}
.cs-dnav > i:first-child { width: 34px; height: 34px; border-radius: 9px; background: #F1F5F3; color: var(--cs-forest-2); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.cs-dnav-l { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cs-dnav-l small { font-size: 11px; font-weight: 500; color: var(--cs-muted); }
.cs-dnav-go { color: #B3BFBA; }
.cs-dnav:hover { background: #F5F8F7; }
.cs-dnav.is-active { background: #FFF4E6; }
.cs-dnav.is-active > i:first-child { background: var(--cs-saffron); color: #fff; }
.cs-drawer-foot { margin-top: auto; }

/* ------------------------------------------------------------ cards (shared) */
.cs-card {
  background: #fff; border: 1px solid var(--cs-line); border-radius: 14px; padding: 20px 22px;
  box-shadow: 0 1px 0 rgba(3, 23, 15, .02), 0 18px 40px -34px rgba(3, 23, 15, .35);
}
.cs-card-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cs-card-eyebrow { display: flex; align-items: center; gap: 5px; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; color: var(--cs-saffron); }
.cs-card-eyebrow i { font-size: 13px; }
.cs-card-t { margin: 4px 0 0; font-family: var(--font-display, Poppins, sans-serif); font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; color: var(--cs-ink); }
.cs-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--cs-blue); cursor: pointer; }
.cs-link i { transition: transform .3s var(--cs-ease); }
.cs-link:hover i { transform: translateX(3px); }
.cs-link:hover { text-decoration: underline; }
.cs-empty-s { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 8px; font-size: 12.5px; color: var(--cs-muted); text-align: center; }
.cs-empty-s i { font-size: 26px; color: #B9C4C0; }
.cs-sec-label { display: flex; align-items: center; gap: 12px; margin: 30px 0 14px; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; font-weight: 700; color: var(--cs-muted); }
.cs-sec-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--cs-line), transparent); }

/* ------------------------------------------------------------ Overview hero */
.cs-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: center;
  border-radius: 18px; padding: 28px 32px; color: #fff;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.05'%3E%3Ccircle cx='30' cy='30' r='12'/%3E%3Cpath d='M30 0v60M0 30h60'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(420px 260px at 88% 30%, rgba(255, 154, 61, .22), transparent 70%),
    radial-gradient(520px 300px at 0% 120%, rgba(47, 191, 113, .18), transparent 70%),
    linear-gradient(120deg, #062A20 0%, #0B3B2E 50%, #12523D 100%);
  box-shadow: 0 30px 60px -40px rgba(3, 23, 15, .8);
}
.cs-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--sd-tricolour, linear-gradient(90deg, #FF9933 0 33%, #F4F4F0 33% 66%, #138808 66%)); opacity: .85; }
.cs-hero-eyebrow { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600; color: var(--cs-saffron-2); }
.cs-hero-eyebrow .sd-hindi { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.cs-hero-h { margin: 8px 0 0; font-family: var(--font-display, Poppins, sans-serif); font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.4px; color: #fff; }
.cs-hero-p { margin: 8px 0 0; font-size: 13.5px; color: rgba(255, 255, 255, .72); max-width: 620px; line-height: 1.55; }
.cs-hero-p b { color: #fff; }
.cs-hero-p .cs-red { color: #FFB4A8; }
.cs-segbar { display: flex; gap: 3px; height: 14px; margin-top: 22px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .1); max-width: 640px; }
.cs-seg { flex: 0 0 auto; min-width: 0; height: 100%; transform-origin: left; }
.cs-seg[style*="flex-basis:0%"] { display: none; }
.cs-seg-filed { background: linear-gradient(90deg, #1FA35A, #2FBF71); }
.cs-seg-pending { background: repeating-linear-gradient(135deg, #F5B53B 0 8px, #E39A0B 8px 16px); }
.cs-seg-overdue { background: linear-gradient(90deg, #EF4444, #DC2626); }
.cs-seg-none { background: rgba(255, 255, 255, .12); }
#app.fx-enter .cs-seg { animation: cs-grow .9s var(--cs-ease) .15s both; }
@keyframes cs-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.cs-seglegend { display: flex; gap: 10px 26px; flex-wrap: wrap; margin-top: 14px; }
.cs-seglegend > div { display: flex; align-items: baseline; gap: 7px; font-size: 12px; color: rgba(255, 255, 255, .66); }
.cs-seglegend b { font-family: var(--font-display, Poppins, sans-serif); font-size: 20px; color: #fff; letter-spacing: -.3px; }
.cs-seglegend i { width: 9px; height: 9px; border-radius: 3px; align-self: center; }
.cs-k-filed { background: #2FBF71; } .cs-k-pending { background: #F5B53B; } .cs-k-overdue { background: #EF4444; }
.cs-seg-total { margin-left: auto; padding-left: 18px; border-left: 1px solid rgba(255, 255, 255, .16); }

.cs-hero-r { display: flex; flex-direction: column; align-items: center; }
.cs-gauge { position: relative; width: 260px; }
.cs-gauge-svg { display: block; width: 100%; height: auto; overflow: visible; }
.cs-gauge-track { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 16; stroke-linecap: round; }
.cs-gauge-val { fill: none; stroke: url(#cs-g-grad); stroke-width: 16; stroke-linecap: round; filter: drop-shadow(0 4px 10px rgba(255, 154, 61, .35)); }
#app.fx-enter .cs-gauge-val { animation: cs-gauge 1.3s var(--cs-ease) .1s both; }
@keyframes cs-gauge { from { stroke-dasharray: 0 100; } }
.cs-gauge-knob { fill: #fff; stroke: var(--cs-saffron); stroke-width: 3; }
#app.fx-enter .cs-gauge-knob { animation: cs-fade .5s ease 1.1s both; }
@keyframes cs-fade { from { opacity: 0; } }
.cs-gauge-ticks line { stroke: rgba(255, 255, 255, .22); stroke-width: 2; stroke-linecap: round; }
.cs-gauge-ticks line.on { stroke: rgba(255, 190, 120, .75); }
.cs-gauge-read { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.cs-gauge-read b { display: block; font-family: var(--font-display, Poppins, sans-serif); font-size: 38px; line-height: 1; font-weight: 700; letter-spacing: -1px; }
.cs-gauge-read span { display: block; margin-top: 6px; font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .6); font-weight: 600; }
.cs-gauge-band { margin-top: 12px; font-size: 11.5px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid; }
.cs-band-ok { color: #9BE8BD; border-color: rgba(47, 191, 113, .45); background: rgba(47, 191, 113, .12); }
.cs-band-mid { color: #FFD08A; border-color: rgba(245, 181, 59, .45); background: rgba(245, 181, 59, .12); }
.cs-band-low { color: #FFB4A8; border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .14); }

/* ------------------------------------------------------------ Overview body */
.cs-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; margin-top: 24px; }
.cs-col, .cs-rail { display: flex; flex-direction: column; min-width: 0; }
.cs-rail { gap: 20px; position: sticky; top: 138px; }
#app.fx-enter .cs-dash > *, #app.fx-enter .cs-body > * { animation: sd-rise .6s var(--cs-ease) both; }
#app.fx-enter .cs-body > *:nth-child(2) { animation-delay: .1s; }

/* status filter pills */
.cs-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cs-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--cs-line); background: #fff; color: #3C4B46; font: 600 12.5px/1 var(--font-body, sans-serif);
  transition: background .2s, color .2s, border-color .2s, transform .3s var(--cs-ease);
}
.cs-pill span { min-width: 22px; padding: 3px 6px; border-radius: 999px; background: #EEF3F1; color: #3C4B46; font-size: 11px; text-align: center; font-family: var(--font-mono, monospace); }
.cs-pill:hover { border-color: #BCC9C4; transform: translateY(-1px); }
.cs-pill.is-on { background: var(--cs-ink); border-color: var(--cs-ink); color: #fff; }
.cs-pill.is-on span { background: rgba(255, 255, 255, .16); color: #fff; }
.cs-pill-pending.is-on { background: #9A5B00; border-color: #9A5B00; }
.cs-pill-overdue.is-on { background: #B91C1C; border-color: #B91C1C; }
.cs-pill-filed.is-on { background: #0F6B34; border-color: #0F6B34; }

/* compliance register table */
.cs-reg { border: 1px solid var(--cs-line-2); border-radius: 10px; overflow: hidden; }
.cs-reg-head, .cs-reg-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 150px 112px 36px; gap: 14px; align-items: center; padding: 0 16px; }
.cs-reg-head { height: 36px; background: #F5F8F7; border-bottom: 1px solid var(--cs-line-2); font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase; font-weight: 700; color: var(--cs-muted); }
.cs-reg-row { min-height: 60px; border-bottom: 1px solid var(--cs-line-2); cursor: pointer; position: relative; transition: background .18s; }
.cs-reg-row:last-of-type { border-bottom: 0; }
.cs-reg-row::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cs-saffron); transform: scaleY(0); transition: transform .3s var(--cs-ease); }
.cs-reg-row:hover { background: #FAFBF8; }
.cs-reg-row:hover::before { transform: scaleY(1); }
.cs-reg-row[hidden] { display: none; }
.cs-reg-row:focus-visible { outline: 2px solid var(--cs-saffron); outline-offset: -2px; }
.cs-reg-code { justify-self: start; font-size: 11px; font-weight: 600; color: var(--cs-ink); background: #E8F1EC; border: 1px solid #D5E5DC; padding: 4px 8px; border-radius: 6px; }
.cs-reg-name { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cs-reg-name b { font-size: 13.5px; font-weight: 600; color: var(--cs-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-reg-name small { font-size: 11.5px; color: var(--cs-muted); }
.cs-reg-due { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cs-reg-due b { font-size: 12.5px; font-weight: 600; color: #2F3E39; }
.cs-reg-due small { font-size: 11px; color: #6B7773; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 6px; border: 1px solid; }
.cs-status i { width: 7px; height: 7px; border-radius: 50%; }
.cs-st-filed { color: #0F6B34; background: #E3F4E8; border-color: #C4E6CF; } .cs-st-filed i { background: var(--cs-ok); }
.cs-st-pending { color: #9A5B00; background: #FFF3D6; border-color: #F5D79A; } .cs-st-pending i { background: var(--cs-warn); }
.cs-st-overdue { color: #B91C1C; background: #FDECEC; border-color: #F6C9C9; } .cs-st-overdue i { background: var(--cs-bad); animation: sd-ping 2s infinite; }
.cs-reg-go { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #6B7773; font-size: 16px; transition: background .2s, color .2s, transform .3s var(--cs-ease); }
.cs-reg-row:hover .cs-reg-go { background: var(--cs-saffron); color: #fff; transform: translate(2px, -2px); }
.cs-reg-empty { padding: 26px; text-align: center; font-size: 13px; color: var(--cs-muted); }
.cs-reg-empty[hidden] { display: none; }

/* deadline radar timeline */
.cs-radar-list { list-style: none; margin: 0; padding: 0 0 0 18px; position: relative; }
.cs-radar-list::before { content: ""; position: absolute; left: 5px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(180deg, var(--cs-saffron), #C9D6D0 70%, transparent); border-radius: 2px; }
.cs-radar-i { position: relative; padding: 5px 0; }
.cs-radar-dot { position: absolute; left: -18px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid #9FB1AA; box-sizing: border-box; }
.cs-tone-hot .cs-radar-dot, .cs-tone-late .cs-radar-dot { border-color: var(--cs-bad); box-shadow: 0 0 0 4px rgba(220, 38, 38, .12); }
.cs-tone-warm .cs-radar-dot { border-color: var(--cs-warn); }
.cs-tone-calm .cs-radar-dot { border-color: var(--cs-blue); }
.cs-radar-card { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border: 1px solid var(--cs-line-2); border-radius: 10px; cursor: pointer; background: #fff; transition: border-color .2s, box-shadow .3s var(--cs-ease), transform .3s var(--cs-ease); }
.cs-radar-card:hover { border-color: #F2C9A3; box-shadow: 0 12px 26px -18px rgba(235, 122, 28, .6); transform: translateX(3px); }
.cs-radar-date { width: 44px; flex: none; text-align: center; border-right: 1px dashed var(--cs-line); padding-right: 10px; }
.cs-radar-date b { display: block; font-family: var(--font-display, Poppins, sans-serif); font-size: 19px; line-height: 1; color: var(--cs-ink); }
.cs-radar-date span { display: block; font-size: 9.5px; letter-spacing: 1.2px; font-weight: 700; color: var(--cs-muted); margin-top: 3px; text-transform: uppercase; }
.cs-radar-body { flex: 1; min-width: 0; }
.cs-radar-t { font-size: 13px; font-weight: 700; color: var(--cs-ink); line-height: 1.25; }
.cs-radar-s, .cs-radar-m { font-size: 11.5px; color: #4E5D58; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cs-radar-m { color: var(--cs-muted); font-size: 11px; }
.cs-radar-pill { flex: none; font-size: 10.5px; font-weight: 700; padding: 4px 8px; border-radius: 6px; background: #E9EFFA; color: var(--cs-blue); font-family: var(--font-mono, monospace); }
.cs-tone-hot .cs-radar-pill, .cs-tone-late .cs-radar-pill { background: #FDECEC; color: #B91C1C; }
.cs-tone-warm .cs-radar-pill { background: #FFF3D6; color: #9A5B00; }

/* rail tabs */
.cs-railtabs { padding: 8px 8px 4px; }
.cs-seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #F1F5F3; border-radius: 10px; padding: 4px; }
.cs-seg-tabs button { white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; padding: 9px 6px; border-radius: 7px; font: 600 12.5px/1 var(--font-body, sans-serif); color: #5B6763; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.cs-seg-tabs button i { font-size: 15px; }
.cs-seg-tabs button.is-on { background: #fff; color: var(--cs-ink); box-shadow: 0 2px 8px -2px rgba(3, 23, 15, .18); }
.cs-seg-tabs button.is-on i { color: var(--cs-saffron); }
.cs-railtabs [data-cs-pane] { padding: 8px 12px 0; }
.cs-railtabs [data-cs-pane]:not([hidden]) { animation: cs-fade .3s ease both; }
.cs-railtabs [data-cs-pane][hidden] { display: none; }
.cs-pane-list { display: flex; flex-direction: column; }
.cs-pane-f { padding: 10px 0 12px; border-top: 1px solid var(--cs-line-2); margin-top: 4px; }
.cs-act-list > div:last-child { border-bottom: 0 !important; }
.cs-doc { display: flex; align-items: center; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--cs-line-2); cursor: pointer; }
.cs-doc:last-child { border-bottom: 0; }
.cs-doc-ic { width: 32px; height: 32px; border-radius: 8px; background: #E9EFFA; color: var(--cs-blue); display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; }
.cs-ft-xls .cs-doc-ic, .cs-doc-ic.cs-ft-xls, .cs-doc-ic.cs-ft-xlsx { background: #E3F4E8; color: #0F6B34; }
.cs-doc-ic.cs-ft-pdf { background: #FDECEC; color: #B91C1C; }
.cs-doc-b { flex: 1; min-width: 0; }
.cs-doc-n { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-doc-m { font-size: 11px; color: var(--cs-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.cs-doc-t { font-size: 9.5px; color: #6B7773; }
.cs-doc:hover .cs-doc-n { color: var(--cs-blue); }

/* workforce widgets */
.cs-wcard { border-radius: 14px !important; transition: border-color .2s, box-shadow .3s var(--cs-ease), transform .3s var(--cs-ease) !important; }
.cs-wcard.company-data-widget:hover { border-color: #C9D6D0 !important; box-shadow: 0 18px 36px -26px rgba(3, 23, 15, .45) !important; }
.cs-hc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-hc-grid > div:first-child { grid-column: 1 / -1; }

/* ------------------------------------------------------------ document tree nodes */
.cs-tree-node {
  position: relative; display: flex; align-items: center; gap: 7px; padding: 6px 10px 6px 8px; margin: 1px 8px;
  border-radius: 7px; cursor: pointer; transition: background .15s, color .15s;
}
.cs-tree-node:hover { background: #EEF3F1 !important; }
.cs-tree-guides { display: flex; align-self: stretch; flex: none; margin: -6px 0; }
.cs-tree-guides > i { width: 14px; flex: none; position: relative; }
.cs-tree-guides > i::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; border-left: 1px dashed #CAD6D1; }
.cs-tree-chev { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex: none; color: #8A9792; font-size: 15px; border-radius: 5px; transition: transform .25s var(--cs-ease), background .15s, color .15s; }
.cs-tree-chev:hover { background: #DCE6E1; color: var(--cs-ink); }
.cs-tree-chev.is-open { transform: rotate(90deg); color: var(--cs-ink); }
.cs-tree-chev.is-leaf { visibility: hidden; }
.cs-tree-ic { font-size: 15px; flex: none; }
.cs-tree-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 500; color: #2F3E39; }
.cs-tree-node.is-selected { background: linear-gradient(90deg, #FFF1E2, #FFF8F0) !important; box-shadow: inset 0 0 0 1px #F6D2AE; }
.cs-tree-node.is-selected::before { content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px; border-radius: 3px; background: var(--cs-saffron); }
.cs-tree-node.is-selected .cs-tree-name { font-weight: 700; color: var(--cs-ink); }
.cs-tree-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cs-tree-ratio { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px; background: #EEF3F1; color: var(--cs-muted); flex: none; font-family: var(--font-mono, monospace); }
.cs-tree-ratio.is-done { background: #E3F4E8; color: #0F6B34; }

.cs-viewmenu { position: absolute; top: 38px; right: 0; width: 196px; background: #fff; border: 1px solid var(--cs-line, #DCE3E0); border-radius: 10px; box-shadow: 0 20px 44px -18px rgba(3, 23, 15, .35); z-index: 50; overflow: hidden; padding: 5px; animation: cs-pop .25s cubic-bezier(.16, 1, .3, 1) both; transform-origin: top right; }
.cs-viewmenu-h { font-size: 10px; letter-spacing: 1.3px; text-transform: uppercase; font-weight: 700; color: #6B7773; padding: 7px 10px 5px; }
.cs-viewmenu-i { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 12.5px; font-weight: 500; color: #2F3E39; transition: background .15s; }
.cs-viewmenu-i:hover { background: #F1F5F3; }
.cs-viewmenu-i i { font-size: 15px; color: #5F6B67; }
.cs-viewmenu-i.is-on { background: #FFF4E6; color: #12352B; font-weight: 700; }
.cs-viewmenu-i.is-on i { color: #EB7A1C; }
.cs-viewmenu-i .ri-check-line { margin-left: auto; }

/* ------------------------------------------------------------ skeleton */
.cs-sk { background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.16), rgba(255,255,255,.08)); background-size: 200% 100%; animation: sd-shimmer 1.4s linear infinite; border-radius: 6px; }
.cs-skel-tabs { display: flex; gap: 22px; align-items: center; height: 50px; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .cs-body { grid-template-columns: minmax(0, 1fr) 320px; }
  .cs-reg-head, .cs-reg-row { grid-template-columns: 70px minmax(0, 1fr) 124px 104px 32px; gap: 12px; }
  .cs-user-n { display: none; }
  .cs-user-btn { padding-right: 8px; }
}
@media (max-width: 1100px) {
  .cs-wrap { padding-left: 24px; padding-right: 24px; }
  .cs-body { grid-template-columns: 1fr; }
  .cs-rail { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .cs-page-t em { display: none; }
  .cs-hero { grid-template-columns: minmax(0, 1fr) 260px; }
  .cs-gauge { width: 230px; }
}
@media (max-width: 900px) {
  .cs-bar-divider { display: none; }
  .cs-tabs-meta { display: none; }
  .cs-tab { padding: 0 13px; }
}
@media (max-width: 767px) {
  .cs-wrap { padding-left: 16px; padding-right: 16px; }
  .cs-bar-in { height: 58px; gap: 10px; }
  .cs-menu-btn { display: flex; }
  .cs-brand-sub { display: none; }
  .cs-brand .brand-mark { width: 32px; height: 32px; }
  .cs-bar-switch { display: none; }
  .cs-bar .sd-clock { display: none; }
  .cs-bar-tools { gap: 8px; }
  .cs-user-btn .ri-arrow-down-s-line { display: none; }
  .cs-user-btn { padding: 3px; }
  .cs-user-pop { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
  .cs-scrim.is-open { opacity: 1; pointer-events: auto; }
  .cs-drawer.is-open { transform: none; visibility: visible; }
  .cs-tab { height: 46px; padding: 0 12px; font-size: 13px; }
  .cs-tab i { font-size: 16px; }
  .cs-tablist { margin: 0 -16px; padding: 0 16px; }
  .cs-titlebar-in { padding-top: 14px; }
  .cs-page-t { display: none; }
  .cs-main { padding-top: 12px; }
  .cs-hero { grid-template-columns: 1fr; padding: 22px 18px 24px; gap: 18px; border-radius: 14px; }
  .cs-hero-h { font-size: 21px; }
  .cs-hero-r { order: -1; flex-direction: row; justify-content: space-between; gap: 12px; }
  .cs-gauge { width: 190px; }
  .cs-gauge-read b { font-size: 30px; }
  .cs-seglegend { gap: 10px 18px; }
  .cs-seglegend b { font-size: 17px; }
  .cs-seg-total { margin-left: 0; border-left: 0; padding-left: 0; }
  .cs-card { padding: 16px; border-radius: 12px; }
  .cs-rail { grid-template-columns: 1fr; }
  .cs-reg-head { display: none; }
  .cs-reg-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "code st" "name name" "due go"; gap: 6px 10px; padding: 12px 14px; }
  .cs-reg-code { grid-area: code; }
  .cs-reg-name { grid-area: name; }
  .cs-reg-name b { white-space: normal; }
  .cs-reg-due { grid-area: due; flex-direction: row; gap: 8px; align-items: baseline; }
  .cs-reg-due small::before { content: "\00b7"; margin-right: 8px; }
  .cs-reg-st { grid-area: st; justify-self: end; }
  .cs-reg-go { grid-area: go; justify-self: end; }
  .cs-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 12px; padding: 0 16px 2px; }
  .cs-pill { flex: none; }
  .cs-foot-in { font-size: 11px; }
}
@media (max-width: 380px) {
  .cs-hero-r { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-ink, .cs-drawer, .cs-reg-row::before { transition: none !important; }
  #app.fx-enter .cs-gauge-val, #app.fx-enter .cs-seg { animation: none !important; }
}

/* narrow layouts: register first, then the rail (radar + tabs), then workforce */
@media (max-width: 1100px) {
  .cs-body { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .cs-col { display: contents; }
  .cs-body > .cs-col > .cs-register { order: 1; }
  .cs-body > .cs-rail { order: 2; margin-top: 20px; width: 100%; }
  .cs-body > .cs-col > :not(.cs-register) { order: 3; }
}
@media (max-width: 767px) {
  .cs-register .cs-card-h > :last-child { flex-shrink: 1 !important; width: 100%; justify-content: flex-start !important; }
  .cs-register .cs-card-h .btn-export { font-size: 12px !important; }
}
