/* ============================================================
   CloudPanel BS5 Theme — cp-theme.css
   ============================================================
   Replaces avant.css + avant-bootstrap-overrides.css. Loaded AFTER
   bootstrap.min.css (BS5) and BEFORE modern.css. Brand customization
   is expressed as Bootstrap 5 CSS custom properties; the file only
   contains hand-written rules for layout primitives BS5 has no
   opinion about (left sidebar, login-split, secure-email portal).

   Section map:
     1. Brand tokens — non-BS5-vendored CSS custom properties
     2. BS5 variable overrides (:root)
     3. Component-level BS5 var overrides (.btn, .alert, .card, …)
     4. Sidebar / leftbar layout shell
     5. Page heading, breadcrumb tweaks
     6. Login split-screen
     7. Secure email portal
     8. Error pages

   Anything specific to a single page lives in that page's
   own CSS file (login.css → modern.css §7, secure-email.css,
   error-page.css). This file is global only.
   ============================================================ */

/* ============================================================
   1. Brand tokens
   ============================================================
   Match the values modern.css already uses, so the BS5 cutover
   doesn't shift visible button / link / navbar colors. */

:root {
  /* Teal — primary action color (buttons, links, focus rings) */
  --brand-teal:        #32c5d2;
  --brand-teal-2:      #28aab8;
  --brand-teal-deep:   #1c8a95;
  --brand-teal-soft:   #d6f3f6;

  /* Navy — navbar gradient + accent surfaces */
  --brand-navy:        #2e5dac;
  --brand-navy-2:      #254a8a;
  --brand-navy-deep:   #1c3a6f;

  /* Sidebar surface */
  --sb-bg:             #5e6878;
  --sb-bg-2:           #4e5666;

  /* Status palette */
  --st-success:        #527f26;
  --st-success-bg:     #ebf6e1;
  --st-warn:           #927608;
  --st-warn-bg:        #fcf3d0;
  --st-danger:         #a81515;
  --st-danger-bg:      #fdf2f2;
  --st-info:           #157890;
  --st-info-bg:        #ddf4fa;

  /* CloudPanel functional palette — drives dashboard tile colors,
     metric stripes, status pills, sparklines. */
  --cp-tile-info:      #4f8edc;
  --cp-tile-orange:    #f4813a;
  --cp-tile-success:   #85c744;
  --cp-tile-magenta:   #b5468f;
  --cp-tile-midnight:  #2a3f5c;
  --cp-tile-green:     #14eb60;
  --cp-tile-purple:    #8064a1;
  --cp-tile-red:       #c0504e;
  --cp-accent-cyan:    #2bbce0;

  /* Surfaces & lines — generic aliases consumed throughout the
     legacy modern.css ruleset. Mirror the BS5 vars where applicable
     so the two namespaces stay in sync. */
  --bg:                #f6f7fa;
  --bg-2:              #ffffff;
  --bg-3:              #fbfbfd;
  --fg:                #1d2128;
  --fg-2:              #3a4150;
  --fg-muted:          #8a93a4;
  --line:              #e6e8ee;
  --line-2:            #eef0f4;
  --hover:             #f1f3f7;

  /* Geometry */
  --r-card:            6px;
  --r-input:           5px;
  --r-pill:            999px;
  --gap:               16px;
}

/* ============================================================
   1b. Base layout — body padding for fixed navbar + typography
   ============================================================
   The fixed-top navbar is 64px tall; without padding-top the
   leftbar and page content tuck under it. Typography helpers
   `.mono / .muted / .eyebrow` are referenced by dashboard widgets
   folded in below. */

body {
  padding-top: 64px;
}

/* BS5 ships `a { text-decoration: underline }` by default — BS3 didn't,
   so CloudPanel's previous look had no link underlines. Restore the
   BS3-like behaviour: underline on hover only. Anchors that legitimately
   need a permanent underline can opt back in with `text-decoration:
   underline` inline or via a utility class. */
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Open Sans", system-ui, sans-serif;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.muted { color: var(--fg-muted); }
.eyebrow {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* ============================================================
   2. BS5 variable overrides
   ============================================================
   Drives every component that consumes the standard
   --bs-* tokens (buttons, links, alerts, badges, borders,
   focus rings, form controls, navbar, modal, dropdown). */

:root,
[data-bs-theme="light"] {
  /* Theme colors */
  --bs-primary:                 #32c5d2;
  --bs-primary-rgb:             50, 197, 210;
  --bs-secondary:               #6c757d;
  --bs-secondary-rgb:           108, 117, 125;
  --bs-success:                 #527f26;
  --bs-success-rgb:             82, 127, 38;
  --bs-info:                    #157890;
  --bs-info-rgb:                21, 120, 144;
  --bs-warning:                 #927608;
  --bs-warning-rgb:             146, 118, 8;
  --bs-danger:                  #a81515;
  --bs-danger-rgb:              168, 21, 21;

  /* Body / surface */
  --bs-body-bg:                 #f6f7fa;
  --bs-body-bg-rgb:             246, 247, 250;
  --bs-body-color:              #1d2128;
  --bs-body-color-rgb:          29, 33, 40;
  --bs-emphasis-color:          #000;
  --bs-secondary-color:         rgba(29, 33, 40, 0.6);
  --bs-secondary-bg:            #eef0f4;
  --bs-tertiary-bg:             #fbfbfd;
  --bs-tertiary-color:          rgba(29, 33, 40, 0.45);

  /* Borders */
  --bs-border-color:            #e6e8ee;
  --bs-border-color-translucent: rgba(0, 0, 0, 0.08);
  --bs-border-radius:           5px;
  --bs-border-radius-sm:        3px;
  --bs-border-radius-lg:        6px;
  --bs-border-radius-xl:        8px;

  /* Links */
  --bs-link-color:              #1c8a95;
  --bs-link-color-rgb:          28, 138, 149;
  --bs-link-hover-color:        #28aab8;
  --bs-link-hover-color-rgb:    40, 170, 184;

  /* Typography */
  --bs-font-sans-serif:         "Open Sans", "Segoe UI", system-ui, -apple-system, "Droid Sans", Tahoma, Arial, sans-serif;
  --bs-body-font-family:        var(--bs-font-sans-serif);
  --bs-body-font-size:          13px;
  --bs-body-line-height:        1.45;
  --bs-body-font-weight:        400;
  --bs-heading-color:           #1d2128;

  /* Focus ring */
  --bs-focus-ring-color:        rgba(50, 197, 210, 0.25);
}

/* ============================================================
   3. Component-level BS5 var overrides
   ============================================================
   Most components pick up the brand colors via --bs-primary
   etc. above. These are the targeted nudges where BS5's default
   visual doesn't match what we want. */

/* Cards — flatter, light header rather than BS5's neutral-grey */
.card {
  --bs-card-border-color:       var(--bs-border-color);
  --bs-card-border-radius:      6px;
  --bs-card-cap-bg:             #fbfbfd;
  --bs-card-cap-color:          #1d2128;
  --bs-card-cap-padding-y:      0.65rem;
  --bs-card-cap-padding-x:      1rem;
  --bs-card-spacer-y:           1rem;
  --bs-card-spacer-x:           1rem;
}
.card > .card-header {
  font-weight: 600;
  font-size: 13px;
  text-transform: none;
  border-bottom: 1px solid var(--bs-border-color);
}

/* `.card.border-primary` was originally a primary-vs-default distinction
   (teal-soft header for primary cards, white for default). Reverted to
   the BS5 default look across all cards for consistency — every card
   renders with a white header (var(--bg-2)) and the standard border
   color (var(--bs-border-color)). The .border-primary class is a no-op
   now; views can keep it on their markup harmlessly. */

/* Buttons — keep Avant's tighter padding */
.btn {
  --bs-btn-padding-y:           0.4rem;
  --bs-btn-padding-x:           0.85rem;
  --bs-btn-font-size:           13px;
  --bs-btn-border-radius:       5px;
  --bs-btn-line-height:         1.45;
}
.btn-sm {
  --bs-btn-padding-y:           0.25rem;
  --bs-btn-padding-x:           0.6rem;
  --bs-btn-font-size:           12px;
  --bs-btn-border-radius:       4px;
}
.btn-primary {
  --bs-btn-color:               #fff;
  --bs-btn-bg:                  var(--brand-teal);
  --bs-btn-border-color:        var(--brand-teal);
  --bs-btn-hover-bg:            var(--brand-teal-2);
  --bs-btn-hover-border-color:  var(--brand-teal-2);
  --bs-btn-hover-color:         #fff;
  --bs-btn-active-bg:           var(--brand-teal-deep);
  --bs-btn-active-border-color: var(--brand-teal-deep);
  --bs-btn-disabled-bg:         var(--brand-teal);
  --bs-btn-disabled-border-color: var(--brand-teal);
}
.btn-secondary {
  --bs-btn-color:               #1d2128;
  --bs-btn-bg:                  #fff;
  --bs-btn-border-color:        #c2c6cf;
  --bs-btn-hover-bg:            #f1f3f7;
  --bs-btn-hover-border-color:  #a1a8b3;
  --bs-btn-hover-color:         #1d2128;
  --bs-btn-active-bg:           #e6e8ee;
  --bs-btn-active-border-color: #8c94a0;
}

/* Forms — line-up with our 13px body type */
.form-control,
.form-select {
  --bs-border-color:            #d4d7de;
  font-size: 13px;
  padding: 0.45rem 0.7rem;
  border-radius: 5px;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 0.2rem var(--bs-focus-ring-color);
}
.form-label,
.col-form-label {
  font-weight: 600;
  font-size: 13px;
  color: var(--bs-body-color);
}
.form-text {
  font-size: 12px;
  color: var(--bs-tertiary-color);
}

/* Badges — bring back something close to BS3 .label proportions */
.badge {
  --bs-badge-padding-x:         0.55em;
  --bs-badge-padding-y:         0.32em;
  --bs-badge-font-size:         0.78em;
  --bs-badge-font-weight:       600;
  --bs-badge-border-radius:     3px;
}

/* Alerts — subtler tint than BS5 default */
.alert {
  --bs-alert-padding-x:         1rem;
  --bs-alert-padding-y:         0.7rem;
  --bs-alert-margin-bottom:     1rem;
  --bs-alert-border-radius:     5px;
}
.alert-success { --bs-alert-color: var(--st-success); --bs-alert-bg: var(--st-success-bg); --bs-alert-border-color: rgba(82,127,38,0.2); }
.alert-info    { --bs-alert-color: var(--st-info);    --bs-alert-bg: var(--st-info-bg);    --bs-alert-border-color: rgba(21,120,144,0.2); }
.alert-warning { --bs-alert-color: var(--st-warn);    --bs-alert-bg: var(--st-warn-bg);    --bs-alert-border-color: rgba(146,118,8,0.2); }
.alert-danger  { --bs-alert-color: var(--st-danger);  --bs-alert-bg: var(--st-danger-bg);  --bs-alert-border-color: rgba(168,21,21,0.2); }

/* Modals — keep Avant's 5px radius and a hair softer backdrop */
.modal {
  --bs-modal-border-radius:     6px;
  --bs-modal-header-padding-y:  0.85rem;
  --bs-modal-header-padding-x:  1rem;
  --bs-modal-padding:           1rem;
}
.modal-backdrop.show { opacity: 0.55; }

/* Force the modal-header to its BS5 default flex layout: title left,
   close button right. Some legacy rule we haven't located is competing
   with the auto margin on .btn-close — these explicit declarations
   re-establish the contract. */
.modal-header {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
}
.modal-header .btn-close {
  margin-left: auto !important;
  margin-right: calc(-0.5 * var(--bs-modal-header-padding-x, 1rem)) !important;
  order: 99;
}
/* BS5's `.modal-title` defaults to `font-size: 1.25rem` (~20 px) which
   reads larger than the BS3/Avant pattern. Trim to match the card-header
   size so modals and cards feel like the same surface family. */
.modal-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  order: 0;
}

