/* =============================================================================
   SHARDHAN DESIGN SYSTEM — portal theme layer
   Loaded after each portal's base stylesheet. Base styles (and the inline
   styles emitted by the portal JS) already use the Shardhan palette; this layer
   adds typography, the institutional shell, component polish and motion.
   ============================================================================= */

:root {
  --sd-forest-950: #03170F;
  --sd-forest-900: #041F17;
  --sd-forest-800: #062A20;
  --sd-forest-700: #0B3B2E;
  --sd-forest-600: #12523D;
  --sd-forest-500: #1A6B50;
  --sd-forest-100: #E4EFEA;
  --sd-forest-50: #F1F7F4;
  --sd-ink: #12352B;
  --sd-saffron: #EB7A1C;
  --sd-saffron-2: #FF9A3D;
  --sd-saffron-50: #FFF4E6;
  --sd-green: #0F6B34;
  --sd-green-2: #2FBF71;
  --sd-blue: #1F4FA8;
  --sd-bg: #F4F7F6;
  --sd-border: #DCE3E0;
  --sd-muted: #5F6B67;
  --sd-tricolour: linear-gradient(90deg, #FF9933 0 33.33%, #F4F4F0 33.33% 66.66%, #138808 66.66% 100%);
  --font-display: 'Poppins', 'Noto Sans', system-ui, sans-serif;
  --font-body: 'Noto Sans', 'Noto Sans Devanagari', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --shadow-1: 0 1px 2px rgba(4, 24, 18, .06), 0 2px 8px -2px rgba(4, 24, 18, .08);
  --shadow-2: 0 2px 4px rgba(4, 24, 18, .05), 0 14px 32px -12px rgba(4, 24, 18, .22);
  --shadow-3: 0 30px 80px -20px rgba(3, 23, 15, .45);
}

/* ------------------------------------------------------------ typography */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body) !important;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  background-color: var(--sd-bg);
  background-image:
    radial-gradient(1200px 500px at 100% -10%, rgba(235, 122, 28, .06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(19, 128, 63, .06), transparent 60%);
  background-attachment: fixed;
}
h1, h2, h3, h4,
.title, .login-title, .panel-header, .modal-head h2, .client-header h1,
[style*="font-weight:700"], [style*="font-weight: 700"], [style*="font-weight:800"] {
  font-family: var(--font-display) !important;
  letter-spacing: -.01em;
}
.mono, [style*="monospace"] { font-family: var(--font-mono) !important; }
::selection { background: var(--sd-saffron); color: #fff; }

/* icon glyphs (Remix Icon) */
.si { display: inline-block; line-height: 1; vertical-align: middle; flex: none; }
.search-box .si, .company-search-box .si, .act-search .si { color: var(--sd-muted); }
.no-client .si { color: var(--sd-muted); margin-bottom: 14px; }
.cd-warn .si { color: #C2570C; margin-top: 1px; }

/* ------------------------------------------------------------ scrollbars */
* { scrollbar-width: thin; scrollbar-color: #B9C8C2 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C4D2CC; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: #9FB3AB; }
aside.sidebar::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .18); }

/* ------------------------------------------------------------ tricolour ribbon (top of every page) */
.sd-ribbon {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 3000;
  background: var(--sd-tricolour); pointer-events: none;
}
.sd-ribbon::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
  width: 30%; transform: translateX(-100%);
  animation: sd-sweep 5.5s var(--ease-out) infinite;
}
@keyframes sd-sweep { 0% { transform: translateX(-120%); } 60%, 100% { transform: translateX(420%); } }

/* ------------------------------------------------------------ route/fetch progress bar */
.sd-progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0; z-index: 3001;
  background: linear-gradient(90deg, var(--sd-saffron-2), var(--sd-saffron), var(--sd-green-2));
  box-shadow: 0 0 12px rgba(235, 122, 28, .7);
  opacity: 0; transition: width .35s var(--ease-out), opacity .4s;
}
.sd-progress.on { opacity: 1; }

