/* ============================================================
   CloudPanel Modern Theme
   ============================================================
   The only theme CloudPanel ships. Loaded last in `_Layout.cshtml`
   and `login.cshtml` so its rules override Avant + Bootstrap.

   Architecture:
     1. Tokens — CSS custom properties on :root
     2. Base / typography
     3. Layout (navbar 64px, sidebar 273px, page-heading)
     4. Re-skinned Bootstrap primitives — .panel, .btn, .label,
        .badge, .table, .form-control, .breadcrumb, .pagination
     5. New design primitives — .card, .pill, .tbl, .av, .pagehead
     6. Feature components — .metric (Dashboard tiles),
        .ws (workspace tiles), .spark (sparklines),
        .shortcut-tiles (legacy dashboard markup re-skin)
     7. Login split-screen
     8. DataTables overrides + responsive card-mode
     9. Mobile breakpoints (≤ 767px)

   Design tokens map directly to the values in the Claude Design
   handoff at design_handoff_cloudpanel_modernization/. When in
   doubt, that handoff is the source of truth.
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;500;600;700&display=swap");

/* ============================================================
   1. Tokens
   ============================================================ */

:root {
  /* Brand */
  --brand-teal:        #32c5d2;
  --brand-teal-2:      #28aab8;
  --brand-teal-deep:   #1c8a95;
  --brand-teal-soft:   #d6f3f6;
  --brand-navy:        #2e5dac;
  --brand-navy-2:      #254a8a;
  --brand-navy-deep:   #1c3a6f;

  /* CloudPanel palette (re-used as functional color) */
  --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 */
  --bg:                #f6f7fa;
  --bg-2:              #ffffff;
  --bg-3:              #fbfbfd;
  --fg:                #1d2128;
  --fg-2:              #3a4150;
  --fg-muted:          #8a93a4;
  --line:              #e6e8ee;
  --line-2:            #eef0f4;
  --hover:             #f1f3f7;

  /* Status */
  --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;

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

  /* Sidebar surface (steel) — exposed as a token so the navbar/topbar
     can reference it without hard-coding. */
  --sb-bg:             #5e6878;
  --sb-bg-2:           #4e5666;
}

/* ============================================================
   2. Base / typography
   ============================================================ */

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

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);
}

/* ============================================================
   3. Layout — navbar (64px), sidebar (273px), content
   ============================================================ */

/* Body sits flush below the fixed navbar — no breathing-room gap so
   the sidebar starts immediately under the navy header. */
body { padding-top: 64px; }

/* 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) 273px,
    var(--bg) 273px,
    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;
  }
}

nav.navbar { min-height: 64px; }

/* 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: 265px;
  padding: 0; left: 0;
  overflow: hidden; position: relative;
  transition: width 0.2s ease, opacity 0.2s ease;
}
.navbar-brand img {
  position: absolute;
  top: calc(50% + 4px); /* +4 corrects Avant's font:0/0 rendering offset */
  left: 50%;
  transform: translate(-50%, -50%);
  max-height: 56px;
  max-width: 235px;
  width: auto; height: auto;
}
body.collapse-leftbar .navbar-brand { width: 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 {
  line-height: 64px;
  padding: 0 10px;
}
.navbar-nav.toolbar > li > a:hover,
.navbar-nav.toolbar > li.open > 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: 14px !important; /* override Avant's 12px */
}

/* ============================================================
   Sidebar — 273px 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: 273px;
  background-color: transparent;
  box-shadow: none;
}
#page-content {
  margin-left: 273px;
  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 18px;
  font-size: 14.5px;
  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. */
#sidebar > li > a i {
  font-size: 16px;
  width: 18px;
  min-width: 18px;
  margin-right: 12px;
  color: rgba(255,255,255,.7);
}