/* Tooltips / popovers — readable on both light + dark surfaces */
.tooltip {
  --bs-tooltip-bg:              #333;
  --bs-tooltip-color:           #fff;
  --bs-tooltip-font-size:       12px;
  --bs-tooltip-padding-x:       0.6rem;
  --bs-tooltip-padding-y:       0.35rem;
}

/* Dropdowns — match BS3 spacing density */
.dropdown-menu {
  --bs-dropdown-font-size:      13px;
  --bs-dropdown-padding-y:      0.4rem;
  --bs-dropdown-item-padding-y: 0.4rem;
  --bs-dropdown-item-padding-x: 1rem;
  --bs-dropdown-border-radius:  5px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

/* Force dropdown menus inside the navbar to position absolutely.
   BS5's default makes `.navbar-nav .dropdown-menu` static (it's the
   collapsed-on-mobile pattern); without a `.navbar-expand-*` class
   on our <header>, that static positioning persists at all sizes,
   so opening the user-toolbar dropdown injects the menu into the
   navbar flow and grows its height. */
header.navbar .navbar-nav .dropdown-menu,
nav.navbar .navbar-nav .dropdown-menu {
  position: absolute;
}

/* Tables — Avant-density default. Striping disabled (transparent
   stripe color) so DataTables stay all-white with only the hover
   highlight visually distinguishing rows. To re-enable, change
   --bs-table-striped-bg to e.g. rgba(0,0,0,0.02). */
.table {
  --bs-table-bg:                transparent;
  --bs-table-color:             var(--bs-body-color);
  --bs-table-border-color:      var(--bs-border-color);
  --bs-table-striped-bg:        transparent;
  font-size: 13px;
}
.table > thead {
  background: #f6f7fa;
  font-weight: 600;
}

/* Pagination — teal accent for the active page */
.pagination {
  --bs-pagination-color:                #1d2128;
  --bs-pagination-bg:                   #fff;
  --bs-pagination-border-color:         var(--bs-border-color);
  --bs-pagination-hover-color:          var(--brand-teal-deep);
  --bs-pagination-hover-bg:             var(--brand-teal-soft);
  --bs-pagination-active-bg:            var(--brand-teal);
  --bs-pagination-active-border-color:  var(--brand-teal);
  --bs-pagination-disabled-bg:          #fff;
  --bs-pagination-disabled-color:       var(--bs-tertiary-color);
  --bs-pagination-disabled-border-color: var(--bs-border-color);
  --bs-pagination-font-size:            13px;
}

/* Breadcrumb */
.breadcrumb {
  --bs-breadcrumb-divider-color:       var(--bs-tertiary-color);
  --bs-breadcrumb-item-active-color:   var(--bs-body-color);
  --bs-breadcrumb-font-size:           13px;
  --bs-breadcrumb-margin-bottom:       0.5rem;
  --bs-breadcrumb-padding-x:           0;
  --bs-breadcrumb-padding-y:           0;
  --bs-breadcrumb-bg:                  transparent;
}

/* List group — override BS5's default `--bs-list-group-bg: var(
   --bs-body-bg)` (which inherits our page-grey #f6f7fa) so items
   render on white instead of blending into the page background. */
.list-group {
  --bs-list-group-bg: var(--bg-2);
}

/* Tabs */
.nav-tabs {
  --bs-nav-tabs-border-color:          var(--bs-border-color);
  --bs-nav-tabs-link-active-color:     var(--brand-teal-deep);
  --bs-nav-tabs-link-active-border-color: var(--bs-border-color) var(--bs-border-color) #fff;
  --bs-nav-tabs-link-hover-border-color: transparent transparent var(--brand-teal);
  font-size: 13px;
  font-weight: 600;
}

/* ============================================================
   4. Sidebar / leftbar layout shell
   ============================================================
   BS5 has no opinion about left rails. The sidebar markup
   (#page-leftbar > ul.acc-menu) is preserved from the existing
   _LeftMenu.cshtml partial; this block re-establishes the steel
   surface and item styling on top of BS5. The mobile collapse
   logic and menu interactions live in cloudpanel.js. */

#page-container {
  background: linear-gradient(to right,
    var(--sb-bg) 0,
    var(--sb-bg) 280px,
    var(--bs-body-bg) 280px,
    var(--bs-body-bg) 100%);
  min-height: calc(100vh - 64px);
  position: relative;
  overflow: hidden;
}
body.collapse-leftbar #page-container {
  background: linear-gradient(to right,
    var(--sb-bg) 0,
    var(--sb-bg) 68px,
    var(--bs-body-bg) 68px,
    var(--bs-body-bg) 100%);
}
@media (max-width: 767px) {
  #page-container,
  body.collapse-leftbar #page-container {
    background: var(--bs-body-bg);
  }
}

#page-leftbar {
  width: 280px;
  float: left;
  background: transparent;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  padding-top: 8px;
  transition: width 0.2s ease;
}
body.collapse-leftbar #page-leftbar { width: 68px; }

#page-leftbar ul.acc-menu,
#page-leftbar ul.acc-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
#page-leftbar ul.acc-menu > li > a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border-left: 3px solid transparent;
}
#page-leftbar ul.acc-menu > li > a:hover,
#page-leftbar ul.acc-menu > li.active > a {
  background: var(--sb-bg-2);
  border-left-color: var(--brand-teal);
  color: #fff;
}
#page-leftbar ul.acc-menu > li > a > i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
#page-leftbar ul.acc-menu ul {
  background: var(--sb-bg-2);
  display: none;
}
/* DO NOT add `#page-leftbar ul.acc-menu li.open > ul { display: block }`.
   application.js drives the open/close animation via jQuery slideToggle,
   which manages inline style="display:block|none". A CSS rule keyed on
   `.open` would flash the menu visible the instant addClass('open') runs,
   making slideToggle interpret the click as a "currently visible → animate
   closed" gesture. The `.open` class still controls the chevron flip and
   active-item highlight; opening/closing is JS-only. */
#page-leftbar ul.acc-menu ul li a {
  display: block;
  padding: 6px 16px 6px 44px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 12.5px;
  line-height: 22px;
}
#page-leftbar ul.acc-menu ul li a:hover {
  background: rgba(0,0,0,0.15);
  color: #fff;
}

/* Third-level submenu (e.g. Microsoft Exchange ▸ Global Policies ▸
   ActiveSync). Without this, every nested-ul descendant matches the
   `.acc-menu ul li a` rule above and sits at 44 px padding — flush
   with its grandparent's siblings, so when "Global Policies" is open
   you can't tell whether ActiveSync belongs to Global Policies or to
   Microsoft Exchange directly. The deeper indent + slightly darker
   tint on the inner <ul> makes the hierarchy obvious. */
#page-leftbar ul.acc-menu ul ul {
  background: rgba(0,0,0,0.18);
}
#page-leftbar ul.acc-menu ul ul li a {
  padding-left: 64px;
  font-size: 12px;
}

#page-content {
  margin-left: 280px;
  /* Zero horizontal padding so #page-heading (white-bg banner) can
     extend edge-to-edge inside the leftbar gutter. Content INSIDE
     `.container-fluid` keeps BS5's default 24 px gutter automatically
     via `--bs-gutter-x`. Vertical padding is gone too — components
     own their own top spacing. */
  padding: 0;
  min-height: calc(100vh - 64px - 60px); /* navbar + footer */
  transition: margin-left 0.2s ease;
}
body.collapse-leftbar #page-content { margin-left: 68px; }
body.no-leftbar #page-content { margin-left: 0; }
body.no-leftbar #page-leftbar,
body.no-leftbar #leftmenu-trigger { display: none; }

@media (max-width: 767px) {
  #page-leftbar { width: 0 !important; overflow: hidden; }
  body.show-leftbar #page-leftbar { width: 100% !important; }
  #page-content,
  body.collapse-leftbar #page-content { margin-left: 0; padding: 0; }
}

/* ============================================================
   5. Page heading, breadcrumb, footer
   ============================================================ */

#page-heading {
  margin-bottom: 16px;
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 10px;
}
#page-heading h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 4px 0 0 0;
}
#page-heading .breadcrumb {
  margin-bottom: 8px;
}
#page-heading .breadcrumb a:hover { color: var(--brand-teal); }

footer[role="contentinfo"] {
  background: #fff;
  border-top: 1px solid var(--bs-border-color);
  padding: 4px 20px;
  font-size: 12px;
  color: var(--bs-tertiary-color);
  line-height: 22px;
}
/* Flexbox the inner clearfix so the floated left list and floated
   right back-to-top button align on the same baseline (vertically
   centered against each other). `float-end` on the button works
   inconsistently inside a flex container, so we force the right-edge
   pin via `margin-left: auto` on the button itself. */
footer[role="contentinfo"] > .clearfix {
  display: flex;
  align-items: center;
}
footer[role="contentinfo"] > .clearfix > ul {
  margin: 0;
}
footer[role="contentinfo"] > .clearfix > #back-to-top {
  margin-left: auto;
}

/* ============================================================
   6. Login split-screen
   ============================================================
   Owned by modern.css §7 (`.login-split*` rules around line 1571).
   Kept there to avoid drift between two stylesheets — when login
   visuals change, edit modern.css. cp-theme.css intentionally
   does NOT redefine .login-split* rules. */

/* ============================================================
   7. Secure email portal
   ============================================================
   Standalone view (Views/EncryptedEmailPortal/secure_email.cshtml).
   Currently styled by secure-email.css — keep that file as-is;
   this block is reserved for future BS5-specific overrides. */

/* (intentionally empty — see Content/css/secure-email.css) */

/* ============================================================
   8. Error pages
   ============================================================
   Standalone views (Views/Error/{401,404,500}.cshtml). They load
   error-page.css directly and do not pull Bootstrap at all, so
   no BS5 overrides are needed. */

/* (intentionally empty — see Content/css/error-page.css) */

/* ============================================================
   9. BS3 form compat — keep .form-group + .form-horizontal alive
   ============================================================
   BS5 dropped both classes; rewriting the ~470 occurrences across
   43 view files would dwarf every other piece of this migration.
   Re-implement the BS3 behaviour here so the markup keeps working.
   The visual outcome is identical because BS3 / BS5 share the same
   underlying grid columns. */