/* ------------------------------------------------------------ SIDEBAR (both portals) */
aside.sidebar {
  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' stroke-width='1'%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(420px 260px at 0% 0%, rgba(255, 154, 61, .16), transparent 70%),
    radial-gradient(380px 300px at 100% 100%, rgba(47, 191, 113, .14), transparent 70%),
    linear-gradient(180deg, var(--sd-forest-800) 0%, var(--sd-forest-700) 55%, var(--sd-forest-900) 100%) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, .06), 8px 0 30px -18px rgba(3, 23, 15, .6);
  z-index: 30;
}
aside.sidebar::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 3px;
  background: linear-gradient(180deg, #FF9933 0 33.3%, #F4F4F0 33.3% 66.6%, #138808 66.6%);
  opacity: .9; pointer-events: none;
}
.side-brand .mark, aside.sidebar [data-action="goHome"] {
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45);
  transition: transform .35s var(--ease-spring);
}
.side-brand .mark { background: transparent !important; width: 40px !important; height: 40px !important; }
.side-brand .mark .brand-mark, .side-brand .mark img { width: 40px; height: 40px; display: block; }
.side-brand:hover .mark, aside.sidebar [data-action="goHome"]:hover { transform: translateY(-2px) rotate(-2deg); }
.side-brand .eyebrow { color: var(--sd-saffron-2) !important; letter-spacing: 2px !important; }
.side-brand .title { font-family: var(--font-display); font-size: 14px !important; letter-spacing: 1.5px !important; }
.side-brand .hindi, .sd-hindi { font-family: 'Noto Sans Devanagari', var(--font-body); font-weight: 500; letter-spacing: 0; }
.side-section-label { color: rgba(255, 255, 255, .38) !important; display: flex; align-items: center; gap: 8px; }
.side-section-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 255, 255, .14), transparent); }

aside.sidebar .nav-item {
  position: relative;
  transition: background .25s, color .25s, transform .35s var(--ease-out) !important;
}
aside.sidebar .nav-item:hover { transform: translateX(4px); background: rgba(255, 255, 255, .07) !important; }
aside.sidebar .nav-item::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px;
  border-radius: 0 4px 4px 0; background: var(--sd-saffron);
  transform: scaleY(0); transition: transform .35s var(--ease-spring);
  box-shadow: 0 0 14px rgba(255, 154, 61, .8);
}
aside.sidebar .nav-item.active {
  background: linear-gradient(90deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .04)) !important;
  color: #fff !important;
}
aside.sidebar .nav-item.active::before { transform: scaleY(1); }
aside.sidebar .nav-item .nav-ico { transition: background .25s, transform .35s var(--ease-spring), box-shadow .25s; border-radius: 10px !important; }
aside.sidebar .nav-item:hover .nav-ico { transform: scale(1.08); }
aside.sidebar .nav-item.active .nav-ico {
  background: linear-gradient(135deg, var(--sd-saffron-2), var(--sd-saffron)) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px -4px rgba(235, 122, 28, .7);
}
.client-avatar, .side-foot .avatar {
  background: linear-gradient(135deg, var(--sd-saffron-2), var(--sd-saffron)) !important;
  color: #fff !important; box-shadow: 0 4px 12px -4px rgba(235, 122, 28, .6);
}
.client-row { transition: background .25s, transform .35s var(--ease-out) !important; }
.client-row:hover { transform: translateX(3px); }

