/* ============================================================
   REVSTACK ERP — Premium theme
   Deep navy + signal teal, Plus Jakarta Sans / Cormorant
   ============================================================ */
:root {
  --navy-950: #0e1424;
  --navy-900: #141b2d;
  --navy-800: #1c2740;
  --navy-700: #26355a;
  --navy: var(--navy-800);
  --ink: #172239;
  --accent: #0d97a8;
  --accent-light: #69bfc9;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --bg: #eef1f7;
  --card: #ffffff;
  --line: #e6eaf2;
  --muted: #8b96ab;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(13, 21, 38, .05), 0 4px 16px rgba(13, 21, 38, .06);
  --shadow-md: 0 4px 10px rgba(13, 21, 38, .07), 0 12px 32px rgba(13, 21, 38, .10);
  --grad-accent: linear-gradient(135deg, #42aebb 0%, #0d97a8 45%, #0a7683 100%);
  --grad-navy: linear-gradient(160deg, #182137 0%, #141b2d 55%, #0f1524 100%);
  /* Appearance customizer — every value below is overridable at runtime from <html>. */
  --accent-ink: #ffffff;
  --font-sans: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --topbar-h: 68px;
  --topnav-h: 0px;
  --topbar-offset: calc(var(--topbar-h) + var(--topnav-h));
  --content-max: 1600px;
  /* Sidebar skin (data-sidebar-skin) */
  /* Flat, not a gradient: a single dark ground reads as one surface, and the section rules and
     the active row do the separating. --sidebar-bg-deep is the same ground a shade down, used
     for the brand band and the footer so they sit behind the scrolling nav. */
  --sidebar-bg: #1b212e;
  --sidebar-bg-deep: #161b26;
  --sidebar-fg: #aab7cf;
  --sidebar-fg-strong: #ffffff;
  --sidebar-brand: #e6f3f5;
  --sidebar-muted: #5b6a85;
  --sidebar-line: rgba(255, 255, 255, .05);
  --sidebar-border: rgba(255, 255, 255, .04);
  --sidebar-rule: rgba(255, 255, 255, .09);
  --sidebar-hover: rgba(255, 255, 255, .05);
  --sidebar-active-fg: #cfeef2;
  --sidebar-chip: rgba(255, 255, 255, .04);
  --sidebar-chip-line: rgba(255, 255, 255, .1);
  --sidebar-user-fg: #e7ecf6;
  --sidebar-user-sub: #8d9bb5;
  --sidebar-action-bg: rgba(255, 255, 255, .07);
  --sidebar-action-fg: #cfd8e8;
  --sidebar-shadow: rgba(5, 10, 20, .28);
  /* Header skin (data-header-skin) */
  --header-bg: rgba(255, 255, 255, .82);
  --header-fg: var(--ink);
  --header-title: var(--navy-900);
  --header-line: var(--line);
  --header-btn-bg: #fff;
  --header-btn-line: var(--line);
  --header-btn-hover-line: #d5dbe8;
}

* { -webkit-font-smoothing: antialiased; }
body {
  background:
    radial-gradient(1100px 500px at 85% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(28, 44, 79, .08), transparent 60%),
    var(--bg);
  font-family: var(--font-sans);
  color: var(--ink);
}
::selection { background: var(--accent-soft); }

/* Custom scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c6cddb; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #a9b3c6; }

.erp-layout { display: flex; min-height: 100vh; }

/* ================= Sidebar ================= */
.erp-sidebar {
  width: 232px; flex-shrink: 0; color: var(--sidebar-fg);
  background: var(--sidebar-bg);
  border-inline-end: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  transition: width .24s ease, margin-inline-end .24s ease, inset-inline-start .25s ease, box-shadow .24s ease;
}
.erp-sidebar::-webkit-scrollbar-thumb { background: var(--sidebar-scroll, rgba(255,255,255,.12)); border-color: transparent; }

.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; position: relative; background: var(--sidebar-bg-deep, transparent); }
.brand::after {
  content: ""; position: absolute; inset-inline: 20px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
}
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--grad-accent); color: var(--accent-ink);
  font-weight: 800; font-size: 1rem; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.brand-name {
  color: var(--sidebar-brand); font-weight: 600; font-size: 1.02rem; line-height: 1.15;
  font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.25rem; letter-spacing: .3px;
}
.brand-sub { font-size: .62rem; color: var(--accent); letter-spacing: 3px; text-transform: uppercase; font-weight: 600; }
.brand-copy { min-width: 0; white-space: nowrap; transition: opacity .15s ease; }
.sidebar-collapse-toggle {
  position: fixed; z-index: 1041; top: 24px; inset-inline-start: 218px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; border-radius: 50%;
  border: 1px solid var(--accent); color: var(--accent-ink); background: var(--grad-accent);
  font-size: .78rem; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, inset-inline-start .24s ease;
}
.sidebar-collapse-toggle:hover { color: var(--accent-ink); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 50%, transparent); }
.sidebar-collapse-toggle:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

.erp-nav { padding: 8px 12px 16px; flex: 1; }
.nav-section {
  font-size: .6rem; text-transform: uppercase; letter-spacing: 1.6px;
  color: var(--sidebar-muted); margin: 14px 11px 5px; font-weight: 700;
}
.erp-nav .nav-link {
  color: var(--sidebar-fg); border-radius: 8px; padding: 7px 11px; font-size: .8125rem; font-weight: 500;
  display: flex; align-items: center; gap: 10px; margin-bottom: 1px;
  position: relative; transition: all .18s ease;
}
.erp-nav .nav-link i { width: 17px; text-align: center; font-size: .95rem; opacity: .8; transition: all .18s ease; }
.nav-group-head { display: flex; align-items: center; }
.nav-group-head .nav-link { flex: 1 1 auto; min-width: 0; }
.nav-group-toggle { flex: 0 0 26px; display: grid; place-items: center; width: 26px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; color: var(--sidebar-muted); cursor: pointer; transition: transform .18s ease, color .18s ease, background .18s ease; }
.nav-group-toggle:hover { background: var(--sidebar-hover); color: var(--sidebar-fg-strong); }
.nav-group-toggle i { font-size: .72rem; transition: transform .18s ease; }
.nav-group.open .nav-group-toggle i { transform: rotate(180deg); }
.nav-sub { display: none; margin: 1px 0 4px; padding-inline-start: 12px; border-inline-start: 1px solid var(--sidebar-rule); margin-inline-start: 20px; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-sub-link { padding: 5px 10px; font-size: .78rem; gap: 8px; }
.nav-sub .nav-sub-link i { width: 15px; font-size: .82rem; opacity: .65; }
.nav-sub .nav-sub-link.active { background: color-mix(in srgb, var(--accent) 14%, transparent); }

.erp-nav .nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-fg-strong); transform: translateX(2px); }
.erp-nav .nav-link:hover i { opacity: 1; color: var(--accent-light); }
.erp-nav .nav-link.active {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  color: var(--sidebar-active-fg); font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent);
}
.erp-nav .nav-link.active::before {
  content: ""; position: absolute; inset-inline-start: -14px; top: 20%; bottom: 20%; width: 3px;
  border-radius: 3px; background: var(--grad-accent);
}
.erp-nav .nav-link.active i { color: var(--accent); opacity: 1; }