.form-group {
  margin-bottom: 1rem;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-horizontal .form-group {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-right: -0.75rem;
  margin-left: -0.75rem;
}
.form-horizontal .form-group > [class^="col-"],
.form-horizontal .form-group > [class*=" col-"] {
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}
.form-horizontal .col-form-label {
  padding-top: calc(0.45rem + 1px);
  padding-bottom: calc(0.45rem + 1px);
  margin-bottom: 0;
  text-align: right;
}
@media (max-width: 575.98px) {
  .form-horizontal .col-form-label {
    text-align: left;
  }
}
.form-horizontal .form-control-plaintext {
  padding-top: calc(0.45rem + 1px);
}

/* `.tab-container.tab-right` (used by /admin/settings) — port from
   avant.css. Nav-tabs float right as a vertical strip; the .tab-content
   fills the rest of the row and the active tab "merges" into it via a
   teal accent border. Adapted for BS5 nav markup (`.nav-item` on <li>,
   `.nav-link` on <a>). */
.tab-container { margin-bottom: 20px; }
.tab-container::after {
  content: "";
  display: table;
  clear: both;
}
.tab-container .nav-tabs .nav-link {
  border-radius: 0;
}
.tab-container > .tab-content {
  border: 1px solid var(--line);
  border-top: 0;
  padding: 12px 16px;
  background: var(--bg-2);
}
.tab-container > .nav-tabs > .nav-item > .nav-link.active {
  border-top: 2px solid var(--brand-teal);
  background-color: var(--bg-2);
}

/* Vertical (left/right) variants */
.tab-container.tab-left > .nav-tabs,
.tab-container.tab-right > .nav-tabs {
  flex-direction: column;
  border-bottom: none;
  min-width: 140px;
}
.tab-container.tab-left > .nav-tabs > .nav-item,
.tab-container.tab-right > .nav-tabs > .nav-item {
  width: 100%;
}
.tab-container.tab-left > .nav-tabs .nav-link,
.tab-container.tab-right > .nav-tabs .nav-link {
  border: 1px solid var(--line);
  margin: 0;
}
.tab-container.tab-left > .tab-content,
.tab-container.tab-right > .tab-content {
  overflow: auto;
  border-top: 1px solid var(--line);
}
.tab-container.tab-right > .nav-tabs {
  float: right;
  margin-left: -1px;
}
.tab-container.tab-right > .nav-tabs .nav-link {
  border-left: 0;
}
.tab-container.tab-right > .nav-tabs > .nav-item > .nav-link.active {
  border-top: 1px solid var(--line);
  border-right: 2px solid var(--brand-teal);
}
.tab-container.tab-left > .nav-tabs {
  float: left;
  margin-right: -1px;
}
.tab-container.tab-left > .nav-tabs .nav-link {
  border-right: 0;
}
.tab-container.tab-left > .nav-tabs > .nav-item > .nav-link.active {
  border-top: 1px solid var(--line);
  border-left: 2px solid var(--brand-teal);
}

/* BS5 dropped .form-inline (BS3/BS4 had it). Re-implement: form is a
   flex row with wrapped form-groups, each form-group stacks its label
   above its input. Used by /logging "Manually Ban an IP" and similar. */
form.form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
form.form-inline .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
form.form-inline .form-group > label {
  margin-bottom: 2px;
}

/* BS3 small inputs were `.input-sm`; BS5 renamed that shape to
   `.form-control-sm` / `.form-select-sm`. Keep the old markup visually
   small while views are migrated opportunistically. */
.input-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  border-radius: var(--bs-border-radius-sm);
}
select.input-sm {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
textarea.input-sm {
  min-height: auto;
}

/* Some views (Overview/overview.cshtml) wrap a single .col-* inside a
   <form> directly under a .row. In BS5's flex-based grid, the form
   becomes the flex item itself — taking the full row width — and any
   sibling .col-* wraps below instead of laying out side-by-side.
   `display: contents` makes the form's layout box disappear so its
   .col-* child participates as a direct flex item of the .row. Form
   submit / validation semantics are unaffected. */
.row > form {
  display: contents;
}

/* ============================================================
   10. BS3 well compat
   ============================================================
   `.well` was removed in BS5. Five surviving uses across the
   codebase keep working with this shim. */

.well {
  background-color: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.well-sm { padding: 0.5rem 0.75rem; }

/* ============================================================
   11. Print
   ============================================================ */

@media print {
  .hidden-print,
  #page-leftbar,
  header.navbar,
  footer[role="contentinfo"] { display: none !important; }
  #page-content { margin-left: 0 !important; padding: 0 !important; }
}

/* ============================================================
   12. Folded from modern.css (CloudPanel design system)
   ============================================================
   Originally a separate stylesheet loaded after cp-theme.css.
   Folded in 2026-05-07 to consolidate the BS5 theme into a
   single file. Sections retained from the original modern.css:

     3. Layout (navbar, sidebar) â€” overrides cp-theme's defaults
     4. Re-skinned Bootstrap primitives
     5. New design primitives (.card, .pill, .tbl, .av, .pagehead)
     6. Feature components (.metric, .ws, .spark, .shortcut-tiles)
     7. Login split-screen
     8. DataTables overrides + responsive card-mode
     9. Mobile breakpoints (â‰¤767px)
   ============================================================ */
/* ============================================================
   3. Layout — navbar (64px), sidebar (280px), content
   ============================================================ */

/* (body padding-top is set once in §1b above; do not duplicate here.) */

/* Steel sidebar rail — painted as a left-edge gradient on
   `#page-container` so it always extends to the bottom of the page
   content (regardless of how short the leftbar's actual menu items
   are) and stops cleanly at the footer instead of overlaying it.
   Avant's `#page-container` is `position: relative; overflow: hidden`,
   which contains this background and lets the leftbar's float layout
   sit on top normally. */
#page-container {
  background: linear-gradient(to right,
    var(--sb-bg) 0,
    var(--sb-bg) 280px,
    var(--bg) 280px,
    var(--bg) 100%) !important;
}
body.collapse-leftbar #page-container {
  background: linear-gradient(to right,
    var(--sb-bg) 0,
    var(--sb-bg) 68px,
    var(--bg) 68px,
    var(--bg) 100%) !important;
}
@media (max-width: 767px) {
  #page-container,
  body.collapse-leftbar #page-container {
    background: var(--bg) !important;
  }
}

/* Both <nav class="navbar"> and <header class="navbar"> need this — the
   header element in _Header.cshtml wouldn't match `nav.navbar`. flex-wrap:
   nowrap keeps the brand + leftmenu-trigger on the same line as the
   right-side toolbar instead of wrapping into a double-height navbar. */
header.navbar,
nav.navbar {
  /* Drop BS5's 0.5rem vertical padding so toolbar items can fill the
     full navbar height — without this the hover background on
     #leftmenu-trigger / .toolbar > li > a stops 8 px short of the
     navbar's top + bottom edges. */
  --bs-navbar-padding-y: 0;
  min-height: 64px;
  flex-wrap: nowrap;
  align-items: stretch;
}

/* The .navbar-header div wraps the brand + the leftmenu-trigger.
   Without explicit layout, the .navbar-brand (display: flex below)
   acts as a block-level box and forces the trigger onto a new line.
   Making .navbar-header itself a flex container puts both children
   side-by-side. */
.navbar-header {
  display: flex;
  align-items: center;
}

/* Navbar — navy gradient */
.navbar-inverse {
  background: linear-gradient(180deg, var(--brand-navy) 0%, var(--brand-navy-2) 100%);
  border-color: transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,.08);
}
.navbar-inverse .navbar-collapse,
.navbar-inverse .navbar-form { border-color: rgba(255,255,255,.1); }
.navbar-inverse .navbar-nav > li > a {
  color: rgba(255,255,255,.85);
}
.navbar-inverse .navbar-nav > li > a:hover,
.navbar-inverse .navbar-nav > li > a:focus {
  color: #fff;
  background: rgba(255,255,255,.1);
}
.navbar-inverse .navbar-nav > .active > a,
.navbar-inverse .navbar-nav > .active > a:hover,
.navbar-inverse .navbar-nav > .active > a:focus,
.navbar-inverse .navbar-nav > .open > a,
.navbar-inverse .navbar-nav > .open > a:hover,
.navbar-inverse .navbar-nav > .open > a:focus {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* Strip the inset borders Avant adds between toolbar items */
header .toolbar .dropdown,
header #headerbardropdown,
header #rightmenu-trigger,
header #leftmenu-trigger {
  border: none;
}

.navbar-brand {
  height: 64px;
  /* width: auto + max-width caps the brand at 265 px for very wide
     tenant logos but lets it shrink to its content for normal logos.
     Collapses cleanly via `max-width: 0` (transitionable, unlike `auto`)
     so the leftmenu-trigger stays adjacent to the logo regardless of
     how narrow the logo image actually is. */
  width: auto;
  max-width: 265px;
  padding: 0 0 0 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: max-width 0.2s ease, opacity 0.2s ease;
  /* Avant 1.3 sets a default logo background-image; we render the
     branded logo as an inline <img> instead, so clear any url(). */
  background: none !important;
}
.navbar-brand img {
  max-height: 44px;
  max-width: 220px;
  width: auto;
  height: auto;
}
body.collapse-leftbar .navbar-brand { max-width: 0; padding: 0; opacity: 0; }

/* Avant ships `#leftmenu-trigger { height: 40px; width: 40px;
   background-image: url(...) }` and the more-specific
   `header #leftmenu-trigger { border-right: 1px solid #27292d }`.
   Force `height: 64px !important` so the hover background fills the
   full navbar height instead of the legacy 40px hit area. `width:
   auto` lets the calc-aligned icon center naturally. */
#leftmenu-trigger {
  margin-left: 15px;
  height: 64px !important;
  width: auto !important;
  min-width: 48px;
  line-height: 64px !important;
  background-image: none !important;
  border-right: none !important;
  text-align: center;
  color: rgba(255,255,255,.7);
  font-size: 20px;
  display: inline-block;
  padding: 0 14px;
}
#leftmenu-trigger:hover {
  background: rgba(255,255,255,.08);
  background-image: none !important;
  color: #fff;
}
#rightmenu-trigger {
  height: 64px !important;
  line-height: 64px !important;
}

.navbar-nav > li > a,
.navbar-nav .dropdown-toggle {
  padding-top: 24px;
  padding-bottom: 24px;
}

.navbar-nav.toolbar > li > a {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  line-height: 1;
  text-decoration: none;
}
/* `.show` is BS5's open-state class on the .dropdown-menu (BS3's
   `<li class="open">` doesn't exist anymore). Match both forms so
   the highlight stays painted while the menu is open. */
.navbar-nav.toolbar > li > a:hover,
.navbar-nav.toolbar > li.open > a,
.navbar-nav.toolbar > li > a[aria-expanded="true"],
.navbar-nav.toolbar > li.show > a {
  background: rgba(255,255,255,.08);
}
.navbar-nav.toolbar .fa-user-circle {
  font-size: 35px;
  vertical-align: middle;
  margin-left: 8px;
}