/* ------------------------------------------------------------ TOPBAR (both portals) */
header.topbar {
  background: rgba(255, 255, 255, .82) !important;
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom: 1px solid rgba(220, 227, 224, .9) !important;
  box-shadow: 0 10px 30px -24px rgba(3, 23, 15, .5);
  top: 4px !important;
}
.topbar .heading .eyebrow { color: var(--sd-saffron) !important; letter-spacing: 1.6px !important; }
.topbar .heading .title { font-size: 21px !important; }
.search-box, .company-search-box, .act-search {
  transition: border-color .2s, box-shadow .25s, width .35s var(--ease-out), background .2s;
  border-radius: 999px !important;
}
.search-box:focus-within { border-color: var(--sd-saffron) !important; box-shadow: 0 0 0 4px rgba(235, 122, 28, .14); background: #fff !important; width: 300px; }
.sd-clock {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 11.5px/1 var(--font-mono); color: var(--sd-forest-600);
  background: var(--sd-forest-50); border: 1px solid var(--sd-forest-100);
  padding: 7px 11px; border-radius: 999px; white-space: nowrap;
}
.sd-clock .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sd-green-2); box-shadow: 0 0 0 0 rgba(47, 191, 113, .6); animation: sd-ping 2s infinite; }
@keyframes sd-ping { 0% { box-shadow: 0 0 0 0 rgba(47, 191, 113, .55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(47, 191, 113, 0); } }
@media (max-width: 1100px) { .sd-clock { display: none; } }

/* ------------------------------------------------------------ surfaces & cards */
.stat-card, .hc-card, .uw-card, .cd-mini-card, .law-req-card, .card-hover, .upcoming-widget {
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .25s !important;
}
.stat-card, .hc-card, .cd-mini-card { position: relative; overflow: hidden; box-shadow: var(--shadow-1); }
.stat-card::after, .hc-card::after, .cd-mini-card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--sd-saffron), var(--sd-saffron-2) 40%, var(--sd-green-2));
  transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out);
}
.stat-card:hover, .hc-card:hover, .uw-card:hover, .cd-mini-card:hover, .card-hover:hover, .law-req-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-2) !important;
}
.stat-card:hover::after, .hc-card:hover::after, .cd-mini-card:hover::after { transform: scaleX(1); }
.hc-num, .cd-mini-num { font-family: var(--font-display) !important; }
.client-header { border-bottom: 0 !important; position: relative; }
.client-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--sd-saffron) 0 18%, var(--sd-border) 18%);
}

/* ------------------------------------------------------------ buttons */
.btn-submit, .btn-add,
button[style*="background:#12352B"], a[style*="background:#12352B"] {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, var(--sd-forest-600), var(--sd-forest-800)) !important;
  border-color: transparent !important;
  transition: transform .25s var(--ease-out), box-shadow .3s, filter .2s !important;
  box-shadow: 0 6px 16px -8px rgba(6, 42, 32, .7);
}
.btn-submit:hover:not(:disabled), .btn-add:hover,
button[style*="background:#12352B"]:hover, a[style*="background:#12352B"]:hover {
  transform: translateY(-1px); box-shadow: 0 10px 24px -10px rgba(6, 42, 32, .8), inset 0 -3px 0 var(--sd-saffron);
}
.btn-submit:active, .btn-add:active { transform: translateY(0) scale(.98); }
.btn-submit:disabled { background: #BCC6C2 !important; box-shadow: none !important; }
.btn-add-compliance, .btn-enable { transition: transform .25s var(--ease-out), box-shadow .3s, border-color .2s, background .2s !important; }
.btn-add-compliance:hover, .btn-enable:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn-ghost, .btn-back, .btn-menu, .row-action-btn, .icon-btn, .switcher-btn, .btn-home, .btn-export {
  transition: background .2s, border-color .2s, transform .25s var(--ease-out), color .2s !important;
}
.btn-ghost:hover, .row-action-btn:hover, .icon-btn:hover { transform: translateY(-1px); }
.btn-danger { transition: transform .25s var(--ease-out), box-shadow .3s !important; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 8px 20px -10px rgba(185, 28, 28, .8); }
.sd-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  background: rgba(255, 255, 255, .35); transform: scale(0); animation: sd-ripple .6s var(--ease-out) forwards;
}
@keyframes sd-ripple { to { transform: scale(2.6); opacity: 0; } }

/* ------------------------------------------------------------ form controls */
.field-input, input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  transition: border-color .2s, box-shadow .25s, background .2s;
}
.field-input:focus, input[type="text"]:focus, input[type="email"]:focus, input[type="password"]:focus,
input[type="number"]:focus, input[type="date"]:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sd-saffron) !important; box-shadow: 0 0 0 4px rgba(235, 122, 28, .14) !important; background: #fff;
}
.search-box input:focus, .company-search-box input:focus, .act-search input:focus { box-shadow: none !important; }
.field-label { letter-spacing: .2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--sd-forest-600); }