.sidebar-foot {
  padding: 12px; color: var(--sidebar-muted); font-size: .72rem;
  border-top: 1px solid var(--sidebar-line);
}
.sidebar-foot form { margin: 0; }
.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid var(--sidebar-chip-line); border-radius: 14px; background: var(--sidebar-chip); }
.sidebar-user-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; padding: 2px; border-radius: 10px; color: var(--sidebar-user-fg); text-decoration: none; transition: background .18s ease; }
.sidebar-user-main:hover { background: var(--sidebar-hover); color: var(--sidebar-fg-strong); }
.sidebar-user-main .avatar { flex: 0 0 38px; }
.sidebar-user-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.sidebar-user-copy strong { font-size: .8rem; font-weight: 600; color: var(--sidebar-user-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy small { font-size: .68rem; color: var(--sidebar-user-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-action { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 34px; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; color: var(--sidebar-action-fg); background: var(--sidebar-action-bg); font-size: .95rem; cursor: pointer; transition: background .18s ease, color .18s ease, transform .18s ease; }
.sidebar-user-action:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.sidebar-user-action:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

@media (min-width: 992px) {
  html.erp-sidebar-collapsed .erp-sidebar { width: 80px; }
  html.erp-sidebar-collapsed .brand { justify-content: center; padding-inline: 10px; }
  html.erp-sidebar-collapsed .brand-copy,
  html.erp-sidebar-collapsed .nav-section { display: none; }
  html.erp-sidebar-collapsed:not(.erp-sidebar-peek) .nav-sub,
  html.erp-sidebar-collapsed:not(.erp-sidebar-peek) .nav-group-toggle { display: none; }
  html.erp-sidebar-collapsed .sidebar-collapse-toggle { inset-inline-start: 66px; }
  html.erp-sidebar-collapsed .erp-nav { padding: 38px 10px 18px; }
  html.erp-sidebar-collapsed .erp-nav .nav-link { justify-content: center; gap: 0; padding: 10px; margin-bottom: 4px; }
  html.erp-sidebar-collapsed .erp-nav .nav-link i { width: 20px; font-size: 1.08rem; }
  html.erp-sidebar-collapsed .erp-nav .nav-link .nav-label { display: none; }
  html.erp-sidebar-collapsed .erp-nav .nav-link:hover { transform: none; }
  html.erp-sidebar-collapsed .erp-nav .nav-link.active::before { inset-inline-start: -10px; }
  html.erp-sidebar-collapsed .sidebar-foot { padding: 12px 10px; }
  html.erp-sidebar-collapsed .sidebar-user { flex-direction: column; gap: 6px; padding: 8px 4px; }
  html.erp-sidebar-collapsed .sidebar-user-copy { display: none; }
  html.erp-sidebar-collapsed .sidebar-user-main { flex: 0 0 auto; justify-content: center; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-sidebar { width: 264px; margin-inline-end: -184px; z-index: 1040; box-shadow: 18px 0 38px var(--sidebar-shadow); }
  html.erp-sidebar-collapsed.erp-sidebar-peek .brand { justify-content: flex-start; padding: 22px 20px 18px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .brand-copy { display: block; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .sidebar-collapse-toggle { inset-inline-start: 250px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-nav { padding: 14px 14px 20px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .nav-section { display: block; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-nav .nav-link { justify-content: flex-start; gap: 12px; padding: 9px 14px; margin-bottom: 2px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-nav .nav-link i { width: 18px; font-size: 1rem; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-nav .nav-link .nav-label { display: inline; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-nav .nav-link:hover { transform: translateX(2px); }
  html.erp-sidebar-collapsed.erp-sidebar-peek .erp-nav .nav-link.active::before { inset-inline-start: -14px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .sidebar-foot { padding: 12px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .sidebar-user { flex-direction: row; gap: 8px; padding: 6px; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .sidebar-user-copy { display: flex; }
  html.erp-sidebar-collapsed.erp-sidebar-peek .sidebar-user-main { flex: 1 1 auto; justify-content: flex-start; }
}

/* ================= Main / Topbar ================= */
.erp-main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.erp-topbar {
  background: var(--header-bg); color: var(--header-fg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--header-line);
  padding: 14px 28px;
  display: flex; align-items: center;
  position: sticky; top: 0; z-index: 100;
}
.page-title {
  font-size: 1.28rem; font-weight: 700; margin: 0; color: var(--header-title);
  letter-spacing: -.02em;
}
.page-title::after {
  content: ""; display: block; width: 34px; height: 3px; margin-top: 4px;
  border-radius: 3px; background: var(--grad-accent);
}
.erp-topbar .btn-light {
  background: var(--header-btn-bg); color: var(--header-fg);
  border: 1px solid var(--header-btn-line); border-radius: 12px;
  box-shadow: var(--shadow-sm); transition: all .18s ease;
}
.erp-topbar .btn-light:hover { color: var(--header-fg); border-color: var(--header-btn-hover-line); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.theme-toggle { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.theme-toggle i { font-size: 1rem; transition: transform .25s ease; }
.theme-toggle:hover i { transform: rotate(16deg); }
.topbar-menu-toggle { color: var(--header-fg); }

.erp-content { padding-block: 20px 28px; padding-inline: 18px 28px; flex: 1; width: 100%; max-width: var(--content-max); margin-inline: auto; }
.impersonation-banner{position:absolute;top:13px;inset-inline-start:50%;z-index:101;display:flex;align-items:center;gap:10px;max-width:42%;padding:5px 6px 5px 11px;color:#392b0b;background:#fff3cd;border:1px solid #e7cf82;border-radius:12px;box-shadow:var(--shadow-sm);font-size:.72rem;transform:translateX(-50%);white-space:nowrap}.impersonation-banner span{overflow:hidden;text-overflow:ellipsis}.impersonation-banner form{flex:0 0 auto;margin:0}.impersonation-banner .btn{padding:5px 9px;font-size:.68rem}
.dashboard-intro { position: relative; z-index: 10; }
.erp-footer { padding: 14px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.erp-footer a { color: inherit; font-weight: 600; text-decoration: none; border-bottom: 1px solid transparent; }
.erp-footer a:hover, .erp-footer a:focus-visible { color: var(--accent); border-bottom-color: currentColor; }

/* ================= Cards ================= */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .25s ease, transform .25s ease;
}
.card-header {
  background: transparent; border-bottom: 1px solid var(--line);
  font-weight: 700; color: var(--navy-900); font-size: .95rem;
  padding: 14px 20px; letter-spacing: -.01em;
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

.metric-card { position: relative; overflow: hidden; border: 1px solid var(--line); }
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.metric-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad-accent); opacity: 0;
  transition: opacity .25s ease;
}
.metric-card:hover::before { opacity: 1; }
.metric-card .icon {
  width: 50px; height: 50px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.35rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);
}
.metric-value {
  font-size: 1.55rem; font-weight: 800; color: var(--navy-900);
  letter-spacing: -.03em; line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.metric-label {
  font-size: .68rem; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--muted); font-weight: 700; margin-top: 2px;
}

/* ================= Avatars ================= */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: #fff; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(13, 21, 38, .22), inset 0 1px 0 rgba(255, 255, 255, .25);
  border: 2px solid rgba(255, 255, 255, .85); overflow: hidden;
}
.avatar-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ================= Tables ================= */
.table { --bs-table-hover-bg: #f7f9fd; margin-bottom: 0; }
.table thead th {
  font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--muted); font-weight: 700;
  background: #fafbfe; border-bottom: 1px solid var(--line) !important;
  padding: 12px 16px;
}
.table td { vertical-align: middle; font-size: .875rem; padding: 12px 16px; border-color: #f0f3f9; }
.table tbody tr { transition: background .12s ease; }
.table-danger td { background: #fdf1f2 !important; }
.table-warning td { background: #fdf8ec !important; }

/* ================= Badges & buttons ================= */
.badge {
  font-weight: 600; letter-spacing: .2px; padding: .38em .7em;
  border-radius: 20rem; font-size: .7rem;
}
.badge.text-bg-light { background: #f2f5fa !important; color: #5a677e !important; border-color: var(--line) !important; }

.btn { border-radius: 11px; font-weight: 600; letter-spacing: .1px; transition: all .18s ease; }
.btn-primary {
  background: linear-gradient(150deg, #2c3c66, #1a2540);
  border: 1px solid #1a2540;
  box-shadow: 0 3px 10px rgba(22, 35, 61, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary:hover {
  background: linear-gradient(150deg, #35497a, #223054);
  border-color: #223054; transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(22, 35, 61, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-accent {
  background: var(--grad-accent); color: var(--accent-ink); border: none;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.btn-accent:hover { color: var(--accent-ink); transform: translateY(-1px); box-shadow: 0 7px 18px color-mix(in srgb, var(--accent) 48%, transparent); }
.btn-sm { border-radius: 9px; }
.btn-outline-secondary, .btn-outline-primary, .btn-outline-success { border-width: 1.5px; }

/* ================= Forms ================= */
.form-control, .form-select {
  border-radius: 11px; border-color: #dde3ee; padding: .5rem .85rem;
  transition: all .18s ease; font-size: .9rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--accent) 18%, transparent);
}
.form-label { color: #5a677e; font-weight: 600; }
.input-group-text { border-radius: 11px 0 0 11px; background: #f7f9fd; border-color: #dde3ee; color: var(--muted); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-switch .form-check-input:focus { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--accent) 18%, transparent); }

/* ================= Dropdowns / modals / tabs ================= */
.dropdown-menu {
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 8px;
  animation: ddIn .16s ease;
}
@keyframes ddIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dropdown-item { border-radius: 9px; padding: 8px 12px; font-size: .875rem; }
.dropdown-item:hover { background: #f4f6fb; }
.dropdown-item.active { background: var(--accent-soft); color: var(--navy-900); }
.dropdown-header { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; color: var(--muted); }

.modal-content { border: none; border-radius: 20px; box-shadow: 0 24px 70px rgba(10, 16, 32, .35); }
.modal-header { border-bottom: 1px solid var(--line); padding: 18px 24px; }
.modal-title { font-weight: 700; letter-spacing: -.01em; color: var(--navy-900); }
.modal-body { padding: 22px 24px; }
.modal-footer { border-top: 1px solid var(--line); padding: 14px 24px; }
.modal-backdrop.show { opacity: .55; backdrop-filter: blur(2px); }
.offcanvas-backdrop {
  background: rgba(13, 21, 38, .18);
}
.offcanvas-backdrop.show {
  opacity: 1;
  backdrop-filter: none;
}
.offcanvas.contact-offcanvas {
  --bs-offcanvas-width: min(680px, 100vw);
  width: var(--bs-offcanvas-width);
}
.contact-offcanvas form,
.contact-offcanvas .offcanvas-body { min-height: 0; }
.contact-offcanvas .offcanvas-footer {
  background: #fff;
  box-shadow: 0 -8px 24px rgba(13, 21, 38, .06);
}

.nav-tabs { border-bottom: 1px solid var(--line); gap: 4px; }
.nav-tabs .nav-link {
  border: none; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 600; font-size: .875rem;
  padding: 10px 18px;
}
.nav-tabs .nav-link:hover { color: var(--navy-900); background: #f4f6fb; }
.nav-tabs .nav-link.active {
  color: var(--navy-900); background: transparent;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.alert { border-radius: 14px; border: 1px solid var(--line); }
.alert-danger { background: #fdf1f2; border-color: #f5d4d8; color: #8c2f3b; }
.alert-success { background: #eefaf3; border-color: #cfeeda; color: #1d6b41; }
.alert-light { background: #fff; }
.kanban-col-head .badge { background: #fff !important; color: var(--muted) !important; border: 1px solid var(--line); }
.kanban-card .name { font-weight: 700; font-size: .88rem; letter-spacing: -.01em; }

/* ================= Login ================= */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 600px at 80% 10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    radial-gradient(700px 500px at 10% 90%, rgba(63, 96, 160, .18), transparent 55%),
    var(--grad-navy);
  position: relative; overflow: hidden;
}
.login-page::before, .login-page::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
}
.login-page::before { width: 620px; height: 620px; top: -220px; inset-inline-end: -160px; }
.login-page::after { width: 900px; height: 900px; top: -340px; inset-inline-end: -280px; }

.login-card {
  max-width: 440px; width: 100%; border-radius: 24px; border: none;
  box-shadow: 0 30px 80px rgba(4, 8, 18, .55), 0 0 0 1px rgba(255, 255, 255, .06);
  animation: cardIn .5s cubic-bezier(.22, .8, .3, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
.login-title { font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; letter-spacing: .02em; }
/* Password label and its recovery link share a row; baseline alignment keeps the label's own
   bottom margin as the gap to the field, so spacing matches the rows above it. */
.auth-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.auth-forgot { flex: 0 0 auto; text-decoration: none; }
.auth-forgot:hover { text-decoration: underline; }

.user-pick {
  cursor: pointer; border: 1.5px solid var(--line); border-radius: 14px;
  transition: all .18s ease; background: #fff;
}
.user-pick:hover { border-color: #cfd7e6; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.user-pick.selected {
  border-color: var(--accent);
  background: linear-gradient(160deg, #f2fcfd, #e4f8fb);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ================= Misc ================= */
.text-accent { color: var(--accent) !important; }
/* Links sit in the accent family — a deeper teal than the accent itself so they stay legible
   as body-copy links, with the accent proper reserved for hover. */
a { color: #0a7683; }
a:hover { color: var(--accent); }
html[data-theme="dark"] a { color: var(--accent-light); }
.card .border-bottom { border-color: #f0f3f9 !important; }

/* Page fade-in */
.erp-content > * { animation: pageIn .35s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= Responsive columns ================
   No inner y-scroll: tables shed low-priority columns as the
   viewport narrows (xl <1400, lg <1200, md <992); below 768px
   the mobile card view takes over entirely.
   If a table still overflows, first column stays pinned. */
.table-desktop { overflow-x: auto; position: relative; }
.table-desktop th:first-child,
.table-desktop td:first-child {
  position: sticky; inset-inline-start: 0; z-index: 3;
  background: #fff;
}
.table-desktop thead th:first-child { background: #fafbfe; }
.table-desktop tbody tr:hover td:first-child { background: #f7f9fd; }
.table-desktop tr.table-danger td:first-child { background: #fdf1f2 !important; }
.table-desktop tr.table-warning td:first-child { background: #fdf8ec !important; }

/* Per-table column priorities (nth-child = column index) */
@media (max-width: 1399.98px) {
  .t-contacts th:nth-child(6), .t-contacts td:nth-child(6),
  .t-contacts th:nth-child(10), .t-contacts td:nth-child(10),
  .t-meetings th:nth-child(7), .t-meetings td:nth-child(7),
  .t-documents th:nth-child(6), .t-documents td:nth-child(6),
  .t-invoices th:nth-child(6), .t-invoices td:nth-child(6),
  .t-procurement th:nth-child(8), .t-procurement td:nth-child(8),
  .t-compliance th:nth-child(2), .t-compliance td:nth-child(2),
  .t-notes th:nth-child(1), .t-notes td:nth-child(1),
  .t-audit th:nth-child(1), .t-audit td:nth-child(1),
  .t-billing th:nth-child(4), .t-billing td:nth-child(4) { display: none; }
}
@media (max-width: 1199.98px) {
  .t-contacts th:nth-child(3), .t-contacts td:nth-child(3),
  .t-contacts th:nth-child(5), .t-contacts td:nth-child(5),
  .t-tasks th:nth-child(5), .t-tasks td:nth-child(5),
  .t-meetings th:nth-child(1), .t-meetings td:nth-child(1),
  .t-meetings th:nth-child(5), .t-meetings td:nth-child(5),
  .t-documents th:nth-child(4), .t-documents td:nth-child(4),
  .t-documents th:nth-child(5), .t-documents td:nth-child(5),
  .t-invoices th:nth-child(4), .t-invoices td:nth-child(4),
  .t-invoices th:nth-child(7), .t-invoices td:nth-child(7),
  .t-procurement th:nth-child(5), .t-procurement td:nth-child(5),
  .t-procurement th:nth-child(6), .t-procurement td:nth-child(6),
  .t-compliance th:nth-child(4), .t-compliance td:nth-child(4),
  .t-compliance th:nth-child(8), .t-compliance td:nth-child(8),
  .t-notes th:nth-child(5), .t-notes td:nth-child(5),
  .t-notes th:nth-child(7), .t-notes td:nth-child(7),
  .t-audit th:nth-child(5), .t-audit td:nth-child(5),
  .t-billing th:nth-child(3), .t-billing td:nth-child(3) { display: none; }
}
@media (max-width: 991.98px) {
  .t-contacts th:nth-child(4), .t-contacts td:nth-child(4),
  .t-contacts th:nth-child(8), .t-contacts td:nth-child(8),
  .t-contacts th:nth-child(9), .t-contacts td:nth-child(9),
  .t-tasks th:nth-child(3), .t-tasks td:nth-child(3),
  .t-tasks th:nth-child(6), .t-tasks td:nth-child(6),
  .t-meetings th:nth-child(4), .t-meetings td:nth-child(4),
  .t-meetings th:nth-child(6), .t-meetings td:nth-child(6),
  .t-documents th:nth-child(2), .t-documents td:nth-child(2),
  .t-invoices th:nth-child(5), .t-invoices td:nth-child(5),
  .t-procurement th:nth-child(3), .t-procurement td:nth-child(3),
  .t-compliance th:nth-child(5), .t-compliance td:nth-child(5),
  .t-compliance th:nth-child(7), .t-compliance td:nth-child(7),
  .t-notes th:nth-child(3), .t-notes td:nth-child(3),
  .t-notes th:nth-child(4), .t-notes td:nth-child(4),
  .t-audit th:nth-child(3), .t-audit td:nth-child(3),
  .t-audit th:nth-child(4), .t-audit td:nth-child(4),
  .t-billing th:nth-child(6), .t-billing td:nth-child(6) { display: none; }
}

/* ================= Toasts ================= */
 /* ================= Pagination ================= */
.erp-pager {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--line);
  flex-wrap: wrap; gap: 10px;
}
.pagination { margin: 0; }
.pagination .page-link {
  border-radius: 9px; margin: 0 2px; border-color: var(--line);
  color: var(--ink); font-size: .8rem; font-weight: 600;
  min-width: 32px; text-align: center;
}
.pagination .page-link:hover { background: #f4f6fb; color: var(--navy-900); }
.pagination .page-item.active .page-link {
  background: var(--grad-accent); border-color: var(--accent);
  color: var(--accent-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}
.pagination .page-item.disabled .page-link { color: #c2cad8; background: transparent; }

/* ================= Mobile card list (HRMS-style) ================= */
.mobile-card-list { display: none; }
.mobile-card {
  border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 12px; background: var(--card);
  box-shadow: var(--shadow-sm);
}
.mobile-card-header { display: flex; align-items: center; gap: 11px; }
.mobile-card-title { flex: 1; min-width: 0; }
.mobile-card-name {
  font-weight: 700; font-size: .92rem; line-height: 1.25; color: var(--navy-900);
  letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mobile-card-sub { font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-card-badges { margin-inline-start: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.mobile-card-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f3f9;
}
.mobile-card-grid .label {
  display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); font-weight: 700;
}
.mobile-card-grid .value { display: block; font-size: .82rem; word-break: break-word; color: var(--ink); }
.mobile-card-actions {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid #f0f3f9;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.mobile-card-actions .btn { flex: 1; min-width: 100px; }

@media (max-width: 767.98px) {
  .table-desktop { display: none !important; }
  .mobile-card-list { display: block; padding: 14px; }
}

/* ================= Unified data-list experience ================= */
.data-toolbar {
  border: 1px solid rgba(27, 44, 76, .08);
  background: linear-gradient(135deg, #fff 0%, #fbfcff 72%, #e8f6f8 140%);
  box-shadow: 0 8px 24px rgba(20, 34, 61, .06);
}
.data-toolbar .card-body { padding: 16px 18px; }
.data-toolbar .form-label { text-transform: uppercase; letter-spacing: .65px; font-size: .62rem !important; }
.data-toolbar .form-control, .data-toolbar .form-select { min-height: 38px; background-color: #fff; }
.toolbar-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.toolbar-actions .btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.data-list-card { overflow: hidden; box-shadow: 0 10px 30px rgba(20, 34, 61, .07); }
.data-list-card > .card-header { background: linear-gradient(180deg, #fff, #fcfdff); }
.list-count { color: var(--muted); font-size: .75rem; font-weight: 600; }
.data-table tbody tr:hover td { background-color: #f7f9fd; }
.data-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.empty-state { display: flex; min-height: 140px; align-items: center; justify-content: center; flex-direction: column; gap: 8px; color: var(--muted); font-size: .85rem; }
.empty-state i { font-size: 1.7rem; color: #b7c0d0; }
.pager-summary { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.pager-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent); }
.pager-controls, .page-size { display: flex; align-items: center; gap: 9px; }
.page-size label { color: var(--muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.page-size .form-select { width: 72px; min-height: 34px; }
.pagination .page-link { min-height: 34px; display: flex; align-items: center; justify-content: center; }
.mobile-card { position: relative; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.mobile-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--grad-accent); }
.mobile-card:active { transform: scale(.992); }
.mobile-card-actions form { flex: 1; display: flex; }
.mobile-card-actions form .btn { width: 100%; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; white-space: nowrap; }
.action-icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 9px; }
.action-icon:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(20,34,61,.12); }
.user-directory-card { overflow: hidden; }
.user-directory-toolbar { padding-bottom: 14px; }
.user-directory-list { border-top: 1px solid var(--line); }
.user-directory-list .card-header { border-radius: 0; }
.user-directory-list > .erp-pager { border-radius: 0 0 var(--radius) var(--radius); }
.user-toolbar-head { display: flex; align-items: center; gap: 16px; }
.user-toolbar-head > div:first-child { flex: 0 0 auto; }
.user-toolbar-actions { width: auto; margin-inline-start: 0; justify-content: flex-end; flex-wrap: wrap; }
.user-toolbar-actions > .btn,
.user-toolbar-actions > .dropdown { flex: 0 0 auto; }
.user-toolbar-submit { display: flex; justify-content: flex-start; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.advanced-filter-panel { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #f7f9fc; }
.user-directory-title { min-width: 128px; }
.user-header-search { position: relative; display: flex; align-items: center; flex: 1 1 auto; max-width: none; min-width: 240px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.user-header-search > .bi-search { margin-inline-start: 12px; color: var(--muted); }
.user-header-search-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 38px; width: 38px; height: 38px; padding: 0; border: 0; color: var(--muted); background: transparent; }
.user-header-search-button:hover { color: var(--navy-900); background: #f3f6fb; }
.user-header-search input { min-width: 0; flex: 1; height: 100%; padding: 0 10px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .82rem; }
.user-header-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-inline-start: 1px solid var(--line); color: var(--muted); background: transparent; text-decoration: none; }
.user-header-icon:hover { color: var(--navy-900); background: #f3f6fb; }
.user-header-icon.disabled { color: #c5ccd8; cursor: not-allowed; background: #fafbfc; }
.user-header-icon .filter-active-dot { position: absolute; top: 7px; inset-inline-end: 6px; margin: 0; }
.user-add-button { height: 38px; display: inline-flex; align-items: center; white-space: nowrap; }
.advanced-filter-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: .82rem; font-weight: 700; color: var(--navy-900); }
.advanced-filter-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 5px; }
.pager-exports { display: flex; align-items: center; gap: 5px; }
.pager-label { margin-inline-end: 3px; color: var(--muted); font-size: .72rem; font-weight: 600; }
.pager-exports a { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--card); text-decoration: none; }
.pager-exports a:hover { color: var(--navy-900); border-color: #aebbd0; background: #f4f6fb; }
.pager-exports .export-csv { color: #18794e; }
.pager-exports .export-excel { color: #107c41; }
.pager-exports .export-pdf { color: #c62828; }
.pager-exports .export-print { color: #334155; }
.user-header-exports + .user-toolbar-actions { margin-inline-start: -8px; }
.active-filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.active-filter-chips a { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 20px; color: var(--ink); background: var(--accent-soft); font-size: .7rem; font-weight: 600; text-decoration: none; }
.active-filter-chips a:hover { border-color: var(--accent); }
.bulk-user-toolbar { display: none; align-items: center; gap: 8px; padding: 9px 14px; border-top: 1px solid var(--line); background: #f7f9fc; }
.bulk-user-toolbar.show { display: flex; }
#bulkEntityTypeForm, #bulkReferenceForm, #bulkTenantForm, #bulkRegistrationForm, #bulkDomainForm { display: flex; }
.bulk-user-toolbar > div { margin-inline-end: auto; color: var(--muted); font-size: .76rem; white-space: nowrap; }
.bulk-user-toolbar .form-select { width: 180px; }
html[data-theme="dark"] .bulk-user-toolbar { background: #111c2c; border-color: #334155; }
html[data-theme="dark"] .active-filter-chips a { background: #172235; border-color: #40506a; color: #d9e3f2; }
html[data-theme="dark"] .user-header-search-button:hover { background: #172235; }

@media (max-width: 420px) {
  .user-directory-card .erp-pager { gap: 4px; padding: 10px 7px; }
  .user-directory-card .pager-summary { gap: 3px; font-size: .66rem; white-space: nowrap; }
  .user-directory-card .pager-dot { display: none; }
  .user-directory-card .page-size { gap: 4px; }
  .user-directory-card .page-size label { font-size: .58rem; }
  .user-directory-card .page-size .form-select { width: 54px; padding-inline: 7px 20px; }
  .user-directory-card .pagination .page-link { min-width: 27px; min-height: 30px; padding: 4px 6px; }
  .user-directory-card .mobile-card-actions .btn { min-width: 0; }
}
.select-column { width: 38px; }
.table-sort { display: inline-flex; align-items: center; gap: 3px; color: inherit; text-decoration: none; }
.table-sort:hover { color: var(--navy-900); }
.table-sort i { font-size: .65rem; opacity: .45; }
.user-archived { opacity: .7; }
.filter-active-dot { display: inline-block; width: 7px; height: 7px; margin-inline-start: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); vertical-align: 1px; }

/* ================= Permission matrix ================= */
.role-details-card { border-color: rgba(27,44,76,.1); box-shadow: 0 8px 24px rgba(20,34,61,.06); }
.permission-toolbar { position: sticky; top: var(--topbar-offset); z-index: 20; border-color: rgba(27,44,76,.1); box-shadow: 0 8px 24px rgba(20,34,61,.08); }
.permission-search { position: relative; width: min(100%,460px); }
.permission-search i { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: #8b96a9; }
.permission-search .form-control { padding-inline-start: 40px; }
.permission-bulk-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.permission-group { overflow: hidden; border-color: #e1e6ef; box-shadow: 0 5px 18px rgba(20,34,61,.045); }
.permission-group-header { display: flex; align-items: center; justify-content: space-between; min-height: 52px; background: #f7f9fc; }
.permission-count { margin-inline-start: 8px; color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.permission-table { min-width: 980px; }
.permission-table th { text-align: center; color: #69758a; font-size: .68rem; text-transform: uppercase; letter-spacing: .55px; white-space: nowrap; }
.permission-table td { text-align: center; vertical-align: middle; height: 58px; }
.permission-table .permission-module-column { position: sticky; inset-inline-start: 0; z-index: 2; width: 260px; min-width: 260px; text-align: start; background: #fff; box-shadow: 1px 0 0 #e8ecf3; }
.permission-table thead .permission-module-column { z-index: 4; background: #fbfcfe; }
.permission-module-column strong { display: block; color: var(--navy); font-size: .85rem; }
.permission-module-column span { display: block; color: #98a2b3; font: .7rem ui-monospace,SFMono-Regular,Menlo,monospace; }
.permission-check { width: 1.25rem; height: 1.25rem; cursor: pointer; border-color: #b9c3d2; }
.permission-check:checked, .group-access:checked { background-color: var(--accent); border-color: var(--accent); }
.permission-na { color: #d3d9e3; }
.permission-extra-column { min-width: 190px; }
.extra-permission { display: inline-flex; align-items: center; gap: 4px; margin: 3px 8px 3px 0; color: #58657a; font-size: .7rem; white-space: nowrap; }
.extra-permission .permission-check { width: 1rem; height: 1rem; }
.role-form-footer { position: sticky; bottom: 0; z-index: 22; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; margin: 0 -4px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -8px 28px rgba(20,34,61,.09); backdrop-filter: blur(10px); }

/* ================= Account center ================= */
.account-hero { background: linear-gradient(135deg,#fff 0%,#f9fbff 70%,#e4f8fb 130%); border-color: rgba(27,44,76,.08); box-shadow: 0 10px 30px rgba(20,34,61,.07); }
.account-security-badge { display: flex; align-items: center; gap: 10px; min-width: 245px; padding: 12px 15px; border-radius: 14px; }
.account-security-badge.secure { color: #12633b; background: #eaf8f0; border: 1px solid #c7ecd6; }
.account-security-badge.attention { color: #8a5c00; background: #fff7df; border: 1px solid #f0dfaa; }
.account-security-badge > i { font-size: 1.55rem; }
.account-security-badge strong,.account-security-badge small { display: block; }
.account-security-badge small { opacity: .78; font-size: .7rem; }
.security-event-icon,.security-status-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; background: #f2f5fa; color: var(--navy); }
.security-status-icon.secure { background: #dff5e8; color: #198754; }
.account-fact { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0f5; font-size: .85rem; }
.account-fact:last-child { border-bottom: 0; }
.account-fact span { color: var(--muted); }
.profile-photo-editor { display: flex; align-items: center; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fafbfe; }
.profile-photo-preview { display: inline-flex; flex: 0 0 auto; }
.profile-photo-preview .avatar { width: 76px !important; height: 76px !important; font-size: 1.8rem !important; }
.profile-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.profile-photo-controls { flex: 1; min-width: 0; }
.user-photo-upload { display: flex; align-items: center; gap: 14px; }
.user-photo-upload-preview { display: inline-flex; flex: 0 0 42px; width: 42px; height: 42px; }
.user-photo-upload-preview .avatar { overflow: hidden; }
.contact-select-choice { display: flex; align-items: center; gap: 9px; min-width: 0; }
.contact-select-choice img { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.contact-select-choice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-dropdown .contact-select-choice { padding: 2px 0; }
.user-photo-upload-button { display: flex; align-items: center; justify-content: center; gap: 9px; flex: 1; min-width: 0; height: 42px; padding: 0 16px; border: 1px solid var(--navy); border-radius: 7px; color: var(--navy); background: var(--card); font-weight: 600; cursor: pointer; transition: background .15s ease,color .15s ease,border-color .15s ease; }
.user-photo-upload-button i { color: #7c83e8; font-size: 1.15rem; }
.user-photo-upload-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-photo-upload-button:hover { color: #fff; background: var(--navy); }
.user-photo-upload-button:hover i { color: #fff; }
.user-photo-upload-reset { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--card); }
.user-photo-upload-reset:hover { color: #fff; border-color: var(--navy); background: var(--navy); }
.user-view-identity { display: flex; align-items: center; gap: 18px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); }
.user-view-identity .avatar { flex: 0 0 auto; }
.user-view-detail { height: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafd; }
.user-view-detail span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .69rem; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.user-view-detail strong { display: block; color: var(--ink); font-size: .85rem; overflow-wrap: anywhere; }
.user-view-print-heading { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; }
  .erp-sidebar, .erp-topbar, .erp-footer, .erp-shell, .erp-main, .erp-content { display: block !important; width: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .erp-content > * { animation: none !important; }
  .user-view-page { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; transform: none !important; }
  .user-view-print-heading { display: flex; align-items: flex-end; justify-content: space-between; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 2px solid #1b2c4c; color: #111; }
  .user-view-print-heading strong { font-size: 16pt; }
  .user-view-print-heading span { color: #555; font-size: 9pt; text-transform: uppercase; letter-spacing: .6px; }
  .user-view-page .card-header { padding: 12px 0; border-bottom: 1px solid #bbb; border-radius: 0 !important; color: #111 !important; }
  .user-view-page .card-body { padding: 18px 0 0; }
  .user-view-identity { break-inside: avoid; border-color: #bbb; }
  .user-view-identity h4, .user-view-detail strong { color: #111 !important; }
  .user-view-detail { break-inside: avoid; border-color: #bbb !important; background: #fff !important; box-shadow: none !important; }
  .user-view-detail span, .user-view-identity .text-muted, .user-view-page .text-muted { color: #555 !important; }
  .user-view-page .badge { color: #111 !important; background: #fff !important; border: 1px solid #777 !important; }
  /* Invoice detail prints as the document: no toolbar, no action controls. */
  .invoice-detail-toolbar, .invoice-actions, .invoice-side-card form { display: none !important; }
  .invoice-detail-grid { display: block !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: #fff !important; }
  .invoice-sidebar { border: 0 !important; padding: 0 !important; }
  .invoice-paper, .invoice-side-card { padding: 0 0 14px !important; border-color: #bbb !important; background: #fff !important; box-shadow: none !important; break-inside: avoid; }
  .invoice-paper h2, .invoice-meta strong, .invoice-summary strong, .invoice-payment-info strong, .invoice-side-card h3, .invoice-line-card th { color: #111 !important; }
  .invoice-kicker, .invoice-meta span, .invoice-paper-head > div > div, .invoice-side-card p, .invoice-side-card > span, .invoice-summary > div, .invoice-payment-info > div { color: #555 !important; }
  .invoice-summary .invoice-total, .invoice-total-box { background: #f4f4f4 !important; color: #111 !important; }
  .invoice-summary .invoice-total strong, .invoice-total-box strong { color: #111 !important; }
  .payment-received { background: #fff !important; border-color: #777 !important; color: #111 !important; }
}
.account-nav { display: inline-flex; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(20,34,61,.05); }
.account-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 10px; color: #667085; font-size: .82rem; font-weight: 700; text-decoration: none; }
.account-nav a:hover { color: var(--navy); background: #f6f8fc; }
.account-nav a.active { color: #fff; background: var(--navy); box-shadow: 0 4px 12px rgba(20,34,61,.2); }
.session-agent { max-width: 420px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .72rem; }
.security-checklist { list-style: none; padding: 0; }
.security-checklist li { position: relative; padding-block: 8px; padding-inline: 27px 0; color: var(--muted); font-size: .82rem; }
.security-checklist li::before { content: "\F26B"; position: absolute; inset-inline-start: 0; font-family: "bootstrap-icons"; color: #a9b2c0; }
.security-checklist li.done::before { content: "\F26A"; color: #198754; }

@media (max-width: 767.98px) {
  .profile-photo-editor { align-items: flex-start; }
  .erp-content { padding: 14px 12px; }
  .data-toolbar .row > [class*="col"] { flex: 0 0 100%; width: 100%; }
  .data-toolbar .advanced-filter-panel .row > [class*="col-6"] { flex: 0 0 50%; width: 50%; }
  .data-toolbar .toolbar-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .data-toolbar .toolbar-actions .btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .data-list-card { border-radius: 18px; background: transparent; box-shadow: none; border: 0; }
  .data-list-card > .card-header { border: 1px solid var(--line); border-radius: 14px !important; margin-bottom: 10px; padding: 12px 14px; }
  .data-list-card .mobile-card-list { padding: 0; }
  .mobile-card { border-radius: 18px; padding: 16px; box-shadow: 0 7px 22px rgba(20,34,61,.08); }
  .mobile-card-grid { grid-template-columns: 1fr 1fr; }
  .erp-pager { background: #fff; border: 1px solid var(--line); border-radius: 16px; justify-content: center; padding: 14px; }
  .pager-summary { width: 100%; justify-content: center; }
  .pager-controls { width: 100%; flex-direction: column; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .permission-toolbar { top: 61px; }
  .permission-bulk-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .permission-group-header { align-items: flex-start; gap: 10px; }
  .permission-table .permission-module-column { width: 170px; min-width: 170px; }
  .role-form-footer { flex-direction: column; align-items: stretch; gap: 10px; }
  .role-form-footer > div:last-child { display: grid !important; grid-template-columns: 1fr 1fr; }
  .account-nav { display: grid; grid-template-columns: repeat(3,1fr); width: 100%; }
  .account-nav a { justify-content: center; padding: 9px 7px; }
  .account-security-badge { min-width: 0; width: 100%; }
  .user-directory-toolbar { padding: 14px; }
  .data-list-card.user-directory-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: 0 10px 30px rgba(20,34,61,.08); }
  .user-directory-list { border-top: 1px solid var(--line); }
  .user-directory-card .mobile-card-list { padding: 0; }
  .user-directory-card .mobile-card { margin: 0; padding: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; background: var(--card); }
  .user-directory-card .mobile-card:last-child { border-bottom: 0; }
  .user-directory-card .erp-pager { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); background: var(--card); box-shadow: none; }
  .user-directory-card .erp-pager { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 8px; padding: 12px; }
  .user-directory-card .pager-summary { grid-column: 1; width: auto; justify-content: flex-start; white-space: nowrap; }
  .user-directory-card .pager-controls { display: contents; }
  .user-directory-card .page-size { grid-column: 2; justify-self: center; }
  .user-directory-card .pager-controls > nav { grid-column: 3; justify-self: end; }
  .user-directory-card .pagination { flex-wrap: nowrap; justify-content: flex-end; }
  .bulk-user-toolbar.show { display: grid; grid-template-columns: 1fr auto; }
  #bulkEntityTypeForm, #bulkReferenceForm { display: grid; grid-template-columns: 1fr auto; }
  .bulk-user-toolbar > div { grid-column: 1 / -1; margin: 0; }
  .bulk-user-toolbar .form-select { width: 100%; }
  .user-toolbar-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; }
  .user-toolbar-head > div:first-child { grid-column: 1; grid-row: 1; width: 100%; }
  .user-header-exports { grid-column: 2; grid-row: 1; justify-self: end; }
  .user-header-search { grid-column: 1 / -1; grid-row: 2; flex-basis: 42px; width: 100%; max-width: none; min-width: 0; }
  .data-toolbar .user-toolbar-actions { grid-column: 1 / -1; grid-row: 3; display: grid; grid-template-columns: 1fr; width: 100%; margin-inline-start: 0; }
  .user-toolbar-actions > .btn,
  .user-toolbar-actions > .dropdown,
  .user-toolbar-actions > .dropdown > .btn { width: 100%; }
  .user-toolbar-submit .btn { width: 100%; }
  .advanced-filter-panel { padding: 12px; }
}

/* Mobile sidebar */
@media (max-width: 991.98px) {
  .erp-sidebar { position: fixed; inset-inline-start: -280px; z-index: 1050; transition: inset-inline-start .25s ease; height: 100vh; box-shadow: 0 0 60px rgba(0,0,0,.4); }
  .erp-sidebar.open { inset-inline-start: 0; }
  .sidebar-collapse-toggle { display: none; }
  .erp-content { padding: 18px; }
}

/* ================= Light / dark theme ================= */
html[data-theme="dark"] {
  --bg: #080f1c;
  --card: #111b2a;
  --line: #27344a;
  --ink: #e7edf7;
  --muted: #95a1b5;
  --accent-soft: color-mix(in srgb, var(--accent) 18%, transparent);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.22), 0 5px 18px rgba(0,0,0,.2);
  --shadow-md: 0 5px 12px rgba(0,0,0,.28), 0 14px 36px rgba(0,0,0,.3);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--ink);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--line);
  --bs-tertiary-bg: #172235;
}
html[data-theme="dark"] body {
  background:
    radial-gradient(1100px 500px at 85% -10%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(62,91,146,.1), transparent 60%),
    var(--bg);
}
html[data-theme="dark"] .erp-topbar { background: rgba(11,18,31,.88); }
html[data-theme="dark"] .page-title,
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .metric-value,
html[data-theme="dark"] .mobile-card-name,
html[data-theme="dark"] .modal-title,
html[data-theme="dark"] .kanban-col-head { color: #edf2fa; }
html[data-theme="dark"] .erp-topbar .btn-light,
html[data-theme="dark"] .card,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .offcanvas,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .mobile-card,
html[data-theme="dark"] html[data-theme="dark"] .erp-topbar .btn-light { color: var(--ink); box-shadow: var(--shadow-sm); }
html[data-theme="dark"] .erp-topbar .btn-light:hover { background: #1a263a; border-color: #3a4961; }
html[data-theme="dark"] .dropdown-item { color: var(--ink); }
html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus { color: #fff; background: #1b283c; }
html[data-theme="dark"] .dropdown-divider,
html[data-theme="dark"] .card .border-bottom { border-color: var(--line) !important; }
html[data-theme="dark"] .table {
  --bs-table-color: var(--ink);
  --bs-table-bg: transparent;
  --bs-table-border-color: var(--line);
  --bs-table-hover-color: #fff;
  --bs-table-hover-bg: #172337;
}
html[data-theme="dark"] .table thead th,
html[data-theme="dark"] .table-desktop thead th:first-child { background: #152033; color: #aeb9cb; }
html[data-theme="dark"] .table td { border-color: #202c3f; }
html[data-theme="dark"] .table-desktop td:first-child,
html[data-theme="dark"] .permission-table .permission-module-column { background: var(--card); }
html[data-theme="dark"] .table-desktop tbody tr:hover td:first-child,
html[data-theme="dark"] .data-table tbody tr:hover td { background: #172337; }
html[data-theme="dark"] .table-danger td,
html[data-theme="dark"] .table-desktop tr.table-danger td:first-child { background: #391f28 !important; }
html[data-theme="dark"] .table-warning td,
html[data-theme="dark"] .table-desktop tr.table-warning td:first-child { background: #362e1b !important; }
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text { color: var(--ink); background-color: #0d1727; border-color: #334159; }
html[data-theme="dark"] .form-control::placeholder { color: #748198; }
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-select:disabled { color: #8c98ab; background-color: #172235; }
html[data-theme="dark"] .form-label { color: #adb8ca; }
html[data-theme="dark"] .badge.text-bg-light { background: #1d2a3e !important; color: #c3ccda !important; border-color: #334159 !important; }
html[data-theme="dark"] .alert-light { color: var(--ink); background: var(--card); }
html[data-theme="dark"] .alert-danger { color: #f4b5bd; background: #351d25; border-color: #67303d; }
html[data-theme="dark"] .alert-success { color: #a8dfbf; background: #153326; border-color: #285b43; }
html[data-theme="dark"] .pagination .page-link { color: var(--ink); background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .pagination .page-link:hover { color: #fff; background: #1b283c; }
html[data-theme="dark"] .user-header-icon:hover,
html[data-theme="dark"] .pager-exports a:hover { color: #fff; background: #1b283c; border-color: #41506a; }
html[data-theme="dark"] .advanced-filter-heading { color: var(--ink); }
html[data-theme="dark"] .user-view-detail { background: #111c2c; }
html[data-theme="dark"] .pagination .page-item.disabled .page-link { color: #5e6a7d; background: #0e1726; }
html[data-theme="dark"] .data-toolbar,
html[data-theme="dark"] .account-hero { background: linear-gradient(135deg,#111b2a 0%,#101a29 72%,#192021 140%); border-color: var(--line); }
html[data-theme="dark"] .data-toolbar .form-control,
html[data-theme="dark"] .data-toolbar .form-select { background-color: #0d1727; }
html[data-theme="dark"] .data-list-card > .card-header { background: linear-gradient(180deg,#121d2d,#101a29); }
html[data-theme="dark"] .mobile-card-grid,
html[data-theme="dark"] .mobile-card-actions,
html[data-theme="dark"] .account-fact { border-color: var(--line); }
html[data-theme="dark"] .kanban-card,
html[data-theme="dark"] .kanban-col-head .badge { background: #162236 !important; }
html[data-theme="dark"] .permission-group { border-color: var(--line); }
html[data-theme="dark"] .permission-group-header,
html[data-theme="dark"] .permission-table thead .permission-module-column { background: #152033; }
html[data-theme="dark"] .permission-module-column strong { color: #e7edf7; }
html[data-theme="dark"] .extra-permission { color: #b0bbcc; }
html[data-theme="dark"] .role-form-footer { color: var(--ink); background: rgba(17,27,42,.96); border-color: var(--line); }
html[data-theme="dark"] .profile-photo-editor,
html[data-theme="dark"] .account-nav,
html[data-theme="dark"] .security-event-icon,
html[data-theme="dark"] .security-status-icon { background: #152033; border-color: var(--line); }
html[data-theme="dark"] .advanced-filter-panel { background: #101a29; border-color: var(--line); }
html[data-theme="dark"] .account-nav a { color: #aeb9cb; }
html[data-theme="dark"] .account-nav a:hover { color: #fff; background: #1d2a3e; }
html[data-theme="dark"] .account-nav a.active { color: #fff; background: #263958; }
html[data-theme="dark"] .account-security-badge.secure { color: #a8dfbf; background: #153326; border-color: #285b43; }
html[data-theme="dark"] .account-security-badge.attention { color: #f1d493; background: #352d19; border-color: #66552c; }
html[data-theme="dark"] .bg-white { background-color: var(--card) !important; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a465b; border-color: var(--bg); }

@media (max-width: 767.98px) {
  html[data-theme="dark"] .erp-pager { background: var(--card); }
}
/* Intake form builder */
.eyebrow,.preview-kicker{font-size:.68rem;letter-spacing:.12em;font-weight:700;color:#6b7f9d}.builder-section{border:1px solid var(--line);border-radius:12px;padding:1rem 1.1rem;background:var(--card)}.field-row{display:flex;align-items:center;gap:.65rem;padding:.65rem 0;border-top:1px solid var(--line)}.field-row:first-child{border-top:0}.drag{color:#93a0b5}.preview-kicker{font-size:.6rem}.preview-kicker+h4{margin-top:.45rem}
.form-builder-shell{margin:-4px auto 0;max-width:980px}.form-builder-topbar{position:sticky;top:var(--topbar-offset);z-index:20;display:flex;align-items:center;padding:10px 12px;margin-bottom:18px;border:1px solid var(--line);border-radius:12px;background:color-mix(in srgb,var(--card) 94%,transparent);box-shadow:var(--shadow-sm);backdrop-filter:blur(12px)}.form-builder-canvas{max-width:770px;margin:auto}.gf-title-card,.gf-section{position:relative;margin-bottom:16px;border:1px solid var(--line);border-radius:10px;background:var(--card);box-shadow:0 2px 7px rgba(28,39,60,.08)}.gf-title-card{padding:24px 28px;border-top:8px solid #673ab7}.gf-title-input,.gf-description-input,.gf-section-head input,.gf-section-head textarea,.gf-question-title,.gf-option input{width:100%;border:0;border-bottom:1px solid transparent;outline:0;color:var(--ink);background:transparent}.gf-title-input{padding:4px 0 10px;font-size:1.9rem}.gf-description-input{resize:vertical;color:var(--muted)}.gf-title-input:focus,.gf-description-input:focus,.gf-section-head input:focus,.gf-section-head textarea:focus,.gf-question-title:focus,.gf-option input:focus{border-bottom-color:#673ab7}.gf-section{overflow:hidden}.gf-section-head{display:grid;gap:7px;padding:18px 22px;background:color-mix(in srgb,#673ab7 5%,var(--card))}.gf-section-number{color:#673ab7;font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.gf-section-head input{font-size:1.15rem;font-weight:600}.gf-section-head textarea{resize:vertical;color:var(--muted);font-size:.82rem}.gf-questions{padding:16px;background:var(--bg)}.gf-question-card{margin-bottom:14px;padding:18px;border:1px solid var(--line);border-inline-start:5px solid transparent;border-radius:9px;background:var(--card);box-shadow:0 1px 4px rgba(28,39,60,.06)}.gf-question-card:focus-within{border-inline-start-color:#673ab7;box-shadow:0 4px 14px rgba(103,58,183,.12)}.gf-question-main{display:grid;grid-template-columns:20px minmax(0,1fr) 205px;gap:10px;align-items:center}.gf-drag{color:#a5adba;cursor:grab}.gf-question-title{padding:9px 10px;background:var(--bg);border-bottom-color:var(--line)}.gf-type-select{font-size:.82rem}.gf-answer-preview{width:62%;padding:18px 10px 8px;margin-inline-start:30px;color:#8993a4;border-bottom:1px dotted #9aa4b3;font-size:.78rem}.gf-options{padding-block:13px 2px;padding-inline:30px 0}.gf-option{display:grid;grid-template-columns:18px minmax(0,1fr) 32px;gap:9px;align-items:center;margin-bottom:8px}.gf-option>i{color:#8f99a9}.gf-option input{padding:6px 2px}.gf-icon-button,.gf-option button,.gf-section-actions button{border:0;color:var(--muted);background:transparent}.gf-icon-button{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:50%}.gf-icon-button:hover:not(:disabled){color:#673ab7;background:rgba(103,58,183,.08)}.gf-icon-button:disabled{opacity:.3}.gf-add-option{margin:4px 0 0;margin-inline-start:27px;border:0;color:#673ab7;background:transparent;font-size:.8rem}.gf-question-footer{display:flex;align-items:center;justify-content:flex-end;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}.gf-divider{height:28px;margin:0 12px;border-inline-start:1px solid var(--line)}.gf-required{display:flex;align-items:center;gap:8px;margin:0;font-size:.78rem}.gf-required input{position:absolute;opacity:0}.gf-required span{position:relative;width:34px;height:19px;border-radius:20px;background:#b9c0cb}.gf-required span:after{content:"";position:absolute;top:3px;inset-inline-start:3px;width:13px;height:13px;border-radius:50%;background:#fff;transition:.15s}.gf-required input:checked+span{background:#673ab7}.gf-required input:checked+span:after{inset-inline-start:18px}.gf-section-actions{display:flex;justify-content:flex-end;gap:18px;padding:12px 18px;border-top:1px solid var(--line)}.gf-section-actions button{font-size:.78rem}.gf-section-actions button:hover:not(:disabled){color:#673ab7}.gf-add-footer{display:flex;justify-content:center;gap:10px;padding:5px 0 30px}.gf-add-footer .btn{border:1px solid var(--line);box-shadow:var(--shadow-sm)}html[data-theme="dark"] .gf-question-card:focus-within{box-shadow:0 4px 14px rgba(169,123,255,.13)}html[data-theme="dark"] .gf-section-head{background:#18152a}
@media(max-width:767.98px){.form-builder-topbar{top:var(--topbar-offset)}.gf-title-card{padding:20px}.gf-title-input{font-size:1.45rem}.gf-question-main{grid-template-columns:18px minmax(0,1fr)}.gf-type-select{grid-column:2}.gf-questions{padding:10px}.gf-question-card{padding:14px 10px}.gf-answer-preview{width:auto}.gf-add-footer{flex-direction:column}.gf-add-footer .btn{width:100%}}
.form-builder-shell{max-width:1280px}.form-builder-workspace{display:grid;grid-template-columns:210px minmax(0,770px) 180px;gap:18px;align-items:start;justify-content:center}.form-builder-canvas{width:100%;min-width:0;max-width:none}.gf-palette,.gf-builder-help{position:sticky;top:calc(var(--topbar-offset) + 77px);padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--card);box-shadow:var(--shadow-sm)}.gf-panel-title{display:flex;align-items:center;gap:8px;padding-bottom:11px;margin-bottom:12px;border-bottom:1px solid var(--line);font-size:.86rem;font-weight:700}.gf-panel-title i{color:#673ab7}.gf-palette-label{margin:13px 0 7px;color:var(--muted);font-size:.62rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.gf-palette-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}.gf-palette-grid button,.gf-add-section-button{display:flex;align-items:center;gap:7px;min-height:42px;padding:7px 8px;border:1px solid var(--line);border-radius:7px;color:var(--ink);background:var(--card);font-size:.7rem;text-align:start}.gf-palette-grid button:hover,.gf-add-section-button:hover{color:#673ab7;border-color:#9f7bd1;background:rgba(103,58,183,.05)}.gf-palette-grid i,.gf-add-section-button i{color:#673ab7;font-size:.9rem}.gf-add-section-button{width:100%;margin-top:10px;justify-content:center}.gf-builder-help p{color:var(--muted);font-size:.7rem;line-height:1.5}.gf-builder-stat{display:flex;align-items:baseline;gap:6px;padding-top:10px;border-top:1px solid var(--line)}.gf-builder-stat strong{color:#673ab7;font-size:1.4rem}.gf-builder-stat span{color:var(--muted);font-size:.7rem}.gf-content-card{border-inline-start-color:#9f7bd1}.gf-content-card .gf-question-title{font-weight:600}.gf-heading .gf-question-title{font-size:1.08rem}.gf-paragraphBlock .gf-question-main{align-items:start}.gf-paragraphBlock .gf-drag{margin-top:10px}.gf-content-title{min-height:78px;overflow:hidden;resize:vertical;line-height:1.45;white-space:pre-wrap}.gf-content-preview{padding:12px 30px 3px;color:var(--muted);font-size:.78rem}.gf-spacer-preview{height:30px;margin:12px 30px 3px;border-top:1px dashed var(--line);border-bottom:1px dashed var(--line);color:var(--muted);font-size:.65rem;line-height:28px;text-align:center}
@media(max-width:1199.98px){.form-builder-workspace{grid-template-columns:190px minmax(0,770px)}.gf-builder-help{display:none}}
@media(max-width:991.98px){.form-builder-workspace{display:block}.gf-palette{position:static;margin-bottom:16px}.gf-palette-grid{grid-template-columns:repeat(4,1fr)}}
@media(max-width:767.98px){.gf-palette-grid{grid-template-columns:repeat(2,1fr)}}
.form-builder-workspace{grid-template-columns:minmax(0,820px) 190px}.form-builder-canvas{max-width:820px}.gf-add-footer{flex-wrap:wrap}
@media(max-width:991.98px){.form-builder-workspace{display:block}.gf-builder-help{position:static;max-width:820px;margin:0 auto 16px}.gf-add-footer{display:grid;grid-template-columns:1fr 1fr}}
.intake-builder-directory .avatar{background:var(--navy-700)!important}.gf-title-card{border-top-color:var(--accent)}.gf-title-input:focus,.gf-description-input:focus,.gf-section-head input:focus,.gf-section-head textarea:focus,.gf-question-title:focus,.gf-option input:focus{border-bottom-color:var(--accent)}.gf-section-head{background:var(--accent-soft)}.gf-section-number{color:#2f8c98}.gf-question-card:focus-within{border-inline-start-color:var(--accent);box-shadow:0 4px 14px color-mix(in srgb, var(--accent) 16%, transparent)}.gf-icon-button:hover:not(:disabled){color:var(--navy-700);background:var(--accent-soft)}.gf-add-option,.gf-section-actions button:hover:not(:disabled){color:var(--navy-700)}.gf-required input:checked+span{background:var(--navy-700)}.gf-panel-title i,.gf-builder-stat strong{color:var(--accent)}.gf-content-card{border-inline-start-color:var(--accent-light)}html[data-theme="dark"] .gf-question-card:focus-within{border-inline-start-color:var(--accent);box-shadow:0 4px 14px color-mix(in srgb, var(--accent) 20%, transparent)}html[data-theme="dark"] .gf-section-head{background:color-mix(in srgb, var(--accent) 8%, transparent)}html[data-theme="dark"] .gf-section-number{color:var(--accent-light)}.intake-builder-form-card>.card-body{background:var(--bg)}.intake-builder-form-card .form-builder-shell{max-width:1120px;margin:0 auto}.intake-builder-form-card .form-builder-workspace{grid-template-columns:minmax(0,820px) 190px}.intake-builder-form-card .gf-builder-help{top:calc(var(--topbar-offset) + 16px)}.gf-section-heading-row{display:flex;align-items:center;gap:5px}.gf-section-drag,.gf-drag{display:inline-flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;user-select:none}.gf-section-drag{width:22px;height:22px;margin-inline-start:-8px;color:#8a94a5;border-radius:5px}.gf-section-drag:hover,.gf-drag:hover{color:var(--navy-700);background:var(--accent-soft)}.gf-section-drag:active,.gf-drag:active{cursor:grabbing}.gf-dragging{opacity:.45}.gf-questions.gf-drop-zone{outline:2px dashed var(--accent);outline-offset:-8px;background:var(--accent-soft)}.gf-question-card.gf-drop-before{box-shadow:0 -3px 0 var(--accent),0 1px 4px rgba(28,39,60,.06)}.gf-question-card.gf-drop-after{box-shadow:0 3px 0 var(--accent),0 1px 4px rgba(28,39,60,.06)}.gf-section.gf-section-drop-before:before,.gf-section.gf-section-drop-after:after{content:"";position:absolute;z-index:4;inset-inline:0;height:4px;background:var(--accent);border-radius:3px}.gf-section.gf-section-drop-before:before{top:-10px}.gf-section.gf-section-drop-after:after{bottom:-10px}@media(max-width:767.98px){.intake-builder-form-card>.card-footer{align-items:stretch!important;flex-direction:column}.intake-builder-form-card>.card-footer .btn{width:100%}}.intake-view-heading .avatar{display:inline-flex;align-items:center;justify-content:center;flex:0 0 54px;width:54px;height:54px;border-radius:14px;color:#fff;background:var(--navy-700)}@media(max-width:575.98px){.intake-view-question-title{padding-inline-end:0}.intake-view-type{position:static;margin-top:4px}.intake-form-view>.card-body{padding:16px}.intake-view-items{padding:0 15px}}@media print{.intake-view-section{break-inside:avoid}.intake-view-section-head{-webkit-print-color-adjust:exact;print-color-adjust:exact}.intake-form-view .card-footer{display:none!important}}.client-preview-bar .brand-mark{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:9px;color:#132038;background:linear-gradient(135deg,#7ee4f1,#29a7b8);font-weight:800}.client-preview-field>.form-label{font-size:.88rem;font-weight:600}.client-preview-field .form-control,.client-preview-field .form-select{max-width:620px}@media(max-width:575.98px){.client-preview-bar{align-items:flex-start;flex-direction:column;padding:10px 14px}.client-preview-shell{margin-top:16px}.client-preview-title,.client-preview-section{border-radius:10px}.client-preview-title{padding:20px}.client-preview-title h1{font-size:1.4rem}.client-preview-section-head,.client-preview-fields{padding-inline-start:16px;padding-inline-end:16px}}
/* Contact case management */
.case-page{max-width:1480px;margin:0 auto}.case-hero{position:relative;overflow:hidden;margin-bottom:18px;padding:24px 26px 0;border:1px solid color-mix(in srgb, var(--accent) 26%, transparent);border-radius:18px;color:#fff;background:linear-gradient(122deg,#101d35 0%,#192b4b 62%,#26395a 100%);box-shadow:0 14px 36px rgba(16,29,53,.16)}.case-hero:after{content:"";position:absolute;inset-inline-end:-90px;top:-145px;width:360px;height:360px;border:1px solid color-mix(in srgb, var(--accent) 15%, transparent);border-radius:50%;box-shadow:0 0 0 42px color-mix(in srgb, var(--accent) 3.5%, transparent),0 0 0 84px color-mix(in srgb, var(--accent) 2.5%, transparent);pointer-events:none}.case-hero-main{position:relative;z-index:1;display:flex;align-items:center;gap:16px;padding-inline-end:320px}.case-hero-avatar{display:flex;flex:0 0 58px}.case-hero-avatar .avatar{border:2px solid rgba(255,255,255,.5);box-shadow:0 7px 18px rgba(0,0,0,.2)}.case-eyebrow{margin-bottom:4px;color:#79d8e4;font-size:.66rem;font-weight:700;letter-spacing:.1em;text-transform:uppercase}.case-eyebrow i{margin-inline-end:5px}.case-hero h2{margin:0;color:#fff;font-size:1.55rem;font-weight:700;letter-spacing:-.02em}.case-hero-meta{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin-top:6px;color:#c7d0df;font-size:.76rem}.case-meta-dot{width:3px;height:3px;border-radius:50%;background:#5ec6d4}.case-hero-actions{position:absolute;z-index:2;top:25px;inset-inline-end:26px;display:flex;gap:8px}.case-hero-actions .btn-light{color:#e7edf6;border-color:rgba(255,255,255,.18);background:rgba(255,255,255,.08)}.case-hero-actions .btn-light:hover{color:#172743;background:#fff}.case-hero-actions .btn-primary{color:#fff;border-color:#0a7683;background:#0d97a8}.case-hero-stats{position:relative;z-index:1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));margin-top:22px;border-top:1px solid rgba(255,255,255,.12)}.case-hero-stats>div{display:flex;flex-direction:column;gap:5px;padding:15px 20px;border-inline-end:1px solid rgba(255,255,255,.12)}.case-hero-stats>div:first-child{padding-inline-start:0}.case-hero-stats>div:last-child{border-inline-end:0}.case-hero-stats span{color:#aebbcf;font-size:.63rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.case-hero-stats strong{color:#fff;font-size:.88rem}.case-hero-stats .badge{align-self:flex-start}.case-workspace{display:grid;grid-template-columns:285px minmax(0,1fr);gap:18px;align-items:start;transform:none!important}.case-profile-card,.case-workbench{overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--card);box-shadow:0 8px 26px rgba(20,34,61,.07)}.case-profile-card{position:sticky;top:calc(var(--topbar-offset) + 16px)}.case-profile-heading{display:flex;align-items:center;justify-content:space-between;padding:17px 18px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,color-mix(in srgb,var(--card) 96%,var(--accent-soft)),var(--card))}.case-profile-heading span,.case-profile-heading strong{display:block}.case-profile-heading span{color:var(--muted);font-size:.62rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.case-profile-heading strong{margin-top:2px;color:var(--ink);font-size:.82rem}.case-profile-heading>i{display:flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;color:#2c8a96;background:var(--accent-soft)}.case-summary{padding:5px 18px}.case-summary>div{display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;padding:11px 0;border-bottom:1px solid var(--line)}.case-summary>div:last-child{border-bottom:0}.case-summary i{grid-row:1/3;align-self:center;color:#8895a9;font-size:.94rem}.case-summary span{color:var(--muted);font-size:.6rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.case-summary strong{overflow:hidden;color:var(--ink);font-size:.76rem;font-weight:600;text-overflow:ellipsis}.case-profile-link{display:flex;align-items:center;gap:8px;padding:13px 18px;color:var(--navy-700);border-top:1px solid var(--line);background:color-mix(in srgb,var(--card) 96%,var(--bg));font-size:.72rem;font-weight:700;text-decoration:none}.case-profile-link:hover{color:#277f8b;background:var(--accent-soft)}.case-workbench-nav{padding:0 16px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--card) 97%,var(--bg))}.case-tabs{display:flex;gap:4px;flex-wrap:nowrap;overflow-x:auto}.case-tabs .nav-link{position:relative;display:flex;align-items:center;gap:7px;padding:16px 12px;color:var(--muted);border:0;border-radius:0;background:transparent;font-size:.75rem;font-weight:650;white-space:nowrap}.case-tabs .nav-link:after{content:"";position:absolute;inset-inline:10px;bottom:-1px;height:2px;border-radius:4px;background:transparent}.case-tabs .nav-link:hover{color:var(--ink)}.case-tabs .nav-link.active{color:var(--navy-700);background:transparent}.case-tabs .nav-link.active:after{background:var(--accent)}.case-tabs .nav-link i{font-size:.9rem}.case-tabs .nav-link em{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;border-radius:10px;color:#7d899b;background:var(--bg);font-size:.62rem;font-style:normal}.case-tabs .nav-link.active em{color:#277f8b;background:var(--accent-soft)}.case-workbench-body{min-height:390px;padding:0}.case-workbench-body>.tab-pane>.d-flex:first-child{align-items:center!important;margin:0!important;padding:18px 20px;border-bottom:1px solid var(--line)}.case-workbench-body>.tab-pane>.d-flex:first-child h6{margin:0;color:var(--ink);font-size:.88rem;font-weight:700}.case-workbench-body>.tab-pane>.d-flex:first-child h6:before{content:"Case records";display:block;margin-bottom:3px;color:var(--muted);font-size:.58rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}.case-workbench-body>.tab-pane>.d-flex:first-child .btn{padding:.42rem .7rem;border-radius:8px;font-size:.7rem;box-shadow:0 3px 9px rgba(22,38,67,.12)}.case-row{display:flex;justify-content:space-between;gap:18px;align-items:center;min-height:70px;padding:13px 20px;border-bottom:1px solid var(--line);transition:background .15s ease}.case-row:last-of-type{border-bottom:0}.case-row:hover{background:color-mix(in srgb,var(--card) 96%,var(--bg))}.case-row>div{min-width:0}.case-row>div:first-child{flex:1}.case-row strong{display:block;color:var(--ink);font-size:.82rem;font-weight:650}.case-row small{display:block;color:var(--muted);margin-top:3px;font-size:.7rem}.case-row .btn-sm{display:inline-flex;align-items:center;justify-content:center;width:31px;height:31px;padding:0;border-radius:8px}.case-row .badge{font-size:.62rem}.case-workbench .empty-state{min-height:250px;border:0;background:transparent}.case-workbench #sendIntake{margin:16px 20px!important;border-color:var(--line)!important;background:color-mix(in srgb,var(--card) 95%,var(--bg))}.case-workbench .tab-pane>form+div.case-row{border-top:1px solid var(--line)}html[data-theme="dark"] .case-hero{border-color:color-mix(in srgb, var(--accent) 22%, transparent);background:linear-gradient(122deg,#101a2a,#17263e 62%,#233551)}html[data-theme="dark"] .case-tabs .nav-link.active{color:var(--accent-light)}html[data-theme="dark"] .case-profile-link{color:var(--accent-light)}
@media(max-width:1199.98px){.case-workspace{grid-template-columns:250px minmax(0,1fr)}.case-tabs .nav-link{padding-inline:9px}.case-tabs .nav-link span{font-size:.7rem}}
@media(max-width:991.98px){.case-hero-main{padding-inline-end:0}.case-hero-actions{position:relative;top:auto;inset-inline-end:auto;margin-top:18px}.case-workspace{display:block}.case-profile-card{position:static;margin-bottom:16px}.case-summary{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 22px}.case-summary>div:nth-last-child(2){border-bottom:0}}
@media(max-width:575.98px){.case-hero{padding:19px 16px 0;border-radius:14px}.case-hero-main{align-items:flex-start}.case-hero h2{font-size:1.25rem}.case-hero-meta{align-items:flex-start;flex-direction:column;gap:3px}.case-meta-dot{display:none}.case-hero-actions{display:grid;grid-template-columns:1fr 1fr}.case-hero-actions .btn-primary{grid-column:1/-1}.case-hero-stats{grid-template-columns:1fr 1fr}.case-hero-stats>div{padding:12px 10px}.case-hero-stats>div:nth-child(2){border-inline-end:0}.case-hero-stats>div:nth-child(-n+2){border-bottom:1px solid rgba(255,255,255,.12)}.case-summary{display:block}.case-summary>div:nth-last-child(2){border-bottom:1px solid var(--line)}.case-workbench-nav{padding:0 8px}.case-tabs .nav-link{padding:13px 9px}.case-tabs .nav-link span{display:none}.case-tabs .nav-link i{font-size:1rem}.case-row{align-items:flex-start;flex-direction:column;gap:9px;padding:13px 16px}.case-row>div:last-child{width:100%;justify-content:flex-end}.case-workbench-body>.tab-pane>.d-flex:first-child{padding:15px 16px}}.case-record-list .case-row{position:relative;min-height:78px;padding-block:14px;padding-inline:16px 14px;border:1px solid var(--line);border-inline-start:3px solid #aab4c3;border-radius:11px;background:var(--card);box-shadow:0 2px 8px rgba(20,34,61,.045)}.case-record-list .case-row:last-of-type{border-bottom:1px solid var(--line)}.case-record-list .case-row:hover{border-color:#c8d0dc;background:var(--card);box-shadow:0 7px 18px rgba(20,34,61,.085);transform:translateY(-1px)}.case-date-pill,.case-count-pill{display:inline-flex!important;align-items:center;gap:6px;margin:0!important;padding:6px 9px;border:1px solid var(--line);border-radius:8px;color:#66758b!important;background:color-mix(in srgb,var(--card) 88%,var(--bg));font-size:.65rem!important;white-space:nowrap}.case-date-pill i,.case-count-pill i{color:#8b99ad}.case-row-task.priority-high,.case-row-activity.priority-high,.case-row-activity.priority-very-high{border-inline-start-color:#dc5967!important}.case-row-task.priority-medium,.case-row-activity.priority-medium{border-inline-start-color:#d7aa43!important}.case-row-task.priority-low,.case-row-activity.priority-low{border-inline-start-color:#56a479!important}.case-text-action{width:auto!important;padding:0 9px!important}.case-return-box{width:260px}.case-return-box .btn{width:auto!important;padding:4px 8px!important}html[data-theme="dark"] .case-record-list .case-row:hover{border-color:#3c4a61}html[data-theme="dark"] .case-date-pill,html[data-theme="dark"] .case-count-pill{background:#111d2e}
@media(max-width:767.98px){.case-record-list{padding:9px}.case-record-list .case-row{padding:13px}.case-record-actions{width:100%;padding-inline-start:52px}.case-record-meta{gap:5px 10px}.case-record-icon{flex-basis:38px;width:38px;height:38px}.case-return-box{width:min(260px,calc(100vw - 110px))}}
@media(max-width:480px){.case-record-actions{padding-inline-start:0;flex-wrap:wrap}.case-date-pill,.case-count-pill{margin-inline-end:auto!important}.case-record-main{width:100%}}.intake-review-answer.is-wide,.intake-review-content{grid-column:1/-1}
@media(max-width:767.98px){.intake-review-grid{grid-template-columns:1fr}.intake-review-answer.is-wide,.intake-review-content{grid-column:auto}.intake-review-decision{align-items:stretch;flex-direction:column}.intake-review-decision .btn{width:100%}.intake-review-signature{align-items:flex-start;flex-direction:column}}
/* Client signature upload */
.client-signature-upload{display:grid;grid-template-columns:46px minmax(0,1fr) auto;gap:12px;align-items:center;max-width:650px;padding:14px;border:1px dashed #aab6c8;border-radius:10px;background:#f8fafd}.client-signature-icon{display:flex;align-items:center;justify-content:center;width:46px;height:46px;border-radius:10px;color:#287f8a;background:#dcf7fb;font-size:1.25rem}.client-signature-copy strong,.client-signature-copy span{display:block}.client-signature-copy strong{color:#26344d;font-size:.8rem}.client-signature-copy span{margin-top:3px;color:#778399;font-size:.68rem}.client-signature-preview{grid-column:2/4;max-width:260px;max-height:100px;padding:8px;border:1px solid #dce2eb;border-radius:8px;background:#fff;object-fit:contain}@media(max-width:575.98px){.client-signature-upload{grid-template-columns:42px minmax(0,1fr)}.client-signature-upload>label{grid-column:1/3}.client-signature-preview{grid-column:1/3;max-width:100%}}

/* Platform responsiveness, unified theming, and enhanced controls */
img,svg,video,canvas{max-width:100%}.erp-main,.erp-content,.card,.card-body,.row>[class*="col"]{min-width:0}.data-list-card{overflow:hidden}.row-actions{display:inline-flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:nowrap}.row-actions form{margin:0}.select-column{width:52px;text-align:center!important}.form-check-input{width:1.08rem;height:1.08rem;border:2px solid #7d8aa1;box-shadow:0 0 0 3px rgba(36,70,117,.05)}.form-check-input:checked{border-color:var(--navy-700);background-color:var(--navy-700)}.record-check-mobile{display:flex;align-items:center;gap:7px;width:max-content;margin:0 0 12px;padding:6px 10px;color:var(--navy-700);font-size:.72rem;font-weight:700;border:1px solid var(--line);border-radius:8px;background:var(--bg)}
.dashboard-charts{display:grid;grid-template-columns:2fr 1fr 1fr;gap:16px}.dashboard-chart-card .card-header{display:flex;align-items:center;justify-content:space-between;gap:12px}.dashboard-chart-card .card-header strong,.dashboard-chart-card .eyebrow{display:block}.dashboard-chart-card .eyebrow{margin-bottom:3px;color:#2e8d9a;font-size:.62rem;letter-spacing:.11em}.dashboard-chart{width:100%;min-height:270px}
.flatpickr-calendar{border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 44px rgba(13,28,52,.2);font-family:inherit}.flatpickr-day.selected,.flatpickr-day.startRange,.flatpickr-day.endRange{background:var(--navy-700);border-color:var(--navy-700)}.flatpickr-day.today{border-color:var(--accent)}.flatpickr-months .flatpickr-month,.flatpickr-current-month .flatpickr-monthDropdown-months{background:transparent}.flatpickr-input[readonly]{background-color:var(--card)!important}
html[data-theme="dark"] body,html[data-theme="dark"] .erp-main,html[data-theme="dark"] .erp-content{background:#0b1220;color:var(--ink)}html[data-theme="dark"] .card,html[data-theme="dark"] .modal-content,html[data-theme="dark"] .dropdown-menu,html[data-theme="dark"] .offcanvas,html[data-theme="dark"] .list-group-item{color:var(--ink);background:#111c2c;border-color:#2b394e}html[data-theme="dark"] .card-header,html[data-theme="dark"] .card-footer,html[data-theme="dark"] .modal-header,html[data-theme="dark"] .modal-footer{background:#142033;border-color:#2b394e}html[data-theme="dark"] .form-control,html[data-theme="dark"] .form-select,html[data-theme="dark"] .input-group-text{color:#e8edf5;background-color:#0d1727;border-color:#35445b}html[data-theme="dark"] .form-control::placeholder{color:#7f8ca2}html[data-theme="dark"] .btn-light,html[data-theme="dark"] .text-bg-light,html[data-theme="dark"] .badge.text-bg-light{color:#dce4f0!important;background:#1a263a!important;border-color:#3a4961!important}html[data-theme="dark"] .dropdown-item{color:#dce4f0}html[data-theme="dark"] .dropdown-item:hover,html[data-theme="dark"] .dropdown-item:focus{background:#223149}html[data-theme="dark"] .border-bottom,html[data-theme="dark"] .border-top,html[data-theme="dark"] .border{border-color:#2b394e!important}html[data-theme="dark"] .record-check-mobile{color:#6fd5e3;background:#142033;border-color:#3a4961}html[data-theme="dark"] .form-check-input{border-color:#8190a8;background-color:#0d1727}html[data-theme="dark"] .form-check-input:checked{background-color:#56c2d0;border-color:#56c2d0}html[data-theme="dark"] .flatpickr-calendar{color:#e8edf5;background:#111c2c;border-color:#35445b}html[data-theme="dark"] .flatpickr-months .flatpickr-month,html[data-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,html[data-theme="dark"] span.flatpickr-weekday{color:#e8edf5;background:#111c2c}html[data-theme="dark"] .flatpickr-day{color:#dce4f0}html[data-theme="dark"] .flatpickr-day:hover,html[data-theme="dark"] .flatpickr-day:focus{background:#223149;border-color:#35445b}html[data-theme="dark"] .flatpickr-day.prevMonthDay,html[data-theme="dark"] .flatpickr-day.nextMonthDay{color:#66758c}html[data-theme="dark"] .flatpickr-time input,html[data-theme="dark"] .flatpickr-time .flatpickr-am-pm{color:#e8edf5;background:#111c2c}html[data-theme="dark"] .flatpickr-time{border-color:#35445b}
.payment-page{min-height:100vh;margin:0;color:#17233b;background:radial-gradient(circle at 85% 10%,color-mix(in srgb, var(--accent) 20%, transparent),transparent 30%),#eef2f7}.payment-shell{width:min(980px,calc(100% - 32px));margin:40px auto}.payment-shell-small{max-width:620px}.payment-brand{display:flex;align-items:center;gap:12px;margin-bottom:18px}.payment-brand .brand-mark{display:grid;place-items:center;width:48px;height:48px;border-radius:12px;color:#11213d;background:linear-gradient(135deg,#79e2f0,#2eaaba);font-weight:800}.payment-brand strong,.payment-brand small{display:block}.payment-brand strong{font-family:Georgia,serif;font-size:1.15rem}.payment-brand small{color:#68748a;font-size:.78rem}.payment-card{display:grid;grid-template-columns:.85fr 1.15fr;overflow:hidden;border:1px solid #dce3ed;border-radius:22px;background:#fff;box-shadow:0 24px 65px rgba(15,32,59,.14)}.payment-summary{padding:42px;color:#fff;background:linear-gradient(145deg,#0e1b31,#213b63)}.payment-kicker{color:#6ed4e2;font-size:.68rem;font-weight:800;letter-spacing:.12em}.payment-summary h1{margin:18px 0 12px;font-size:2.4rem}.payment-summary p{color:#c6d0df;line-height:1.6}.payment-summary dl{margin:32px 0 0}.payment-summary dl div{padding:13px 0;border-top:1px solid rgba(255,255,255,.14)}.payment-summary dt{color:#93a4bd;font-size:.68rem;text-transform:uppercase}.payment-summary dd{margin:4px 0 0}.payment-form{padding:42px}.payment-form h2{font-size:1.2rem}.payment-form>p{margin-bottom:28px;font-size:.82rem;line-height:1.5}.payment-foot{text-align:center;color:#7b8799;font-size:.72rem;margin-top:18px}.payment-success{text-align:center;padding:36px 0}.payment-success i{color:#198754;font-size:3rem}.payment-success h2{margin-top:14px}.payment-unavailable{display:block;padding:54px;text-align:center}.payment-unavailable>i{color:#0d97a8;font-size:3rem}.payment-unavailable h1{margin:18px 0 10px;font-size:1.5rem}.payment-unavailable p{color:#68748a}
@media(max-width:1199.98px){.dashboard-charts{grid-template-columns:1fr 1fr}.dashboard-chart-wide{grid-column:1/-1}}
@media(max-width:767.98px){.erp-topbar{padding-inline:14px}.erp-topbar .page-title{font-size:1.05rem}.erp-content{padding:14px 10px 22px}.card,.data-toolbar,.data-list-card{border-radius:14px}.card-header{padding:13px 15px}.metric-card .card-body{padding:15px}.dashboard-charts{grid-template-columns:1fr}.dashboard-chart-wide{grid-column:auto}.dashboard-chart-card .card-body{padding:8px}.toolbar-actions,.card-header.d-flex{flex-wrap:wrap}.bulk-user-toolbar.show{display:grid;grid-template-columns:1fr 1fr}.bulk-user-toolbar>div{grid-column:1/-1}.bulk-user-toolbar .form-select{width:100%}.bulk-user-toolbar .btn{width:100%}.modal-dialog{margin:10px}.modal-body{padding:18px}.modal-footer{padding:12px 18px}.modal-footer .btn{flex:1}.row-actions{width:100%;display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.row-actions .btn,.row-actions form,.row-actions form .btn{width:100%;min-width:0}.payment-shell{margin:18px auto}.payment-card{grid-template-columns:1fr}.payment-summary,.payment-form{padding:26px}.payment-summary h1{font-size:2rem}}
@media(max-width:767.98px){.impersonation-banner{position:fixed;top:68px;inset-inline-end:10px;bottom:auto;inset-inline-start:auto;z-index:1100;max-width:calc(100vw - 20px);padding:5px 6px 5px 9px;transform:none}.impersonation-banner span{max-width:32vw}.impersonation-banner .btn{white-space:nowrap}}
@media(max-width:420px){.erp-topbar{gap:6px}.erp-topbar>.ms-auto{gap:5px!important}.erp-topbar .btn{padding:7px 9px}.page-title{max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-card-grid{grid-template-columns:1fr}.dashboard-intro .btn-group,.dashboard-intro .btn-group>.btn{width:100%}.payment-summary,.payment-form{padding:22px 18px}}
.directory-hero{display:flex;align-items:center;justify-content:space-between;gap:22px;padding:22px 24px;color:#fff;border-radius:18px;background:linear-gradient(135deg,#11213d,#26456f);box-shadow:0 12px 28px rgba(18,37,67,.14)}.directory-hero .eyebrow{color:#67d1df;font-size:.65rem;font-weight:800;letter-spacing:.12em}.directory-hero h2{margin:5px 0 4px;font-size:1.35rem}.directory-hero p{margin:0;color:#c3cedf;font-size:.82rem}@media(max-width:575.98px){.directory-hero{align-items:flex-start;flex-direction:column;padding:18px}.directory-hero .btn{width:100%}.regulatory-detail-list>div{align-items:flex-start;flex-direction:column;gap:5px}.regulatory-detail-list strong{text-align:start}}
.dashboard-date{margin-bottom:4px;color:#2e8d9a;font-size:.65rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase}.dashboard-alert{display:flex;align-items:center;gap:13px;padding:13px 16px;color:#8d2834;border:1px solid #f0c9cf;border-radius:12px;background:#fff4f5}.dashboard-alert>i{font-size:1.2rem}.dashboard-alert div{display:flex;flex:1;min-width:0;flex-direction:column;font-size:.76rem}.dashboard-alert div span{margin-top:2px;color:#9c5962}.dashboard-alert>a{color:inherit;font-size:.72rem;font-weight:700;text-decoration:none;white-space:nowrap}.dashboard-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.dashboard-kpi{color:inherit;text-decoration:none;transition:transform .15s ease,box-shadow .15s ease}.dashboard-kpi:hover{color:inherit;transform:translateY(-2px);box-shadow:0 10px 24px rgba(20,34,61,.1)}.dashboard-kpi .card-body{min-height:102px}.dashboard-kpi-arrow{margin-inline-start:auto;color:#a2adbd;font-size:.72rem}.dashboard-analytics{display:grid;grid-template-columns:1.55fr 1fr;gap:16px}.dashboard-chart-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.dashboard-chart-card{overflow:hidden}.dashboard-chart-card .card-header small{display:block;margin-top:2px;color:var(--muted);font-size:.65rem;font-weight:400}.dashboard-chart-large{min-height:310px}.chart-empty{position:absolute;inset:45% 0 auto;display:flex;align-items:center;justify-content:center;gap:7px;color:var(--muted);font-size:.72rem}.dashboard-bottom-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.dashboard-activity{grid-column:span 2}.dashboard-list{padding:4px 16px}.dashboard-list-row{display:flex;align-items:center;gap:10px;min-height:61px;padding:10px 0;color:inherit;border-bottom:1px solid var(--line);text-decoration:none}.dashboard-list-row:last-child{border-bottom:0}.dashboard-list-row:hover strong{color:var(--navy-700)}.dashboard-list-row strong,.dashboard-list-row small{display:block}.dashboard-list-row strong{overflow:hidden;color:var(--ink);font-size:.75rem;font-weight:650;text-overflow:ellipsis;white-space:nowrap}.dashboard-list-row small{margin-top:3px;color:var(--muted);font-size:.64rem}.dashboard-list-row time{color:var(--muted);font-size:.62rem;white-space:nowrap}.dashboard-list-icon{display:grid;place-items:center;flex:0 0 32px;width:32px;height:32px;color:#45658f;border-radius:9px;background:#edf3fb}.dashboard-list-icon.risk{color:#8a5ca4;background:#f4eef8}.activity-dot{flex:0 0 8px;width:8px;height:8px;border-radius:50%;background:#0d97a8;box-shadow:0 0 0 4px var(--accent-soft)}.dashboard-quality{display:grid;gap:15px}.dashboard-quality>div>div:first-child{color:var(--muted);font-size:.68rem}.dashboard-quality>div>div:first-child strong{color:var(--ink)}.dashboard-quality .progress{height:6px;margin:6px 0;background:var(--bg)}.dashboard-quality .progress-bar{border-radius:20px;background:linear-gradient(90deg,#244675,#4a77ae)}.dashboard-quality>div>small{color:var(--muted);font-size:.61rem}.dashboard-contact-list .eyebrow{color:#2e8d9a;font-size:.6rem;font-weight:800;letter-spacing:.11em}html[data-theme="dark"] .dashboard-alert{color:#f2aab2;border-color:#59333b;background:#291b22}html[data-theme="dark"] .dashboard-alert div span{color:#c8848d}html[data-theme="dark"] .dashboard-list-row:hover strong{color:var(--accent-light)}
@media(max-width:1199.98px){.dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-analytics{grid-template-columns:1fr}.dashboard-chart-grid{grid-template-columns:1fr 1fr}.dashboard-bottom-grid{grid-template-columns:1fr 1fr}.dashboard-activity{grid-column:span 2}}
@media(max-width:767.98px){.dashboard-chart-grid,.dashboard-bottom-grid{grid-template-columns:1fr}.dashboard-activity{grid-column:auto}.dashboard-alert{align-items:flex-start;flex-wrap:wrap}.dashboard-alert>a{margin-inline-start:32px}}
@media(max-width:420px){.dashboard-kpis{grid-template-columns:1fr}}
.dashboard-activity{grid-column:1/-1}@media(max-width:767.98px){.dashboard-activity{grid-column:auto}}.dashboard-chart-grid-single{grid-template-columns:minmax(0,1fr)}.dashboard-bottom-grid{grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}@media(max-width:1199.98px){.dashboard-kpis-clients,.dashboard-kpis-compliance,.dashboard-kpis-operations{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:420px){.dashboard-kpis-clients,.dashboard-kpis-compliance,.dashboard-kpis-operations{grid-template-columns:1fr}}
.rich-editor{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--card)}
.rich-editor-toolbar{display:flex;align-items:center;gap:3px;padding:6px 8px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--bg) 70%,var(--card))}
.rich-editor-toolbar button{width:30px;height:28px;border:0;border-radius:5px;color:var(--muted);background:transparent}.rich-editor-toolbar button:hover,.rich-editor-toolbar button:focus{color:var(--navy-700);background:var(--card)}
.rich-editor-divider{width:1px;height:20px;margin:0 4px;background:var(--line)}
.rich-editor-surface{min-height:220px;padding:14px 16px;outline:0;line-height:1.65}.rich-editor-surface:empty:before{content:attr(data-placeholder);color:var(--muted);pointer-events:none}.rich-editor-surface blockquote{margin:12px 0;padding-inline-start:12px;border-inline-start:3px solid var(--accent);color:var(--muted)}.rich-editor-surface ul,.rich-editor-surface ol{padding-inline-start:24px}
.login-brand-icon{display:block;width:58px;height:58px;object-fit:contain;border-radius:16px}
.email-editor .rich-editor-toolbar{flex-wrap:wrap;row-gap:4px}.email-editor .rich-editor-toolbar button{display:inline-flex;align-items:center;justify-content:center}.email-editor .rich-editor-toolbar button:disabled{opacity:.35;pointer-events:none}.email-editor .rich-editor-dropdown,.email-editor .rich-editor-source{width:auto;padding:0 8px;font-size:.78rem;font-weight:600}.email-editor .rich-editor-source.active{color:#fff;background:var(--navy-700)}.email-editor .rich-editor-surface{min-height:360px;font-family:Arial,Helvetica,sans-serif;font-size:.95rem}.email-editor .rich-editor-surface h2{margin:0 0 12px;font-family:"Cormorant Garamond",Georgia,serif;font-size:1.45rem;font-weight:600;color:var(--navy-900)}.email-editor .rich-editor-surface p{margin:0 0 12px}.email-editor .rich-editor-surface a{color:#1f4e8c}.email-editor .rich-editor-surface a.btn{display:inline-block;padding:10px 22px;border-radius:6px;background:#0e1b31;color:#fff;font-weight:700;text-decoration:none}.email-editor .rich-editor-surface .muted{color:var(--muted);font-size:.84rem}.email-editor .rich-editor-surface .code{display:inline-block;padding:8px 16px;border:1px solid #b2dde3;border-radius:6px;background:#e9f9fb;color:#0e1b31;font-family:monospace;font-size:1.25rem;font-weight:700;letter-spacing:4px}.email-editor .rich-editor-surface .divider{height:1px;margin:18px 0;background:var(--line)}.email-editor .rich-editor-source-input{min-height:360px;border:0;border-radius:0;font-size:.82rem;line-height:1.55;resize:vertical}.email-editor .rich-editor-source-input:focus{box-shadow:none}html[data-theme="dark"] .email-editor .rich-editor-surface{color:#e6e9ef}html[data-theme="dark"] .email-editor .rich-editor-surface h2{color:#e6f3f5}
/* Directory toolbar: keep Add/export visible on narrow desktops & tablets */
@media (min-width: 768px) and (max-width: 1199.98px) {
  .user-toolbar-head { flex-wrap: wrap; row-gap: 10px; }
  .user-toolbar-head > .user-directory-title { order: 1; flex: 1 1 auto; }
  .user-toolbar-head > .user-header-exports { order: 2; }
  .user-toolbar-head > .user-toolbar-actions { order: 3; }
  .user-toolbar-head > .user-header-search { order: 4; flex: 1 1 100%; min-width: 0; }
}
.t-reference-lists td{vertical-align:middle}.t-reference-lists .reference-order{width:96px}.t-reference-lists .form-control-sm{min-width:120px}.t-reference-lists .reference-add-row td{background:color-mix(in srgb,var(--accent-soft) 45%,var(--card))}.t-reference-lists .form-switch .form-check-input{cursor:pointer}
/* Searchable selects (Tom Select) — match .form-select */
.ts-wrapper.form-select{padding:0;background-image:none;min-height:38px}
.ts-wrapper.form-select .ts-control{min-height:38px;padding:.375rem 2.25rem .375rem .75rem;border:0;border-radius:inherit;background:transparent;box-shadow:none;color:var(--ink);font-size:inherit;line-height:1.5}
.ts-wrapper.single .ts-control{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");background-repeat:no-repeat;background-position:right .75rem center;background-size:16px 12px}
.ts-wrapper.single .ts-control:after{display:none}
.ts-wrapper.form-select.focus{border-color:var(--accent);box-shadow:0 0 0 .2rem color-mix(in srgb, var(--accent) 22%, transparent)}
.ts-wrapper.ts-sm{min-height:31px}.ts-wrapper.ts-sm .ts-control{min-height:31px;padding:.25rem 2rem .25rem .5rem;font-size:.875rem}
.ts-wrapper.multi .ts-control{gap:4px;padding-inline-end:.75rem}
.ts-wrapper.multi .ts-control>.item{display:inline-flex;align-items:center;margin:0;padding:2px 4px 2px 9px;border-radius:999px;color:var(--navy-700);background:var(--accent-soft);font-size:.78rem;font-weight:600}
.ts-wrapper.multi .ts-control>.item .remove{margin-inline-start:4px;padding:0 5px;border:0;color:inherit;opacity:.65}.ts-wrapper.multi .ts-control>.item .remove:hover{opacity:1;background:transparent}
.ts-wrapper .ts-control>input::placeholder{color:var(--muted)}
.ts-dropdown{z-index:1090;margin-top:4px;border:1px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);box-shadow:var(--shadow-md);overflow:hidden;font-size:.88rem}
.ts-dropdown .dropdown-input-wrap{padding:8px;border-bottom:1px solid var(--line);background:var(--card)}
.ts-dropdown .dropdown-input{width:100%;height:34px;padding:0 10px 0 32px;border:1px solid var(--line);border-radius:8px;color:var(--ink);background:var(--card) url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238b96ab' viewBox='0 0 16 16'%3e%3cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001l3.85 3.85a1 1 0 0 0 1.415-1.414zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0'/%3e%3c/svg%3e") no-repeat 10px center;font-size:.84rem}
.ts-dropdown .dropdown-input:focus{outline:0;border-color:var(--accent);box-shadow:0 0 0 .18rem color-mix(in srgb, var(--accent) 20%, transparent)}
.ts-dropdown .ts-dropdown-content{max-height:260px;padding:4px}
.ts-dropdown .option{padding:7px 10px;border-radius:7px}
.ts-dropdown .option.active{color:var(--navy-900);background:var(--accent-soft)}
.ts-dropdown .option.selected{font-weight:600}
.ts-dropdown .no-results{padding:10px 12px;color:var(--muted);font-size:.82rem}
.ts-dropdown .highlight{background:color-mix(in srgb, var(--accent) 35%, transparent);border-radius:2px}
html[data-theme="dark"] .ts-wrapper.form-select{color:#e8edf5;background-color:#0d1727;border-color:#35445b}html[data-theme="dark"] .ts-wrapper.form-select .ts-control{color:#e8edf5;background-color:transparent}
html[data-theme="dark"] .ts-wrapper.single .ts-control{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23adb5bd' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e")}
html[data-theme="dark"] .ts-wrapper.multi .ts-control>.item{color:var(--accent-light)}
html[data-theme="dark"] .ts-dropdown .option.active{color:#fff}
/* SweetAlert2 — CRM skin */
.swal2-container{z-index:1200}
.erp-swal-toast.swal2-popup{width:auto;max-width:420px;padding:12px 14px;border:1px solid var(--line);border-inline-start-width:4px;border-radius:12px;background:var(--card);color:var(--ink);box-shadow:var(--shadow-md);font-size:.86rem;font-weight:500}
.erp-swal-toast.swal2-popup.swal2-icon-success{border-inline-start-color:#198754}.erp-swal-toast.swal2-popup.swal2-icon-error{border-inline-start-color:#dc3545}.erp-swal-toast.swal2-popup.swal2-icon-warning{border-inline-start-color:#e0a100}.erp-swal-toast.swal2-popup.swal2-icon-info{border-inline-start-color:#1f4e8c}
.erp-swal-toast .swal2-icon{margin:0 10px 0 0;width:1.5em;height:1.5em;min-width:1.5em;border-width:2px}.erp-swal-toast .swal2-icon .swal2-icon-content{font-size:1.2em}
.erp-swal-toast .swal2-html-container{margin:0;padding-inline:0 8px;text-align:start;font-size:inherit;color:inherit;line-height:1.45}
.erp-swal-toast .swal2-close{position:static;width:1.4em;height:1.4em;margin:0;color:var(--muted);font-size:1.2em}.erp-swal-toast .swal2-close:hover{color:var(--ink)}
.erp-swal-toast .swal2-timer-progress-bar{background:color-mix(in srgb, var(--accent) 55%, transparent)}
.erp-swal-title{font-weight:700;margin-bottom:4px}.erp-swal-list{margin:0;padding-inline-start:18px}.erp-swal-list li{margin:2px 0}
.erp-swal.swal2-popup{border:1px solid var(--line);border-radius:18px;background:var(--card);color:var(--ink);box-shadow:var(--shadow-md);padding:26px 26px 22px}
.erp-swal .swal2-title{font-family:"Cormorant Garamond",Georgia,serif;font-size:1.45rem;font-weight:600;color:var(--navy-900)}
.erp-swal .swal2-html-container{font-size:.9rem;color:var(--muted);line-height:1.55}
.erp-swal .swal2-icon{margin:6px auto 12px;width:64px;height:64px;border-width:3px}
.erp-swal .swal2-actions{gap:8px;margin-top:20px}.erp-swal .swal2-actions .btn{min-width:120px;font-weight:600}
.erp-swal .swal2-icon.swal2-warning{border-color:#e0a100;color:#e0a100}.erp-swal .swal2-icon.swal2-question{border-color:var(--accent);color:var(--accent)}
html[data-theme="dark"] .erp-swal .swal2-title{color:#e6f3f5}html[data-theme="dark"] .swal2-container.swal2-backdrop-show{background:rgba(3,8,18,.7)}
.ts-wrapper.is-invalid{border-color:#dc3545}
.erp-field-error{display:block;width:100%;margin-top:5px;font-size:.79rem;font-weight:500;line-height:1.35;color:#dc3545}
.erp-field-error:empty{display:none}
html[data-theme="dark"] .erp-field-error{color:#f28b93}


/* Document editor (Jodit) + rendered document content */
.jodit-container:not(.jodit_inline){border:1px solid var(--line)!important;border-radius:12px!important;overflow:hidden;background:var(--card)}
.jodit-toolbar__box:not(:empty){border-bottom:1px solid var(--line)!important;background:color-mix(in srgb,var(--bg) 70%,var(--card))!important;border-radius:0!important}
.jodit-toolbar-button__button:hover{background:var(--accent-soft)!important}
.jodit-wysiwyg{padding:22px 26px!important;font-family:Arial,Helvetica,sans-serif;font-size:15px;line-height:1.65;color:var(--ink)}
.jodit-status-bar{border-top:1px solid var(--line)!important;background:color-mix(in srgb,var(--bg) 70%,var(--card))!important;color:var(--muted)!important}
.jodit-workplace{background:var(--card)}
.jodit-container.jodit_theme_dark:not(.jodit_inline){border-color:var(--line)!important}@media print{.document-content-card{border-color:#bbb!important;background:#fff!important}}
/* Role permission matrix on the user form */
.role-matrix{border:1px solid var(--line);border-radius:14px;overflow:hidden;background:var(--card)}
.role-matrix>.card-header{background:linear-gradient(180deg,#fff,#fcfdff)}
.role-matrix-group-header{display:flex;align-items:center;justify-content:space-between;padding:8px 16px;background:#f7f9fc;border-top:1px solid var(--line);border-bottom:1px solid var(--line);font-size:.7rem;font-weight:800;letter-spacing:.6px;text-transform:uppercase;color:var(--navy-700)}
.role-matrix-group:first-child .role-matrix-group-header{border-top:0}
.role-matrix-group.is-empty .role-matrix-group-header{color:var(--muted)}
.role-matrix-table.permission-table{min-width:860px}
.role-matrix-table.permission-table td{height:42px;padding-top:6px;padding-bottom:6px}
.role-matrix-table .permission-module-column{width:210px;min-width:210px}
.role-matrix-table .permission-module-column strong{font-size:.8rem}
.role-matrix .permission-check:disabled{opacity:1;cursor:default;border-color:#d5dbe6}
.role-matrix .permission-check:disabled:checked{background-color:#26355a;border-color:#26355a}
.role-matrix.is-editing .permission-check:checked{background-color:var(--accent);border-color:var(--accent)}
.role-matrix.is-editing>.card-header{background:linear-gradient(180deg,#f5feff,#e6fcff)}
.role-matrix-warning{background:#fff7df;color:#8a5c00}
html[data-theme="dark"] .role-matrix>.card-header,html[data-theme="dark"] .role-matrix-group-header{background:#101a2b}
html[data-theme="dark"] .role-matrix .permission-check:disabled:checked{background-color:var(--accent);border-color:var(--accent)}
.ts-wrapper.multi.form-select{min-height:44px}.ts-wrapper.multi .ts-control{padding:6px 10px;min-height:44px}.ts-wrapper.multi .ts-control>.item{padding:3px 6px 3px 11px;font-size:.82rem}.ts-wrapper.multi .ts-control>input{min-width:140px;margin:2px 0}


/* ============================================================
   Appearance customizer — every rule below reacts to a data-*
   attribute or custom property set on <html>. Nothing here is
   applied per component or per page.
   ============================================================ */

/* ---- Page width (data-width) ---- */
html[data-width="fixed"] { --content-max: 1600px; }
html[data-width="fluid"] { --content-max: none; }
html[data-width="boxed"] { --content-max: 1320px; }
html[data-width="boxed"] .erp-main { background: color-mix(in srgb, var(--navy-900) 3%, transparent); }
html[data-width="boxed"] .erp-topbar, html[data-width="boxed"] .erp-footer { padding-inline: max(28px, calc((100% - var(--content-max)) / 2)); }

/* ---- Font family (data-font) ---- */
:root { --font-display: "Cormorant Garamond", Georgia, serif; }
html[data-font="serif"] { --font-sans: Georgia, "Iowan Old Style", "Times New Roman", Times, serif; --font-display: var(--font-sans); }
html[data-font="mono"] { --font-sans: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace; --font-display: var(--font-sans); }
html[data-font="comic"] { --font-sans: "Comic Sans MS", "Comic Neue", "Chalkboard SE", "Segoe Print", cursive; --font-display: var(--font-sans); }
.brand-name, .login-title { font-family: var(--font-display); }

/* ---- Navbar type (data-navbar) ---- */
html[data-navbar="static"] .erp-topbar { position: static; }
html[data-navbar="static"] { --topbar-h: 0px; }
@media (min-width: 992px) {
  html[data-navbar="hidden"] .erp-topbar { display: none; }
  html[data-navbar="hidden"] { --topbar-h: 0px; }
  /* In Topnav there is no sidebar footer, so the top bar carries the only profile and sign-out
     menu. Hidden degrades to Static there rather than stranding the user. */
  html[data-navbar="hidden"][data-navigation="topnav"] .erp-topbar { display: flex; position: static; }
  html[data-navbar="hidden"][data-navigation="topnav"] { --topbar-h: 0px; }
}

/* ---- Sidebar skin (data-sidebar-skin) ---- */
html[data-sidebar-skin="gradient"] {
  --sidebar-bg: linear-gradient(162deg, #17284c 0%, #182137 44%, color-mix(in srgb, var(--accent) 40%, #0e1424) 100%);
  --sidebar-bg-deep: transparent;
  --sidebar-shadow: color-mix(in srgb, var(--accent) 26%, transparent);
}
html[data-sidebar-skin="light"] {
  --sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f5f8fd 100%);
  --sidebar-bg-deep: transparent;
  --sidebar-fg: #56647d; --sidebar-fg-strong: var(--navy-900); --sidebar-brand: var(--navy-900);
  --sidebar-muted: #98a5ba; --sidebar-line: var(--line); --sidebar-border: var(--line); --sidebar-rule: #e2e8f2;
  --sidebar-hover: color-mix(in srgb, var(--navy-700) 6%, transparent);
  --sidebar-active-fg: var(--navy-900); --sidebar-chip: #f4f7fc; --sidebar-chip-line: var(--line);
  --sidebar-user-fg: var(--navy-900); --sidebar-user-sub: var(--muted);
  --sidebar-action-bg: #eaeff8; --sidebar-action-fg: #56647d;
  --sidebar-shadow: rgba(20, 34, 61, .16); --sidebar-scroll: #ccd5e4;
}
html[data-theme="dark"][data-sidebar-skin="light"] {
  --sidebar-bg: linear-gradient(180deg, #16223a 0%, #111b2c 100%);
  --sidebar-bg-deep: transparent;
  --sidebar-fg: #aeb9cb; --sidebar-fg-strong: #ffffff; --sidebar-brand: #edf2fa;
  --sidebar-muted: #6c7a92; --sidebar-line: var(--line); --sidebar-border: var(--line); --sidebar-rule: #2b3a52;
  --sidebar-hover: #1d2a3e; --sidebar-active-fg: #cfeef2; --sidebar-chip: #172235; --sidebar-chip-line: var(--line);
  --sidebar-user-fg: #edf2fa; --sidebar-user-sub: #8d9bb5;
  --sidebar-action-bg: #1d2a3e; --sidebar-action-fg: #cfd8e8; --sidebar-scroll: #3a465b;
}
html[data-sidebar-skin="light"] .erp-nav .nav-link.active {
  background: linear-gradient(90deg, var(--accent-soft), transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---- Header skin (data-header-skin) ---- */
html[data-header-skin="dark"] {
  --header-bg: color-mix(in srgb, var(--navy-900) 93%, transparent);
  --header-fg: #d5deec; --header-title: #f3f7fd; --header-line: rgba(255, 255, 255, .08);
  --header-btn-bg: rgba(255, 255, 255, .06); --header-btn-line: rgba(255, 255, 255, .13); --header-btn-hover-line: rgba(255, 255, 255, .3);
}
html[data-header-skin="gradient"] {
  --header-bg: linear-gradient(100deg, var(--navy-900) 0%, var(--navy-700) 55%, color-mix(in srgb, var(--accent) 42%, var(--navy-700)) 100%);
  --header-fg: #dfe6f2; --header-title: #ffffff; --header-line: rgba(255, 255, 255, .1);
  --header-btn-bg: rgba(255, 255, 255, .08); --header-btn-line: rgba(255, 255, 255, .16); --header-btn-hover-line: rgba(255, 255, 255, .34);
}
html[data-header-skin="dark"] .erp-topbar .text-muted,
html[data-header-skin="gradient"] .erp-topbar .text-muted { color: #a8b5ca !important; }
html[data-header-skin="dark"] .erp-topbar .avatar,
html[data-header-skin="gradient"] .erp-topbar .avatar { border-color: rgba(255, 255, 255, .3); }

/* ---- Navigation mode (data-navigation) ---- */
.erp-topnav { display: none; }
.erp-topnav-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; width: 100%; max-width: var(--content-max); margin-inline: auto; }
/* No overflow container here: a scrolling strip would clip the dropdown menus. Icons drop out
   first so the six sections stay on one row down to 992px, and the bar wraps rather than clips. */
@media (max-width: 1199.98px) { .erp-topnav .dropdown-toggle > i:first-child, .erp-topnav .nav-link > i:first-child { display: none; } }
.erp-topnav .nav-link, .erp-topnav .dropdown-toggle {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 9px;
  color: var(--ink); background: transparent; font-size: .78rem; font-weight: 600; white-space: nowrap; text-decoration: none;
  transition: color .16s ease, background .16s ease;
}
.erp-topnav .nav-link i, .erp-topnav .dropdown-toggle i:first-child { font-size: .9rem; opacity: .75; }
.erp-topnav .nav-link:hover, .erp-topnav .dropdown-toggle:hover,
.erp-topnav .dropdown-toggle[aria-expanded="true"] { color: var(--navy-900); background: color-mix(in srgb, var(--navy-700) 7%, transparent); }
.erp-topnav .nav-link.active, .erp-topnav .dropdown.active > .dropdown-toggle { color: var(--navy-900); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent); }
.erp-topnav .dropdown-menu { border-color: var(--line); border-radius: 12px; box-shadow: var(--shadow-md); padding: 6px; }
.erp-topnav .dropdown-item { display: flex; align-items: center; gap: 9px; border-radius: 8px; padding: 7px 10px; font-size: .8rem; }
.erp-topnav .dropdown-item i { width: 17px; text-align: center; opacity: .7; }
.erp-topnav .dropdown-item.active { color: var(--navy-900); background: var(--accent-soft); font-weight: 600; }
html[data-theme="dark"] .erp-topnav .nav-link, html[data-theme="dark"] .erp-topnav .dropdown-toggle { color: var(--ink); }
html[data-theme="dark"] .erp-topnav .nav-link:hover, html[data-theme="dark"] .erp-topnav .dropdown-toggle:hover,
html[data-theme="dark"] .erp-topnav .dropdown-toggle[aria-expanded="true"] { color: #fff; background: #1b283c; }
html[data-theme="dark"] .erp-topnav .nav-link.active, html[data-theme="dark"] .erp-topnav .dropdown.active > .dropdown-toggle,
html[data-theme="dark"] .erp-topnav .dropdown-item.active { color: var(--accent-light); }
@media (min-width: 992px) {
  html[data-navigation="topnav"] .erp-topnav, html[data-navigation="combo"] .erp-topnav {
    display: block; position: sticky; top: var(--topbar-h); z-index: 99;
    padding: 5px 28px; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, transparent);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  html[data-navigation="topnav"], html[data-navigation="combo"] { --topnav-h: 47px; }
  html[data-navigation="topnav"] .erp-sidebar,
  html[data-navigation="topnav"] .sidebar-collapse-toggle { display: none; }
}

/* ---- Appearance panel ---- */
.erp-appearance-launcher {
  position: fixed; z-index: 1035; inset-inline-end: 0; top: 50%; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 46px; padding: 0;
  color: var(--accent-ink); background: var(--grad-accent); border: 1px solid var(--accent); border-inline-end: 0;
  border-start-start-radius: 13px; border-end-start-radius: 13px;
  box-shadow: -3px 0 14px color-mix(in srgb, var(--accent) 38%, transparent);
  transition: width .18s ease, box-shadow .18s ease;
}
.erp-appearance-launcher:hover { width: 44px; color: var(--accent-ink); box-shadow: -4px 0 20px color-mix(in srgb, var(--accent) 55%, transparent); }
.erp-appearance-launcher:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.erp-appearance-launcher i { font-size: 1.05rem; animation: erpSpin 9s linear infinite; }
@keyframes erpSpin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .erp-appearance-launcher i { animation: none; } }
.offcanvas.erp-appearance { z-index: 1060; width: min(340px, 92vw); }
.erp-appearance .offcanvas-header { padding: 15px 18px; border-bottom: 1px solid var(--line); background: var(--grad-navy); color: #f3f6fc; }
.erp-appearance .offcanvas-title { font-size: .98rem; font-weight: 700; }
.erp-appearance .offcanvas-title small { display: block; color: color-mix(in srgb, var(--accent-light) 90%, transparent); font-size: .64rem; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; }
.erp-appearance .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.erp-appearance .offcanvas-body { padding: 0; }
.erp-appearance .offcanvas-footer { display: flex; gap: 9px; padding: 13px 18px; border-top: 1px solid var(--line); background: var(--card); }
.appearance-group { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.appearance-group:last-of-type { border-bottom: 0; }
.appearance-legend { display: block; margin-bottom: 9px; padding: 0; color: var(--muted); font-size: .64rem; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.appearance-legend small { display: block; margin-top: 2px; color: var(--muted); font-size: .64rem; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .85; }
.appearance-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.appearance-options[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.appearance-option { position: relative; margin: 0; }
.appearance-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.appearance-option span {
  display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; padding: 6px 7px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink);
  font-size: .72rem; font-weight: 600; text-align: center; cursor: pointer; transition: all .16s ease;
}
.appearance-option span i { font-size: .86rem; opacity: .7; }
.appearance-option:hover span { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.appearance-option input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.appearance-option input:checked + span i { opacity: 1; color: var(--accent); }
.appearance-option input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 2px; }
.appearance-swatches { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.appearance-swatch { position: relative; margin: 0; }
.appearance-swatch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.appearance-swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--line); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease; }
.appearance-swatch:hover span { transform: scale(1.08); }
.appearance-swatch input:checked + span { box-shadow: 0 0 0 2px var(--ink); }
.appearance-swatch input:focus-visible + span { outline: 2px solid var(--accent-light); outline-offset: 3px; }
.appearance-custom { display: inline-flex; align-items: center; gap: 7px; margin-inline-start: auto; color: var(--muted); font-size: .7rem; font-weight: 600; }
.appearance-custom input[type="color"] { width: 30px; height: 28px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; }
.appearance-note { margin: 8px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.45; }
html[data-theme="dark"] .erp-appearance .offcanvas-footer,
html[data-theme="dark"] .appearance-option span { background: var(--card); }

/* ---- RTL corrections for rules that cannot be expressed logically ---- */
html[dir="rtl"] .erp-nav .nav-link:hover { transform: translateX(-2px); }
html[dir="rtl"].erp-sidebar-collapsed.erp-sidebar-peek .erp-nav .nav-link:hover { transform: translateX(-2px); }
html[dir="rtl"].erp-sidebar-collapsed.erp-sidebar-peek .erp-sidebar { box-shadow: -18px 0 38px var(--sidebar-shadow); }
html[dir="rtl"] .permission-table .permission-module-column { box-shadow: -1px 0 0 #e8ecf3; }
html[dir="rtl"][data-theme="dark"] .permission-table .permission-module-column { box-shadow: -1px 0 0 var(--line); }
html[dir="rtl"] .impersonation-banner { transform: translateX(50%); }
@media (max-width: 767.98px) { html[dir="rtl"] .impersonation-banner { transform: none; } }
html[dir="rtl"] .erp-appearance-launcher { box-shadow: 3px 0 14px color-mix(in srgb, var(--accent) 38%, transparent); }
html[dir="rtl"] .erp-appearance-launcher:hover { box-shadow: 4px 0 20px color-mix(in srgb, var(--accent) 55%, transparent); }
html[dir="rtl"] .case-hero:after { transform: scaleX(-1); }

/* ---- Nothing from the customizer reaches print ---- */
@media print {
  .erp-appearance-launcher, .erp-appearance, .offcanvas-backdrop, .erp-topnav { display: none !important; }
  .erp-content { max-width: none !important; margin: 0 !important; }
}

/* ---- Operations > Calendar ---- */
.calendar-shell{display:grid;grid-template-columns:264px minmax(0,1fr);gap:18px;align-items:start}
.calendar-rail{display:flex;flex-direction:column;gap:12px;position:sticky;top:calc(var(--topbar-offset) + 16px)}
.calendar-add .btn{border-radius:11px;font-weight:650;box-shadow:0 6px 16px rgba(22,38,67,.14)}
.calendar-mini,.calendar-filters{padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--card);box-shadow:var(--shadow-sm)}
.calendar-mini-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;color:var(--ink);font-size:.8rem}
.calendar-nav-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;color:var(--muted);border:1px solid var(--line);border-radius:9px;background:var(--card);text-decoration:none;transition:background .15s ease,color .15s ease}
.calendar-nav-btn:hover{color:var(--ink);background:var(--bg)}
.calendar-mini-grid{width:100%;table-layout:fixed;border-collapse:collapse;font-size:.68rem}
.calendar-mini-grid th{padding:5px 0;color:var(--muted);font-weight:700;text-align:center}
.calendar-mini-grid td{padding:1px;text-align:center}
.calendar-mini-grid a{position:relative;display:block;padding:5px 0;color:var(--ink);border-radius:8px;text-decoration:none}
.calendar-mini-grid a:hover{background:var(--bg)}
.calendar-mini-grid a.is-muted{color:var(--muted);opacity:.55}
.calendar-mini-grid a.has-events:after{content:"";position:absolute;inset-inline:calc(50% - 2px);bottom:2px;width:4px;height:4px;border-radius:50%;background:var(--accent)}
.calendar-mini-grid a.is-today{color:#277f8b;font-weight:700;background:var(--accent-soft)}
.calendar-mini-grid a.is-current{color:#fff;background:var(--navy-700)}
.calendar-mini-grid a.is-current.has-events:after{background:#fff}
.calendar-filters-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;color:var(--ink);font-size:.68rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}
.calendar-filters-clear{color:var(--muted);font-size:.68rem;font-weight:600;text-decoration:none}
.calendar-filters-clear:hover{color:#277f8b;text-decoration:underline}
.calendar-filters-sub{margin:12px 0 4px;color:var(--muted);font-size:.63rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}
.calendar-search{position:relative;display:flex;align-items:center;margin-bottom:8px}
.calendar-search i{position:absolute;inset-inline-start:10px;color:var(--muted);font-size:.78rem;pointer-events:none}
.calendar-search input{width:100%;padding:7px 10px 7px 30px;color:var(--ink);border:1px solid var(--line);border-radius:9px;background:color-mix(in srgb,var(--card) 96%,var(--bg));font-size:.76rem}
.calendar-search input:focus{outline:0;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.calendar-switch{display:flex;align-items:center;gap:8px;padding:5px 0;color:var(--ink);font-size:.76rem;cursor:pointer}
.calendar-filter{display:flex;align-items:center;gap:8px;padding:5px 0;color:var(--ink);font-size:.76rem;cursor:pointer}
.calendar-filter-label{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.calendar-filter-count{min-width:22px;padding:1px 6px;color:var(--muted);border-radius:9px;background:var(--bg);font-size:.65rem;font-weight:700;text-align:center}
.calendar-swatch{display:inline-block;width:11px;height:11px;flex:0 0 11px;border-radius:4px}
.calendar-swatch.is-striped{background:repeating-linear-gradient(45deg,#dc3545,#dc3545 3px,#fff 3px,#fff 5px)}
.calendar-export{border-color:var(--line);font-weight:600}
.calendar-timezone{color:var(--ink);border-color:var(--line);background:var(--card);font-size:.75rem}
.calendar-timezone-note{margin-top:5px;color:var(--muted);font-size:.63rem;line-height:1.35}
.calendar-panel{overflow:hidden;padding:0;border:1px solid var(--line);border-radius:16px}
.calendar-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:15px 18px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,color-mix(in srgb,var(--card) 96%,var(--accent-soft)),var(--card))}
.calendar-toolbar-nav{display:flex;align-items:center;gap:10px}
.calendar-nav-group{display:inline-flex;gap:6px}
.calendar-today{border-radius:9px;font-weight:650}
.calendar-heading{display:flex;flex-direction:column;line-height:1.15}
.calendar-title{margin:0;color:var(--ink);font-size:1.16rem;font-weight:700;letter-spacing:-.015em}
.calendar-subtitle{color:var(--muted);font-size:.68rem}
.calendar-view-switch{display:inline-flex;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--card)}
.calendar-view-switch a{padding:7px 16px;color:var(--muted);font-size:.74rem;font-weight:650;text-decoration:none;transition:background .15s ease,color .15s ease}
.calendar-view-switch a+a{border-inline-start:1px solid var(--line)}
.calendar-view-switch a:hover{color:var(--ink);background:var(--bg)}
.calendar-view-switch a.is-active{color:#fff;background:var(--navy-700)}
.calendar-stats{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:11px 18px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--card) 97%,var(--bg))}
.calendar-stat{display:flex;align-items:baseline;gap:7px;padding:5px 11px;border:1px solid var(--line);border-radius:9px;background:var(--card)}
.calendar-stat span{color:var(--muted);font-size:.63rem;font-weight:700;letter-spacing:.05em;text-transform:uppercase}
.calendar-stat strong{color:var(--ink);font-size:.85rem}
.calendar-stat.is-alert{border-color:color-mix(in srgb,#dc3545 35%,transparent);background:color-mix(in srgb,#dc3545 8%,transparent)}
.calendar-stat.is-alert strong{color:#b02a37}
.calendar-stat-note{margin-inline-start:auto;color:var(--muted);font-size:.68rem}
.calendar-grid-wrap{overflow-x:auto}
.calendar-grid{width:100%;min-width:780px;table-layout:fixed;border-collapse:collapse}
.calendar-grid th{padding:10px 8px;color:var(--muted);border-bottom:1px solid var(--line);font-size:.66rem;font-weight:700;letter-spacing:.07em;text-align:center;text-transform:uppercase}
.calendar-grid th.is-weekend{color:color-mix(in srgb,var(--muted) 75%,var(--accent))}
.calendar-grid td{height:132px;padding:6px 7px 8px;vertical-align:top;border:1px solid var(--line);transition:background .15s ease}
.calendar-grid-week td{height:420px}
.calendar-grid td.is-weekend{background:color-mix(in srgb,var(--card) 97%,var(--bg))}
.calendar-grid td.is-outside{background:color-mix(in srgb,var(--card) 92%,var(--bg))}
.calendar-grid td.is-outside .calendar-day-number{color:var(--muted);opacity:.65}
.calendar-grid td.is-today{background:color-mix(in srgb,var(--accent) 7%,var(--card));box-shadow:inset 0 2px 0 var(--accent)}
.calendar-day-head{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-bottom:5px}
.calendar-day-number{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:24px;padding:0 6px;color:var(--ink);border-radius:8px;font-size:.75rem;font-weight:650;text-decoration:none}
.calendar-day-number:hover{color:#277f8b;background:var(--accent-soft)}
.calendar-grid td.is-today .calendar-day-number{color:#fff;background:var(--navy-700)}
.calendar-day-count{padding:1px 6px;color:var(--muted);border-radius:8px;background:var(--bg);font-size:.6rem;font-weight:700}
.calendar-day-events{display:flex;flex-direction:column;gap:3px}
.calendar-event{position:relative;display:flex;align-items:center;gap:6px;padding:4px 8px;color:var(--ink);border-radius:7px;background:color-mix(in srgb,var(--event-color) 13%,transparent);font-size:.71rem;text-decoration:none;transition:background .15s ease,transform .15s ease}
.calendar-event{width:100%;border:0;text-align:start;cursor:pointer}
.calendar-event:hover{background:color-mix(in srgb,var(--event-color) 24%,transparent);color:var(--ink)}
.calendar-event-dot{width:6px;height:6px;flex:0 0 6px;border-radius:50%;background:var(--event-color)}
.calendar-event.is-compact{overflow:hidden;white-space:nowrap}
.calendar-event.is-compact .calendar-event-title{overflow:hidden;text-overflow:ellipsis}
.calendar-event-time{color:color-mix(in srgb,var(--event-color) 70%,var(--ink));font-weight:700;white-space:nowrap}
.calendar-event-meta{display:flex;align-items:center;gap:5px;margin-inline-start:auto;color:var(--muted);font-size:.68rem;white-space:nowrap}
.calendar-event-flag{padding:1px 6px;color:#fff;border-radius:6px;background:#dc3545;font-size:.58rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase}
.calendar-event.is-overdue{background:color-mix(in srgb,#dc3545 11%,transparent);box-shadow:inset 2px 0 0 #dc3545}
.calendar-event.is-compact .calendar-event-flag{display:none}
.calendar-event.is-compact.is-overdue .calendar-event-title{color:#b02a37}
.calendar-preview-modal .modal-header{border-bottom-color:var(--line);background:linear-gradient(135deg,var(--navy-700),#183a68);color:#fff}
.calendar-preview-modal .btn-close{filter:invert(1)}
.calendar-preview-kicker{display:block;color:var(--accent-light);font-size:.65rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.calendar-preview-modal .modal-title{margin-top:4px;font-size:1.08rem}
.calendar-preview-detail{display:flex;gap:10px;align-items:flex-start;padding:10px 0;color:var(--ink);font-size:.82rem;border-bottom:1px solid var(--line)}
.calendar-preview-detail:last-child{border-bottom:0}.calendar-preview-detail i{color:var(--accent);margin-top:2px}.calendar-preview-modal .modal-footer{border-top-color:var(--line)}
.calendar-more{display:inline-block;padding:1px 4px;color:var(--muted);font-size:.67rem;font-weight:600;text-decoration:none}
.calendar-more:hover{color:#277f8b;text-decoration:underline}
.calendar-agenda{padding:4px 0;min-height:320px}
.calendar-agenda-day{display:grid;grid-template-columns:78px minmax(0,1fr);gap:16px;padding:14px 18px;border-bottom:1px solid var(--line)}
.calendar-agenda-day:last-child{border-bottom:0}
.calendar-agenda-date{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;padding:8px 0;color:var(--muted);border-radius:12px;background:color-mix(in srgb,var(--card) 96%,var(--bg));font-size:.66rem;line-height:1.25}
.calendar-agenda-date strong{color:var(--ink);font-size:1.25rem;font-weight:700}
.calendar-agenda-dow{font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.calendar-agenda-date.is-today{color:#277f8b;background:var(--accent-soft)}
.calendar-agenda-date.is-today strong{color:#277f8b}
.calendar-agenda-events{display:flex;flex-direction:column;gap:6px}
.calendar-agenda-events .calendar-event{padding:10px 13px;font-size:.79rem}
.calendar-legend{display:flex;align-items:center;gap:14px;flex-wrap:wrap;padding:11px 18px;color:var(--muted);border-top:1px solid var(--line);background:color-mix(in srgb,var(--card) 97%,var(--bg));font-size:.68rem}
.calendar-legend-item{display:inline-flex;align-items:center;gap:6px}
.calendar-legend-item.is-off{opacity:.4}
.calendar-legend-item em{color:var(--ink);font-style:normal;font-weight:700}
.calendar-mobile-bar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.calendar-filters-toggle{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);border-radius:11px;font-size:.78rem;font-weight:650;white-space:nowrap}
.calendar-filters-badge{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 5px;color:#fff;border-radius:9px;background:var(--navy-700);font-size:.62rem;font-weight:700}
@media (max-width:1199.98px){.calendar-shell{grid-template-columns:232px minmax(0,1fr)}}
@media (max-width:991.98px){
  .calendar-shell{display:flex;flex-direction:column;gap:12px}
  .calendar-mobile-bar{order:1}
  .calendar-rail{order:2;position:static;gap:10px}
  .calendar-mini{display:none} /* the main grid already covers month navigation on small screens */
  .calendar-panel{order:3}
  .calendar-toolbar{align-items:stretch;flex-direction:column;gap:10px;padding:13px 14px}
  .calendar-toolbar-nav{justify-content:space-between}
  .calendar-heading{align-items:flex-end;margin-inline-start:auto;text-align:end}
  .calendar-title{font-size:1.02rem}
  .calendar-view-switch{width:100%}
  .calendar-view-switch a{flex:1;padding:8px 0;text-align:center}
  .calendar-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:10px 14px}
  .calendar-stat{justify-content:space-between}
  .calendar-stat-note{grid-column:1/-1;margin-inline-start:0}
  .calendar-legend{gap:10px;padding:10px 14px;font-size:.65rem}
}
@media (max-width:767.98px){
  /* Month and week collapse to dot markers: tap a day to open its agenda. */
  .calendar-grid{min-width:0}
  .calendar-grid th{padding:7px 2px;font-size:.58rem;letter-spacing:.02em}
  .calendar-grid td{height:70px;padding:4px 3px}
  .calendar-grid-week td{height:150px}
  .calendar-day-head{margin-bottom:3px}
  .calendar-day-number{min-width:21px;height:21px;padding:0 3px;font-size:.7rem}
  .calendar-day-count{display:none}
  .calendar-day-events{flex-direction:row;flex-wrap:wrap;gap:3px}
  .calendar-event.is-compact{gap:0;width:8px;height:8px;padding:0;border-radius:50%;background:var(--event-color);box-shadow:none}
  .calendar-event.is-compact .calendar-event-dot,.calendar-event.is-compact .calendar-event-time,.calendar-event.is-compact .calendar-event-title{display:none}
  .calendar-event.is-compact.is-overdue{background:#dc3545;box-shadow:0 0 0 2px color-mix(in srgb,#dc3545 25%,transparent)}
  .calendar-more{padding:0;font-size:.6rem;line-height:1}
  /* Week keeps readable chips and scrolls sideways; only Month collapses to dots. */
  .calendar-grid-week{min-width:660px}
  .calendar-grid-week td{height:240px}
  .calendar-grid-week .calendar-day-count{display:inline-block}
  .calendar-grid-week .calendar-day-events{flex-direction:column;flex-wrap:nowrap;gap:3px}
  .calendar-grid-week .calendar-event.is-compact{gap:6px;width:auto;height:auto;padding:4px 8px;border-radius:7px;background:color-mix(in srgb,var(--event-color) 13%,transparent);box-shadow:none}
  .calendar-grid-week .calendar-event.is-compact.is-overdue{background:color-mix(in srgb,#dc3545 11%,transparent);box-shadow:inset 2px 0 0 #dc3545}
  .calendar-grid-week .calendar-event.is-compact .calendar-event-dot{display:block}
  .calendar-grid-week .calendar-event.is-compact .calendar-event-time,.calendar-grid-week .calendar-event.is-compact .calendar-event-title{display:inline}
  .calendar-agenda-day{grid-template-columns:56px minmax(0,1fr);gap:10px;padding:12px 14px}
  .calendar-agenda-date strong{font-size:1.05rem}
  .calendar-agenda-events .calendar-event{align-items:flex-start;flex-wrap:wrap;padding:9px 11px;font-size:.76rem}
  .calendar-agenda-events .calendar-event-meta{flex-basis:100%;margin-inline-start:0;margin-top:3px;white-space:normal}
  .calendar-mini-grid a{padding:7px 0}
}
html[data-theme="dark"] .calendar-mini-grid a.is-today{color:var(--accent-light)}
html[data-theme="dark"] .calendar-event{color:#e7edf6}
html[data-theme="dark"] .calendar-event:hover{color:#fff}
html[data-theme="dark"] .calendar-grid td.is-today .calendar-day-number,html[data-theme="dark"] .calendar-view-switch a.is-active{color:#141b2d;background:var(--accent-light)}
html[data-theme="dark"] .calendar-stat.is-alert strong{color:#ff8b95}
html[data-theme="dark"] .calendar-event.is-compact.is-overdue .calendar-event-title{color:#ff9aa2}
@media print{.calendar-rail,.calendar-view-switch,.calendar-toolbar-nav .calendar-nav-group,.calendar-today{display:none!important}.calendar-shell{grid-template-columns:minmax(0,1fr)}.calendar-panel{box-shadow:none}}


/* ============================================================
   Authentication page styles (Settings → Authentication).
   Four arrangements off one attribute on <body>. Everything is scoped to
   .auth-page[data-auth-style] — bare .login-page is left alone because the client intake
   portal and the error pages share that surface.
   ============================================================ */
.auth-shell { display: flex; align-items: center; justify-content: center; width: 100%; }
.auth-aside { display: none; }
.auth-aside-inner { position: relative; z-index: 1; max-width: 470px; color: #dfe7f4; animation: cardIn .5s cubic-bezier(.22, .8, .3, 1); }
.auth-aside-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 30px; }
.auth-aside-brand .brand-mark { width: 46px; height: 46px; flex: 0 0 46px; font-size: 1.05rem; }
.auth-aside-icon { display: block; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px; object-fit: contain; }
.auth-aside-name { font-family: var(--font-display, "Cormorant Garamond", Georgia, serif); font-size: 1.45rem; font-weight: 600; letter-spacing: .01em; color: #e6f3f5; }
.auth-aside-art { display: none; width: 100%; max-width: 400px; height: auto; color: #cfdcf2; }
.auth-aside-lockup { display: flex; flex-direction: column; line-height: 1.15; }
.auth-form-head, .auth-secure-note { display: none; }
.auth-form-sub { margin: 6px 0 0; font-size: .86rem; color: var(--muted); }
/* Eyebrow, headline copy and the footer note belong to Cover only — every other style leaves them off. */
.auth-aside-eyebrow, .auth-aside-copy, .auth-aside-foot, .auth-aside-sub { display: none; }
.auth-status-dot { display: inline-block; flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #37c98a; box-shadow: 0 0 0 3px rgba(55, 201, 138, .18); }
.auth-aside-tagline { max-width: 27ch; margin: 0 0 26px; font-family: var(--font-display, "Cormorant Garamond", Georgia, serif); font-size: clamp(1.7rem, 2.6vw, 2.3rem); line-height: 1.2; font-weight: 600; color: #fff; }
.auth-aside-points { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.auth-aside-points li { display: flex; align-items: center; gap: 11px; font-size: .84rem; color: #b9c7de; }
.auth-aside-points i { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 10px; color: var(--accent-light); background: color-mix(in srgb, var(--accent) 13%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); font-size: .88rem; }

/* ---- Basic: the shipped single centred card on the branded gradient. Nothing to override. ---- */

/* ---- Boxed: a compact card on a flat, undecorated ground ---- */
.auth-page[data-auth-style="boxed"] { background: var(--bg); }
.auth-page[data-auth-style="boxed"]::before,
.auth-page[data-auth-style="boxed"]::after { display: none; }
.auth-page[data-auth-style="boxed"] .login-card {
  max-width: 392px; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 34px rgba(20, 34, 61, .09);
}
.auth-page[data-auth-style="boxed"] .login-card > .card-body { padding: 30px 28px !important; }
html[data-theme="dark"] .auth-page[data-auth-style="boxed"] .login-card { background: var(--card); border-color: var(--line); }

/* ---- Cover: a full-bleed dark brand panel beside a chrome-free form column ----
   The panel runs edge to edge and carries the brand, the headline and the trust note; the form
   column is plain ground, so the card chrome, the in-card brand block and the input icons all
   switch off here. Everything stays inside the 992px query — below that Cover falls back to the
   shipped centred card, which still wants its gradient and its shadow. */
@media (min-width: 992px) {
  .auth-page[data-auth-style="cover"] { background: var(--card); overflow: visible; }
  .auth-page[data-auth-style="cover"]::before,
  .auth-page[data-auth-style="cover"]::after { display: none; }
  .auth-page[data-auth-style="cover"] .auth-shell {
    display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
    gap: 0; width: 100%; min-height: 100vh; align-items: stretch;
  }

  /* Panel */
  .auth-page[data-auth-style="cover"] .auth-aside {
    position: relative; display: flex; overflow: hidden; border: 0;
    padding: clamp(40px, 4.4vw, 76px);
    background:
      radial-gradient(80% 60% at 12% 92%, rgba(63, 96, 160, .22), transparent 62%),
      radial-gradient(70% 55% at 88% 8%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
      var(--grad-navy);
  }
  /* The two rings echo the ones the Basic page draws, pinned to opposite corners of the panel. */
  .auth-page[data-auth-style="cover"] .auth-aside::before,
  .auth-page[data-auth-style="cover"] .auth-aside::after {
    content: ""; position: absolute; border-radius: 50%; pointer-events: none;
    border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  }
  .auth-page[data-auth-style="cover"] .auth-aside::before { width: 560px; height: 560px; top: -260px; inset-inline-end: -180px; }
  .auth-page[data-auth-style="cover"] .auth-aside::after { width: 460px; height: 460px; bottom: -230px; inset-inline-start: -180px; }

  .auth-page[data-auth-style="cover"] .auth-aside-inner {
    display: flex; flex-direction: column; width: min(520px, 100%); max-width: none;
  }
  /* Brand sits at the top, the trust note at the very bottom, the copy in between. */
  .auth-page[data-auth-style="cover"] .auth-aside-brand { margin-bottom: auto; }
  .auth-page[data-auth-style="cover"] .auth-aside-sub { display: block; font-size: .6rem; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: #8c9ab4; }
  .auth-page[data-auth-style="cover"] .auth-aside-name { font-family: var(--font-sans); font-size: 1.15rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; }
  .auth-page[data-auth-style="cover"] .auth-aside-eyebrow {
    display: block; margin: 0 0 18px; font-size: .68rem; font-weight: 700;
    letter-spacing: 2.6px; text-transform: uppercase; color: var(--accent-light);
  }
  /* Cover wants a heavy sans headline, not the serif tagline the other styles show. */
  .auth-page[data-auth-style="cover"] .auth-aside-tagline {
    max-width: 15ch; margin: 0 0 22px; font-family: var(--font-sans);
    font-size: clamp(2.1rem, 3.4vw, 3.1rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em;
  }
  .auth-page[data-auth-style="cover"] .auth-aside-copy { display: block; max-width: 42ch; margin: 0; font-size: .92rem; line-height: 1.65; color: #9fb0cb; }
  .auth-page[data-auth-style="cover"] .auth-aside-points { display: none; }
  .auth-page[data-auth-style="cover"] .auth-aside-foot {
    display: flex; align-items: center; gap: 9px; margin: auto 0 0; padding-top: 40px;
    font-size: .76rem; color: #8c9ab4;
  }

  /* Form column — no card, no shadow, no in-card brand block: the panel already carries the brand. */
  .auth-page[data-auth-style="cover"] .login-card {
    display: flex; align-items: center; justify-content: center;
    width: 100%; max-width: none; margin: 0 !important;
    background: var(--card); border: 0; border-radius: 0; box-shadow: none !important; animation: none;
  }
  /* .card-body carries Bootstrap's flex:1 1 auto; let it shrink to its content or it fills the
     column and the form pins to the top instead of centring. */
  .auth-page[data-auth-style="cover"] .login-card > .card-body {
    flex: 0 1 auto; width: min(415px, 100%); padding: clamp(32px, 4vw, 56px) 0 !important;
  }
  .auth-page[data-auth-style="cover"] .login-brand-block { display: none; }
  /* The reset / two-factor shell has no separate heading block — keep its <h1> but drop the
     centred brand mark, which the panel already shows. */
  .auth-page[data-auth-style="cover"] .auth-alt-head { text-align: start !important; margin-bottom: 26px !important; }
  .auth-page[data-auth-style="cover"] .auth-alt-head .brand-mark { display: none; }
  .auth-page[data-auth-style="cover"] .auth-alt-head .login-title { font-family: var(--font-sans); font-size: 1.45rem !important; font-weight: 800; letter-spacing: -.01em; }
  .auth-page[data-auth-style="cover"] .auth-form-head { display: block; margin-bottom: 26px; }
  .auth-page[data-auth-style="cover"] .auth-form-title { margin: 0 0 6px; font-family: var(--font-sans); font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
  .auth-page[data-auth-style="cover"] .auth-form-sub { margin: 0; font-size: .86rem; color: var(--muted); }
  /* Sentence-case labels on this style; the uppercase micro-labels belong to the card layouts. */
  .auth-page[data-auth-style="cover"] .form-label {
    font-size: .8rem !important; font-weight: 600; letter-spacing: 0;
    text-transform: none !important; color: var(--ink) !important; margin-bottom: 6px;
  }
  /* The leading icon is card furniture — drop it so the field reads as one plain box. */
  .auth-page[data-auth-style="cover"] .input-group > .input-group-text { display: none; }
  /* The whole group is the field: it carries the tint, the border and the corners, while the
     control and the appended visibility toggle sit inside it with no chrome of their own.
     Without this the toggle reads as a second box parked beside the password box. */
  .auth-page[data-auth-style="cover"] .form-control,
  .auth-page[data-auth-style="cover"] .form-select,
  .auth-page[data-auth-style="cover"] .input-group {
    border-radius: 10px !important; background: color-mix(in srgb, var(--accent) 5%, var(--bg));
    border: 1px solid transparent;
  }
  .auth-page[data-auth-style="cover"] .form-control,
  .auth-page[data-auth-style="cover"] .form-select { padding: 11px 14px; }
  .auth-page[data-auth-style="cover"] .input-group { overflow: hidden; }
  .auth-page[data-auth-style="cover"] .input-group > .form-control {
    background: transparent; border: 0; box-shadow: none;
  }
  .auth-page[data-auth-style="cover"] .input-group > .erp-password-toggle {
    border: 0; background: transparent; margin-inline-end: 4px;
  }
  /* Focus lands on the group, not the bare control, or the highlight would stop short of the toggle. */
  .auth-page[data-auth-style="cover"] .form-control:focus,
  .auth-page[data-auth-style="cover"] .form-select:focus,
  .auth-page[data-auth-style="cover"] .input-group:focus-within { background: var(--card); border-color: var(--accent); }
  .auth-page[data-auth-style="cover"] .input-group > .form-control:focus { background: transparent; border-color: transparent; }
  .auth-page[data-auth-style="cover"] .btn-accent { border-radius: 10px; padding-block: 11px; }
  /* Quick login reads as a bordered aside rather than a stack of alerts. */
  .auth-page[data-auth-style="cover"] .login-quick {
    padding: 16px; border: 1px dashed color-mix(in srgb, var(--accent) 38%, transparent);
    border-radius: 12px; background: color-mix(in srgb, var(--accent) 6%, transparent);
  }
  .auth-page[data-auth-style="cover"] .login-quick .alert { background: transparent; border: 0; padding: 0 0 4px !important; color: var(--ink); }
  .auth-page[data-auth-style="cover"] .auth-secure-note { display: block; margin-top: 30px; text-align: center; }
  .auth-page[data-auth-style="cover"] .auth-secure-rule {
    display: flex; align-items: center; gap: 12px; font-size: .64rem; font-weight: 600;
    letter-spacing: 2.4px; text-transform: uppercase; color: var(--muted);
  }
  .auth-page[data-auth-style="cover"] .auth-secure-rule::before,
  .auth-page[data-auth-style="cover"] .auth-secure-rule::after { content: ""; flex: 1 1 auto; height: 1px; background: var(--line); }
  .auth-page[data-auth-style="cover"] .auth-secure-note p {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin: 16px 0 0; font-size: .78rem; color: var(--muted);
  }
}
html[data-theme="dark"] .auth-page[data-auth-style="cover"] .auth-form-title { color: #eef2f9; }

/* ---- Illustration: a light tinted art panel, form on plain ground with no card chrome ---- */
.auth-page[data-auth-style="illustration"] { background: var(--card); }
.auth-page[data-auth-style="illustration"]::before,
.auth-page[data-auth-style="illustration"]::after { display: none; }
@media (min-width: 992px) {
  .auth-page[data-auth-style="illustration"] .auth-shell {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0;
    width: 100%; min-height: 100vh; align-items: stretch;
  }
  .auth-page[data-auth-style="illustration"] .auth-aside {
    display: flex; align-items: center; justify-content: center; padding: clamp(32px, 5vw, 72px);
    background:
      radial-gradient(90% 70% at 50% 45%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
      color-mix(in srgb, var(--accent) 13%, #f6f7fb);
  }
  /* The panel carries the drawing alone — the words live beside the form. */
  .auth-page[data-auth-style="illustration"] .auth-aside-brand,
  .auth-page[data-auth-style="illustration"] .auth-aside-tagline,
  .auth-page[data-auth-style="illustration"] .auth-aside-points { display: none; }
  .auth-page[data-auth-style="illustration"] .auth-aside-inner { width: 100%; max-width: 520px; }
  .auth-page[data-auth-style="illustration"] .auth-aside-art { display: block; width: 100%; max-width: none; color: var(--navy-700); }
  /* The panel is the frame here, so the form sits on the plain ground.
     .shadow-lg is a Bootstrap utility and carries !important — match it to switch the card off. */
  .auth-page[data-auth-style="illustration"] .login-card {
    background: transparent; border: 0; box-shadow: none !important;
    width: 100%; max-width: 420px; justify-self: center; align-self: center; margin-inline: 0 !important;
  }
}
html[data-theme="dark"] .auth-page[data-auth-style="illustration"] .auth-aside { background: color-mix(in srgb, var(--accent) 10%, var(--navy-900)); }

/* Below 992px every split style collapses to the centred card so the form is never crowded. */
@media (max-width: 991.98px) {
  .auth-page .auth-aside { display: none !important; }
  .auth-page .auth-shell { display: flex; }
  .auth-page[data-auth-style="illustration"] .login-card { max-width: 440px; }
  /* The art panel is gone here, so borrow its tint for the page or the white card has
     nothing to stand against. */
  .auth-page[data-auth-style="illustration"] { background: color-mix(in srgb, var(--accent) 10%, #f5f7fb); }
}

/* ---- Nothing here reaches print ---- */
@media print { .auth-aside { display: none !important; } }

/* ============================================================
   Operations > Files — browse rail, storage meter, card grid.
   Layout is a two-column grid on desktop; below 992px the rail
   becomes a horizontal chip scroller so the grid keeps the width.
   Colours come from the shared tokens, so dark mode needs no overrides.
   ============================================================ */
.fm-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); gap: 20px; align-items: start; min-width: 0; }
.fm-panel, .fm-rail, .fm-nav, .fm-grid { min-width: 0; }

/* ---- Browse rail ---- */
.fm-rail { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--topbar-offset) + 16px); }
.fm-rail-card { padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); }
.fm-nav { display: flex; flex-direction: column; gap: 3px; }
.fm-nav-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; color: var(--ink); border-radius: 12px; font-size: .85rem; font-weight: 600; text-decoration: none; transition: background .16s ease, color .16s ease; }
.fm-nav-item i { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: 0 0 30px; color: var(--muted); border-radius: 10px; background: var(--bg); font-size: .92rem; transition: background .16s ease, color .16s ease; }
.fm-nav-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fm-nav-item:hover { background: var(--bg); }
.fm-nav-item:hover i { color: var(--ink); }
.fm-nav-item.is-active { color: var(--accent-ink); background: var(--grad-accent); box-shadow: 0 8px 18px rgba(22, 38, 67, .16); }
.fm-nav-item.is-active i { color: var(--accent-ink); background: rgba(255, 255, 255, .26); }
.fm-nav-count { min-width: 22px; padding: 2px 7px; color: var(--muted); border-radius: 8px; background: var(--bg); font-size: .68rem; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.fm-nav-item.is-active .fm-nav-count { color: var(--accent-ink); background: rgba(255, 255, 255, .3); }

/* ---- Storage meter ---- */
.fm-storage { padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm); }
.fm-storage-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--ink); font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.fm-storage-head i { color: var(--accent); font-size: .92rem; }
.fm-storage-head span { flex: 1; }
.fm-storage-pct { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.fm-storage-track { overflow: hidden; height: 8px; border-radius: 99px; background: var(--bg); box-shadow: inset 0 1px 2px rgba(13, 21, 38, .08); }
.fm-storage-fill { display: block; min-width: 6px; height: 100%; border-radius: 99px; background: var(--grad-accent); transition: width .35s ease; }
.fm-storage-fill.is-full { background: linear-gradient(135deg, #e2745f, #d6453c); }
.fm-storage-copy { display: flex; align-items: baseline; gap: 5px; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.fm-storage-copy strong { color: var(--ink); font-weight: 700; }

/* ---- Panel ---- */
.fm-panel { display: flex; flex-direction: column; overflow: hidden; min-height: 440px; padding: 0; border: 1px solid var(--line); border-radius: 18px; }
.fm-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--card) 94%, var(--accent-soft)), var(--card)); }
.fm-search { position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 380px; }
.fm-search i { position: absolute; inset-inline-start: 13px; color: var(--muted); font-size: .84rem; pointer-events: none; }
.fm-search input { width: 100%; padding: 10px 34px 10px 36px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: .84rem; }
.fm-search input::placeholder { color: var(--muted); }
.fm-search input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fm-search-clear { position: absolute; inset-inline-end: 12px; display: inline-flex; color: var(--muted); font-size: .7rem; text-decoration: none; }
.fm-search-clear:hover { color: var(--ink); }
.fm-toolbar-actions { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.fm-toolbar-actions .btn { display: inline-flex; align-items: center; border-radius: 12px; font-size: .82rem; font-weight: 650; white-space: nowrap; }
.fm-body { flex: 1; padding: 20px 20px 26px; }

/* ---- Heading + breadcrumb ---- */
.fm-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.fm-heading h2 { margin: 0; color: var(--ink); font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.fm-heading p { margin: 3px 0 0; max-width: 62ch; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.fm-crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); color: var(--muted); font-size: .75rem; }
.fm-crumbs a { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); text-decoration: none; }
.fm-crumbs a:hover { color: var(--ink); }
.fm-crumbs a:last-of-type { color: var(--ink); font-weight: 650; }
.fm-crumbs i.bi-chevron-right { font-size: .58rem; opacity: .7; }
.fm-section-title { display: flex; align-items: center; gap: 9px; margin: 26px 0 12px; color: var(--muted); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.fm-section-title:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fm-section-title span { padding: 1px 7px; border-radius: 7px; background: var(--bg); font-size: .66rem; letter-spacing: 0; font-variant-numeric: tabular-nums; }

/* ---- Grids ---- */
.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 16px; }
.fm-grid-folders { grid-template-columns: repeat(auto-fill, minmax(238px, 1fr)); }
.fm-card, .fm-folder { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.fm-card:hover, .fm-folder:hover { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.fm-card:focus-within, .fm-folder:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fm-card.is-starred, .fm-folder.is-starred { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.fm-card { padding: 12px; }

/* File card */
.fm-thumb { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--card) 90%, var(--bg)); color: var(--muted); font-size: 2.15rem; text-decoration: none; transition: background .16s ease; }
a.fm-thumb:hover { background: var(--bg); }
.fm-thumb.is-image { color: #3aa0d8; } .fm-thumb.is-archive { color: #e2568c; } .fm-thumb.is-sheet { color: #2fa66b; } .fm-thumb.is-doc { color: #2f6fd0; }
.fm-thumb.is-slides { color: #e07a34; } .fm-thumb.is-pdf { color: #d6453c; } .fm-thumb.is-video { color: #7b5ce0; } .fm-thumb.is-audio { color: var(--accent); } .fm-thumb.is-text { color: #4aa3df; }
.fm-card-body { display: flex; flex-direction: column; gap: 3px; padding: 12px 2px 2px; }
.fm-name { overflow: hidden; color: var(--ink); font-size: .84rem; font-weight: 650; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.fm-meta { color: var(--muted); font-size: .73rem; font-variant-numeric: tabular-nums; }
.fm-sub { display: flex; align-items: center; gap: 5px; margin-top: 7px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: .71rem; }
.fm-sub i { font-size: .7rem; }
.fm-sub strong { color: var(--ink); font-weight: 650; }
.fm-star { position: absolute; top: 20px; inset-inline-start: 20px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--accent); border-radius: 8px; background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(3px); font-size: .74rem; }

/* Folder card */
.fm-folder-main { display: flex; align-items: center; gap: 13px; padding: 15px 44px 15px 15px; text-decoration: none; }
.fm-folder-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px; background: color-mix(in srgb, var(--accent-soft) 75%, transparent); color: var(--accent); font-size: 1.22rem; }
.fm-folder-icon.has-files { color: #e0982f; background: color-mix(in srgb, #e0982f 14%, transparent); }
.fm-folder-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fm-folder-copy strong { overflow: hidden; color: var(--ink); font-size: .86rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.fm-folder-copy small { color: var(--muted); font-size: .73rem; font-variant-numeric: tabular-nums; }

/* ---- Item menu ---- */
.fm-menu { position: absolute; top: 9px; inset-inline-end: 9px; z-index: 2; }
.fm-menu-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; color: var(--muted); border: 1px solid transparent; border-radius: 9px; background: transparent; font-size: .84rem; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.fm-menu-btn:hover, .fm-menu-btn[aria-expanded="true"] { color: var(--ink); border-color: var(--line); background: var(--card); }
.fm-menu .dropdown-menu { --bs-dropdown-min-width: 11rem; padding: 6px; border-radius: 13px; font-size: .82rem; }
.fm-menu .dropdown-item { border-radius: 9px; }
.fm-menu .dropdown-menu form { display: block; }
.fm-menu .dropdown-menu button.dropdown-item { width: 100%; text-align: start; }

/* ---- Empty state + upload dialog ---- */
.fm-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; margin-top: 24px; padding: 54px 24px; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; background: color-mix(in srgb, var(--card) 96%, var(--bg)); text-align: center; }
.fm-empty i { color: var(--accent); font-size: 2rem; opacity: .8; }
.fm-empty span { color: var(--ink); font-size: .88rem; font-weight: 600; }
.fm-dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: 15px; background: color-mix(in srgb, var(--card) 94%, var(--bg)); cursor: pointer; text-align: center; transition: border-color .15s ease, background .15s ease; }
.fm-dropzone:hover, .fm-dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.fm-dropzone i { color: var(--accent); font-size: 1.8rem; }
.fm-dropzone strong { color: var(--ink); font-size: .9rem; }
.fm-dropzone small { font-size: .74rem; }
.fm-upload-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; margin: 12px 0 0; padding: 0; list-style: none; }
.fm-upload-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; font-size: .79rem; }
.fm-upload-list li i { color: var(--muted); }
.fm-upload-list li span { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.fm-upload-list li small { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Responsive ---- */
@media (max-width: 1399.98px) { .fm-shell { grid-template-columns: 238px minmax(0, 1fr); gap: 16px; } }

@media (max-width: 991.98px) {
  /* The rail turns into a scrollable chip row so the grid keeps the full width. */
  .fm-shell { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
  .fm-rail { position: static; flex-direction: row; align-items: stretch; gap: 12px; }
  .fm-rail-card { flex: 1 1 0; min-width: 0; overflow: hidden; padding: 8px; }
  .fm-nav { flex-direction: row; gap: 6px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .fm-nav::-webkit-scrollbar { display: none; }
  .fm-nav-item { flex: 0 0 auto; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); font-size: .8rem; }
  .fm-nav-item i { width: 20px; height: 20px; flex-basis: 20px; background: none; font-size: .85rem; }
  .fm-nav-item.is-active { border-color: transparent; }
  .fm-nav-item.is-active i { background: none; }
  .fm-storage { flex: 0 0 232px; align-self: stretch; padding: 12px 14px; }
  .fm-storage-head { margin-bottom: 9px; }
  .fm-storage-copy { margin-top: 8px; font-size: .72rem; }
  .fm-panel { min-height: 0; }
}

@media (max-width: 767.98px) {
  /* Stacked rail: reset the row-direction flex sizes so heights are content-driven again. */
  .fm-rail { flex-direction: column; }
  .fm-rail-card, .fm-storage { flex: 0 0 auto; }
  .fm-toolbar { padding: 12px 14px; }
  .fm-search { flex: 1 1 100%; max-width: none; }
  .fm-toolbar-actions { width: 100%; margin-inline-start: 0; }
  .fm-toolbar-actions .btn { flex: 1 1 auto; justify-content: center; }
  .fm-toolbar-actions form { flex: 1 1 100%; display: flex; }
  .fm-toolbar-actions form .btn { width: 100%; }
  .fm-body { padding: 16px 14px 22px; }
  .fm-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .fm-grid-folders { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
  .fm-thumb { font-size: 1.8rem; }
  .fm-empty { padding: 40px 18px; }
}

@media (max-width: 575.98px) {
  .fm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fm-grid-folders { grid-template-columns: minmax(0, 1fr); }
  .fm-folder-main { padding: 13px 42px 13px 13px; }
  .fm-heading h2 { font-size: 1.14rem; }
  .fm-section-title { margin: 20px 0 10px; }
}

@media (hover: none) { .fm-card:hover, .fm-folder:hover { transform: none; box-shadow: var(--shadow-sm); } }
@media (prefers-reduced-motion: reduce) { .fm-card, .fm-folder, .fm-storage-fill { transition: none; } }.item-total{font-weight:700;white-space:nowrap}.invoice-meta span,.invoice-payment-info span,.invoice-side-card>span:not(.badge){display:block;font-size:.78rem;color:var(--muted);margin-bottom:5px}.invoice-side-card>.badge{margin-bottom:12px}.payment-received{display:block!important;background:color-mix(in srgb,#198754 12%,var(--card));border:1px solid color-mix(in srgb,#198754 30%,var(--line));border-radius:9px;margin-top:18px;padding:14px!important;color:#198754!important}.invoice-actions .btn{width:100%}.invoice-detail-toolbar .btn{font-size:.8rem}
@media(max-width:900px){.invoice-detail-grid{grid-template-columns:1fr}.invoice-paper-head{gap:20px}.invoice-sidebar{border-inline-start:0;border-top:1px solid var(--line)}}
@media(max-width:575px){.invoice-paper,.invoice-side-card{padding:17px}.invoice-paper-head,.invoice-meta{grid-template-columns:1fr}.invoice-paper hr{margin:18px 0}.invoice-detail-toolbar{align-items:stretch;flex-direction:column}.invoice-detail-toolbar>div{width:100%}.invoice-detail-toolbar .btn{flex:1}}

/* Live counters on navigation entries (e.g. unread mail, per signed-in user). */
.erp-nav .nav-badge, .erp-topnav .nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px; margin-inline-start: auto;
  border-radius: 999px; background: var(--grad-accent); color: var(--accent-ink);
  font-size: .66rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
}
.erp-nav .nav-link { position: relative; }
html.erp-sidebar-collapsed:not(.erp-sidebar-peek) .erp-nav .nav-badge {
  position: absolute; inset-inline-end: 6px; top: 6px; min-width: 8px; height: 8px; padding: 0; font-size: 0;
}

/* Password visibility control */
.erp-password-wrapper { position: relative; }
.erp-password-wrapper > input { padding-inline-end: 2.75rem; }
.erp-password-toggle {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.75rem; padding: .375rem .65rem; font-size: 1rem;
}
.erp-password-toggle:hover, .erp-password-toggle:focus-visible { color: var(--ink); }
.erp-password-wrapper > .erp-password-toggle {
  position: absolute; inset-inline-end: 0; top: 50%; transform: translateY(-50%);
}
.input-group > .erp-password-toggle { border-inline-start: 1px solid var(--line); }

/* ---- Step wizard (workspace settings) ---- */
.wizard-card { overflow: hidden; }
.wizard-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 430px; }
.wizard-steps { padding: 14px 0 14px 14px; border-inline-end: 1px solid var(--line); }
.wizard-step { position: relative; display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 60px; padding: 0 12px 12px 0; border: 0; background: transparent; color: var(--muted); text-align: start; }
.wizard-step:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 15px; top: 36px; bottom: 2px; border-inline-start: 1px dashed var(--line); }
.wizard-step-icon { position: relative; z-index: 1; display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); font-size: .78rem; }
.wizard-step strong { display: block; margin-top: 0; color: var(--ink); font-size: .76rem; font-weight: 600; line-height: 1.25; }
.wizard-step small { display: block; max-width: 145px; margin-top: 1px; overflow: hidden; color: var(--muted); font-size: .63rem; white-space: nowrap; text-overflow: ellipsis; }
.wizard-step.active .wizard-step-icon { border-color: var(--navy-800); background: var(--navy-800); color: #fff; box-shadow: 0 0 0 2px var(--card), 0 0 0 3px color-mix(in srgb, var(--navy-800) 35%, transparent); }
.wizard-step.active strong { color: var(--navy-800); }
.wizard-step.is-done .wizard-step-icon { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent); }
.wizard-panels { display: flex; flex-direction: column; min-width: 0; padding: 20px; }
.wizard-panel { display: none; flex: 1; animation: wizard-panel-in .18s ease; }
.wizard-panel.active { display: block; }
@keyframes wizard-panel-in { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.wizard-panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.wizard-panel-heading > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: .7rem; font-weight: 700; }
.wizard-panel-heading h2 { margin: 0; color: var(--ink); font-size: 1.02rem; font-weight: 700; }
.wizard-panel-heading p { margin: 2px 0 0; color: var(--muted); font-size: .72rem; }
.wizard-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.wizard-actions .btn { min-width: 96px; }
.wizard-swatch { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; color: #fff; font-size: 1.6rem; box-shadow: var(--shadow-sm); }
.wizard-surface { display: flex; align-items: center; gap: 22px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafd; }
html[data-theme="dark"] .wizard-steps { border-color: #334155; }
html[data-theme="dark"] .wizard-step:not(:last-child)::after { border-color: #334155; }
html[data-theme="dark"] .wizard-step-icon { border-color: #334155; background: #111c2c; color: #94a3b8; }
html[data-theme="dark"] .wizard-step strong { color: #e2e8f4; }
html[data-theme="dark"] .wizard-step.active .wizard-step-icon { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); box-shadow: none; }
html[data-theme="dark"] .wizard-step.active strong { color: var(--accent-light); }
html[data-theme="dark"] .wizard-panel-heading, html[data-theme="dark"] .wizard-actions { border-color: #334155; }
html[data-theme="dark"] .wizard-panel-heading h2 { color: #e2e8f4; }
html[data-theme="dark"] .wizard-surface { border-color: #334155; background: #111c2c; }
@media (max-width: 991.98px) {
  .wizard-layout { grid-template-columns: 1fr; }
  .wizard-steps { display: flex; gap: 4px; overflow-x: auto; padding: 14px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .wizard-step { min-width: 62px; min-height: auto; justify-content: center; padding: 0; }
  .wizard-step:not(:last-child)::after, .wizard-step > span:last-child { display: none; }
  .wizard-panels { padding: 16px; }
}
@media (max-width: 575.98px) {
  .wizard-surface { flex-direction: column; align-items: flex-start; padding: 16px; }
  .wizard-swatch { width: 54px; height: 54px; font-size: 1.15rem; }
  .wizard-actions { flex-direction: column; align-items: stretch; }
  .wizard-actions .btn, .wizard-actions > div { width: 100%; }
  .wizard-actions > div { display: flex; gap: 8px; margin-inline-start: 0 !important; }
  .wizard-panel-heading p { display: none; }
}

/* ---- Workspace switcher (sidebar footer) ---- */
.workspace-switch .dropdown-menu { --bs-dropdown-min-width: 0; max-height: 60vh; overflow-y: auto; padding: 6px; }
.workspace-switch .dropdown-item { padding: 7px 9px; border-radius: 10px; }
.workspace-switch .dropdown-item strong { font-size: .8rem; font-weight: 600; }
.workspace-switch .dropdown-item small { font-size: .68rem; }
.workspace-switch .dropdown-item .avatar { flex: 0 0 26px; }
.workspace-switch form { margin: 0; }
html.erp-sidebar-collapsed:not(.erp-sidebar-peek) .workspace-switch .btn { justify-content: center; }
html.erp-sidebar-collapsed:not(.erp-sidebar-peek) .workspace-switch .dropdown-menu { min-width: 232px; }

/* ---- Shell dropdowns: fixed anchoring ----
   These toggles use data-bs-display="static", so the menu is placed by CSS
   rather than recomputed by Popper on every open — the position no longer
   shifts between openings or when the top bar is sticky/blurred. */
.erp-topbar .dropdown { position: relative; }
.erp-topbar .dropdown-menu { inset: auto 0 auto auto; margin-top: 8px; }
.erp-topbar .dropdown-menu[data-bs-popper] { top: 100%; right: 0; left: auto; }
.workspace-switch .dropdown-menu { inset: auto auto 100% 0; margin-bottom: 8px; width: 100%; }
.workspace-switch .dropdown-menu[data-bs-popper] { bottom: 100%; top: auto; left: 0; right: auto; }