/* Notification badge — orange dot per design (was red) */
.navbar-nav .badge,
header .toolbar .badge {
  background: var(--cp-tile-orange);
  color: #fff;
}

a.username {
  font-size: 15px !important; /* override Avant's 12px */
}

/* ============================================================
   Top-bar — Profile / Cog / Divider / Company switcher
   ============================================================
   Replaces the legacy username-text dropdown with a 48 px profile
   circle, a SuperAdmin-only 48 px settings cog, a 1 px divider, and
   a dynamic-width company switcher (globe + name + optional swap).
   Markup: Views/Shared/_Header.cshtml. Mobile rules live with the
   rest of the responsive overrides further down this file.
   ============================================================ */

/* Force horizontal layout on the toolbar. BS5's .navbar-nav defaults
   to flex-direction:column when no .navbar-expand-* is on a parent
   (the header here has no expand class), which would stack the
   switcher / divider / cog / profile vertically. The legacy layout
   shipped with one <li> in this list so the column default was
   invisible; with four <li>s it manifests as overlapping content
   on initial load. align-items:stretch keeps the divider full-height
   without us having to pad it. */
.navbar-nav.toolbar {
  flex-direction: row;
  align-items: stretch;
}

/* Settings cog + profile circle share the 48 px square shape and
   hover behaviour. Toolbar items use display:flex (BS5 navbar-nav
   default) so align-items + justify-content + height fully control
   the inner alignment without relying on line-height tricks. */
.cp-toolbar-cog > a,
.cp-toolbar-profile > a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 64px;
  padding: 0;
  color: rgba(255,255,255,.85);
  text-decoration: none;
}
.cp-toolbar-cog > a:hover,
.cp-toolbar-profile > a:hover,
.cp-toolbar-profile.show > a {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.cp-toolbar-cog .icon-ic_fluent_settings_20_regular { font-size: 18px; }

/* Profile circle — 36 px circle, 1 px white border. The circle hosts
   either an <img> (when ProfilePhotoUrl is populated by the Exchange
   backports pass) or initials text from Context.Initials().

   flex-shrink:0 + box-sizing:border-box guard against the avatar
   being squished into an oval by the parent flex container — the
   <a> wrapping it is `display:flex`, which would otherwise allow
   the avatar to shrink in the main axis when space is tight. */
.cp-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-navy-2);
  overflow: hidden;
}
.cp-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cp-avatar-initials {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}
.cp-profile-name {
  padding: 8px 16px 4px;
  color: #555;
  font-size: 13px;
}

/* 1 px divider — 5 px from top and bottom of the 64 px navbar gives
   a 54 px tall hairline. align-self:stretch lets it fill that height
   regardless of sibling content. */
.cp-toolbar-divider {
  width: 1px;
  background: rgba(255,255,255,.18);
  margin: 5px 0;
  align-self: stretch;
}

/* Company switcher — dynamic width. Globe (left), name (centre,
   truncates to 240 px), swap (right; only rendered for super /
   reseller). For company-admin / plain users the trigger is rendered
   as a <span class="is-static"> so there's no hover affordance. */
.cp-toolbar-switcher {
  display: flex;
  align-items: stretch;
}
.cp-switcher-trigger {
  display: flex;
  align-items: center;
  height: 64px;
  padding: 0 14px;
  gap: 10px;
  color: rgba(255,255,255,.85);
  text-decoration: none;
  cursor: pointer;
}
.cp-switcher-trigger:hover,
.cp-toolbar-switcher.show > .cp-switcher-trigger {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.cp-switcher-trigger.is-static,
.cp-switcher-trigger.is-static:hover {
  cursor: default;
  background: transparent;
  color: rgba(255,255,255,.85);
}
.cp-switcher-globe,
.cp-switcher-swap { font-size: 18px; flex: 0 0 auto; }
.cp-switcher-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.cp-switcher-name.is-empty {
  font-style: italic;
  color: rgba(255,255,255,.55);
}

/* Switcher dropdown panel — 320 px wide, scrollable list with a
   search filter pinned to the top. Right-aligned so it doesn't run
   off the viewport edge on smaller desktops.

   Layout uses flex-column so the search bar stays pinned and the
   list area grows / scrolls. BS5 toggles .dropdown-menu between
   `display: none` (closed) and `display: block` (open) via the
   `.show` class — the flex layout has to live on `.show`, not on
   the bare selector, otherwise the closed menu paints anyway and
   the dropdown looks "stuck open" on initial page load. */
.cp-switcher-menu {
  width: 320px;
  padding: 0;
  max-height: 70vh;
}
.cp-switcher-menu.show {
  display: flex;
  flex-direction: column;
}
.cp-switcher-search {
  position: relative;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
.cp-switcher-search input { padding-left: 32px; }
.cp-switcher-search .icon-ic_fluent_search_20_regular {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  font-size: 16px;
  pointer-events: none;
}
.cp-switcher-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1 1 auto;
  max-height: 50vh;
}
.cp-switcher-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cp-switcher-item:hover { background: var(--bg-2); filter: brightness(0.97); }
.cp-switcher-item.is-active {
  background: var(--brand-teal-soft);
  border-left: 3px solid var(--brand-teal);
  padding-left: 11px; /* 14 − 3px border so text doesn't shift */
}
.cp-switcher-item-name { font-size: 14px; font-weight: 500; color: #222; }
.cp-switcher-sub { font-size: 11px; color: rgba(0,0,0,.55); }
.cp-switcher-status {
  padding: 14px;
  text-align: center;
  color: #888;
  font-size: 13px;
  font-style: italic;
  list-style: none;
}

/* ============================================================
   Sidebar — 280px steel, teal active accent
   ============================================================ */

/* The sidebar is full-bleed in the new design — no inset margin, no
   rounded corners, flush with the navbar above and the footer below.
   The steel column itself is painted by `#page-container`'s linear
   gradient (above); `#page-leftbar` here just establishes the float +
   width. The leftbar's own background is transparent so the gradient
   shows through even when the menu items don't fill the column. */
#page-leftbar {
  width: 280px;
  background-color: transparent;
  box-shadow: none;
}
#page-content {
  margin-left: 280px;
  background-color: var(--bg);
  box-shadow: none;
}

#sidebar {
  background-color: var(--sb-bg);
  border-radius: 0;
  margin: 0;
  /* Top padding gives the first menu item breathing room from the
     navbar bottom — without it the navbar's drop-shadow clips the top
     edge of the first item. Bottom padding mirrors so the last item
     also has breathing room before the sidebar's bottom edge. */
  padding: 18px 0 12px;
  overflow: visible;
}
#sidebar > li > a {
  display: flex;
  align-items: center;
  height: 40px;
  padding: 0 16px 0 12px;
  font-size: 14px;
  color: rgba(255,255,255,.88);
  border-left: 2px solid transparent;
  border-radius: 0;
  margin: 0;
  background-color: transparent;
  transition: background 0.15s, color 0.15s;
}
/* Sidebar icons match the text color — Avant otherwise tints them
   green (#14eb60) which clashes with the modern theme. Setting
   `color` explicitly here overrides Avant's `#sidebar i` rule.
   `vertical-align` doesn't work here because the parent anchor is a
   flex container (see rule above) — flex uses align-items, not
   baseline alignment. Use `position: relative; top: …` for the
   optical-center nudge that vertical-align provides elsewhere. */
#sidebar > li > a i {
  /* font-size 18px (not 16) because FluentUI System Icons fill ~87% of the
     em-square, so font-size: 16px renders a visible glyph of only ~14px.
     18px puts the visible glyph at ~16px to match the design intent. */
  font-size: 18px;
  width: 18px;
  min-width: 15px;
  color: rgba(255,255,255,.7);
  position: relative;
  top: 2px;
}

/* Submenu expand chevron — pinned to the right edge of items that have
   a nested .acc-menu. The `:before` pseudo-element renders a FluentUI
   chevron glyph that flips between right (closed) and down (open).
   These rules originally lived in avant.css; they're folded in here so
   the chevron survives the avant cleanup. */
#sidebar li.hasChild > a {
  position: relative;
}
#sidebar li.hasChild > a::before,
#sidebar li.hasChild.open > a::before {
  /* FluentUI System Icons — \e480 chevron-right, \e488 chevron-down */
  content: "\e480";
  font-family: FluentSystemIcons-Resizable;
  font-style: normal;
  font-weight: normal;
  font-size: 16px !important;
  text-decoration: inherit;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  opacity: 0.55 !important;
  order: 0;
}
#sidebar li.hasChild.open > a::before {
  content: "\e488";
}
/* Chevron-right is drawn slightly smaller than chevron-down in the
   Resizable font; bump just the closed state up by 1 px so they read
   visually identical. */
#sidebar li.hasChild:not(.open) > a::before {
  font-size: 17px !important;
}
#sidebar li.hasChild > a:hover::before { opacity: 0.85 !important; }
/* The label `<span>` between the icon and the caret should grow to
   fill available space so the caret pins to the right edge cleanly. */
#sidebar > li > a > span { flex: 1; }
/* Reserve right-padding on hasChild items so the label text doesn't
   run into the absolutely-positioned caret. */
#sidebar li.hasChild > a { padding-right: 32px !important; }
#sidebar > li > a:hover,
#sidebar a:hover {
  background-color: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 0;
}
#sidebar > li > a:hover i {
  color: #fff;
}
#sidebar > li.active > a {
  background-color: rgba(255,255,255,.08);
  color: #fff;
  border-left-color: var(--brand-teal);
  padding-left: 14px; /* 16 - 2 (border) so labels stay aligned with non-active items */
  border-radius: 0;
}
#sidebar > li.active > a i,
#sidebar li.active i,
#sidebar li.active a:hover i {
  background: transparent;
  color: var(--brand-teal);
}
#sidebar > li.active > a:after { display: none; }

#sidebar ul,
#sidebar ul li a {
  background-color: var(--sb-bg);
}
#sidebar li a,
#sidebar ul li.active:not(.open) > a {
  color: #fff;
}
#sidebar ul li a {
  color: rgba(255,255,255,.7);
}
#sidebar ul {
  padding: 0;
  border-radius: 0;
}
#sidebar ul li a {
  border-radius: 0;
}
#sidebar .divider {
  background-color: rgba(255,255,255,.06);
}
#sidebar .divider:hover {
  background-color: rgba(255,255,255,.06);
}

/* Search box in sidebar */
#search form .search-query {
  background: rgba(0,0,0,.18);
  color: rgba(255,255,255,.86);
  border-radius: 6px;
}
#search form .search-query:-moz-placeholder           { color: rgba(255,255,255,.5); }
#search form .search-query::-moz-placeholder          { color: rgba(255,255,255,.5); }
#search form .search-query:-ms-input-placeholder      { color: rgba(255,255,255,.5); }
#search form .search-query::-webkit-input-placeholder { color: rgba(255,255,255,.5); }
#search form button[type=submit] i { color: rgba(255,255,255,.7); }