/* ------------------------------------------------------------ tables */
.mgmt-table thead th, .cd-employee-table thead th {
  background: linear-gradient(180deg, var(--sd-forest-50), #EAF2EE) !important;
  color: var(--sd-forest-600) !important;
  font-family: var(--font-display); font-size: 10.5px !important; letter-spacing: 1px !important; text-transform: uppercase;
}
.mgmt-table tbody tr, .cd-employee-table tbody tr, .cal-row, .act-row, .row-hover, .doc-row {
  transition: background .2s, box-shadow .25s !important;
}
.mgmt-table tbody tr:hover, .cd-employee-table tbody tr:hover, .cal-row:hover, .act-row:hover {
  background: #F6FAF8 !important; box-shadow: inset 3px 0 0 var(--sd-saffron);
}

/* ------------------------------------------------------------ status pills */
.status-pill, .uw-pill, .act-badge, .badge-active, .badge-disabled, .code-chip, .lf-tag, .custom-tag {
  border-radius: 999px !important; letter-spacing: .2px;
}

/* ------------------------------------------------------------ modals & toast */
.modal-overlay {
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
  backdrop-filter: blur(6px) saturate(1.2);
  background: rgba(3, 23, 15, .5) !important;
}
.modal-card { box-shadow: var(--shadow-3) !important; border-top: 4px solid var(--sd-saffron) !important; }
.fx-pop { animation: sd-fade .3s ease both; }
.fx-pop .modal-card { animation: sd-pop .45s var(--ease-spring) both; }
@keyframes sd-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sd-pop { from { opacity: 0; transform: translateY(18px) scale(.96); } to { opacity: 1; transform: none; } }
[style*="rgba(6,30,23,0.5)"], [style*="rgba(18,53,43,0.45)"], [style*="rgba(18,53,43,.45)"] {
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
#toast {
  background: linear-gradient(135deg, var(--sd-forest-700), var(--sd-forest-900)) !important;
  border-left: 4px solid var(--sd-saffron); border-radius: 12px !important;
  transition: opacity .3s, transform .45s var(--ease-spring) !important;
}
#toast .dot { background: var(--sd-saffron-2) !important; box-shadow: 0 0 10px var(--sd-saffron-2); }

/* ------------------------------------------------------------ skeletons */
.skeleton {
  background: linear-gradient(100deg, #E6ECE9 30%, #F5F9F7 50%, #E6ECE9 70%) !important;
  background-size: 300% 100% !important;
  animation: sd-shimmer 1.4s ease-in-out infinite !important;
}
@keyframes sd-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* ------------------------------------------------------------ page-enter motion (gated by theme.js) */
@keyframes sd-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#main-content.fx-enter > *,
#app.fx-enter main > *,
#app.fx-enter main > div > *,
.fx-enter .kpi-grid > *, .fx-enter .cards-grid > *, .fx-enter .hc-grid > *, .fx-enter .stat-row > *, .fx-enter .main-grid > * {
  animation: sd-rise .6s var(--ease-out) both;
}
#main-content.fx-enter > *:nth-child(2), #app.fx-enter main > *:nth-child(2), .fx-enter .kpi-grid > *:nth-child(2), .fx-enter .hc-grid > *:nth-child(2), .fx-enter .stat-row > *:nth-child(2), .fx-enter .cards-grid > *:nth-child(2), .fx-enter .main-grid > *:nth-child(2) { animation-delay: .06s; }
#main-content.fx-enter > *:nth-child(3), #app.fx-enter main > *:nth-child(3), .fx-enter .kpi-grid > *:nth-child(3), .fx-enter .hc-grid > *:nth-child(3), .fx-enter .stat-row > *:nth-child(3), .fx-enter .cards-grid > *:nth-child(3), .fx-enter .main-grid > *:nth-child(3) { animation-delay: .12s; }
#main-content.fx-enter > *:nth-child(4), #app.fx-enter main > *:nth-child(4), .fx-enter .kpi-grid > *:nth-child(4), .fx-enter .hc-grid > *:nth-child(4), .fx-enter .stat-row > *:nth-child(4), .fx-enter .cards-grid > *:nth-child(4), .fx-enter .main-grid > *:nth-child(4) { animation-delay: .18s; }
#main-content.fx-enter > *:nth-child(n+5), #app.fx-enter main > *:nth-child(n+5), .fx-enter .kpi-grid > *:nth-child(n+5), .fx-enter .hc-grid > *:nth-child(n+5), .fx-enter .stat-row > *:nth-child(n+5), .fx-enter .cards-grid > *:nth-child(n+5), .fx-enter .main-grid > *:nth-child(n+5) { animation-delay: .24s; }

/* ------------------------------------------------------------ accessibility dock (gov-style) */
.sd-a11y {
  position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 2500;
  display: flex; align-items: flex-start; font-family: var(--font-body);
}
.sd-a11y-toggle {
  width: 40px; border: 0; cursor: pointer; color: #fff;
  background: linear-gradient(180deg, var(--sd-saffron), #C2410C);
  border-radius: 12px 0 0 12px; display: flex; align-items: center; justify-content: center;
  box-shadow: -6px 8px 22px -8px rgba(194, 65, 12, .7); font-size: 20px; height: 46px; padding: 0; transition: width .25s var(--ease-out);
}
.sd-a11y-toggle:hover { width: 46px;
}
.sd-a11y-panel {
  width: 0; overflow: hidden; background: #fff; border: 1px solid var(--sd-border); border-right: 0;
  box-shadow: var(--shadow-2); transition: width .45s var(--ease-out);
}
.sd-a11y.open .sd-a11y-panel { width: 214px; }
.sd-a11y-inner { width: 214px; padding: 14px; }
.sd-a11y-title { font: 600 11px/1 var(--font-display); letter-spacing: 1.4px; color: var(--sd-muted); margin-bottom: 10px; text-transform: uppercase; }
.sd-a11y-row { display: flex; gap: 6px; margin-bottom: 12px; }
.sd-a11y-row button {
  flex: 1; border: 1px solid var(--sd-border); background: var(--sd-forest-50); color: var(--sd-ink);
  border-radius: 8px; padding: 8px 0; cursor: pointer; font: 700 13px/1 var(--font-display);
  transition: background .2s, border-color .2s, color .2s;
}
.sd-a11y-row button:hover { border-color: var(--sd-saffron); }
.sd-a11y-row button.on { background: var(--sd-forest-700); color: #fff; border-color: var(--sd-forest-700); }
html.sd-hc body { filter: contrast(1.35) saturate(1.1); }
html.sd-invert body { filter: invert(1) hue-rotate(180deg); background: #fff; }
html.sd-invert img, html.sd-invert video, html.sd-invert .brand-mark { filter: invert(1) hue-rotate(180deg); }
html.sd-links a, html.sd-links [data-action], html.sd-links button { text-decoration: underline !important; text-underline-offset: 3px; }
html.sd-calm *, html.sd-calm *::before, html.sd-calm *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
.sd-skip {
  position: fixed; left: 12px; top: -60px; z-index: 4000; background: var(--sd-forest-800); color: #fff;
  padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 13px; text-decoration: none; transition: top .25s;
}
.sd-skip:focus { top: 12px; }
@media (max-width: 768px) {
  .sd-a11y { top: auto; bottom: 88px; transform: none; }
  .sd-a11y-toggle { width: 36px; font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ------------------------------------------------------------ brand: Shardhan Consultants wordmark (Sep 2026) */
.sd-wordmark { display: block; height: auto; max-width: 100%; }
.is-side .is-wordmark { display: block; width: 172px; height: auto; margin: 0 0 6px; }
.is-side .is-rail-mark { display: none; }
.is-rail .is-side .is-rail-mark { display: block; }
.cs-brand .cs-wordmark { width: 150px; margin-bottom: 4px; }
.cs-drawer-head .cs-wordmark { width: 150px; }
.auth-brand { flex-direction: column; align-items: flex-start; gap: 10px; }
.auth-brand .sd-wordmark { width: 230px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .35)); }
.auth-splash .auth-splash-logo { width: 260px; animation: sd-float 3s ease-in-out infinite; }
.cv-err-brand .cv-err-logo { width: 150px; margin: 0 auto; }
.ed-wordmark { width: 150px; }
@media (max-width: 640px) {
  .cs-brand .cs-wordmark { width: 118px; margin-bottom: 0; }
  .auth-brand .sd-wordmark { width: 190px; }
}
