/* =====================================================================
   MAINTENANT DESIGN SYSTEM — v1 (Phase 1: global layout)
   ---------------------------------------------------------------------
   Loaded LAST in includes/admin_head, after the Vuexy template,
   custom.css, modern-theme.css and ops-pages.css.
   All rules are scoped under `html.ds` so they win over the older theme
   layers without touching them. Remove the <link> (and the `ds` class on
   <html>) to roll back instantly.

   Sections
     0. Tokens
     1. Legacy-token bridge (re-points older theme variables to the new palette)
     2. Base: canvas & typography
     3. Sidebar
     4. Top bar
     5. Quick navigation (Ctrl K)
     6. Page header, related links, module tabs
     7. Primitives: buttons, forms, cards, badges, dropdowns, tables
     8. Reusable components (x-ui.*)
     9. Footer
    10. Responsive
   ===================================================================== */

/* ---------------------------------------------------------------------
   0. Tokens
   --------------------------------------------------------------------- */
:root {
    /* brand */
    --ds-primary: #6948E8;
    --ds-primary-hover: #5835D9;
    --ds-primary-active: #4C2BC4;
    --ds-primary-50: #F3F0FE;
    --ds-primary-100: #E7E1FC;
    --ds-primary-200: #CFC3F8;
    --ds-primary-rgb: 105, 72, 232;
    --ds-primary-light: #7C5EF2;
    --ds-primary-dark: #5636D4;
    --ds-primary-ring: rgba(var(--ds-primary-rgb), 0.18);

    /* sidebar */
    --ds-nav-bg: #171936;
    --ds-nav-bg-raised: #1F2246;
    --ds-nav-hover: rgba(255, 255, 255, 0.05);
    --ds-nav-active: rgba(var(--ds-primary-rgb), 0.22);
    --ds-nav-border: rgba(255, 255, 255, 0.07);
    --ds-nav-text: #C5C8E0;
    --ds-nav-text-strong: #FFFFFF;
    --ds-nav-muted: #7C80A6;
    --ds-nav-accent: #9F86FF;

    /* surfaces & ink */
    --ds-bg: #F6F7FB;
    --ds-surface: #FFFFFF;
    --ds-surface-2: #FAFBFD;
    --ds-surface-3: #F1F3F8;
    --ds-border: #E6E8F0;
    --ds-border-strong: #D5D9E5;
    --ds-ink: #14162B;
    --ds-ink-2: #3D4160;
    --ds-ink-3: #6B7090;
    --ds-ink-4: #9A9EB8;

    /* status */
    --ds-success: #16A36A;
    --ds-success-rgb: 22, 163, 106;
    --ds-success-50: #E8F7F0;
    --ds-success-ink: #0E7A4E;
    --ds-warning: #E99A37;
    --ds-warning-rgb: 233, 154, 55;
    --ds-warning-50: #FDF3E6;
    --ds-warning-ink: #A9661A;
    --ds-danger: #DC3F4D;
    --ds-danger-rgb: 220, 63, 77;
    --ds-danger-50: #FCECEE;
    --ds-danger-ink: #B42634;
    --ds-info: #2E86DE;
    --ds-info-50: #E9F3FC;
    --ds-info-ink: #1D64A8;

    /* type */
    --ds-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ds-text-xs: 0.72rem;   /* 11.5px */
    --ds-text-sm: 0.8125rem; /* 13px */
    --ds-text-md: 0.875rem;  /* 14px */
    --ds-text-lg: 1rem;      /* 16px */
    --ds-text-xl: 1.375rem;  /* 22px */

    /* shape, depth, motion */
    --ds-radius-xs: 6px;
    --ds-radius-sm: 8px;
    --ds-radius: 10px;
    --ds-radius-lg: 14px;
    --ds-shadow-xs: 0 1px 2px rgba(20, 22, 43, 0.05);
    --ds-shadow-sm: 0 1px 2px rgba(20, 22, 43, 0.04), 0 1px 3px rgba(20, 22, 43, 0.04);
    --ds-shadow-md: 0 4px 12px -2px rgba(20, 22, 43, 0.08), 0 2px 4px -2px rgba(20, 22, 43, 0.04);
    --ds-shadow-lg: 0 18px 40px -12px rgba(20, 22, 43, 0.22);
    --ds-ease: cubic-bezier(0.2, 0, 0, 1);
    --ds-dur: 140ms;

    /* layout */
    --ds-topbar-h: 64px;
    --ds-gutter: 1.75rem;
}

/* ---------------------------------------------------------------------
   1. Legacy-token bridge
   The older theme layers read these variables; pointing them at the new
   tokens moves every existing page onto the new palette at once.
   Gradients collapse to a flat brand colour (no more indigo→violet).
   --------------------------------------------------------------------- */
html.ds:root,
html.ds.light-style {
    --mt-primary: var(--ds-primary);
    --mt-primary-600: var(--ds-primary-hover);
    --mt-primary-soft: var(--ds-primary-50);
    --mt-primary-ring: var(--ds-primary-ring);
    --mt-success: var(--ds-success);
    --mt-success-soft: var(--ds-success-50);
    --mt-warning: var(--ds-warning);
    --mt-warning-soft: var(--ds-warning-50);
    --mt-danger: var(--ds-danger);
    --mt-danger-soft: var(--ds-danger-50);
    --mt-info: var(--ds-info);
    --mt-info-soft: var(--ds-info-50);
    --mt-ink: var(--ds-ink);
    --mt-bg: var(--ds-bg);
    --mt-border: var(--ds-border);
    --mt-border-strong: var(--ds-border-strong);
    --mt-font: var(--ds-font);
    --mt-radius: var(--ds-radius-lg);
    --mt-radius-sm: var(--ds-radius);
    --mt-grad: linear-gradient(0deg, var(--ds-primary), var(--ds-primary));
    --mt-grad-hover: linear-gradient(0deg, var(--ds-primary-hover), var(--ds-primary-hover));
    --mt-nav-bg: var(--ds-nav-bg);
    --mt-nav-bg-2: var(--ds-nav-bg);

    --bs-primary: var(--ds-primary);
    --bs-primary-rgb: var(--ds-primary-rgb);
    --bs-success: var(--ds-success);
    --bs-success-rgb: var(--ds-success-rgb);
    --bs-warning: var(--ds-warning);
    --bs-warning-rgb: var(--ds-warning-rgb);
    --bs-link-color: var(--ds-primary);
    --bs-link-color-rgb: var(--ds-primary-rgb);
    --bs-link-hover-color: var(--ds-primary-hover);
    --bs-body-bg: var(--ds-bg);
    --bs-body-font-family: var(--ds-font);
    --bs-border-color: #E6E8F0;
    --bs-body-color: #14162B;
    --bs-body-color-rgb: 20, 22, 43;
    --bs-heading-color: #14162B;
    --bs-secondary-color: #6B7090;
}

/* ---------------------------------------------------------------------
   2. Base: canvas & typography
   --------------------------------------------------------------------- */