body.collapse-leftbar #search.keep-open > a {
  background: rgba(0,0,0,.18) !important;
}
body.collapse-leftbar #search.keep-open > a:hover {
  background: rgba(255,255,255,.08);
}

/* Horizontal navbar variant (alt MenuType) */
#horizontal-navbar { background-color: var(--sb-bg); }
#horizontal-navbar .navbar-nav > .open > a {
  background: rgba(255,255,255,.06);
  color: #fff;
}
#horizontal-navbar .navbar-nav ul { background-color: var(--sb-bg); }
#horizontal-navbar .navbar-nav ul li a { color: rgba(255,255,255,.7); }
#horizontal-navbar .navbar-nav ul li a:hover {
  background: rgba(255,255,255,.06); color: #fff;
}
#horizontal-navbar .navbar-nav li a { color: #fff; }
#horizontal-navbar .navbar-nav li a i { color: #fff; }
#horizontal-navbar .navbar-nav li.active a,
#horizontal-navbar .navbar-nav li.active a i,
#horizontal-navbar .navbar-nav li.active a:hover,
#horizontal-navbar .navbar-nav li.active a:hover i {
  background: rgba(255,255,255,.12);
  color: var(--brand-teal);
}
#horizontal-navbar .navbar-nav li a:hover,
#horizontal-navbar .navbar-nav li a:hover i {
  background: rgba(255,255,255,.06); color: #fff;
}
nav.navbar { background: var(--sb-bg); }
nav.navbar .navbar-toggle,
nav.navbar .navbar-toggle:hover,
nav.navbar .navbar-toggle:focus { color: #fff; }
@media (min-width:768px) {
  #horizontal-navbar.large-icons-nav .navbar-nav li ul { background-color: var(--sb-bg); }
  #horizontal-navbar.large-icons-nav .navbar-nav li ul li a { color: rgba(255,255,255,.7); }
  #horizontal-navbar.large-icons-nav .navbar-nav li ul li a:hover {
    background: rgba(255,255,255,.06); color: #fff;
  }
}

/* Collapsed sidebar (desktop): 68px strip, still full-bleed (no inset
   margin) so the column doesn't visually float when collapsed. */
body.collapse-leftbar #sidebar {
  overflow: visible;
  background-color: var(--sb-bg);
  border-radius: 0;
  margin: 0;
}
body.collapse-leftbar #page-leftbar { width: 68px; }
body.collapse-leftbar #page-content,
body.collapse-leftbar footer { margin-left: 68px; }
body.collapse-leftbar #sidebar > li > a {
  width: 68px;
  padding: 12px 0;
  /* The base flex anchor uses `align-items: center` for vertical
     centering; collapsed mode also needs `justify-content: center`
     to center the icon horizontally within the 68px column. Without
     it the flex children pack to flex-start (left edge). */
  justify-content: center;
  text-align: center;
}
body.collapse-leftbar #sidebar > li.active > a {
  border-left: 2px solid var(--brand-teal);
  padding-left: 0;
}
body.collapse-leftbar #sidebar > li > a i {
  margin-right: 0 !important;
  margin-left: 0 !important;
}
/* The label `<span>` and the submenu chevron should both disappear in
   collapsed mode so the icon is the only visible glyph in the 68px
   column — Avant hides .span by default but the submenu `:before`
   chevron leaks through without an explicit override. */
body.collapse-leftbar #sidebar > li > a > span { display: none; }
body.collapse-leftbar #sidebar li.hasChild > a::before { display: none !important; }
/* The expanded-mode `.hasChild > a { padding-right: 32px }` rule (which
   reserves space for the chevron) leaves the icon visually offset to
   the left in collapsed mode, since `justify-content: center` then
   centers within an asymmetrically-padded box. Reset to symmetric
   zero padding here so the icon sits dead-center in the 68 px column. */
body.collapse-leftbar #sidebar li.hasChild > a {
  padding-right: 0 !important;
}
body.collapse-leftbar .sidebar-company-label { display: none; }
body.collapse-leftbar #sidebar li { list-style: none; }
body.collapse-leftbar #sidebar li.divider { display: none; }
body.collapse-leftbar #sidebar > li:hover > a {
  width: auto;
  padding: 12px 15px;
  text-align: left;
}
body.collapse-leftbar #sidebar > li:hover > a i {
  margin-right: 8px !important;
  margin-left: 0 !important;
}

footer {
  margin-left: 0;
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}

/* Sidebar company-name eyebrow */
.sidebar-company-label {
  padding: 8px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
  cursor: default;
  list-style: none;
}
.sidebar-company-label:hover { background-color: transparent !important; }

/* Disabled left-menu items — applied to every <li> below the company
   eyebrow when no company is selected. opacity + pointer-events on
   the <li> cascades to its children (anchors, nested submenu <ul>),
   and cursor:not-allowed surfaces because pointer-events:none on the
   <li> means the cursor falls back to the <li>'s declared cursor
   when hovering anywhere inside it. */
#sidebar li.cp-section-disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* Destructive sidebar item — red text only (no full-row tint, which
   would read as an alert banner rather than a single dangerous link).
   Used by the company Exchange "Disable" entry. */
#sidebar a.cp-menu-danger { color: #f08080; }
#sidebar a.cp-menu-danger:hover { color: #ff6b6b; }

/* ============================================================
   Page heading (breadcrumb area)
   ============================================================ */

#page-heading {
  background: var(--bg-2);
  /* Top-heavy vertical padding — the breadcrumb wants room to breathe
     above the h1, while the bottom only needs to clear the page-sub.
     Loosened by 6 px from a previously-symmetric 26/26 to 26/20 to
     make room for the larger h1→page-sub gap (see .page-sub below)
     without growing total header height. */
  padding: 18px 24px 18px !important;
  border-bottom: 1px solid var(--line);
  /* Flex so the `.page-titles` (h1 + sub) stack on the left and
     `.page-actions` (the day-range dropdown) stays vertically
     centered against them on the right. `overflow: visible` is
     essential — without it the dropdown menu (positioned absolutely
     below the button) gets clipped at the heading's bottom border. */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: visible;
}
/* Avant ships `#page-heading:before, #page-heading:after { content: " ";
   display: table }` as a clearfix for the legacy float layout. With our
   flex layout those pseudo-elements become anonymous flex items and
   shove the real children (`.page-titles`, `.page-actions`) off the
   center axis. Suppress them. */
#page-heading::before,
#page-heading::after {
  content: none !important;
  display: none !important;
}
#page-heading .page-titles { flex: 1; min-width: 0; }
#page-heading .page-actions { flex-shrink: 0; }
/* Avant's `#page-heading h1` ships `float: left; padding: 20px;
   font-size: 42px; font-weight: 300` which overrides our defaults
   and stacks the subtitle to the right of the title rather than
   below it. Force-restore the modern typography + block layout. */
#page-heading h1 {
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  font-size: 22px !important;
  font-weight: 500 !important;
  color: var(--fg);
  letter-spacing: -0.015em;
  line-height: 1.25 !important;
  display: block;
}
/* Optional sub-heading below the page title, e.g.
   "System overview across all your tenants". The 8 px gap above
   reads as a clean separation rather than the previous 2 px which
   visually butted the description against the h1's descenders.
   Compensated by trimming `#page-heading`'s bottom padding so total
   header height is unchanged. */
#page-heading .page-sub {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--fg-muted);
}

/* Right-aligned action slot for page-level controls (e.g. the
   dashboard's "Last 7 days" range selector). The parent
   `#page-heading` is a flexbox so the actions are vertically
   centered automatically — no float / margin-top hacks needed. */
#page-heading .page-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Day-range button-dropdown — calendar icon + label + chevron, white
   surface with subtle border, matches the reference mockup. The
   `.day-range-chevron` is a small follow-on chevron sized down so the
   visual emphasis stays on the calendar icon and label. */
/* Company-overview limit rows — floats restored from avant.css's
   `.contextual-progress .progress-title/.progress-percentage` rules.
   Title sits flush left, count flush right on the same line; the
   wrapping `.clearfix` div cleans up the floats. The 20 px margin
   between rows came from Avant too — without it, the rows stack
   right against each other. */
.contextual-progress { margin: 20px 0; }
.contextual-progress:first-child { margin-top: 0; }
.contextual-progress .progress-title { float: left; }
.contextual-progress .progress-percentage { float: right; }
.contextual-progress .progress { height: 2px; margin: 5px 0 0; }

/* Doubled `.day-range-btn.day-range-btn` selector raises specificity
   above BS5's `.btn-secondary` color-variable rules so the explicit
   border survives no matter the class order on the markup. */
.day-range-btn.day-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid #d4d7de;
  color: var(--fg-2);
  font-weight: 500;
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: var(--r-input);
  min-width: 140px;
  justify-content: flex-start;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.day-range-btn.day-range-btn:hover,
.day-range-btn.day-range-btn:focus,
.open > .day-range-btn,
.open > .day-range-btn:focus {
  background: var(--hover);
  border-color: #c2c6cf;
  color: var(--fg);
  outline: none;
}
.day-range-btn .fa-calendar {
  color: var(--fg-muted);
  font-size: 12px;
}
.day-range-btn .day-range-label {
  flex: 1;
  text-align: left;
}
.day-range-btn .day-range-chevron {
  color: var(--fg-muted);
  font-size: 9px;
  margin-left: 2px;
}
/* BS5's `.dropdown-toggle` paints a CSS-triangle caret via `::after`.
   The day-range button has its own FluentUI chevron icon
   (`.day-range-chevron`) so the BS5 default doubles up — hide it. */
.day-range-btn.dropdown-toggle::after {
  display: none;
}
#dayRangeDropdown .dropdown-menu {
  min-width: 140px;
  padding: 4px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
#dayRangeDropdown .dropdown-menu > li > a {
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--fg-2);
}
#dayRangeDropdown .dropdown-menu > li > a:hover,
#dayRangeDropdown .dropdown-menu > li > a:focus {
  background: var(--hover);
  color: var(--fg);
}
/* Breadcrumb rendering left in place for views that still rely on it,
   but de-floated and styled as a thin breadcrumb above an h1. */
#page-heading .breadcrumb {
  background: transparent;
  padding: 0;
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.4;
  float: none;
}
#page-heading .breadcrumb a { color: var(--fg-muted); }
#page-heading .breadcrumb a:hover { color: var(--brand-teal); }
#page-heading .breadcrumb > li.active {
  color: var(--fg);
  font-weight: 500;
}
.breadcrumb > li + li:before {
  content: "/";
  color: var(--fg-muted);
  opacity: 0.5;
}

/* New page-head pattern (per design handoff) */
.pagehead {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding: 14px 24px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pagehead h1 {
  margin: 0;
  font: 500 22px/1.25 "Open Sans";
  color: var(--fg);
  letter-spacing: -0.015em;
}
.pagehead .sub {
  font-size: 12.5px;
  color: var(--fg-muted);
  margin-top: 2px;
}
.pagehead .actions { display: flex; gap: 6px; }

/* ============================================================
   4. Bootstrap re-skin — Card / Panel
   ============================================================ */

.panel,
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: none;
  margin-bottom: var(--gap);
}