/* Submenu expand chevron — Avant ships this as a `:before` pseudo-
   element with `float: right`, which doesn't work inside our flex
   anchor (flex items can't float) and varies between top-level and
   nested items. Pin it via absolute positioning so it always sits
   12px in from the right edge of the anchor regardless of whether
   the parent is flex (top-level) or block (nested submenus like
   Plans → Exchange). */
#sidebar li.hasChild > a {
  position: relative;
}
#sidebar li.hasChild > a::before {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
  font-size: 12px !important;
  opacity: 0.55 !important;
  /* `order` is irrelevant once positioned absolutely, but reset it
     so it doesn't carry residual flex semantics if browser quirks
     hand it back to the flow. */
  order: 0;
}
#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; }
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; }

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

#page-heading {
  background: var(--bg-2);
  /* Symmetric vertical padding so the title-stack vertically
     centers between the navbar above and the divider below. */
  padding: 26px 24px !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". */
#page-heading .page-sub {
  margin-top: 2px;
  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. */
.day-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  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:hover,
.day-range-btn:focus,
.open > .day-range-btn,
.open > .day-range-btn:focus {
  background: var(--hover);
  border-color: var(--line);
  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;
}
#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 4px;
  font-size: 12px;
  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 `.panel-heading { height: 40px;
   line-height: 2em; font-size: 18px }` and `.panel-heading + .panel-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. */
.panel-heading {
  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 `.panel-heading + .panel-body`
   matches; force-restore them here so the panel's outer border
   continues all the way around and content has comfortable padding. */
.panel-body,
.panel-heading + .panel-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 > .panel-heading > h4 { color: #fff }` that
   would otherwise paint the title white-on-white in our re-skinned
   default panel surface. */
.panel-heading h1,
.panel-heading h2,
.panel-heading h3,
.panel-heading h4,
.panel-heading h5,
.panel-heading h6,
.panel-heading .panel-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;
  /* Float left so a sibling `.options` floated right shares the same
     line — this is the Avant pattern the existing markup expects.
     The line-height override above keeps the heading from inflating to
     Avant's default 40px line. */
  float: left;
}
.panel-heading .panel-title > a,
.panel-heading h1 > a,
.panel-heading h2 > a,
.panel-heading h3 > a,
.panel-heading h4 > a,
.panel-heading h5 > a,
.panel-heading 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 `.panel-heading .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. */
.panel-heading .options {
  float: right;
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.panel-heading .options > a,
.panel-heading .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;
}
.panel-heading .options a:hover { color: var(--brand-teal) !important; }
.panel-heading .options .btn {
  line-height: 1.4 !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

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

.panel-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 > .panel-heading,
.panel-default > .panel-heading,
.panel-info > .panel-heading,
.panel-success > .panel-heading,
.panel-warning > .panel-heading,
.panel-danger > .panel-heading {
  background: var(--bg-2);
  color: var(--fg);
  border-bottom: 1px solid var(--line-2);
}
.panel-primary > .panel-body,
.panel-default > .panel-body,
.panel-info > .panel-body,
.panel-success > .panel-body,
.panel-warning > .panel-body,
.panel-danger > .panel-body {
  background: var(--bg-2);
}

/* The "options" affordance Avant puts in panel headings (right-side actions) */
.panel-heading .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);
  border: 1px solid 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 FontAwesome `\f0d7` glyph via
   `:before` and pins it `vertical-align: top`. Inside our flex
   `.btn`, vertical-align is ignored, and the FA 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 */
.pagination > li > a,
.pagination > li > span {
  color: var(--fg-2);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.pagination > li > a:hover,
.pagination > li > span:hover {
  background: 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: #0f3a3f; }
.metric.m3 .mic { background: var(--cp-tile-magenta); }
.metric.m4 .mic { background: var(--cp-tile-orange); color: #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);
}

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 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 {
    width: 160px !important;
    height: 50px;
    opacity: 1 !important;
  }
  .navbar-brand img {
    max-width: 140px;
    max-height: 38px;
    top: 50%;
  }
  #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; }

  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; }
}