html.ds body {
    background: var(--ds-bg) !important;
    color: var(--ds-ink);
    font-family: var(--ds-font);
    font-size: var(--ds-text-md);
    line-height: 1.5;
    font-feature-settings: 'cv11', 'ss01';
    letter-spacing: -0.006em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
html.ds body .layout-page { background: none !important; }
html.ds { scrollbar-gutter: stable; } /* no layout jump when the search dialog locks scrolling */
html.ds body h1, html.ds body h2, html.ds body h3,
html.ds body h4, html.ds body h5, html.ds body h6 {
    color: var(--ds-ink);
    font-weight: 600;
    letter-spacing: -0.018em;
}
html.ds body a { color: var(--ds-primary); }
html.ds body a:hover { color: var(--ds-primary-hover); }
html.ds body ::selection { background: var(--ds-primary-100); }
html.ds body .text-muted { color: var(--ds-ink-3) !important; }
html.ds body :focus-visible { outline: 2px solid var(--ds-primary); outline-offset: 2px; }
html.ds body .ds-icon { flex-shrink: 0; display: inline-block; vertical-align: middle; }

/* ---------------------------------------------------------------------
   3. Sidebar — Deep Violet Gradient · Midnight Navy · Compact
   Widths: 250px expanded · 76px compact (desktop collapsed, and tablet by default)
   Compact visuals are generated for two contexts (see the end of this section).
   --------------------------------------------------------------------- */
:root {
    --ds-sb-w: 250px;
    --ds-sb-w-compact: 76px;
    --ds-sb-bg: #19172F;
    --ds-sb-grad-start: #39236D;
    --ds-sb-grad-end: #171936;
    --ds-sb-grad-start-rgb: 57, 35, 109;
    --ds-sb-grad-mid: var(--ds-sb-grad-mid);
    --ds-sb-raised: var(--ds-sb-raised);
    --ds-sb-raised-2: var(--ds-sb-raised-2);
    --ds-sb-active: var(--ds-primary);
    --ds-sb-accent: #B9A6FF;
    --ds-sb-accent-rgb: 185, 166, 255;
    --ds-sb-text: #FFFFFF;
    --ds-sb-text-2: #AAA7C3;
    --ds-sb-text-3: rgba(170, 167, 195, 0.62);
    --ds-sb-hover: rgba(255, 255, 255, 0.07);
    --ds-sb-line: rgba(255, 255, 255, 0.07);
    --ds-sb-dur: 260ms;
}

/* frame */
html.ds body .layout-menu.ds-sidebar {
    width: var(--ds-sb-w) !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column;
    background-color: var(--ds-sb-bg) !important;
    background-image: linear-gradient(180deg, var(--ds-sb-grad-start) 0%, var(--ds-sb-grad-mid) 18%, var(--ds-sb-bg) 46%, var(--ds-sb-grad-end) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
    box-shadow: none !important;
    color: var(--ds-sb-text-2);
    z-index: 1100;
    transition: width var(--ds-sb-dur) var(--ds-ease), transform var(--ds-sb-dur) var(--ds-ease), box-shadow var(--ds-sb-dur) var(--ds-ease) !important;
}
html.ds body .layout-menu.ds-sidebar::after { /* fine top sheen */
    content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; pointer-events: none;
    background: radial-gradient(120% 100% at 0% 0%, rgba(var(--ds-sb-accent-rgb), 0.12), transparent 70%);
}
html.ds body #layout-menu ~ .layout-page { transition: padding-left var(--ds-sb-dur) var(--ds-ease); }

/* brand */
html.ds body .ds-sidebar .ds-brand {
    position: relative; z-index: 1;
    display: flex; align-items: center; gap: 0.5rem;
    height: var(--ds-topbar-h); min-height: var(--ds-topbar-h);
    margin: 0 !important; padding: 0 0.9rem 0 1.05rem !important;
    flex-shrink: 0;
}
html.ds body .ds-sidebar .ds-brand-link { display: flex; align-items: center; gap: 0.7rem; min-width: 0; flex: 1; text-decoration: none; }
html.ds body .ds-sidebar .ds-brand-logo {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px;
    background: #FFFFFF; color: var(--ds-primary);
    display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
    box-shadow: 0 6px 16px -4px rgba(8, 6, 24, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.12);
}
html.ds body .ds-sidebar .ds-brand-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
html.ds body .ds-sidebar .ds-brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; transition: opacity 160ms var(--ds-ease); }
html.ds body .ds-sidebar .ds-brand-name { color: var(--ds-sb-text); font-size: 0.875rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-sidebar .ds-brand-kicker { color: var(--ds-sb-text-2); font-size: 0.7rem; font-weight: 500; white-space: nowrap; }
html.ds body .ds-sidebar .ds-drawer-close {
    display: none !important; width: 32px; height: 32px; padding: 0 !important; margin: 0 !important;
    align-items: center; justify-content: center; border-radius: 8px;
    color: var(--ds-sb-text-2) !important; background: var(--ds-sb-hover) !important;
}

/* edge collapse button (≥768px) */
html.ds body .ds-sidebar .ds-edge-toggle {
    position: absolute; top: calc(var(--ds-topbar-h) / 2 - 12px); right: -12px; z-index: 3;
    width: 24px; height: 24px; padding: 0; margin: 0;
    display: none; align-items: center; justify-content: center;
    border-radius: 50%; border: 1px solid var(--ds-border);
    background: #FFFFFF; color: var(--ds-ink-2);
    box-shadow: 0 2px 6px rgba(20, 22, 43, 0.16);
    cursor: pointer;
    transition: color 150ms var(--ds-ease), border-color 150ms var(--ds-ease), box-shadow 150ms var(--ds-ease);
}
html.ds body .ds-sidebar .ds-edge-toggle:hover { color: var(--ds-primary); border-color: var(--ds-primary-200); box-shadow: 0 2px 10px rgba(var(--ds-primary-rgb), 0.3); }
html.ds body .ds-sidebar .ds-edge-toggle:focus-visible { outline: 2px solid var(--ds-sb-accent); outline-offset: 2px; }
html.ds body .ds-sidebar .ds-edge-toggle .ds-icon { transition: transform var(--ds-sb-dur) var(--ds-ease); }

/* search */
html.ds body .ds-sidebar .ds-nav-search-wrap { position: relative; z-index: 1; padding: 0.35rem 0.85rem 0.6rem; flex-shrink: 0; }
html.ds body .ds-sidebar .ds-nav-filter { position: relative; display: block; margin: 0; }
html.ds body .ds-sidebar .ds-nav-filter .ds-icon { position: absolute; left: 0.7rem; top: 50%; transform: translateY(-50%); color: var(--ds-sb-text-2); pointer-events: none; }
html.ds body .ds-sidebar .ds-nav-filter input {
    width: 100%; height: 34px; margin: 0;
    padding: 0 0.6rem 0 2rem;
    border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 9px;
    background: rgba(255, 255, 255, 0.05); box-shadow: none; outline: none;
    color: #FFFFFF; font-size: 0.8125rem; font-family: var(--ds-font);
    transition: background 150ms var(--ds-ease), border-color 150ms var(--ds-ease), box-shadow 150ms var(--ds-ease);
}
html.ds body .ds-sidebar .ds-nav-filter input::placeholder { color: var(--ds-sb-text-2); opacity: 1; }
html.ds body .ds-sidebar .ds-nav-filter input:hover { background: rgba(255, 255, 255, 0.08); }
html.ds body .ds-sidebar .ds-nav-filter input:focus { background: rgba(255, 255, 255, 0.08); border-color: rgba(var(--ds-sb-accent-rgb), 0.55); box-shadow: 0 0 0 3px rgba(var(--ds-primary-rgb), 0.3); }
html.ds body .ds-sidebar .ds-nav-filter input::-webkit-search-cancel-button { filter: invert(1) opacity(0.55); cursor: pointer; }
html.ds body .ds-sidebar .ds-nav-hidden { display: none !important; }
html.ds body .ds-sidebar .ds-nav-group.is-filter-open > .ds-nav-sub-wrap { grid-template-rows: 1fr; }
html.ds body .ds-sidebar .ds-nav-group.is-filter-open > .ds-nav-toggle .ds-nav-chevron { transform: rotate(90deg); }
html.ds body .ds-sidebar mark { padding: 0 1px; border-radius: 3px; background: rgba(var(--ds-sb-accent-rgb), 0.28); color: #FFFFFF; }
html.ds body .ds-sidebar .ds-nav-empty { margin: 0.75rem 0.65rem; color: var(--ds-sb-text-2); font-size: 0.8rem; }

/* scroll area */
html.ds body .ds-sidebar .ds-nav-scroll {
    position: relative; z-index: 1;
    flex: 1 1 auto; min-height: 0; width: 100%;
    display: block !important;
    overflow-y: auto; overflow-x: hidden;
    padding: 0.15rem 0.75rem 1rem !important; margin: 0 !important;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
html.ds body .ds-sidebar .ds-nav-scroll .ps__rail-y { background: transparent !important; }
html.ds body .ds-sidebar .ds-nav-scroll .ps__thumb-y { background-color: rgba(255, 255, 255, 0.2) !important; width: 4px !important; }

/* group headings */
html.ds body .ds-sidebar .ds-nav-heading {
    margin: 1.05rem 0.65rem 0.4rem; padding: 0;
    color: #AAA7C3 !important; opacity: 1; font-size: 0.66rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
    white-space: nowrap; overflow: hidden;
}
html.ds body .ds-sidebar .ds-nav-section:first-child .ds-nav-heading { margin-top: 0.35rem; }

/* items */
html.ds body .ds-sidebar .ds-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; width: 100%; }
html.ds body .ds-sidebar .ds-nav-item { position: relative; }
html.ds body .ds-sidebar .ds-nav-link {
    position: relative;
    width: 100%; height: 38px;
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0 0.65rem; margin: 0;
    border: 0; border-radius: 9px;
    background: transparent;
    color: #CFCCE3; font-size: 0.84rem; font-weight: 500; letter-spacing: -0.005em; text-align: left; text-decoration: none;
    cursor: pointer;
    transition: background 150ms var(--ds-ease), color 150ms var(--ds-ease), box-shadow 150ms var(--ds-ease);
}
html.ds body .ds-sidebar .ds-nav-icon { width: 20px; height: 20px; flex: 0 0 20px; display: inline-flex; align-items: center; justify-content: center; color: var(--ds-sb-text-2); transition: color 150ms var(--ds-ease); }
html.ds body .ds-sidebar .ds-nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-sidebar .ds-nav-link:hover { background: var(--ds-sb-hover); color: var(--ds-sb-text); }
html.ds body .ds-sidebar .ds-nav-link:hover .ds-nav-icon { color: var(--ds-sb-accent); }
html.ds body .ds-sidebar .ds-nav-link:focus-visible { outline: 2px solid var(--ds-sb-accent); outline-offset: -2px; }

/* active link: soft violet gradient, glow, white icon + text, edge indicator */
html.ds body .ds-sidebar .ds-nav-link.is-active {
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--ds-primary-light) 0%, var(--ds-primary) 52%, var(--ds-primary-dark) 100%);
    box-shadow: 0 4px 12px -6px rgba(var(--ds-primary-rgb), 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
html.ds body .ds-sidebar .ds-nav-link.is-active .ds-nav-icon { color: #FFFFFF; }
html.ds body .ds-sidebar .ds-nav-link.is-active::before {
    content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--ds-sb-accent);
    box-shadow: 0 0 6px rgba(var(--ds-sb-accent-rgb), 0.45);
}

/* groups */
html.ds body .ds-sidebar .ds-nav-group.has-active > .ds-nav-toggle { color: #FFFFFF; }
html.ds body .ds-sidebar .ds-nav-group.has-active > .ds-nav-toggle .ds-nav-icon { color: var(--ds-sb-accent); }
html.ds body .ds-sidebar .ds-nav-group.has-active:not(.is-open) > .ds-nav-toggle { background: rgba(var(--ds-primary-rgb), 0.18); }
html.ds body .ds-sidebar .ds-nav-chevron { margin-left: auto; display: inline-flex; color: var(--ds-sb-text-3); transition: transform 220ms var(--ds-ease), color 150ms var(--ds-ease); }
html.ds body .ds-sidebar .ds-nav-group.is-open > .ds-nav-toggle .ds-nav-chevron { transform: rotate(90deg); color: var(--ds-sb-text-2); }
html.ds body .ds-sidebar .ds-nav-sub-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 240ms var(--ds-ease); }
html.ds body .ds-sidebar .ds-nav-group.is-open > .ds-nav-sub-wrap { grid-template-rows: 1fr; }
html.ds body .ds-sidebar .ds-nav-sub-inner { min-height: 0; overflow: hidden; }
html.ds body .ds-sidebar .ds-nav-sub { position: relative; list-style: none; margin: 0; padding: 2px 0 6px 1.95rem; }
html.ds body .ds-sidebar .ds-nav-sub::before { content: ""; position: absolute; left: 20px; top: 2px; bottom: 8px; width: 1px; background: rgba(255, 255, 255, 0.09); }
html.ds body .ds-sidebar .ds-nav-sublink {
    position: relative; display: flex; align-items: center;
    height: 32px; margin: 1px 0; padding: 0 0.6rem;
    border-radius: 7px;
    color: var(--ds-sb-text-2); font-size: 0.8rem; font-weight: 500; text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: background 150ms var(--ds-ease), color 150ms var(--ds-ease);
}
html.ds body .ds-sidebar .ds-nav-sublink:hover { background: rgba(255, 255, 255, 0.05); color: #FFFFFF; }
html.ds body .ds-sidebar .ds-nav-sublink:focus-visible { outline: 2px solid var(--ds-sb-accent); outline-offset: -2px; }
html.ds body .ds-sidebar .ds-nav-sublink.is-active { background: rgba(var(--ds-primary-rgb), 0.3); color: #FFFFFF; font-weight: 600; overflow: visible; }
html.ds body .ds-sidebar .ds-nav-sublink.is-active::before {
    content: ""; position: absolute; left: calc(20px - 1.95rem - 3px); top: 50%;
    width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%);
    background: var(--ds-sb-accent); box-shadow: 0 0 0 3px rgba(var(--ds-sb-accent-rgb), 0.16);
}

/* footer */
html.ds body .ds-sidebar .ds-sidebar-foot {
    position: relative; z-index: 2; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 0.65rem 0.75rem 0.75rem;
    border-top: 1px solid var(--ds-sb-line);
    background: linear-gradient(180deg, rgba(23, 25, 54, 0.2), rgba(23, 25, 54, 0.85));
}
html.ds body .ds-sidebar .ds-plan {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 0.55rem 0.55rem 0.6rem;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(var(--ds-primary-rgb), 0.34) 0%, rgba(var(--ds-sb-grad-start-rgb), 0.5) 100%);
    border: 1px solid rgba(var(--ds-sb-accent-rgb), 0.2);
}
html.ds body .ds-sidebar .ds-plan-icon { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: rgba(244, 194, 122, 0.16); color: #F4C27A; }
html.ds body .ds-sidebar .ds-plan-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
html.ds body .ds-sidebar .ds-plan-name { color: #FFFFFF; font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-sidebar .ds-plan-meta { color: var(--ds-sb-text-2); font-size: 0.68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-sidebar .ds-plan-cta {
    flex-shrink: 0; height: 26px; padding: 0 0.6rem;
    display: inline-flex; align-items: center;
    border-radius: 7px; background: #FFFFFF; color: var(--ds-sb-grad-start) !important;
    font-size: 0.72rem; font-weight: 600; text-decoration: none;
    transition: background 150ms var(--ds-ease);
}
html.ds body .ds-sidebar .ds-plan-cta:hover { background: var(--ds-primary-50); }
html.ds body .ds-sidebar .ds-plan-compact {
    display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
    border-radius: 10px; color: #F4C27A !important;
    background: linear-gradient(135deg, rgba(var(--ds-primary-rgb), 0.34) 0%, rgba(var(--ds-sb-grad-start-rgb), 0.5) 100%);
    border: 1px solid rgba(var(--ds-sb-accent-rgb), 0.2);
}

html.ds body .ds-sidebar .ds-profile { position: relative; }
html.ds body .ds-sidebar .ds-profile-btn {
    width: 100%; display: flex; align-items: center; gap: 0.65rem;
    padding: 0.4rem 0.45rem; border: 0; border-radius: 10px;
    background: transparent; color: #FFFFFF; text-align: left; cursor: pointer;
    transition: background 150ms var(--ds-ease);
}
html.ds body .ds-sidebar .ds-profile-btn:hover,
html.ds body .ds-sidebar .ds-profile-btn[aria-expanded="true"] { background: var(--ds-sb-hover); }
html.ds body .ds-sidebar .ds-profile-btn:focus-visible { outline: 2px solid var(--ds-sb-accent); outline-offset: -2px; }
html.ds body .ds-sidebar .ds-profile-avatar { position: relative; flex-shrink: 0; display: inline-flex; }
html.ds body .ds-sidebar .ds-profile-avatar .ds-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.14); background: rgba(var(--ds-sb-accent-rgb), 0.18); color: #FFFFFF; }
html.ds body .ds-sidebar .ds-online { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ds-success); border: 2px solid var(--ds-sb-grad-end); }
html.ds body .ds-sidebar .ds-profile-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
html.ds body .ds-sidebar .ds-profile-name { color: #FFFFFF; font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-sidebar .ds-profile-role { color: var(--ds-sb-text-2); font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-sidebar .ds-profile-chevron { color: var(--ds-sb-text-2); flex-shrink: 0; }
html.ds body .ds-profile-menu { min-width: 232px; }

/* tooltip + flyout (collapsed mode; appended to <body> level, positioned by JS) */
html.ds body .ds-nav-tip {
    position: fixed; z-index: 2100; left: 0; top: 0;
    padding: 0.35rem 0.6rem; border-radius: 7px;
    background: #14162B; color: #FFFFFF; font-size: 0.75rem; font-weight: 500; white-space: nowrap;
    box-shadow: 0 6px 16px rgba(10, 8, 30, 0.3); pointer-events: none;
    opacity: 0; transform: translateX(-4px); transition: opacity 120ms var(--ds-ease), transform 120ms var(--ds-ease);
}
html.ds body .ds-nav-tip.show { opacity: 1; transform: none; }
html.ds body .ds-nav-tip::before { content: ""; position: absolute; left: -4px; top: 50%; width: 8px; height: 8px; background: #14162B; transform: translateY(-50%) rotate(45deg); border-radius: 1px; }
html.ds body .ds-nav-flyout {
    position: fixed; z-index: 2100; left: 0; top: 0;
    min-width: 212px; max-width: 280px; padding: 0.4rem;
    border-radius: 12px; border: 1px solid rgba(var(--ds-sb-accent-rgb), 0.18);
    background: linear-gradient(180deg, var(--ds-sb-raised) 0%, var(--ds-sb-raised-2) 100%);
    box-shadow: 0 24px 48px -12px rgba(10, 8, 30, 0.6);
    opacity: 0; transform: translateX(-6px); transition: opacity 140ms var(--ds-ease), transform 140ms var(--ds-ease);
}
html.ds body .ds-nav-flyout.show { opacity: 1; transform: none; }
html.ds body .ds-nav-flyout::before { content: ""; position: absolute; left: -10px; top: 0; bottom: 0; width: 10px; } /* hover bridge */
html.ds body .ds-nav-flyout-title { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem 0.4rem; color: #FFFFFF; font-size: 0.8rem; font-weight: 600; }
html.ds body .ds-nav-flyout-title .ds-icon { color: var(--ds-sb-accent); width: 16px; height: 16px; }
html.ds body .ds-nav-flyout ul { list-style: none; margin: 0; padding: 0.15rem 0 0; border-top: 1px solid rgba(255, 255, 255, 0.07); }
html.ds body .ds-nav-flyout a {
    display: flex; align-items: center; height: 32px; margin-top: 2px; padding: 0 0.6rem;
    border-radius: 7px; color: #CFCCE3 !important; font-size: 0.8rem; font-weight: 500; text-decoration: none;
}
html.ds body .ds-nav-flyout a:hover, html.ds body .ds-nav-flyout a:focus-visible { background: var(--ds-sb-hover); color: #FFFFFF !important; outline: none; }
html.ds body .ds-nav-flyout a.is-active { background: rgba(var(--ds-primary-rgb), 0.35); color: #FFFFFF !important; font-weight: 600; }

/* ---- layout widths ---- */
@media (min-width: 1200px) {
    html.ds body #layout-menu ~ .layout-page { padding-left: var(--ds-sb-w) !important; }
    html.ds.layout-menu-collapsed body .layout-menu.ds-sidebar { width: var(--ds-sb-w-compact) !important; }
    html.ds.layout-menu-collapsed body #layout-menu ~ .layout-page { padding-left: var(--ds-sb-w-compact) !important; }
    html.ds body .ds-sidebar .ds-edge-toggle { display: inline-flex; }
}
/* tablet: compact rail by default; the edge button opens the full sidebar over the content */
@media (min-width: 768px) and (max-width: 1199.98px) {
    html.ds body .layout-menu.ds-sidebar { transform: none !important; width: var(--ds-sb-w-compact) !important; position: fixed !important; top: 0 !important; bottom: 0 !important; left: 0 !important; height: 100% !important; }
    html.ds.layout-menu-expanded body .layout-menu.ds-sidebar { width: var(--ds-sb-w) !important; box-shadow: 24px 0 48px rgba(10, 8, 30, 0.35) !important; }
    html.ds body #layout-menu ~ .layout-page { padding-left: var(--ds-sb-w-compact) !important; }
    html.ds body .ds-sidebar .ds-edge-toggle { display: inline-flex; }
}
/* phone: off-canvas drawer */
@media (max-width: 767.98px) {
    html.ds body .layout-menu.ds-sidebar { width: min(280px, 86vw) !important; }
    html.ds.layout-menu-expanded body .layout-menu.ds-sidebar { box-shadow: 24px 0 48px rgba(10, 8, 30, 0.4) !important; }
    html.ds body .ds-sidebar .ds-drawer-close { display: inline-flex !important; }
    html.ds body #layout-menu ~ .layout-page { padding-left: 0 !important; }
}
@media (max-width: 1199.98px) {
    html.ds body .layout-overlay { background: rgba(12, 10, 30, 0.55) !important; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
    html.ds.layout-menu-expanded, html.ds.layout-menu-expanded body { overflow: hidden !important; }
}

/* ---- compact visuals: desktop collapsed ---- */
@media (min-width: 1200px) {
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-brand { justify-content: center; padding: 0 !important; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-brand-link { flex: 0 0 auto; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-brand-text { display: none; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-edge-toggle .ds-icon { transform: rotate(180deg); }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-search-wrap { display: none; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-scroll { margin-top: 0.6rem !important; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-scroll { padding: 0.15rem 0 1rem !important; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-heading { height: 1px; margin: 0.75rem 18px !important; background: var(--ds-sb-line); font-size: 0; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-section:first-child .ds-nav-heading { display: none; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-list { align-items: center; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-item { width: 44px; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-link { width: 44px; height: 40px; padding: 0; gap: 0; justify-content: center; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-label, html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-chevron, html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-sub-wrap { display: none; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-link.is-active::before { left: -16px; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-group.has-active > .ds-nav-toggle { background: rgba(var(--ds-primary-rgb), 0.24); box-shadow: inset 0 0 0 1px rgba(var(--ds-sb-accent-rgb), 0.22); }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-group.has-active > .ds-nav-toggle::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ds-sb-accent); box-shadow: 0 0 6px rgba(var(--ds-sb-accent-rgb), 0.45); }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-nav-group.is-flyout > .ds-nav-toggle { background: var(--ds-sb-hover); }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-sidebar-foot { align-items: center; padding: 0.65rem 0 0.75rem; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-plan { display: none; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-plan-compact { display: inline-flex; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-profile-btn { width: auto; padding: 0.3rem; border-radius: 50%; }
    html.ds.layout-menu-collapsed body .ds-sidebar .ds-profile-meta, html.ds.layout-menu-collapsed body .ds-sidebar .ds-profile-chevron { display: none; }
}
/* ---- compact visuals: tablet rail (until the edge button opens it) ---- */
@media (min-width: 768px) and (max-width: 1199.98px) {
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-brand { justify-content: center; padding: 0 !important; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-brand-link { flex: 0 0 auto; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-brand-text { display: none; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-edge-toggle .ds-icon { transform: rotate(180deg); }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-search-wrap { display: none; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-scroll { margin-top: 0.6rem !important; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-scroll { padding: 0.15rem 0 1rem !important; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-heading { height: 1px; margin: 0.75rem 18px !important; background: var(--ds-sb-line); font-size: 0; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-section:first-child .ds-nav-heading { display: none; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-list { align-items: center; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-item { width: 44px; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-link { width: 44px; height: 40px; padding: 0; gap: 0; justify-content: center; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-label, html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-chevron, html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-sub-wrap { display: none; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-link.is-active::before { left: -16px; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-group.has-active > .ds-nav-toggle { background: rgba(var(--ds-primary-rgb), 0.24); box-shadow: inset 0 0 0 1px rgba(var(--ds-sb-accent-rgb), 0.22); }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-group.has-active > .ds-nav-toggle::before { content: ""; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ds-sb-accent); box-shadow: 0 0 6px rgba(var(--ds-sb-accent-rgb), 0.45); }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-nav-group.is-flyout > .ds-nav-toggle { background: var(--ds-sb-hover); }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-sidebar-foot { align-items: center; padding: 0.65rem 0 0.75rem; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-plan { display: none; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-plan-compact { display: inline-flex; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-profile-btn { width: auto; padding: 0.3rem; border-radius: 50%; }
    html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-profile-meta, html.ds:not(.layout-menu-expanded) body .ds-sidebar .ds-profile-chevron { display: none; }
}

/* ---------------------------------------------------------------------
   4. Top bar
   The template's floating "detached" bar becomes a flush, sticky bar.
   --------------------------------------------------------------------- */
/* demo.css and the template's inline helper style push .layout-page down for the old floating bar */
html.ds body #layout-menu ~ .layout-page { padding-top: 0 !important; }
html.ds body .layout-page::before { display: none !important; }
html.ds body .layout-navbar.ds-topbar {
    position: sticky !important;
    top: 0 !important;
    left: auto !important;
    right: auto !important;
    z-index: 1075;
    width: auto !important;
    max-width: none !important;
    height: var(--ds-topbar-h) !important;
    margin: 0 !important;
    padding: 0 var(--ds-gutter) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--ds-border) !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, 0.88) !important;
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
    box-shadow: none !important;
    flex-wrap: nowrap;
}
html.ds body .ds-topbar .navbar-nav-right { flex-wrap: nowrap !important; gap: 0.75rem; min-width: 0; }
html.ds body .ds-topbar-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
html.ds body .ds-topbar-divider { width: 1px; height: 24px; background: var(--ds-border); margin: 0 0.35rem; }

/* search trigger */
html.ds body .ds-search-trigger {
    display: inline-flex; align-items: center; gap: 0.6rem;
    width: min(380px, 100%);
    height: 38px;
    padding: 0 0.5rem 0 0.75rem;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-sm);
    background: var(--ds-surface-2);
    color: var(--ds-ink-3);
    font-size: var(--ds-text-sm);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--ds-dur) var(--ds-ease), background var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease);
}
html.ds body .ds-search-trigger:hover { border-color: var(--ds-border-strong); background: var(--ds-surface); }
html.ds body .ds-search-trigger:focus-visible { outline: none; border-color: var(--ds-primary); box-shadow: 0 0 0 3px var(--ds-primary-ring); }
html.ds body .ds-search-placeholder { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.ds body .ds-kbd {
    display: inline-flex; align-items: center;
    height: 20px; padding: 0 0.4rem;
    border: 1px solid var(--ds-border);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--ds-surface);
    color: var(--ds-ink-3);
    font: 500 0.68rem/1 var(--ds-font);
    box-shadow: none;
    white-space: nowrap;
}

/* icon buttons */
html.ds body .ds-icon-btn {
    width: 36px; height: 36px; padding: 0 !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    border-radius: var(--ds-radius-sm) !important;
    color: var(--ds-ink-2) !important;
}
html.ds body .btn.ds-btn-ghost {
    background: transparent !important;
    border: 1px solid var(--ds-border) !important;
    color: var(--ds-ink-2) !important;
    box-shadow: none !important;
}
html.ds body .btn.ds-btn-ghost:hover,
html.ds body .btn.ds-btn-ghost[aria-expanded="true"] { background: var(--ds-surface-3) !important; color: var(--ds-ink) !important; }
html.ds body .ds-topbar .layout-menu-toggle .ds-icon-btn:hover { background: var(--ds-surface-3); }
html.ds body .ds-btn-icon-text { display: inline-flex !important; align-items: center; gap: 0.4rem; }

/* user */
html.ds body .ds-topbar .ds-user-trigger {
    display: flex !important; align-items: center; gap: 0.6rem;
    padding: 0.25rem 0.45rem 0.25rem 0.25rem !important;
    border-radius: 999px;
    transition: background var(--ds-dur) var(--ds-ease);
}
html.ds body .ds-topbar .ds-user-trigger:hover,
html.ds body .ds-topbar .show > .ds-user-trigger { background: var(--ds-surface-3); }
html.ds body .ds-avatar {
    position: relative;
    width: 34px; height: 34px; flex: 0 0 34px;
    border-radius: 50%;
    overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ds-primary-50);
    color: var(--ds-primary);
    font-size: 0.75rem; font-weight: 600;
    box-shadow: 0 0 0 1px var(--ds-border);
}
html.ds body .ds-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; box-shadow: none !important; }
html.ds body .ds-avatar-lg { width: 42px; height: 42px; flex-basis: 42px; font-size: 0.85rem; }
html.ds body .ds-user-meta { flex-direction: column; line-height: 1.2; text-align: left; }
html.ds body .ds-user-name { color: var(--ds-ink); font-weight: 600; font-size: var(--ds-text-sm); }
html.ds body .ds-user-role { color: var(--ds-ink-3); font-size: 0.72rem; }
html.ds body .ds-user-chevron { color: var(--ds-ink-4); }
html.ds body .ds-user-menu { min-width: 260px; }
html.ds body .ds-user-card { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0.75rem 0.4rem; }
html.ds body .ds-user-card-text { display: flex; flex-direction: column; min-width: 0; align-items: flex-start; }
html.ds body .ds-user-email { color: var(--ds-ink-3); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }

/* ---------------------------------------------------------------------
   5. Quick navigation (Ctrl K)
   --------------------------------------------------------------------- */
html.ds body .ds-command[hidden] { display: none !important; }
html.ds body .ds-command { position: fixed; inset: 0; z-index: 2000; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; }
html.ds body .ds-command-backdrop { position: absolute; inset: 0; background: rgba(20, 22, 43, 0.42); animation: ds-fade 120ms var(--ds-ease); }
html.ds body .ds-command-panel {
    position: relative;
    width: min(600px, 100%);
    max-height: 70vh;
    display: flex; flex-direction: column;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-lg);
    overflow: hidden;
    animation: ds-pop 140ms var(--ds-ease);
}
html.ds body .ds-command-search { display: flex; align-items: center; gap: 0.7rem; padding: 0 1rem; height: 56px; border-bottom: 1px solid var(--ds-border); color: var(--ds-ink-3); }
html.ds body .ds-command-search input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 0.95rem; color: var(--ds-ink); }
html.ds body .ds-command-search input::placeholder { color: var(--ds-ink-4); }
html.ds body .ds-command-list { list-style: none; margin: 0; padding: 0.4rem; overflow-y: auto; }
html.ds body .ds-command-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.55rem 0.65rem; border-radius: var(--ds-radius-sm); cursor: pointer; }
html.ds body .ds-command-item.is-active { background: var(--ds-primary-50); }
html.ds body .ds-command-icon {
    width: 30px; height: 30px; flex: 0 0 30px; border-radius: var(--ds-radius-sm);
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ds-surface-3); color: var(--ds-ink-2);
}
html.ds body .ds-command-icon svg { width: 16px; height: 16px; }
html.ds body .ds-command-item.is-active .ds-command-icon { background: var(--ds-surface); color: var(--ds-primary); }
html.ds body .ds-command-text { display: flex; flex-direction: column; min-width: 0; }
html.ds body .ds-command-label { color: var(--ds-ink); font-weight: 500; font-size: var(--ds-text-md); }
html.ds body .ds-command-context { color: var(--ds-ink-3); font-size: 0.75rem; }
html.ds body .ds-command-item mark { padding: 0; background: none; color: var(--ds-primary); font-weight: 600; }
html.ds body .ds-command-empty { padding: 1.5rem; text-align: center; color: var(--ds-ink-3); font-size: var(--ds-text-sm); }
html.ds body .ds-command-foot { display: flex; gap: 1rem; padding: 0.55rem 1rem; border-top: 1px solid var(--ds-border); background: var(--ds-surface-2); color: var(--ds-ink-3); font-size: 0.72rem; }
html.ds body .ds-command-foot .ds-kbd { margin-right: 0.2rem; height: 18px; }
html.ds.ds-command-open body { overflow: hidden; }
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-pop { from { opacity: 0; transform: translateY(-6px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------------
   6. Page header, related links, module tabs
   --------------------------------------------------------------------- */
html.ds body .content-wrapper > .container-xxl.container-p-y {
    padding-top: 1.75rem !important;
    padding-bottom: 2rem !important;
    padding-left: var(--ds-gutter) !important;
    padding-right: var(--ds-gutter) !important;
    max-width: 1520px;
}
html.ds body .page-header.ds-page-header {
    margin: 0 0 1.5rem !important;
    padding: 0 !important;
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
}
html.ds body .page-header.ds-page-header.is-empty { display: none !important; }
html.ds body .ds-page-header-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; flex-wrap: wrap; }
html.ds body .ds-page-header-main { min-width: 0; }
html.ds body .ds-page-header .ds-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center;
    margin: 0 0 0.35rem !important; padding: 0 !important;
    background: none !important;
    font-size: var(--ds-text-sm);
}
html.ds body .ds-page-header .ds-breadcrumb:empty { display: none; }
html.ds body .ds-page-header .breadcrumb-item,
html.ds body .ds-page-header .breadcrumb-item.active { color: var(--ds-ink-3) !important; font-weight: 500; }
html.ds body .ds-page-header .breadcrumb-item a { color: var(--ds-ink-3) !important; text-decoration: none; }
html.ds body .ds-page-header .breadcrumb-item a:hover { color: var(--ds-primary) !important; }
html.ds body .ds-page-header .breadcrumb-item:last-child { color: var(--ds-ink-2) !important; }
html.ds body .ds-page-header .breadcrumb-item + .breadcrumb-item { padding-left: 0.45rem !important; }
html.ds body .ds-page-header .breadcrumb-item + .breadcrumb-item::before {
    content: "" !important;
    width: 6px; height: 6px; margin: 0 0.5rem 0 0 !important; padding: 0 !important; float: none !important;
    display: inline-block; vertical-align: middle;
    border: solid var(--ds-ink-4); border-width: 1.5px 1.5px 0 0;
    transform: rotate(45deg) translateY(-1px);
    background: none !important;
}
html.ds body .ds-page-header .page-header-title h4.ds-page-title {
    margin: 0 !important; padding: 0 !important;
    font-size: var(--ds-text-xl) !important;
    font-weight: 600;
    letter-spacing: -0.022em;
    line-height: 1.25;
    color: var(--ds-ink) !important;
}
html.ds body .ds-page-header .page-header-title h4::before { display: none !important; }
html.ds body .ds-page-header .breadcrumb { padding-left: 0 !important; }
html.ds body .ds-page-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 0 0 auto !important; width: auto !important; }
html.ds body .ds-page-actions:empty { display: none; }

/* related pages chips (includes/page_links) */
html.ds body .page-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: -0.5rem 0 1.25rem; }
html.ds body .page-links-label { color: var(--ds-ink-3); font-size: 0.75rem; font-weight: 500; margin-right: 0.15rem; }
html.ds body .page-link-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    height: 30px; padding: 0 0.7rem;
    border: 1px solid var(--ds-border);
    border-radius: 999px;
    background: var(--ds-surface);
    color: var(--ds-ink-2) !important;
    font-size: 0.78rem; font-weight: 500;
    box-shadow: var(--ds-shadow-xs);
    transition: border-color var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease);
}
html.ds body .page-link-chip:hover { border-color: var(--ds-primary-200); color: var(--ds-primary) !important; }
html.ds body .page-link-chip.active { background: var(--ds-primary-50); border-color: var(--ds-primary-200); color: var(--ds-primary) !important; }

/* module tabs (includes/module_tabs) */
html.ds body .module-tabs {
    margin: -0.5rem 0 1.5rem; padding: 0; gap: 0;
    background: none; border: 0; border-bottom: 1px solid var(--ds-border); border-radius: 0; box-shadow: none;
}
html.ds body .module-tabs-title { display: none; }
html.ds body .module-tab {
    position: relative; padding: 0.6rem 0.9rem; border-radius: 0;
    color: var(--ds-ink-3) !important; font-weight: 500; background: none !important; box-shadow: none !important;
}
html.ds body .module-tab:hover { color: var(--ds-ink) !important; }
html.ds body .module-tab.active { color: var(--ds-primary) !important; }
html.ds body .module-tab.active::after { content: ""; position: absolute; left: 0.6rem; right: 0.6rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--ds-primary); }

/* ---------------------------------------------------------------------
   7. Primitives
   --------------------------------------------------------------------- */
/* buttons */
html.ds body .btn {
    font-family: var(--ds-font);
    font-weight: 500;
    letter-spacing: -0.005em;
    border-radius: var(--ds-radius-sm);
    transition: background-color var(--ds-dur) var(--ds-ease), border-color var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease);
}
html.ds body .btn:not(.btn-sm):not(.btn-lg):not(.btn-xs):not(.btn-icon) { min-height: 38px; }
html.ds body .btn-sm { min-height: 34px; padding: 0.35rem 0.8rem; font-size: var(--ds-text-sm); }
html.ds body .btn .ds-icon { margin-top: -1px; }
html.ds body .waves-ripple { display: none !important; }

html.ds body .btn-primary,
html.ds body .btn.btn-secondary.btn-primary,
html.ds body .layout-navbar .btn-primary.remove-row-btn {
    background: var(--ds-primary) !important;
    background-image: none !important;
    border-color: var(--ds-primary) !important;
    color: #FFFFFF !important;
    box-shadow: 0 1px 2px rgba(var(--ds-primary-rgb), 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}
html.ds body .btn-primary:hover,
html.ds body .btn.btn-secondary.btn-primary:hover,
html.ds body .layout-navbar .btn-primary.remove-row-btn:hover {
    background: var(--ds-primary-hover) !important;
    background-image: none !important;
    border-color: var(--ds-primary-hover) !important;
    box-shadow: 0 2px 6px rgba(var(--ds-primary-rgb), 0.28) !important;
}
html.ds body .btn-primary:active,
html.ds body .btn-primary.active { background: var(--ds-primary-active) !important; border-color: var(--ds-primary-active) !important; }
html.ds body .btn-primary:focus-visible { box-shadow: 0 0 0 3px var(--ds-primary-ring) !important; }
html.ds body .btn-outline-primary { color: var(--ds-primary) !important; border-color: var(--ds-primary-200) !important; background: var(--ds-surface) !important; }
html.ds body .btn-outline-primary:hover { background: var(--ds-primary-50) !important; border-color: var(--ds-primary) !important; }
html.ds body .btn-label-primary { background: var(--ds-primary-50) !important; color: var(--ds-primary) !important; border-color: transparent !important; }
html.ds body .btn-label-primary:hover { background: var(--ds-primary-100) !important; }
html.ds body .btn-success { background: var(--ds-success) !important; border-color: var(--ds-success) !important; background-image: none !important; }
html.ds body .btn-warning { background: var(--ds-warning) !important; border-color: var(--ds-warning) !important; background-image: none !important; color: #FFFFFF !important; }
html.ds body .page-item.active .page-link { background: var(--ds-primary) !important; background-image: none !important; border-color: var(--ds-primary) !important; }
html.ds body .nav-pills .nav-link.active { background: var(--ds-primary) !important; background-image: none !important; box-shadow: none !important; }
html.ds body .progress-bar:not([class*="bg-"]) { background: var(--ds-primary) !important; background-image: none !important; }

/* forms */
html.ds body .form-label,
html.ds body .col-form-label { color: var(--ds-ink-2); font-size: var(--ds-text-sm); font-weight: 500; text-transform: none; letter-spacing: 0; }
html.ds body .form-control,
html.ds body .form-select,
html.ds body .select2-container--default .select2-selection {
    border-color: var(--ds-border-strong);
    border-radius: var(--ds-radius-sm);
    font-size: var(--ds-text-md);
    color: var(--ds-ink);
    box-shadow: var(--ds-shadow-xs);
}
html.ds body .form-control::placeholder { color: var(--ds-ink-4); }
html.ds body .form-control:focus,
html.ds body .form-select:focus,
html.ds body .select2-container--focus .select2-selection,
html.ds body .select2-container--open .select2-selection {
    border-color: var(--ds-primary) !important;
    box-shadow: 0 0 0 3px var(--ds-primary-ring) !important;
}
html.ds body .form-check-input:checked { background-color: var(--ds-primary) !important; border-color: var(--ds-primary) !important; }
html.ds body .form-check-input:focus { box-shadow: 0 0 0 3px var(--ds-primary-ring) !important; border-color: var(--ds-primary); }

/* cards */
html.ds body .card {
    border: 1px solid var(--ds-border) !important;
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-sm) !important;
    background: var(--ds-surface);
}
html.ds body .card:has(> .card-header h5),
html.ds body .card:has(> .card-body > h5:first-child) { border-top: 1px solid var(--ds-border) !important; }
html.ds body .card-header { border-bottom-color: var(--ds-border); }
html.ds body .card-title, html.ds body .card-header h5, html.ds body .card-header h4 { font-weight: 600; letter-spacing: -0.015em; }

/* tables: calm header, soft hover */
html.ds body .table thead th,
html.ds body .table > thead > tr > th {
    background: var(--ds-surface-2) !important;
    color: var(--ds-ink-3) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.04em !important;
    text-transform: uppercase;
    border-color: var(--ds-border) !important;
}
html.ds body .table tbody tr:hover > * { background-color: #F8F7FE !important; }
html.ds body .table > :not(caption) > * > * { border-bottom-color: var(--ds-border); }

/* dropdowns */
html.ds body .dropdown-menu {
    padding: 0.35rem;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius);
    box-shadow: var(--ds-shadow-lg);
    font-size: var(--ds-text-md);
}
html.ds body .dropdown-menu .dropdown-item {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: var(--ds-radius-xs);
    color: var(--ds-ink-2);
    font-weight: 500;
}
html.ds body .dropdown-menu .dropdown-item .ds-icon { color: var(--ds-ink-3); }
html.ds body .dropdown-menu .dropdown-item:hover,
html.ds body .dropdown-menu .dropdown-item:focus { background: var(--ds-surface-3); color: var(--ds-ink); }
html.ds body .dropdown-menu .dropdown-item:hover .ds-icon { color: var(--ds-ink); }
html.ds body .dropdown-menu .dropdown-divider { margin: 0.35rem -0.35rem; border-color: var(--ds-border); }
html.ds body .ds-menu { min-width: 220px; }
html.ds body .ds-menu .ds-menu-label { padding: 0.4rem 0.65rem 0.25rem; color: var(--ds-ink-4); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
html.ds body .dropdown-menu .ds-item-danger,
html.ds body .dropdown-menu .ds-item-danger .ds-icon { color: var(--ds-danger-ink) !important; }
html.ds body .dropdown-menu .ds-item-danger:hover { background: var(--ds-danger-50); }
html.ds body .dropdown-menu form { margin: 0; }
html.ds body .dropdown-menu button.dropdown-item { width: 100%; border: 0; background: none; text-align: left; }

/* badges (incl. Vuexy bg-label-*) */
html.ds body .badge { font-weight: 600; letter-spacing: 0; border-radius: 6px; }
html.ds body .bg-label-primary { background: var(--ds-primary-50) !important; color: var(--ds-primary) !important; }
html.ds body .bg-label-success { background: var(--ds-success-50) !important; color: var(--ds-success-ink) !important; }
html.ds body .bg-label-warning { background: var(--ds-warning-50) !important; color: var(--ds-warning-ink) !important; }
html.ds body .bg-label-danger { background: var(--ds-danger-50) !important; color: var(--ds-danger-ink) !important; }
html.ds body .bg-label-info { background: var(--ds-info-50) !important; color: var(--ds-info-ink) !important; }

/* ---------------------------------------------------------------------
   8. Reusable components (resources/views/components/ui/*)
   --------------------------------------------------------------------- */
html.ds body .ds-card { overflow: hidden; }
html.ds body .ds-card-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--ds-border); }
html.ds body .ds-card-heading { display: flex; align-items: center; gap: 0.7rem; min-width: 0; }
html.ds body .ds-card-icon { width: 30px; height: 30px; border-radius: var(--ds-radius-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--ds-primary-50); color: var(--ds-primary); }
html.ds body .ds-card-title { margin: 0; font-size: 0.95rem; font-weight: 600; letter-spacing: -0.015em; color: var(--ds-ink); }
html.ds body .ds-card-subtitle { margin: 0.1rem 0 0; font-size: 0.78rem; color: var(--ds-ink-3); }
html.ds body .ds-card-actions { display: flex; align-items: center; gap: 0.5rem; }
html.ds body .ds-card-body { padding: 1.25rem; }
html.ds body .ds-card-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--ds-border); background: var(--ds-surface-2); }

html.ds body .ds-stat {
    display: flex; flex-direction: column; gap: 0.35rem;
    height: 100%;
    padding: 1.1rem 1.2rem;
    background: var(--ds-surface);
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    box-shadow: var(--ds-shadow-sm);
    color: var(--ds-ink);
    text-decoration: none;
}
html.ds body .ds-stat.is-link { transition: border-color var(--ds-dur) var(--ds-ease), box-shadow var(--ds-dur) var(--ds-ease); }
html.ds body .ds-stat.is-link:hover { border-color: var(--ds-border-strong); box-shadow: var(--ds-shadow-md); color: var(--ds-ink); }
html.ds body .ds-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
html.ds body .ds-stat-label { color: var(--ds-ink-3); font-size: var(--ds-text-sm); font-weight: 500; }
html.ds body .ds-stat-icon { width: 32px; height: 32px; border-radius: var(--ds-radius-sm); display: inline-flex; align-items: center; justify-content: center; }
html.ds body .ds-stat-value { font-size: 1.6rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
html.ds body .ds-stat-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; color: var(--ds-ink-3); font-size: 0.78rem; }
html.ds body .ds-trend { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 600; padding: 0.1rem 0.4rem; border-radius: 6px; }
html.ds body .ds-trend.is-up { color: var(--ds-success-ink); background: var(--ds-success-50); }
html.ds body .ds-trend.is-down { color: var(--ds-danger-ink); background: var(--ds-danger-50); }

html.ds body .ds-tone-primary .ds-stat-icon, html.ds body .ds-badge.ds-tone-primary { background: var(--ds-primary-50); color: var(--ds-primary); }
html.ds body .ds-tone-success .ds-stat-icon, html.ds body .ds-badge.ds-tone-success { background: var(--ds-success-50); color: var(--ds-success-ink); }
html.ds body .ds-tone-warning .ds-stat-icon, html.ds body .ds-badge.ds-tone-warning { background: var(--ds-warning-50); color: var(--ds-warning-ink); }
html.ds body .ds-tone-danger .ds-stat-icon,  html.ds body .ds-badge.ds-tone-danger  { background: var(--ds-danger-50);  color: var(--ds-danger-ink); }
html.ds body .ds-tone-info .ds-stat-icon,    html.ds body .ds-badge.ds-tone-info    { background: var(--ds-info-50);    color: var(--ds-info-ink); }
html.ds body .ds-tone-neutral .ds-stat-icon, html.ds body .ds-badge.ds-tone-neutral { background: var(--ds-surface-3);  color: var(--ds-ink-2); }

html.ds body .ds-badge {
    display: inline-flex; align-items: center; gap: 0.3rem;
    height: 22px; padding: 0 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem; font-weight: 600; line-height: 1;
    white-space: nowrap;
}
html.ds body .ds-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

html.ds body .ds-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 2.5rem 1rem; }
html.ds body .ds-empty-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--ds-surface-3); color: var(--ds-ink-3); margin-bottom: 0.75rem; }
html.ds body .ds-empty-title { margin: 0; font-weight: 600; color: var(--ds-ink); }
html.ds body .ds-empty-text { margin: 0.25rem 0 0; max-width: 360px; color: var(--ds-ink-3); font-size: var(--ds-text-sm); }
html.ds body .ds-empty-actions { margin-top: 1rem; display: flex; gap: 0.5rem; }

html.ds body .ds-section-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.25rem; }
html.ds body .ds-eyebrow { margin: 0 0 0.25rem; color: var(--ds-primary) !important; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
html.ds body .ds-section-title { margin: 0; font-size: var(--ds-text-xl); font-weight: 600; letter-spacing: -0.022em; }
html.ds body .ds-section-subtitle { margin: 0.25rem 0 0; color: var(--ds-ink-3) !important; font-size: var(--ds-text-sm); }
html.ds body .ds-section-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* =====================================================================
   11. Lists & data tables (Phase 3)
   Applies to every DataTables list (server-side lists keep their markup).
   ===================================================================== */
/* list card header (built by assets/js/filter-toggle.js) */
html.ds body .list-card-header { padding: 1rem 1.25rem !important; border-bottom: 1px solid var(--ds-border) !important; }
html.ds body .list-card-bare { background: var(--ds-surface); border-color: var(--ds-border); border-radius: var(--ds-radius-lg) var(--ds-radius-lg) 0 0; }
html.ds body .list-card-head > .card-title,
html.ds body .list-card-head > h4,
html.ds body .list-card-head > h5 { display: inline-flex; align-items: center; gap: .55rem; font-size: 1rem !important; font-weight: 600 !important; letter-spacing: -.015em; color: var(--ds-ink) !important; }
html.ds body .ds-count { display: inline-flex; align-items: center; height: 22px; padding: 0 .5rem; border-radius: 999px; background: var(--ds-surface-3); color: var(--ds-ink-2); font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
html.ds body .list-card-actions { gap: .5rem; }
html.ds body .list-card-actions .btn,
html.ds body .list-card-actions .filter-toggle { min-height: 36px !important; height: 36px; border-radius: var(--ds-radius-sm) !important; font-weight: 500 !important; font-size: var(--ds-text-sm); }
html.ds body .list-card-actions .page-add-btn { gap: .35rem; padding: 0 .9rem !important; }
html.ds body .list-card-actions .page-add-btn i { font-size: 1rem; margin-right: .15rem !important; }
html.ds body .filter-icon-btn { width: 36px !important; height: 36px !important; min-height: 36px !important; border-radius: var(--ds-radius-sm) !important; background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; color: var(--ds-ink-2) !important; box-shadow: none !important; font-size: 1.05rem; }
html.ds body .filter-icon-btn:hover { background: var(--ds-surface-3) !important; color: var(--ds-ink) !important; }
html.ds body .filter-icon-btn.active, html.ds body .filter-icon-btn[aria-expanded="true"] { background: var(--ds-primary-50) !important; border-color: var(--ds-primary-200) !important; color: var(--ds-primary) !important; }
html.ds body .filter-icon-btn .filter-count { background: var(--ds-primary); }
html.ds body .filter-panel.in-listcard { background: var(--ds-surface-2); border-bottom-color: var(--ds-border); }

/* toolbar row (length · search · export) */
html.ds body .dataTables_wrapper > .row:first-child { margin: 0 !important; padding: .85rem 1.25rem; align-items: center; row-gap: .6rem; }
html.ds body .dataTables_wrapper > .row:first-child > [class*="col"] { padding-left: 0 !important; padding-right: 0 !important; }
html.ds body .dataTables_wrapper > .row:first-child .me-3 { margin-right: 0 !important; }
html.ds body .dataTables_length select,
html.ds body .dataTables_length .form-select { height: 36px !important; min-height: 36px !important; min-width: 76px; padding: 0 2rem 0 .75rem !important; font-size: var(--ds-text-sm); border-radius: var(--ds-radius-sm); }
html.ds body .dataTables_wrapper .dataTables_length,
html.ds body .dataTables_wrapper .dataTables_filter { margin-top: 0 !important; margin-bottom: 0 !important; }
html.ds body .dataTables_filter label { margin: 0; }
html.ds body .dataTables_filter input[type="search"],
html.ds body .dataTables_filter input.form-control {
    height: 36px !important; min-height: 36px !important; width: 260px; min-width: 0 !important; margin: 0 !important;
    padding: 0 .75rem 0 2.1rem !important; font-size: var(--ds-text-sm);
    background: var(--ds-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 24 24' fill='none' stroke='%239A9EB8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E") no-repeat .7rem center / 15px 15px !important;
}
html.ds body .dt-buttons { display: inline-flex; gap: .5rem; }
html.ds body .dt-buttons .btn,
html.ds body .dt-buttons .btn.btn-label-secondary {
    height: 36px; min-height: 36px; margin: 0 0 0 .5rem !important; padding: 0 .8rem;
    display: inline-flex; align-items: center; gap: .3rem;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius-sm) !important;
    color: var(--ds-ink-2) !important; font-size: var(--ds-text-sm); font-weight: 500; box-shadow: none !important;
}
html.ds body .dt-buttons .btn:hover { background: var(--ds-surface-3) !important; color: var(--ds-ink) !important; }
html.ds body .dt-buttons .btn i { font-size: 1rem; }
html.ds body .dt-button-collection .dropdown-item { gap: .55rem; }

/* table */
html.ds body .card-datatable .table,
html.ds body .dataTables_wrapper .table { margin: 0 !important; border-top: 1px solid var(--ds-border); }
html.ds body .dataTables_wrapper table.dataTable > thead > tr > th { padding-top: .7rem; padding-bottom: .7rem; vertical-align: middle; white-space: nowrap; }
html.ds body .dataTables_wrapper table.dataTable > tbody > tr > td { padding-top: .8rem; padding-bottom: .8rem; vertical-align: middle; color: var(--ds-ink); font-size: var(--ds-text-sm); }
html.ds body .dataTables_wrapper table.dataTable > thead > tr > th:first-child,
html.ds body .dataTables_wrapper table.dataTable > tbody > tr > td:first-child { padding-left: 1.25rem; }
html.ds body .dataTables_wrapper table.dataTable > thead > tr > th:last-child,
html.ds body .dataTables_wrapper table.dataTable > tbody > tr > td:last-child { padding-right: 1.25rem; }
html.ds body .dataTables_wrapper table.dataTable > tbody > tr:last-child > td { border-bottom: 0; }

/* sort indicator: one quiet arrow instead of the stacked carets */
html.ds body table.dataTable thead > tr > th.sorting,
html.ds body table.dataTable thead > tr > th.sorting_asc,
html.ds body table.dataTable thead > tr > th.sorting_desc { padding-right: 1.9rem !important; cursor: pointer; }
html.ds body table.dataTable thead > tr > th.sorting::before,
html.ds body table.dataTable thead > tr > th.sorting_asc::before,
html.ds body table.dataTable thead > tr > th.sorting_desc::before { display: none !important; }
html.ds body table.dataTable thead > tr > th.sorting::after,
html.ds body table.dataTable thead > tr > th.sorting_asc::after,
html.ds body table.dataTable thead > tr > th.sorting_desc::after {
    content: "" !important; position: absolute; right: .7rem !important; top: 50% !important; bottom: auto !important;
    width: 12px; height: 12px; transform: translateY(-50%); opacity: .35 !important;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4'/%3E%3Cpath d='M17 20V4'/%3E%3Cpath d='m3 8 4-4 4 4'/%3E%3Cpath d='M7 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4'/%3E%3Cpath d='M17 20V4'/%3E%3Cpath d='m3 8 4-4 4 4'/%3E%3Cpath d='M7 4v16'/%3E%3C/svg%3E") center / contain no-repeat;
}
html.ds body table.dataTable thead > tr > th.sorting_asc::after,
html.ds body table.dataTable thead > tr > th.sorting_desc::after {
    opacity: 1 !important; color: var(--ds-primary);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E");
}
html.ds body table.dataTable thead > tr > th.sorting_desc::after { transform: translateY(-50%) rotate(180deg); }
html.ds body table.dataTable thead > tr > th.sorting_asc,
html.ds body table.dataTable thead > tr > th.sorting_desc { color: var(--ds-ink) !important; }

/* row actions: one calm, consistent icon-button style; intent shows on hover */
html.ds body .table td .btn-group { display: inline-flex; gap: 4px; box-shadow: none !important; }
html.ds body .table td .btn-group > .btn { margin: 0 !important; border-radius: var(--ds-radius-sm) !important; }
html.ds body .table td .btn-sm,
html.ds body .table td .btn-xs,
html.ds body .table td .btn-icon {
    min-width: 32px; height: 32px; min-height: 32px; padding: 0 .5rem !important;
    display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
    border-radius: var(--ds-radius-sm) !important;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important;
    color: var(--ds-ink-2) !important; box-shadow: none !important;
    font-size: .78rem; font-weight: 500;
    transition: background var(--ds-dur) var(--ds-ease), border-color var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease);
}
html.ds body .table td .btn * { background: transparent !important; border: 0 !important; color: inherit !important; }
html.ds body .table td .btn i { font-size: 1rem; }
html.ds body .table td .btn-sm:hover,
html.ds body .table td .btn-xs:hover,
html.ds body .table td .btn-icon:hover { background: var(--ds-primary-50) !important; border-color: var(--ds-primary-200) !important; color: var(--ds-primary) !important; }
html.ds body .table td .btn-danger:hover,
html.ds body .table td .btn-label-danger:hover,
html.ds body .table td .btn-outline-danger:hover { background: var(--ds-danger-50) !important; border-color: #F3C3C8 !important; color: var(--ds-danger-ink) !important; }
html.ds body .table td .btn-success:hover { background: var(--ds-success-50) !important; border-color: #BFE6D3 !important; color: var(--ds-success-ink) !important; }

/* footer row (info · pagination) */
html.ds body .dataTables_wrapper > .row:last-child { margin: 0 !important; padding: .75rem 1.25rem; align-items: center; border-top: 1px solid var(--ds-border); row-gap: .5rem; }
html.ds body .dataTables_wrapper > .row:last-child > [class*="col"] { padding-left: 0 !important; padding-right: 0 !important; }
html.ds body .dataTables_wrapper .dataTables_info { padding: 0 !important; color: var(--ds-ink-3) !important; font-size: .8rem; font-weight: 500; }
html.ds body .dataTables_wrapper .dataTables_paginate { padding: 0 !important; }
html.ds body .dataTables_wrapper .pagination { margin: 0 !important; gap: 4px; justify-content: flex-end; }
html.ds body .dataTables_wrapper .page-item .page-link {
    min-width: 32px; height: 32px; padding: 0 .6rem; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius-sm) !important;
    background: var(--ds-surface) !important; color: var(--ds-ink-2) !important;
    font-size: .8rem; font-weight: 500; box-shadow: none !important; margin: 0 !important;
}
html.ds body .dataTables_wrapper .page-item .page-link:hover { background: var(--ds-surface-3) !important; color: var(--ds-ink) !important; }
html.ds body .dataTables_wrapper .page-item.active .page-link { background: var(--ds-primary) !important; border-color: var(--ds-primary) !important; color: #FFFFFF !important; }
html.ds body .dataTables_wrapper .page-item.disabled .page-link { opacity: .45; }
html.ds body .dataTables_wrapper .dataTables_processing {
    top: 50% !important; padding: .6rem 1rem !important; margin: 0 !important; transform: translate(-50%, -50%); width: auto !important;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius) !important;
    box-shadow: var(--ds-shadow-md) !important; color: var(--ds-ink-2) !important; font-size: var(--ds-text-sm); font-weight: 500;
}
html.ds body table.dataTable td.dataTables_empty { padding: 2.75rem 1rem !important; text-align: center; color: var(--ds-ink-3) !important; font-size: var(--ds-text-sm); }
html.ds body table.dataTable td.dataTables_empty::before {
    content: ""; display: block; width: 40px; height: 40px; margin: 0 auto .7rem; border-radius: 12px;
    background: var(--ds-surface-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236B7090' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='22 12 16 12 14 15 10 15 8 12 2 12'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z'/%3E%3C/svg%3E") center / 20px no-repeat;
}

@media (max-width: 767.98px) {
    html.ds body .dataTables_wrapper > .row:first-child > [class*="col"] { width: 100%; }
    html.ds body .dataTables_wrapper .dt-action-buttons { flex-direction: row !important; flex-wrap: wrap; justify-content: flex-start !important; gap: .5rem; }
    html.ds body .dataTables_filter, html.ds body .dataTables_filter label, html.ds body .dataTables_filter input { width: 100% !important; }
    html.ds body .dt-buttons .btn { margin-left: 0 !important; }
    html.ds body .dataTables_wrapper .pagination { justify-content: center; }
    html.ds body .dataTables_wrapper .dataTables_info { text-align: center; }
}

/* bulk-action bar under some lists (Leases, Invoices, Users, Brokers, Companies, Packages, Subscriptions) */
html.ds body .card .row.div-margin {
    margin: 0 !important; padding: .7rem 1.25rem !important;
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    border-top: 1px solid var(--ds-border); background: var(--ds-surface-2);
    border-radius: 0 0 var(--ds-radius-lg) var(--ds-radius-lg);
}
html.ds body .card .row.div-margin::before { content: "With selected"; color: var(--ds-ink-3); font-size: .8rem; font-weight: 500; margin-right: .15rem; }
html.ds body .card .row.div-margin > [class*="col"] { flex: 0 0 auto !important; width: auto !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
html.ds body .card .row.div-margin .input-group { flex-wrap: nowrap; width: auto; }
html.ds body .card .row.div-margin .input-group-addon { display: none; }
html.ds body .card .row.div-margin .form-control,
html.ds body .card .row.div-margin .form-select,
html.ds body .card .row.div-margin select { height: 36px !important; min-height: 36px !important; min-width: 190px; padding: 0 .75rem; font-size: var(--ds-text-sm); border-radius: var(--ds-radius-sm) !important; }
html.ds body .card .row.div-margin .btn {
    float: none !important; height: 36px; min-height: 36px !important; padding: 0 1rem;
    display: inline-flex; align-items: center;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border-strong) !important;
    color: var(--ds-ink) !important; box-shadow: none !important; font-size: var(--ds-text-sm); font-weight: 500;
}
html.ds body .card .row.div-margin .btn:hover { background: var(--ds-primary-50) !important; border-color: var(--ds-primary-200) !important; color: var(--ds-primary) !important; }

/* =====================================================================
   12. Forms & step wizards (Phase 3)
   bs-stepper wizards: Property, Tenant, Lease (create + edit), checkout.
   Step numbers come from a CSS counter; JS (design-system.js) adds the
   progress bar and the per-step heading. Markup and validation untouched.
   ===================================================================== */
html.ds body .bs-stepper { background: transparent !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; }
html.ds body .bs-stepper.vertical { display: flex !important; flex-direction: row; align-items: flex-start; gap: 1.25rem; margin-top: 0 !important; }
html.ds body .bs-stepper.vertical .bs-stepper-header {
    position: sticky; top: calc(var(--ds-topbar-h) + 1.25rem);
    flex: 0 0 264px; min-width: 0 !important; margin: 0 !important;
    display: flex; flex-direction: column; align-items: stretch !important;
    padding: 1rem .75rem 1rem !important;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius-lg) !important;
    box-shadow: var(--ds-shadow-sm) !important;
    counter-reset: dsstep;
}
html.ds body .bs-stepper.vertical .bs-stepper-content {
    flex: 1 1 auto; min-width: 0; margin: 0 !important;
    padding: 1.5rem 1.75rem 1.5rem !important;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius-lg) !important;
    box-shadow: var(--ds-shadow-sm) !important;
}
html.ds body .bs-stepper .bs-stepper-header .line { display: none !important; }
html.ds body .bs-stepper .step { position: relative; counter-increment: dsstep; margin: 0 !important; }
html.ds body .bs-stepper .step .step-trigger {
    width: 100%; display: flex !important; align-items: center !important; justify-content: flex-start !important; gap: .75rem;
    padding: .55rem .6rem !important; margin: 0 !important; border-radius: var(--ds-radius) !important;
    background: transparent !important; text-align: left; white-space: normal; opacity: 1 !important;
    transition: background var(--ds-dur) var(--ds-ease);
}
html.ds body .bs-stepper .step .step-trigger:hover { background: var(--ds-surface-3) !important; }
html.ds body .bs-stepper .step .step-trigger:focus-visible { outline: 2px solid var(--ds-primary); outline-offset: -2px; }
html.ds body .bs-stepper .bs-stepper-circle {
    position: relative; z-index: 1;
    width: 28px !important; height: 28px !important; min-width: 28px; flex: 0 0 28px; margin: 0 !important; padding: 0 !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    border-radius: 50% !important; border: 1.5px solid var(--ds-border-strong) !important;
    background: var(--ds-surface) !important; color: var(--ds-ink-3) !important; box-shadow: none !important;
    font: 600 .76rem/1 var(--ds-font) !important;
    transition: background var(--ds-dur) var(--ds-ease), border-color var(--ds-dur) var(--ds-ease), color var(--ds-dur) var(--ds-ease);
}
html.ds body .bs-stepper .bs-stepper-circle > i,
html.ds body .bs-stepper .bs-stepper-circle > svg { display: none !important; }
html.ds body .bs-stepper .bs-stepper-circle::before { content: counter(dsstep); }
html.ds body .bs-stepper .bs-stepper-label { margin: 0 !important; display: flex; flex-direction: column; min-width: 0; text-align: left; }
html.ds body .bs-stepper .bs-stepper-title { color: var(--ds-ink-2) !important; font-size: .85rem !important; font-weight: 500 !important; line-height: 1.3; white-space: normal; }
html.ds body .bs-stepper .bs-stepper-subtitle { color: var(--ds-ink-3) !important; font-size: .74rem !important; font-weight: 400 !important; }
/* connector between steps */
html.ds body .bs-stepper.vertical .step::after {
    content: ""; position: absolute; left: calc(.6rem + 13px); top: 41px; bottom: -5px; width: 2px; border-radius: 2px;
    background: var(--ds-border);
}
html.ds body .bs-stepper.vertical .step:last-of-type::after { display: none; }
/* active */
html.ds body .bs-stepper .step.active .step-trigger { background: var(--ds-primary-50) !important; }
html.ds body .bs-stepper .step.active .bs-stepper-circle { background: var(--ds-primary) !important; border-color: var(--ds-primary) !important; color: #FFFFFF !important; box-shadow: 0 0 0 4px var(--ds-primary-ring) !important; }
html.ds body .bs-stepper .step.active .bs-stepper-title { color: var(--ds-ink) !important; font-weight: 600 !important; }
/* completed */
html.ds body .bs-stepper .step.crossed .bs-stepper-circle { background: var(--ds-primary-50) !important; border-color: var(--ds-primary-200) !important; color: var(--ds-primary) !important; }
html.ds body .bs-stepper .step.crossed .bs-stepper-circle::before {
    content: ""; width: 14px; height: 14px; background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
}
html.ds body .bs-stepper .step.crossed .bs-stepper-title { color: var(--ds-ink) !important; }
html.ds body .bs-stepper.vertical .step.crossed::after { background: var(--ds-primary-200); }

/* single-step forms (e.g. Add Property): no rail, full-width card */
html.ds body .bs-stepper.ds-wizard-single .bs-stepper-header { display: none !important; }
html.ds body .bs-stepper.ds-wizard-single .bs-stepper-content { flex: 1 1 100%; }

/* progress (added by JS at the top of the step list) */
html.ds body .ds-wizard-progress { padding: .15rem .6rem 1rem; margin-bottom: .6rem; border-bottom: 1px solid var(--ds-border); }
html.ds body .ds-wizard-progress-top { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .55rem; }
html.ds body .ds-wizard-progress-label { color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 600; }
html.ds body .ds-wizard-progress-pct { color: var(--ds-ink-3); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
html.ds body .ds-wizard-bar { height: 4px; border-radius: 4px; background: var(--ds-surface-3); overflow: hidden; }
html.ds body .ds-wizard-bar > span { display: block; height: 100%; border-radius: 4px; background: var(--ds-primary); transition: width 260ms var(--ds-ease); }

/* per-step heading (added by JS to each pane) */
html.ds body .ds-step-head { margin: 0 0 1.35rem; padding-bottom: 1rem; border-bottom: 1px solid var(--ds-border); }
html.ds body .ds-step-kicker { margin: 0 0 .2rem; color: var(--ds-primary) !important; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
html.ds body .ds-step-title { margin: 0; font-size: 1.1rem; font-weight: 600; letter-spacing: -.018em; color: var(--ds-ink); }

/* wizard footer: Previous · Next/Submit */
html.ds body .bs-stepper-content .col-12.d-flex.justify-content-between:has(.btn-prev, .btn-next, .btn-submit, [type="submit"]) {
    margin-top: 1.75rem !important; padding-top: 1.25rem; border-top: 1px solid var(--ds-border);
    gap: .75rem; flex-wrap: wrap;
}
html.ds body .bs-stepper-content .btn-prev,
html.ds body .bs-stepper-content .btn-next,
html.ds body .bs-stepper-content .btn-submit { min-width: 120px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
html.ds body .bs-stepper-content .btn-prev { background: var(--ds-surface) !important; border: 1px solid var(--ds-border-strong) !important; color: var(--ds-ink-2) !important; box-shadow: none !important; }
html.ds body .bs-stepper-content .btn-prev:hover:not(:disabled) { background: var(--ds-surface-3) !important; color: var(--ds-ink) !important; }
html.ds body .bs-stepper-content .btn-prev:disabled { opacity: .45; }

/* responsive: steps become a horizontal, scrollable strip */
@media (max-width: 991.98px) {
    html.ds body .bs-stepper.vertical { flex-direction: column; align-items: stretch; gap: 1rem; }
    html.ds body .bs-stepper.vertical .bs-stepper-header {
        position: static; flex: none; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: .25rem;
        padding: .6rem !important; scrollbar-width: thin;
    }
    html.ds body .bs-stepper.vertical .ds-wizard-progress { display: none; }
    html.ds body .bs-stepper.vertical .step { flex: 0 0 auto; }
    html.ds body .bs-stepper.vertical .step::after { display: none; }
    html.ds body .bs-stepper .step .step-trigger { padding: .45rem .7rem .45rem .45rem !important; }
    html.ds body .bs-stepper .bs-stepper-title { white-space: nowrap; }
    html.ds body .bs-stepper.vertical .bs-stepper-content { padding: 1.25rem !important; }
}

/* labels, required marks, help + validation */
html.ds body .form-label,
html.ds body label.col-form-label { margin-bottom: .4rem; color: var(--ds-ink-2) !important; font-size: var(--ds-text-sm) !important; font-weight: 500 !important; }
html.ds body .requiredLabel,
html.ds body .form-label .text-danger { color: var(--ds-danger) !important; font-weight: 600; margin-left: 1px; }
html.ds body .form-text { color: var(--ds-ink-3) !important; font-size: .76rem; }
html.ds body .form-control.is-invalid,
html.ds body .form-select.is-invalid,
html.ds body .is-invalid + .select2-container .select2-selection { border-color: var(--ds-danger) !important; box-shadow: 0 0 0 3px rgba(var(--ds-danger-rgb), .12) !important; background-image: none !important; }
html.ds body .invalid-feedback,
html.ds body .fv-plugins-message-container .fv-help-block,
html.ds body .fv-plugins-message-container.invalid-feedback,
html.ds body small.invalid-email strong { display: block; margin-top: .3rem; color: var(--ds-danger-ink) !important; font-size: .76rem !important; font-weight: 500 !important; }
html.ds body .form-control:disabled, html.ds body .form-control[readonly], html.ds body .form-select:disabled { background-color: var(--ds-surface-3) !important; color: var(--ds-ink-3); }
html.ds body textarea.form-control { min-height: 96px; }

/* sub-sections inside forms (Features, Units, Contact persons, charges…) */
html.ds body .pf-section { background: var(--ds-surface-2) !important; border: 1px solid var(--ds-border) !important; border-radius: var(--ds-radius-lg) !important; padding: 1.1rem 1.2rem 1.2rem !important; }
html.ds body .pf-section-head { border-bottom: 1px solid var(--ds-border) !important; padding-bottom: .85rem; margin-bottom: 1rem; }
html.ds body .pf-icon { width: 34px !important; height: 34px !important; border-radius: var(--ds-radius) !important; background: var(--ds-primary-50) !important; color: var(--ds-primary) !important; font-size: 1.05rem !important; }
html.ds body .pf-title { font-size: .95rem !important; font-weight: 600 !important; color: var(--ds-ink) !important; }
html.ds body .pf-sub { color: var(--ds-ink-3) !important; }
html.ds body .pf-add { height: 34px; display: inline-flex; align-items: center; gap: .3rem; background: var(--ds-surface) !important; border: 1px solid var(--ds-primary-200) !important; color: var(--ds-primary) !important; border-radius: var(--ds-radius-sm) !important; font-weight: 500 !important; font-size: var(--ds-text-sm); }
html.ds body .pf-add:hover { background: var(--ds-primary-50) !important; color: var(--ds-primary) !important; }
html.ds body .pf-section .unit-row { border-color: var(--ds-border) !important; border-radius: var(--ds-radius) !important; }
html.ds body .pf-section .unit-row:hover { border-color: var(--ds-primary-200) !important; box-shadow: var(--ds-shadow-sm) !important; }
html.ds body .pf-section .unit-row .form-text { color: var(--ds-primary) !important; }
html.ds body .pf-section .unit-row .copy-btn { background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; color: var(--ds-ink-2) !important; }
html.ds body .pf-section .unit-row .copy-btn i { color: inherit !important; }
html.ds body .pf-section .unit-row .copy-btn:hover { background: var(--ds-primary-50) !important; border-color: var(--ds-primary-200) !important; color: var(--ds-primary) !important; }
html.ds body .pf-section .removeButton, html.ds body .pf-section .remove-row, html.ds body .pf-section .remove-step,
html.ds body .pf-section .remove-item-row, html.ds body .pf-section .remove-btn,
html.ds body .pf-section .remove-feature-item, html.ds body .pf-section .unit-row .delete-btn { background: var(--ds-surface) !important; border: 1px solid var(--ds-border) !important; color: var(--ds-ink-3) !important; border-radius: var(--ds-radius-sm) !important; }
html.ds body .pf-section .removeButton i, html.ds body .pf-section .remove-row i, html.ds body .pf-section .remove-step i,
html.ds body .pf-section .remove-item-row i, html.ds body .pf-section .remove-btn i,
html.ds body .pf-section .remove-feature-item i, html.ds body .pf-section .unit-row .delete-btn i { color: inherit !important; }
html.ds body .pf-section .removeButton:hover, html.ds body .pf-section .remove-row:hover, html.ds body .pf-section .remove-step:hover,
html.ds body .pf-section .remove-item-row:hover, html.ds body .pf-section .remove-btn:hover,
html.ds body .pf-section .remove-feature-item:hover, html.ds body .pf-section .unit-row .delete-btn:hover { background: var(--ds-danger-50) !important; border-color: #F3C3C8 !important; color: var(--ds-danger-ink) !important; }

/* "Go back" button used on every add / edit page: a labelled, quiet button */
html.ds body .ds-page-actions a.btn[title="Go To Back"],
html.ds body .ds-page-actions a.btn[data-title="Back"] {
    min-height: 36px; height: 36px; padding: 0 .85rem 0 .7rem !important;
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-border-strong) !important; border-radius: var(--ds-radius-sm) !important;
    color: var(--ds-ink-2) !important; box-shadow: none !important; font-size: var(--ds-text-sm); font-weight: 500;
}
html.ds body .ds-page-actions a.btn[title="Go To Back"]::after,
html.ds body .ds-page-actions a.btn[data-title="Back"]::after { content: "Back"; }
html.ds body .ds-page-actions a.btn[title="Go To Back"]:hover,
html.ds body .ds-page-actions a.btn[data-title="Back"]:hover { background: var(--ds-surface-3) !important; color: var(--ds-ink) !important; }
html.ds body .ds-page-actions a.btn[title="Go To Back"] i,
html.ds body .ds-page-actions a.btn[data-title="Back"] i { font-size: 1rem; color: inherit !important; }

/* ---------------------------------------------------------------------
   9. Footer
   --------------------------------------------------------------------- */
html.ds body .ds-footer { background: transparent !important; border-top: 1px solid var(--ds-border); }
html.ds body .ds-footer .container-xxl { max-width: 1520px; padding-left: var(--ds-gutter) !important; padding-right: var(--ds-gutter) !important; }
html.ds body .ds-footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; padding: 1rem 0; color: var(--ds-ink-3); font-size: 0.78rem; }
html.ds body .ds-footer-inner a { color: var(--ds-ink-2) !important; font-weight: 500; }
html.ds body .ds-footer-inner a:hover { color: var(--ds-primary) !important; }

/* ---------------------------------------------------------------------
   10. Responsive
   --------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
    html.ds body .ds-topbar .navbar-nav-right { margin-left: 0.25rem; }
}
@media (max-width: 991.98px) {
    :root { --ds-gutter: 1.25rem; }
    html.ds body .ds-search-trigger { width: 40px; flex: 0 0 40px; padding: 0; justify-content: center; }
    html.ds body .ds-search-trigger .ds-search-placeholder,
    html.ds body .ds-search-trigger .ds-kbd { display: none; }
}
@media (max-width: 767.98px) {
    :root { --ds-gutter: 1rem; --ds-topbar-h: 58px; }
    html.ds body .ds-btn-icon-text span { display: none; }
    html.ds body .ds-btn-icon-text { width: 36px; padding: 0 !important; justify-content: center; }
    html.ds body .ds-topbar-divider { display: none; }
    html.ds body .ds-page-header-inner { align-items: flex-start; }
    html.ds body .ds-page-header .page-header-title h4.ds-page-title { font-size: 1.2rem !important; }
    html.ds body .content-wrapper > .container-xxl.container-p-y { padding-top: 1.25rem !important; }
    html.ds body .ds-footer-inner { justify-content: center; text-align: center; }
    html.ds body .ds-command { padding-top: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
    html.ds body * { transition: none !important; animation: none !important; }
}
@media print {
    html.ds body .ds-topbar, html.ds body .ds-command { display: none !important; }
}