/* Panel-heading layout. Avant ships `.card-header { height: 40px;
   line-height: 2em; font-size: 18px }` and `.card-header + .card-body
   { border: none; padding: 20px 0 }` which collectively (a) cap the
   heading at 40px, (b) force a fixed line-height that often hides the
   heading text, and (c) strip the body's border and horizontal padding,
   making the panel border appear to "stop" at the divider. We override
   all three. */
.card-header {
  padding: 12px 16px !important;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line) !important;
  border-top-left-radius: var(--r-card);
  border-top-right-radius: var(--r-card);
  height: auto !important;
  min-height: 48px;
  line-height: 1.4 !important;
  font-size: 14.5px !important;
  overflow: hidden; /* clearfix for floated `.options` */
}

/* Body stays bordered + padded regardless of whether a heading
   precedes it. Avant zeroes both when `.card-header + .card-body`
   matches; force-restore them here so the panel's outer border
   continues all the way around and content has comfortable padding. */
.card-body,
.card-header + .card-body {
  padding: 16px !important;
  border: none !important;
  background: var(--bg-2);
  border-radius: 0 !important;
}
.card-hd {
  padding: 12px 16px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
  border-top-left-radius: var(--r-card);
  border-top-right-radius: var(--r-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Force every heading inside a panel-heading to render at the design's
   13.5px/600/Open-Sans typography in fg color. The `!important`s on
   color and font are deliberately heavy because Avant ships flavors
   like `.panel-inverse > .card-header > h4 { color: #fff }` that
   would otherwise paint the title white-on-white in our re-skinned
   default panel surface. */
.card-header h1,
.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6,
.card-header .card-title,
.card-hd h3 {
  margin: 0 !important;
  padding: 0;
  font: 600 15.5px/1.4 "Open Sans" !important;
  color: var(--fg) !important;
  letter-spacing: -0.005em;
  display: inline;
}
.card-header .card-title > a,
.card-header h1 > a,
.card-header h2 > a,
.card-header h3 > a,
.card-header h4 > a,
.card-header h5 > a,
.card-header h6 > a {
  color: var(--fg) !important;
  text-decoration: none;
}

/* The right-side actions slot in a panel-heading (refresh icon,
   button-group, etc.) — Avant uses `<div class="options">` for this
   and floats it right. Avant also ships `.card-header .options > a
   { line-height: 40px; padding-left: 10px }` which inflates the
   heading height to 64px and creates an apparent extra row of empty
   space below the title — neutralize. */
.card-header .options {
  float: right;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-header .options > a,
.card-header .options a {
  color: var(--fg-muted) !important;
  text-decoration: none;
  line-height: 1.4 !important;
  padding: 0 !important;
  float: none !important;
  font-size: 13px !important;
  opacity: 1 !important;
}
.card-header .options a:hover { color: var(--brand-teal) !important; }
.card-header .options .btn {
  line-height: 1.4 !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

.card-body,
.card-bd {
  padding: 16px;
  color: var(--fg-2);
  font-size: 13px;
}
.card-bd.tight,
.card-body.tight { padding: 0; }

.card-footer {
  background: var(--bg-3);
  border-top: 1px solid var(--line-2);
  padding: 10px 16px;
  border-bottom-left-radius: var(--r-card);
  border-bottom-right-radius: var(--r-card);
}

.panel-primary,
.panel-default,
.panel-info,
.panel-success,
.panel-warning,
.panel-danger {
  border-color: var(--line);
}
.panel-primary > .card-header,
.panel-default > .card-header,
.panel-info > .card-header,
.panel-success > .card-header,
.panel-warning > .card-header,
.panel-danger > .card-header {
  background: var(--bg-2);
  color: var(--fg);
  border-bottom: 1px solid var(--line-2);
}
.panel-primary > .card-body,
.panel-default > .card-body,
.panel-info > .card-body,
.panel-success > .card-body,
.panel-warning > .card-body,
.panel-danger > .card-body {
  background: var(--bg-2);
}

/* The "options" affordance Avant puts in panel headings (right-side actions) */
.card-header .options {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ============================================================
   Bootstrap re-skin — Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font: 600 13px/1.4 "Open Sans";
  border-radius: var(--r-input);
  /* Resolve the border via BS5's var so each `.btn-{variant}` gets
     its own `--bs-btn-border-color`. The previous `1px solid transparent`
     was a holdover from modern.css that hid every button's border by
     default until hover. */
  border-width: 1px;
  border-style: solid;
  border-color: var(--bs-btn-border-color, transparent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(0.5px); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; }
.btn-lg { padding: 10px 16px; font-size: 14px; }
.btn-icon { padding: 6px 9px; }

.btn-primary,
.btn-primary:focus {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-teal-2); border-color: var(--brand-teal-2); color: #fff; }
.btn-primary:active,
.btn-primary.active,
.open > .dropdown-toggle.btn-primary {
  background: var(--brand-teal-deep);
  border-color: var(--brand-teal-deep);
  color: #fff;
}
.btn-primary.disabled,
.btn-primary[disabled] {
  background: var(--brand-teal);
  border-color: var(--brand-teal);
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary .badge { color: var(--brand-teal); background: #fff; }

.btn-default,
.btn-default:focus {
  background: var(--bg-2);
  border-color: var(--line);
  color: var(--fg);
}
.btn-default:hover {
  background: var(--hover);
  border-color: var(--line);
  color: var(--fg);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--fg-2);
}
.btn-ghost:hover,
.btn-ghost:focus {
  background: var(--hover);
  color: var(--fg);
}

.btn-link {
  color: var(--brand-teal);
  border-color: transparent;
  background: transparent;
}
.btn-link:hover {
  color: var(--brand-teal-2);
  text-decoration: underline;
}

.btn-danger,
.btn-danger:focus {
  background: var(--st-danger);
  border-color: var(--st-danger);
  color: #fff;
}
.btn-danger:hover { background: #8e0e0e; border-color: #8e0e0e; color: #fff; }

.btn-success,
.btn-success:focus {
  background: var(--st-success);
  border-color: var(--st-success);
  color: #fff;
}
.btn-success:hover { background: #3e6320; border-color: #3e6320; color: #fff; }

.btn-warning,
.btn-warning:focus {
  background: var(--st-warn);
  border-color: var(--st-warn);
  color: #fff;
}
.btn-warning:hover { background: #765f06; border-color: #765f06; color: #fff; }

.btn-info,
.btn-info:focus {
  background: var(--st-info);
  border-color: var(--st-info);
  color: #fff;
}
.btn-info:hover { background: #0e6478; border-color: #0e6478; color: #fff; }

/* Bootstrap dropdown caret (`<span class="caret">`) — Avant replaces
   the default border-triangle with a FluentUI caret-down glyph via
   `:before` and pins it `vertical-align: top`. Inside our flex
   `.btn`, vertical-align is ignored, and the glyph's natural
   baseline puts it visually low (below the text's optical center).
   Force inline-flex + line-height: 1 so the glyph centers cleanly
   against the button's text. */
.btn > .caret,
.btn-group > .btn > .caret,
.dropdown-toggle > .caret {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  line-height: 1;
  height: auto;
}
.btn > .caret::before,
.btn-group > .btn > .caret::before,
.dropdown-toggle > .caret::before {
  font-size: 11px;
  line-height: 1;
}

/* Pagination — BS3 (`.pagination > li > a`) + BS5 (`.page-link`) selectors
   so DataTables 1.13's BS5 markup gets the white fill. Disabled state
   covered by --bs-pagination-disabled-bg in §3 above. */
.pagination > li > a,
.pagination > li > span,
.pagination .page-link {
  color: var(--fg-2);
  background-color: var(--bg-2);
  border: 1px solid var(--line);
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination .page-link:hover {
  background-color: var(--hover);
  border-color: var(--line);
  color: var(--fg);
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
  background-color: var(--brand-teal);
  border-color: var(--brand-teal);
  color: #fff;
}

/* ============================================================
   Bootstrap re-skin — Labels, Badges, plus new .pill
   ============================================================ */

.label,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 600 11px/1.4 "Open Sans";
  padding: 3px 8px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
}

.pill {
  background: var(--bg-3);
  color: var(--fg-2);
  border-color: var(--line);
}
.pill .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}
.pill.online   { color: var(--st-success); background: var(--st-success-bg); border-color: transparent; }
.pill.offline  { color: var(--fg-muted); background: var(--bg-3); }
.pill.admin    { color: var(--brand-teal-deep); background: var(--brand-teal-soft); border-color: transparent; }
.pill.help     { color: var(--st-warn); background: var(--st-warn-bg); border-color: transparent; }
.pill.info     { color: var(--st-info); background: var(--st-info-bg); border-color: transparent; }
.pill.danger   { color: var(--st-danger); background: var(--st-danger-bg); border-color: transparent; }

.label-default { background: var(--bg-3); color: var(--fg-2); border-color: var(--line); }
.label-primary { background: var(--brand-teal-soft); color: var(--brand-teal-deep); }
.label-success { background: var(--st-success-bg); color: var(--st-success); }
.label-warning { background: var(--st-warn-bg); color: var(--st-warn); }
.label-danger  { background: var(--st-danger-bg); color: var(--st-danger); }
.label-info    { background: var(--st-info-bg); color: var(--st-info); }

.badge {
  background: var(--brand-teal);
  color: #fff;
  border-radius: var(--r-pill);
  font: 600 10.5px/1 "Open Sans";
  padding: 3px 7px;
  min-width: 18px;
  text-align: center;
}

/* ============================================================
   Avatar
   ============================================================ */

.av {
  width: 28px; height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: var(--brand-navy);
  color: #fff;
  flex-shrink: 0;
}
.av.lg { width: 36px; height: 36px; font-size: 13px; }
.av-blue   { background: var(--cp-tile-info); }
.av-orange { background: var(--cp-tile-orange); }
.av-green  { background: var(--cp-tile-success); color: #2c4d10; }
.av-mag    { background: var(--cp-tile-magenta); }
.av-purple { background: var(--cp-tile-purple); }
.av-red    { background: var(--cp-tile-red); }
.av-teal   { background: var(--brand-teal); color: #0f3a3f; }

/* ============================================================
   Bootstrap re-skin — Tables, Forms
   ============================================================ */

.table,
.tbl {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
  margin-bottom: var(--gap);
}
.table > thead > tr > th,
.tbl thead th {
  text-align: left;
  padding: 9px 12px;
  font: 600 11px/1.2 "Open Sans";
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  border-top: none;
}
.table > tbody > tr > td,
.tbl tbody td {
  padding: 11px 12px;
  font-size: 13px;
  color: var(--fg-2);
  border-top: 1px solid var(--line-2);
}
.table > tbody > tr:hover > td,
.tbl tbody tr:hover td {
  background: var(--hover);
}
.table-striped > tbody > tr:nth-of-type(odd) > td {
  background: var(--bg-3);
}
.table-bordered,
.table-bordered > tbody > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > thead > tr > th {
  border: 1px solid var(--line);
}

/* Form controls */
.form-control {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  font-size: 13px;
  color: var(--fg);
  padding: 7px 10px;
  height: auto;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 2px rgba(50,197,210,.15);
  outline: none;
}
.form-control::-webkit-input-placeholder { color: var(--fg-muted); }
.form-control::-moz-placeholder          { color: var(--fg-muted); }
.form-control:-ms-input-placeholder      { color: var(--fg-muted); }

.input-group-addon {
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--fg-muted);
  border-radius: var(--r-input);
}

.control-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--fg-2);
}

/* Help block */
.help-block {
  font-size: 11.5px;
  color: var(--fg-muted);
  margin-top: 4px;
}

/* Database / quota list — rendered inside dashboard cards as a stack of
   `<row name>  <used / total · pct>` headers above a thin progress bar.
   Mirrors the design handoff's database-utilization treatment.
   Mark a row `.warn` to switch the fill to the danger color (the
   convention is >80% utilization). */
.db-list .db-row { margin-bottom: 14px; }
.db-list .db-row:last-child { margin-bottom: 0; }
.db-list .db-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.db-list .db-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-2);
}
.db-list .db-size {
  font-size: 11.5px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}
.db-list .db-bar {
  height: 6px;
  background: var(--bg-3);
  border-radius: 3px;
  overflow: hidden;
}
.db-list .db-bar-fill {
  height: 100%;
  background: var(--brand-teal);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.db-list .db-row.warn .db-bar-fill { background: var(--st-danger); }

/* Section-heading utility — replaces ad-hoc inline-styled <h5>s used as
   form sub-section dividers (Branding admin, Settings, etc.). */
.form-section-title {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--fg-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-group.section-heading { margin-top: 24px; }

/* Alerts re-skin */
.alert {
  border-radius: var(--r-card);
  border: 1px solid transparent;
  padding: 10px 14px;
  font-size: 13px;
}
.alert-success { background: var(--st-success-bg); color: var(--st-success); }
.alert-info    { background: var(--st-info-bg); color: var(--st-info); }
.alert-warning { background: var(--st-warn-bg); color: var(--st-warn); }
.alert-danger  { background: var(--st-danger-bg); color: var(--st-danger); }

/* Nav tabs re-skin (used by Settings page tabs) */
.nav-tabs {
  border-bottom: 1px solid var(--line);
}
.nav-tabs > li > a {
  border: 1px solid transparent;
  border-radius: var(--r-input) var(--r-input) 0 0;
  color: var(--fg-2);
  font-weight: 500;
  font-size: 13px;
  padding: 8px 14px;
  margin-right: 2px;
}
.nav-tabs > li > a:hover {
  background: var(--hover);
  border-color: transparent;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  background: var(--bg-2);
  border-color: var(--line) var(--line) transparent;
  color: var(--fg);
  font-weight: 600;
}

/* Tooltip re-skin */
.tooltip-inner {
  background: var(--cp-tile-midnight);
  color: #fff;
  font-size: 11.5px;
  border-radius: var(--r-input);
  padding: 5px 9px;
}

/* ============================================================
   5. Metric tiles (Dashboard, Flavor C)
   ============================================================ */

.metric {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 20px 16px 16px;
  position: relative;
  min-height: 148px;
  margin-bottom: var(--gap);
  display: flex;
  flex-direction: column;
}
.metric::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--m-stripe, var(--brand-teal));
  border-top-left-radius: var(--r-card);
  border-top-right-radius: var(--r-card);
}
.metric.m1 { --m-stripe: var(--cp-tile-info); }
.metric.m2 { --m-stripe: var(--brand-teal); }
.metric.m3 { --m-stripe: var(--cp-tile-magenta); }
.metric.m4 { --m-stripe: var(--cp-tile-orange); }

.metric .lbl {
  font: 600 11px/1.2 "Open Sans";
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.metric .val {
  font: 500 26px/1.1 "Open Sans";
  color: var(--fg);
  margin: 8px 0 4px;
  letter-spacing: -0.02em;
}
.metric .delta {
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.metric .delta.up   { color: var(--st-success); }
.metric .delta.down { color: var(--st-danger); }

.metric .mic {
  position: absolute; top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}
.metric.m1 .mic { background: var(--cp-tile-info); }
.metric.m2 .mic { background: var(--brand-teal); color: #fff; }  /* was #0f3a3f */
.metric.m3 .mic { background: var(--cp-tile-magenta); }
.metric.m4 .mic { background: var(--cp-tile-orange); color: #fff; } /* was #2c4d10 */

/* Sparkline — CSS-only flex bars. The `margin-top: auto` pushes the
   sparkline to the bottom of its flex parent (used inside `.metric`)
   so cards line up regardless of label/value/delta length above. */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 28px;
  margin-top: auto;
  padding-top: 12px;
}
.spark .b {
  flex: 1;
  border-radius: 1.5px;
  opacity: 0.55;
  background: var(--brand-teal);
}
.spark .b.last { opacity: 1; }
.metric.m1 .spark .b { background: var(--cp-tile-info); }
.metric.m2 .spark .b { background: var(--brand-teal); }
.metric.m3 .spark .b { background: var(--cp-tile-magenta); }
.metric.m4 .spark .b { background: var(--cp-tile-orange); }

/* Re-skin existing CloudPanel `.shortcut-tiles .tiles-*` markup so
   the legacy Dashboard views (dashboard_super.cshtml et al.) pick
   up the new look without DOM changes. */
.shortcut-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.shortcut-tiles .tiles {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 18px 16px 14px;
  position: relative;
  color: var(--fg);
  min-height: 88px;
}
.shortcut-tiles .tiles::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--brand-teal);
  border-top-left-radius: var(--r-card);
  border-top-right-radius: var(--r-card);
}
.shortcut-tiles .tiles-info::before        { background: var(--cp-tile-info); }
.shortcut-tiles .tiles-orange::before      { background: var(--cp-tile-orange); }
.shortcut-tiles .tiles-success::before     { background: var(--cp-tile-success); }
.shortcut-tiles .tiles-magenta::before     { background: var(--cp-tile-magenta); }
.shortcut-tiles .tiles-midnightblue::before{ background: var(--cp-tile-midnight); }
.shortcut-tiles .tiles-green::before       { background: var(--cp-tile-green); }
.shortcut-tiles .tiles-purple::before      { background: var(--cp-tile-purple); }
.shortcut-tiles .tiles-red::before         { background: var(--cp-tile-red); }

/* Sparkline color matches the tile's stripe color so the trend reads
   as a continuation of the tile's identity. */
.shortcut-tiles .tiles-info .spark .b         { background: var(--cp-tile-info); }
.shortcut-tiles .tiles-orange .spark .b       { background: var(--cp-tile-orange); }
.shortcut-tiles .tiles-success .spark .b      { background: var(--cp-tile-success); }
.shortcut-tiles .tiles-magenta .spark .b      { background: var(--cp-tile-magenta); }
.shortcut-tiles .tiles-midnightblue .spark .b { background: var(--cp-tile-midnight); }
.shortcut-tiles .tiles-green .spark .b        { background: var(--cp-tile-green); }
.shortcut-tiles .tiles-purple .spark .b       { background: var(--cp-tile-purple); }
.shortcut-tiles .tiles-red .spark .b          { background: var(--cp-tile-red); }

/* Trend tiles need a bit more vertical room than the legacy 88px to
   fit the 28px sparkline + breathing space without cramping the icon
   and label rows above it. */
.shortcut-tiles .tiles { min-height: 120px; }

/* ============================================================
   6. Workspace tile — keylined navy (Flavor C)
   ============================================================ */

.ws {
  border-radius: var(--r-card);
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #2a3f5c 0%, #324a6e 100%);
  color: #fff;
  padding: 22px 16px 16px;
  border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
  min-height: 132px;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ws::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 4px;
  background: var(--ws-key, var(--brand-teal));
  z-index: 2;
}
.ws::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at top right,
    color-mix(in oklab, var(--ws-key, var(--brand-teal)) 40%, transparent),
    transparent 70%);
  pointer-events: none;
}
.ws:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46,93,172,.25);
}
.ws .ws-hd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
}
.ws .ws-ic {
  width: 36px; height: 36px;
  border-radius: 6px;
  background: color-mix(in oklab, var(--ws-key, var(--brand-teal)) 20%, transparent);
  color: color-mix(in oklab, var(--ws-key, var(--brand-teal)) 90%, white);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.ws .ws-status {
  font-size: 11px;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ws .ws-status .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--cp-tile-green);
  display: inline-block;
}
.ws .ws-nm {
  font-size: 14px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.ws .ws-ds {
  font-size: 11.5px;
  opacity: 0.78;
  margin-top: 2px;
  position: relative;
  z-index: 1;
}
.ws.offline {
  opacity: 0.55;
  cursor: not-allowed;
}
.ws.offline .ws-status .dot { background: #aaa; }

/* Per-card workspace key colors (settable inline via style="--ws-key: …"
   when the workspace row knows its own color, or via .k-{slug} modifier) */
.ws.k-fin { --ws-key: var(--cp-tile-info); }
.ws.k-eng { --ws-key: var(--cp-tile-magenta); }
.ws.k-sec { --ws-key: var(--brand-teal); }
.ws.k-sup { --ws-key: var(--cp-tile-orange); }
.ws.k-des { --ws-key: var(--cp-tile-purple); }
.ws.k-ops { --ws-key: var(--cp-tile-success); }

.grid-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.grid-2     { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap); }
.grid-ws    { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.stack      { display: flex; flex-direction: column; gap: var(--gap); }
.row-flex   { display: flex; align-items: center; gap: 8px; }
.between    { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: currentColor;
  display: inline-block;
}

/* ============================================================
   7. Login — modern split-screen
   ============================================================ */

body.login-modern {
  padding-top: 0;
  margin: 0;
  background: linear-gradient(135deg, #1f3457 0%, #0e1a2e 100%);
  color: #fff;
  min-height: 100vh;
}
body.login-modern a { color: var(--brand-teal); }
body.login-modern a:hover {
  color: var(--brand-teal-2);
  text-decoration: underline;
}

.login-split {
  display: flex;
  min-height: 100vh;
}
.login-split-image {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  position: relative;
}
.login-split-logo {
  max-width: 380px;
  height: auto;
  margin-bottom: 24px;
}
.login-split-form {
  /* 70/30 split — `flex: 0 0 30%` reserves 30% of the viewport for the
     form pane regardless of width. `min-width: 420px` keeps the form
     from collapsing on narrow widescreens. Split flips to vertical at
     ≤767px via the mobile breakpoint at the bottom of this file. */
  flex: 0 0 30%;
  min-width: 420px;
  padding: 60px 48px;
  background: rgba(0,0,0,.18);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-split-content h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 4px;
}
.login-description {
  font-size: 13px;
  color: rgba(255,255,255,.55);
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-split-inputs { margin-bottom: 14px; }
.login-split-inputs .form-group { margin-bottom: 14px; }
.login-split-inputs label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 6px;
  display: block;
}
.login-split-inputs label .text-danger { color: #ff8a8a; }
/* Label row — lets the password label sit on the same line as a
   right-aligned "Forgot?" link, per the modernization mockup. */
.login-split-inputs .label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.login-split-inputs .label-row label { margin-bottom: 0; }
.login-split-inputs .label-row a {
  font-size: 11px;
  color: var(--brand-teal);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.login-split-inputs .form-control {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  width: 100%;
}
.login-split-inputs .form-control:focus {
  border-color: var(--brand-teal);
  box-shadow: 0 0 0 2px rgba(50,197,210,.2);
}
.login-split-inputs .form-control::-webkit-input-placeholder { color: rgba(255,255,255,.4); }
.login-split-inputs .form-control::-moz-placeholder          { color: rgba(255,255,255,.4); }
.login-split-inputs .form-control:-ms-input-placeholder      { color: rgba(255,255,255,.4); }

/* SSO row sits ABOVE the Email/Password fields per the mockup. The OR
   divider only renders when SSO is enabled. */
.login-split-sso {
  margin-bottom: 18px;
}
.login-split-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,.4);
  margin: 18px 0;
}
.login-split-divider::before,
.login-split-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.1);
}
.login-split-actions { margin-top: 20px; }
.login-split-actions .login-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.login-split-actions .btn-login {
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 600;
  background: var(--brand-teal);
  border: 1px solid var(--brand-teal);
  border-radius: 8px;
  color: #fff;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.login-split-actions .btn-login:hover {
  background: var(--brand-teal-2);
  border-color: var(--brand-teal-2);
}
.login-split-actions .btn-login[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
/* Continue-with-M·Identity SSO button — used both at the top of the
   login form (`.login-split-sso`) and inside `.login-split-actions`
   if the layout ever needs an SSO option after the email path. */
.btn-sso {
  width: 100%;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  /* Solid dark-navy fill (matches the legacy M·Identity button color)
     instead of the near-transparent overlay so the SSO option reads as
     a primary affordance, not a ghost button. */
  background: #132245;
  border: 1px solid #1c3a6f;
  border-radius: 8px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}
.btn-sso:hover,
.btn-sso:focus {
  background: #1c3a6f;
  border-color: #2e5dac;
  color: #fff;
  text-decoration: none;
}
.btn-sso::before {
  content: "M\00B7";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 5px;
  background: rgba(50,197,210,.18);
  color: var(--brand-teal);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: -0.04em;
}

.login-split-content .text-danger {
  display: block;
  margin-top: 10px;
  color: #ff8a8a;
  font-size: 12.5px;
}
.login-split-help {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  text-align: center;
}
.login-split-help a { color: var(--brand-teal); }

/* ============================================================
   8. DataTables overrides
   ============================================================ */

.dataTables_wrapper {
  font-size: 13px;
  color: var(--fg-2);
}
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 12.5px;
  color: var(--fg-muted);
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  padding: 5px 8px;
  font-size: 12.5px;
  background: var(--bg-2);
  color: var(--fg);
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--brand-teal);
  outline: none;
  box-shadow: 0 0 0 2px rgba(50,197,210,.15);
}

/* Outrank `dataTables.bootstrap5.min.css`'s `table.dataTable {
   border-collapse: separate !important }` (loaded after cp-theme.css
   from per-view @section HEAD blocks). Without `collapse`, every
   adjacent cell border stacks side-by-side under `border-spacing: 0`,
   making row/cell separators look 2 px instead of 1 px. The doubled
   `.table.dataTable` selector adds the extra class-specificity weight. */
table.table.dataTable {
  border-collapse: collapse !important;
}
table.dataTable thead th,
table.dataTable thead td {
  background: var(--bg-3);
  color: var(--fg-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  border-top: none;
}
table.dataTable tbody td {
  padding: 11px 12px;
  font-size: 13px;
  color: var(--fg-2);
  border-top: 1px solid var(--line-2);
}
/* Exclude `.details-control` cells so the +/- expand-row icon's
   background-image (set inline in views like `users.cshtml`) isn't
   painted over by the row's white/hover surface. */
table.dataTable tbody tr:hover td:not(.details-control) {
  background: var(--hover) !important;
}
table.dataTable tbody tr.odd > td:not(.details-control),
table.dataTable.stripe tbody tr.odd > td:not(.details-control) {
  background: var(--bg-2);
}
table.dataTable tbody tr.even > td:not(.details-control),
table.dataTable.stripe tbody tr.even > td:not(.details-control) {
  background: var(--bg-2);
}

/* DataTables 1.13's BS5 integration paints striping via
   `box-shadow: inset 0 0 0 9999px rgba(var(--dt-row-stripe), 0.05)`
   on odd `<td>` rather than via background-color, so the BS5
   `--bs-table-striped-bg` variable doesn't reach it. Disable the
   inset-shadow stripe so DataTable rows stay solid white. The hover
   highlight (also box-shadow inset, but on tr:hover) is preserved. */
table.dataTable.table-striped > tbody > tr:nth-of-type(2n+1) > * {
  box-shadow: none !important;
}

/* DataTables sort indicators */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
table.dataTable thead .sorting_asc_disabled,
table.dataTable thead .sorting_desc_disabled {
  cursor: pointer;
}

/* ============================================================
   9. Mobile breakpoints (≤ 767px)
   ============================================================ */

@media (max-width: 767px) {
  /* Header row 1: brand left, hamburger right */
  nav.navbar { min-height: 0; }
  header.navbar { height: auto; }
  .navbar-header {
    float: none !important;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
  }
  .navbar-brand {
  height: 64px;
  width: 265px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.2s ease, opacity 0.2s ease;
  /* Avant 1.3 sets a default logo background-image; we render the
     branded logo as an inline <img> instead, so clear any url(). */
  background: none !important;
}
.navbar-brand img {
  max-height: 56px;
  max-width: 235px;
  width: auto;
  height: auto;
}
  #leftmenu-trigger {
    height: 50px;
    line-height: 50px;
    margin-left: 0;
  }

  /* Header row 2: toolbar */
  ul.nav.navbar-nav.toolbar {
    float: none !important;
    display: flex !important;
    justify-content: flex-end;
    width: 100%;
    margin: 0;
    background-color: var(--brand-navy-2);
  }
  .navbar-nav.toolbar > li > a {
    height: 46px;
    line-height: 46px;
    padding-top: 0;
    padding-bottom: 0;
  }
  .navbar-nav.toolbar .fa-user-circle { font-size: 22px; }

  /* New top-bar components shrink to fit the 46 px mobile toolbar
     row. Hide the company-name text on mobile (kept icon-only globe
     + swap so the dropdown is still reachable); the divider goes
     too because there's no longer enough breathing room between
     the icon-only switcher and the cog for it to read as a
     deliberate separator. */
  .cp-toolbar-cog > a,
  .cp-toolbar-profile > a,
  .cp-switcher-trigger { height: 46px; }
  .cp-switcher-name { display: none; }
  .cp-toolbar-divider { display: none; }
  .cp-switcher-trigger { padding: 0 12px; }

  body { padding-top: 100px; }

  /* Sidebar: full-width block, stacks above content */
  #page-leftbar {
    float: none !important;
    width: 0 !important;
    overflow: hidden !important;
  }
  #page-content { margin-left: 0 !important; }
  body.show-leftbar #page-leftbar {
    width: 100% !important;
    overflow: visible !important;
  }
  body.show-leftbar #sidebar { width: auto !important; }
  body.show-leftbar #page-content { margin-left: 0 !important; }
  body.show-leftbar footer {
    transform: none !important;
    -webkit-transform: none !important;
    margin-left: 0 !important;
  }
  body.collapse-leftbar #page-leftbar {
    width: 0 !important;
    overflow: hidden !important;
  }
  body.collapse-leftbar #page-content,
  body.collapse-leftbar footer { margin-left: 0 !important; }
  body.collapse-leftbar.show-leftbar #page-leftbar {
    width: 100% !important;
    overflow: visible !important;
  }
  body.collapse-leftbar.show-leftbar #sidebar { width: auto !important; }
  body.collapse-leftbar #sidebar > li span,
  body.collapse-leftbar #sidebar > li.keep-open span {
    display: inline !important;
  }
  body.collapse-leftbar #sidebar > li > a {
    width: auto !important;
    text-align: left !important;
    padding: 12px 15px !important;
  }
  body.collapse-leftbar #sidebar > li > ul {
    position: static !important;
    width: auto !important;
    left: auto !important;
    visibility: visible !important;
  }
  body.collapse-leftbar #sidebar > li:hover,
  body.collapse-leftbar #sidebar > li.keep-open {
    width: auto !important;
    box-shadow: none !important;
  }
  body.collapse-leftbar #sidebar i {
    margin-right: 8px !important;
  }

  /* DataTable: card layout (all tables) */
  table.dataTable thead { display: none !important; }
  table.dataTable,
  table.dataTable tbody,
  table.dataTable tbody tr,
  table.dataTable tbody td {
    display: block;
    width: 100% !important;
    box-sizing: border-box;
  }
  table.dataTable tbody tr {
    border: 1px solid var(--line);
    border-radius: var(--r-card);
    margin-bottom: 10px;
    /* `overflow: visible` lets row-action dropdowns (Modify, Edit-row,
       etc.) break out below the row instead of being clipped by the
       card's rounded corners. The minor cosmetic cost is that cells
       at the four corners don't crop to the radius — typically
       imperceptible because cells don't fill to the row edge. */
    overflow: visible;
    background: var(--bg-2);
  }
  table.dataTable tbody td {
    display: flex !important;
    align-items: center;
    min-height: 36px;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line-2);
    border-top: none;
    white-space: normal;
    text-align: left;
  }
  table.dataTable tbody td::before {
    content: attr(data-label);
    flex: 0 0 130px;
    font-weight: 600;
    font-size: 12px;
    color: var(--fg-2);
    padding-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  table.dataTable tbody td:last-child {
    border-bottom: none;
    justify-content: flex-end;
  }
  table.dataTable tbody td:last-child::before { display: none; }
  table.dataTable tbody td[data-label=""]::before { display: none; }

  /* Mobile metric/tile grid: 2-up */
  .shortcut-tiles,
  .grid-tiles { grid-template-columns: repeat(2, 1fr); }
  .grid-ws    { grid-template-columns: 1fr; }
  .grid-2     { grid-template-columns: 1fr; }

  /* Login mobile */
  .login-split { flex-direction: column; min-height: 100vh; }
  .login-split-image {
    flex: 0 0 180px;
    justify-content: center;
    align-items: center;
  }
  .login-split-logo {
    max-width: calc(100% - 40px);
    display: block;
    margin: 0 auto;
  }
  .login-split-form {
    flex: 1;
    padding: 24px 0;
  }
  .login-split-content { width: 88%; margin: 0 auto; }
}
