/* ============================================================================
   WATMON CLOUD — Modern light design layer (2026)
   ----------------------------------------------------------------------------
   A pastel / light / contemporary admin theme that sits ON TOP of the existing
   Bootstrap 3 + Gentelella markup. It is purely presentational:

     * No HTML, PHP, JavaScript or database changes are required.
     * It only re-skins colors, borders, radius, shadows, type and spacing for
       the classes the app already emits (.left_col, .top_nav, .x_panel, .table,
       .btn, .form-control, .dropdown-menu, .modal, .label, .badge, .alert, …).
     * It is loaded AFTER custom.css and the per-company wattmon*.css, so at
       equal specificity it wins. A few rules use !important only to beat
       Gentelella's own !important hover/active rules.

   HOW TO DISABLE / REVERT:
     Remove the  <link ... modern-theme.css ...>  line in
     application/views/header.php. Everything instantly returns to the old look.

   Tokens below are prefixed --wm- to avoid colliding with anything else.
   ========================================================================== */

:root{
  --wm-canvas:#FFFFFF;         /* app background behind everything            */
  --wm-surface:#FFFFFF;        /* cards / sidebar / top bar                    */
  --wm-surface-2:#F8FAFC;      /* subtle fills (rows, addons)                  */
  --wm-surface-3:#F1F4FA;      /* hover fills                                  */
  --wm-border:#E7ECF4;         /* hairline borders                             */
  --wm-border-strong:#D9E0EC;  /* stronger borders (inputs, table headers)     */

  --wm-text-1:#1E293B;         /* primary text                                 */
  --wm-text-2:#4B5B74;         /* secondary text / nav links (legible on white)*/
  --wm-text-3:#8A97AD;         /* muted / labels / icons                       */

  --wm-brand:#6366F1;          /* indigo — primary accent                      */
  --wm-brand-2:#4F46E5;        /* hover / active                               */
  --wm-brand-3:#818CF8;        /* lighter accent                               */
  --wm-brand-soft:#EEF0FE;     /* active pill / tint                           */
  --wm-brand-softer:#F5F6FE;   /* row hover / very light tint                  */
  --wm-brand-ring:rgba(99,102,241,.28);

  --wm-success:#10B981;  --wm-success-soft:#E7FBF2;  --wm-success-ink:#047857;
  --wm-warning:#F59E0B;  --wm-warning-soft:#FEF4E2;  --wm-warning-ink:#92600A;
  --wm-danger:#F43F5E;   --wm-danger-soft:#FEECEF;   --wm-danger-ink:#BE123C;
  --wm-info:#0EA5E9;     --wm-info-soft:#E6F6FE;     --wm-info-ink:#0C6E9A;

  --wm-sidebar:#E2E6EC;      /* neutral cool grey (r5: no pink tint, slightly darker) */
  --wm-topbar:#F7F9FC;       /* top navigation bar (lighter, near-white)      */
  --wm-danger-strong:#C62828;/* crimson — accent / hover reds (exact sample red, r5) */
  --wm-danger-deep:#B71C1C;  /* darker red — filled active states (date pill, active menu, r5) */
  --wm-active-bg:#D8DFE8;    /* neutral cool grey — sidebar active-row bg (r6: no pink, darker than sidebar) */

  --wm-radius:14px;
  --wm-radius-sm:10px;
  --wm-radius-xs:8px;

  --wm-shadow-sm:0 1px 2px rgba(16,24,40,.05), 0 2px 6px rgba(16,24,40,.05);
  --wm-shadow:0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.08);
  --wm-shadow-lg:0 8px 16px rgba(16,24,40,.08), 0 24px 48px rgba(16,24,40,.14);

  --wm-font:"Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ==========================================================================
   1. Base
   ========================================================================== */
body{
  font-family:var(--wm-font);
  font-size:14px;
  line-height:1.5;
  color:var(--wm-text-1);
  background:var(--wm-canvas);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,h4,h5,h6{ color:var(--wm-text-1); font-weight:600; letter-spacing:-.2px; }
a{ color:var(--wm-brand); }
a:hover, a:focus{ color:var(--wm-brand-2); }
code, kbd, pre{ font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

::selection{ background:var(--wm-brand-soft); color:var(--wm-brand-2); }

*:focus{ outline:none; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible{
  outline:none; box-shadow:0 0 0 3px var(--wm-brand-ring); border-radius:6px;
}

/* Thin, soft scrollbars (WebKit) */
::-webkit-scrollbar{ width:10px; height:10px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{
  background:#CBD3E1; border-radius:20px; border:2px solid transparent; background-clip:content-box;
}
::-webkit-scrollbar-thumb:hover{ background:#AEB9CC; background-clip:content-box; }

/* mCustomScrollbar (used by the sidebar scroll-view) → neutral tone */
.left_col .mCSB_dragger, .mCSB_dragger_bar .mCSB_dragger{ background:#C9D1E0; }
.left_col .mCSB_scrollTools{ opacity:.5; }
.left_col .mCSB_scrollTools .mCSB_draggerRail{ background:transparent; }

/* ==========================================================================
   2. App shell — Sidebar (.left_col)
   ========================================================================== */
.left_col,
.container.body .col-md-3.left_col{
  background:var(--wm-sidebar) !important;
  border-right:1px solid var(--wm-border);
  scrollbar-width:thin;
}

.navbar.nav_title{
  background:var(--wm-sidebar);
  border-bottom:1px solid var(--wm-border);
  /* Fill the usable 230x57 band: no vertical padding so the 57px logo fits
     the band without overflowing into the menu below. */
  padding:0 16px;
}
.navbar.nav_title a{ display:block; }
/* Company logo: fill the full 230x57 header band (was a 34px cap that left
   small client logos tiny). object-fit:contain scales every logo UP or DOWN
   to the 57px height while preserving its original aspect ratio and never
   distorting; the header background shows through the letterbox. */
.navbar.nav_title a img{
  display:block;
  width:100%;
  height:57px;
  max-width:100%;
  object-fit:contain;
  object-position:center;
  border-radius:6px;
}

.menu_section{ margin-bottom:20px; }
.menu_section h3{
  color:var(--wm-text-3) !important;
  text-transform:uppercase;
  letter-spacing:.7px;
  font-weight:700;
  font-size:11px;
  line-height:1.2;
  padding:6px 4px 6px 8px;
  margin:14px 4px 6px;
  text-shadow:none !important;
  border:0;
}
.menu_section > ul{ margin-top:6px; }

/* Base links */
.nav > li > a{ padding:10px 12px 10px 14px; border-radius:var(--wm-radius-xs); }

.nav.side-menu > li > a{
  color:var(--wm-text-2) !important;
  font-weight:500;
  margin-bottom:2px;
  line-height:1.4;
  transition:background .15s ease, color .15s ease;
}
.nav.side-menu > li > a i{
  color:var(--wm-text-3);
  width:22px;
  text-align:center;
  margin-right:4px;
  transition:color .15s ease;
}
.nav.side-menu > li > a:hover{
  color:var(--wm-text-1) !important;
  background:var(--wm-surface-3) !important;
}
.nav.side-menu > li > a:hover i{ color:var(--wm-danger-strong); }
.nav.side-menu > li > a span.fa{ color:var(--wm-text-3); margin-left:6px; }

/* Collapsed section label (chevron) spacing */
.nav.side-menu > li > a .fa-chevron-down{ margin-left:4px; }

/* Child menu */
.nav.child_menu{ padding-left:4px; }
.nav.child_menu li{ padding-left:6px; }
.nav.child_menu > li > a{
  color:var(--wm-text-2) !important;
  font-weight:500;
  padding:8px 12px 8px 20px;
  line-height:1.4;
}
.nav-md ul.nav.child_menu li:before{
  background:var(--wm-border-strong);
  width:6px; height:6px; left:13px; margin-top:17px;
}
.nav-md ul.nav.child_menu li:after{
  border-left:1px solid var(--wm-border);
  left:15px;
}
/* r6: submenu rows use the same neutral active bg as the top-level menu (was pink) */
.nav.child_menu li:hover,
.nav.child_menu li.active,
.nav.child_menu li li:hover,
.nav.child_menu li li.active{ background:var(--wm-active-bg) !important; }
.nav.child_menu > li > a:hover,
.nav.child_menu > li > a.active,
.nav.child_menu li li a:hover,
.nav.child_menu li li a.active{ color:var(--wm-danger-strong) !important; }

/* Active / current-page (Gentelella uses a teal right border + dark gradient) */
.nav.side-menu > li.current-page,
.nav.side-menu > li.active{ border-right:0 !important; }
/* r5: active = deeper red (B71C1C) so text reads darker; hover reds keep C62828
   r6: active-row bg -> neutral grey (--wm-active-bg), the pink #FEECEF read too warm */
.nav.side-menu > li.current-page > a,
.nav.side-menu > li.active > a{
  background:var(--wm-active-bg) !important;
  color:var(--wm-danger-deep) !important;
  box-shadow:none !important;
  text-shadow:none !important;
  font-weight:600;
}
.nav.side-menu > li.current-page > a,
.nav.side-menu > li.active > a{
  box-shadow:inset 3px 0 0 var(--wm-danger-deep);
}
.nav.side-menu > li.current-page > a i,
.nav.side-menu > li.active > a i{ color:var(--wm-danger-deep) !important; }
.nav li.current-page{ background:transparent; }
.nav li li.current-page a{ color:var(--wm-text-1); }
.active a span.fa{ color:var(--wm-text-3); }

/* Sidebar footer action icons — no top seam: the column is one continuous
   grey (fixed to 100vh, see §3), a border here would read as a scratch. */
.sidebar-footer{ background:var(--wm-sidebar) !important; border-top:0; }
.sidebar-footer a{ color:var(--wm-text-3) !important; margin:0 6px; background:transparent !important; transition:color .15s ease, background .15s ease; }
.sidebar-footer a:hover{ color:var(--wm-danger-strong) !important; background:var(--wm-danger-soft) !important; }

/* ==========================================================================
   3. Top navigation bar (.top_nav)
   ========================================================================== */
.top_nav .nav_menu,
.top_nav .nav_menu > nav{
  background:var(--wm-topbar);
  border-bottom:1px solid var(--wm-border);
  box-shadow:none;
}
/* Fixed top bar starting BESIDE the sidebar (r4, 2026-09-21): the 57px logo
   band (first child of the column, styled in §7) owns the top-left corner
   flush at y=0, so the bar's box must start at x=230 (md) / x=70 (sm)
   instead of x=0. margin:0 alone loses to the base
   .main_container .top_nav{margin-left:230px} (0,2,0), so re-assert the
   offsets below at (0,2,1); the base <=991 media rule (0,4,0, margin:0,
   static) still wins on mobile, so the mobile full-width bar is unchanged.
   z-index 10000 stays above the sidebar (z 9999); the main content is
   pushed DOWN (66px, see the right_col rule below) so nothing slips under
   the bar. */
.top_nav{
  position:fixed !important; top:0; left:0; right:0; margin:0;
  z-index:10000; height:56px;
}
/* The bar paints its background only on the inner .nav_menu (see above), so
   the offset has to come from the element box itself, not from a
   transparent strip. (0,2,1) beats the base rules in any nesting; the
   band fills the corner at x 0-230/70, y 0-57. */
body.nav-md .top_nav{ margin-left:230px; }
body.nav-sm .top_nav{ margin-left:70px; }
/* Pin the whole column to the viewport so the grey runs to the bottom of the
   screen (the base leaves the outer at position:absolute, height:auto → the
   grey used to end at the menu's end). r4 (2026-09-21): NO padding-top — the
   57px logo band (first child of the inner .scroll-view) sits flush at y=0
   and owns the top-left corner, with the fixed bar starting beside it
   (x=230/70, see above), so the empty grey strip behind the bar is gone.
   Same 5-class selector as the base rule, and this file loads after
   custom.min.css, so position:fixed wins there; width/display/z-index
   (230px / flex / 9999) stay from the base. The inner .scroll-view has no
   mCustomScrollBox rules (mCS only inits on .menu_fixed, which we don't
   use), so it scrolls natively when the menu is taller than the viewport. */
.nav-md .container.body .col-md-3.left_col{ position:fixed; top:0; left:0; height:100vh; }
.nav-md .left_col.scroll-view{ overflow-y:auto; }
/* Push the main content below the full-width fixed bar (56px bar + 10px gap).
   NOTE: the node is .right_col (NOT .col-md-3.right_col) — a wrong selector in
   an earlier revision meant this offset never took effect. */
.nav-md .container.body .right_col{ padding-top:66px !important; }
@media (max-width:991px){
  /* Mobile: bar returns to normal flow (static, full-width) so it stops
     overlapping content; undo the pushes (the sidebar is hidden on mobile). */
  .top_nav{ position:static !important; }
  .nav-md .container.body .right_col{ padding-top:10px !important; }
  .nav-md .container.body .col-md-3.left_col{ padding-top:0 !important; }
}
.top_nav .navbar-right{ margin-top:0; }
.top_nav .navbar-nav > li > a{
  color:var(--wm-text-1);
  font-weight:500;
  padding:0 14px;
  line-height:56px;
}
.top_nav .nav .toggle a{
  color:var(--wm-text-2);
  padding:0 14px;
  height:56px;
  line-height:56px;
}
.top_nav .nav .toggle a:hover{ color:var(--wm-brand-2); background:var(--wm-surface-3); }
/* r5: hamburger = sample crimson (accent). Markup is <div class="nav toggle">, so the
   .nav .toggle descendant selectors above never matched — need the compound class. */
.top_nav .nav.toggle a, .top_nav .nav.toggle a i{ color:var(--wm-danger-strong); }
.top_nav .nav.toggle a:hover, .top_nav .nav.toggle a:hover i{ color:var(--wm-danger-deep); }
.user-profile.dropdown-toggle,
.info-number.dropdown-toggle{
  color:var(--wm-text-1);
  font-weight:500;
}
/* Vertically center the alert (envelope) icon. Nav link is ~56px tall; a
   FontAwesome <i> glyph is NOT centered by line-height, so use flex with an
   explicit height. The badge keeps its original corner position (custom.css). */
.info-number.dropdown-toggle{
  display:flex;
  align-items:center;
  justify-content:center;
  height:56px;
  line-height:normal;
}
.user-profile.dropdown-toggle:hover,
.info-number.dropdown-toggle:hover{ background:var(--wm-surface-3); color:var(--wm-brand-2); }
.top_nav .fa-angle-down{ color:var(--wm-text-3); }
.dropdown-toggle .caret, .caret{ color:var(--wm-text-3) !important; border-color:currentColor transparent transparent; }

/* Alerts dropdown feed */
.msg_list li{ border-bottom:1px solid var(--wm-border); }
.msg_list li:last-child{ border-bottom:0; }
.msg_list li a{
  display:block;
  padding:10px 12px;
  color:var(--wm-text-1);
  background:transparent;
  text-decoration:none;
}
.msg_list li a:hover{ background:var(--wm-brand-softer); color:var(--wm-text-1); }
.msg_list li a > span > .fa{ color:var(--wm-brand); }
.msg_list .time{ color:var(--wm-text-3); font-size:11px; float:right; }
.msg_list .message{ color:var(--wm-text-2); font-size:13px; display:block; margin-top:2px; }

/* ==========================================================================
   4. Dropdown menus (shared: user menu, copy-from, etc.)
   ========================================================================== */
.dropdown-menu{
  background:var(--wm-surface);
  border:1px solid var(--wm-border);
  border-radius:12px;
  box-shadow:var(--wm-shadow-lg);
  padding:8px;
  margin-top:6px;
  font-size:14px;
}
.menu-list, .dropdown-menu{ z-index:2000; }
.dropdown-menu > li > a{
  color:var(--wm-text-1);
  padding:9px 12px;
  border-radius:8px;
  font-weight:500;
  line-height:1.4;
  text-decoration:none;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus{
  background:var(--wm-brand-softer);
  color:var(--wm-brand-2);
}
.dropdown-menu > li > a .fa{ color:var(--wm-text-3); width:20px; text-align:center; margin-right:4px; }
.dropdown-menu > li > a:hover .fa{ color:var(--wm-brand); }
.dropdown-menu .divider{ border-top:1px solid var(--wm-border); }
.dropdown-menu .text-center a, .dropdown-menu .text-center{
  color:var(--wm-brand); font-weight:600; display:block; padding:8px 12px;
}

/* ==========================================================================
   5. Page header: breadcrumb + title
   ========================================================================== */
.breadcrumb{
  background:transparent;
  border:0;
  padding:0 0 0 2px;
  margin:0 0 2px;
  border-radius:0;
}
.breadcrumb > li{ color:var(--wm-text-3); font-size:13px; }
.breadcrumb > li > a{ color:var(--wm-text-2); font-weight:500; text-decoration:none; }
.breadcrumb > li > a:hover{ color:var(--wm-brand-2); }
.breadcrumb > li + li:before{ content:"/"; color:var(--wm-border-strong); padding:0 8px; }
.breadcrumb > .active{ color:var(--wm-text-1); font-weight:600; }

.page-title{
  border-bottom:0;
  background:transparent;
  padding:18px 0 16px;
  margin-bottom:18px;
}
.page-title .title_left h3{
  font-size:22px;
  font-weight:700;
  margin:0;
  padding-bottom:10px;
  letter-spacing:-.3px;
  color:var(--wm-text-1);
  line-height:1.25;
}
.page-title .title_left h3 i{ color:var(--wm-brand); margin-right:10px; }
.page-title .title_left h3 .image-icon,
.image-icon{ height:26px; vertical-align:middle; border-radius:6px; margin-right:8px; }

/* ==========================================================================
   6. Cards — .x_panel (shared by every widget + dashboard)
   ========================================================================== */
.x_panel{
  position:relative;
  display:inline-block;
  width:100%;
  background:var(--wm-surface);
  border:1px solid var(--wm-border);
  border-radius:var(--wm-radius);
  box-shadow:var(--wm-shadow-sm);
  padding:16px;
  margin-bottom:18px;
  column-break-inside:avoid;
  transition:box-shadow .2s ease, border-color .2s ease;
}
.x_panel:hover{ box-shadow:var(--wm-shadow); border-color:var(--wm-border-strong); }

.x_panel .x_title{
  border-bottom:1px solid var(--wm-border);
  padding:0 0 12px;
  margin-bottom:14px;
  background:transparent;
}
.x_panel .x_title h2{
  font-size:15px;
  font-weight:600;
  color:var(--wm-text-1);
  margin:0;
  line-height:1.35;
  float:left;
}
.x_panel .x_title h2 small{ color:var(--wm-text-3); font-weight:500; font-size:12px; margin-left:8px; }
.x_panel .x_title span{ color:var(--wm-text-3); }
.x_panel .x_title .filter{ width:auto; }
.x_panel .x_content{ padding:0; margin-top:0; clear:both; position:relative; }
.x_panel .x_content h4{ font-size:15px; font-weight:600; }
.x_panel > .row:last-child, .x_panel > *:last-child{ margin-bottom:0; }

/* Centred stat "tile" variant (used by some widgets) */
.x_panel.tile{ text-align:center; }
.x_panel.tile .x_content{ padding:6px 0; }
.tile h2{ font-size:30px; font-weight:700; }

/* Widget toolbar (gear / delete / load-time chips) */
.panel_toolbox{ float:right; padding:2px 0 0; margin:0 0 0 10px; }
.panel_toolbox li{ list-style:none; display:inline-block; margin:0 0 0 6px; }
.panel_toolbox li a,
.panel_toolbox li a:hover{
  color:var(--wm-text-3);
  background:transparent;
}
.panel_toolbox li a{
  display:inline-block;
  min-width:28px; height:28px; line-height:26px;
  text-align:center;
  border-radius:8px;
  padding:0 7px;
  transition:background .15s ease, color .15s ease;
}
.panel_toolbox li a:hover{ background:var(--wm-surface-3); color:var(--wm-brand-2); }
.panel_toolbox li a .fa{ font-size:14px; }
.panel_toolbox li span{ color:var(--wm-text-3); font-size:12px; line-height:28px; padding:0 6px; white-space:nowrap; }
.collapse-link, .close-link{ color:var(--wm-text-3); }
.collapse-link:hover, .close-link:hover{ color:var(--wm-danger); }
.collapse-link .fa, .close-link .fa{ font-size:14px; }

/* Designer tab bar */
ul.bar_tabs{ border:0; background:transparent; margin:0 0 14px; }
ul.bar_tabs > li{ float:none; display:inline-block; margin-right:6px; background:var(--wm-surface-2); border-radius:10px; }
ul.bar_tabs > li > a{
  display:inline-block; padding:8px 14px; border-radius:10px;
  color:var(--wm-text-2); font-weight:500; border:0; text-decoration:none; background:transparent;
}
ul.bar_tabs > li.active{ background:var(--wm-brand-soft); }
ul.bar_tabs > li.active > a{ color:var(--wm-brand-2); background:transparent; }

/* ==========================================================================
   7. Buttons
   ========================================================================== */
.btn, a.btn, button.btn, input.btn{
  font-family:var(--wm-font);
  font-size:14px;
  font-weight:500;
  line-height:1.4;
  padding:8px 14px;
  border:1px solid transparent;
  border-radius:var(--wm-radius-sm);
  cursor:pointer;
  box-shadow:none;
  text-shadow:none;
  -webkit-appearance:none;
  transition:background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.btn:hover, .btn:focus, .btn:active, .btn.active{ text-decoration:none; }
.btn:active, .btn.active{ box-shadow:inset 0 1px 2px rgba(16,24,40,.12); }
.btn[disabled], .btn.disabled, fieldset[disabled] .btn{ opacity:.55; cursor:not-allowed; }

.btn-default{ background:#fff; color:var(--wm-text-1); border:1px solid var(--wm-border-strong); }
.btn-default:hover, .btn-default:focus{ background:var(--wm-surface-3); border-color:#C4CEDC; color:var(--wm-text-1); }

.btn-primary{ background:var(--wm-brand); color:#fff; border-color:transparent; }
.btn-primary:hover, .btn-primary:focus, .btn-primary.active{ background:var(--wm-brand-2); }

.btn-success{ background:var(--wm-success); color:#fff; border-color:transparent; }
.btn-success:hover, .btn-success:focus{ background:#059669; }

.btn-danger{ background:var(--wm-danger); color:#fff; border-color:transparent; }
.btn-danger:hover, .btn-danger:focus{ background:#E11D48; }

.btn-info{ background:var(--wm-info); color:#fff; border-color:transparent; }
.btn-info:hover, .btn-info:focus{ background:#0284C7; }

.btn-warning{ background:var(--wm-warning); color:#fff; border-color:transparent; }
.btn-warning:hover, .btn-warning:focus{ background:#D97706; }

.dark-slate, .btn-dark{ background:#334155; color:#fff; border-color:transparent; }
.btn-dark:hover{ background:#1E293B; }

.btn-link{
  background:transparent; border:0; color:var(--wm-brand);
  padding:4px 6px; border-radius:6px;
}
.btn-link:hover{ color:var(--wm-brand-2); background:var(--wm-brand-softer); text-decoration:none; }

.btn-lg, .btn-large{ padding:11px 20px; font-size:15px; border-radius:12px; }
.btn-sm, .btn-small{ padding:6px 12px; font-size:13px; }
.btn-xs{ padding:4px 10px; font-size:12px; border-radius:8px; }

.btn-group .btn{ border-radius:var(--wm-radius-sm); }
.btn-group .btn + .btn{ margin-left:-1px; }
.btn-group.open .dropdown-toggle, .btn-group .dropdown-toggle:focus{ box-shadow:none; }
.btn .caret{ margin-left:5px; border-color:currentColor transparent transparent; }

/* ==========================================================================
   8. Forms, inputs & common plugins
   ========================================================================== */
.form-group{ margin-bottom:16px; }
.form-group label, label{ color:var(--wm-text-2); font-weight:500; font-size:13px; }
.help-block{ margin:6px 0 0; font-size:12px; color:var(--wm-text-3); }

.form-control{
  background:#fff;
  border:1px solid var(--wm-border-strong);
  border-radius:var(--wm-radius-sm);
  box-shadow:none !important;
  color:var(--wm-text-1);
  font-size:14px;
  font-family:var(--wm-font);
  padding:8px 12px;
  min-height:38px;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.form-control:hover{ border-color:#C4CEDC; }
.form-control:focus{ border-color:var(--wm-brand); box-shadow:0 0 0 3px var(--wm-brand-ring); }
.form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control{
  background:#E8EDF5; color:#8C96A8; border-color:#D5DCE8; cursor:not-allowed;
}
.form-control::placeholder{ color:var(--wm-text-3); }
textarea.form-control{ min-height:84px; line-height:1.5; }
select.form-control{ min-height:38px; padding:8px 34px 8px 12px; }

.input-group .form-control{ /* keep square corners where attached */ }
.input-group .form-control:first-child{ border-top-right-radius:0; border-bottom-right-radius:0; }
.input-group .form-control:last-child{ border-top-left-radius:0; border-bottom-left-radius:0; }
.input-group-addon{
  background:var(--wm-surface-2);
  border:1px solid var(--wm-border-strong);
  border-radius:var(--wm-radius-sm);
  color:var(--wm-text-2);
  min-height:38px;
  padding:0 12px;
  font-size:13px;
}
.input-group-btn .btn{ border-radius:var(--wm-radius-sm); }

/* validation states (Bootstrap has-error / Parsley) */
.has-error .form-control, .has-error .input-group-addon, .parsley-error .form-control{
  border-color:var(--wm-danger);
  box-shadow:0 0 0 3px var(--wm-danger-soft) !important;
}
.has-error .help-block, .has-error .control-label, .has-error .error{ color:var(--wm-danger); }
.has-success .form-control{ border-color:var(--wm-success); }
.has-success .help-block{ color:var(--wm-success); }
.has-warning .form-control{ border-color:var(--wm-warning); }
.has-warning .help-block{ color:var(--wm-warning); }

/* select2 (single + multiple) */
.select2-container .select2-choice,
.select2-container--default .select2-selection--single{
  background:#fff;
  border:1px solid var(--wm-border-strong);
  border-radius:var(--wm-radius-sm);
  min-height:38px;
  box-shadow:none;
  color:var(--wm-text-1);
}
.select2-container .select2-choice .select2-chosen{ color:var(--wm-text-1); line-height:36px; padding-left:12px; }
.select2-container .select2-choice .select2-arrow b{ border-color:var(--wm-text-3) transparent transparent transparent; margin-top:13px; }
.select2-search-field{ border:1px solid var(--wm-border-strong); border-radius:var(--wm-radius-sm); background:#fff; }
.select2-dropdown{ border-color:var(--wm-border-strong); border-radius:var(--wm-radius-sm); box-shadow:var(--wm-shadow-lg); }
.select2-results .select2-highlighted{ background:var(--wm-brand-soft); color:var(--wm-brand-2); }

/* bootstrap-select (.selectpicker) */
.bootstrap-select > .btn{
  background:#fff !important;
  border:1px solid var(--wm-border-strong) !important;
  color:var(--wm-text-1) !important;
  border-radius:var(--wm-radius-sm);
  min-height:38px;
  box-shadow:none !important;
  text-shadow:none;
  font-weight:500;
}
.bootstrap-select > .btn:hover, .bootstrap-select.open > .btn{
  background:var(--wm-surface-3) !important;
  border-color:#C4CEDC !important;
}
.bootstrap-select > .btn .caret{ border-color:var(--wm-text-3) transparent transparent; }
/* Cap long dropdown menus (several hundred users/sites/dashboards) so they SCROLL,
   ~12 visible rows before the scrollbar appears. Short lists are unaffected
   (max-height only adds a scrollbar when the content exceeds it).
   `!important` is REQUIRED: bootstrap-select v1.10 setSize() (size:"auto") writes an
   inline max-height on this same <ul>, and inline styles beat a plain stylesheet rule —
   so without !important this cap has no effect. A stylesheet !important overrides that
   inline (non-!important) value and is what actually caps + scrolls the list. */
.bootstrap-select .dropdown-menu .inner{ max-height:320px !important; overflow-y:auto !important; -webkit-overflow-scrolling:touch; }

/* daterangepicker */
.daterangepicker{
  background:var(--wm-surface);
  border:1px solid var(--wm-border);
  border-radius:12px;
  box-shadow:var(--wm-shadow-lg);
  font-family:var(--wm-font);
  font-size:13px;
  color:var(--wm-text-1);
  z-index:3000;
}
.daterangepicker::before, .daterangepicker::after{ border:0 !important; }
.daterangepicker .calendar-table{ padding:10px 10px 6px; }
.daterangepicker .calendar-table th{ color:var(--wm-text-2); font-weight:600; }
.daterangepicker td{ color:var(--wm-text-2); }
.daterangepicker td.off, .calendar-days .calendar-table td.off{ color:var(--wm-text-3); }
.daterangepicker td.available:hover{ background:var(--wm-brand-soft); color:var(--wm-brand-2); }
.daterangepicker td.active, .daterangepicker td.active:hover{ background:var(--wm-brand) !important; color:#fff !important; }
.daterangepicker td.in-range{ background:var(--wm-brand-softer); color:var(--wm-brand-2); }
.daterangepicker .ranges{ background:var(--wm-surface-2); border-radius:12px 0 0 12px; }
.daterangepicker .ranges li{ color:var(--wm-text-2); font-weight:500; }
.daterangepicker .ranges li:hover{ background:var(--wm-brand-softer); color:var(--wm-brand-2); }
.daterangepicker .ranges li.active{ background:var(--wm-brand) !important; color:#fff !important; }
.daterangepicker .drp-buttons{ border-top:1px solid var(--wm-border); padding:8px 10px; }
.daterangepicker .drp-buttons .btn{ margin:2px 6px 2px 0; }

/* switchery toggle */
.switchery{ background:var(--wm-border-strong) !important; border-radius:999px; }
.switchery > small{ background:#fff; border-radius:999px; transition:left .15s ease; }
.switchery-primary > small, .switchery[data-switchery-checked="true"], .switchery[data-switchery-checked="true"] > small{ background:none; }
.switchery-primary{ background:var(--wm-brand) !important; }
.switchery[data-switchery-checked="true"]{ background:var(--wm-brand) !important; }

/* iCheck (flat skin) */
.icheckbox_flat, .icheckbox_flat-green, .iradio_flat, .iradio_flat-green{ margin-right:4px; }
.icheckbox_flat i::before, .iradio_flat i::before{ border-color:var(--wm-border-strong); }
.icheckbox_flat.checked i::before, .icheckbox_flat-green.checked i::before{ border-color:var(--wm-brand) !important; box-shadow:inset 0 0 0 1px var(--wm-brand); background:var(--wm-brand-soft); }
.iradio_flat.checked i::before, .iradio_flat-green.checked i::before{ border-color:var(--wm-brand) !important; box-shadow:inset 0 0 0 4px var(--wm-brand); }
.iradio_flat.focused i, .icheckbox_flat.focused i{ box-shadow:0 0 0 3px var(--wm-brand-ring); }

/* starrr (star rating) */
.starrr a{ color:var(--wm-warning); }

/* progress bars */
.progress{ height:9px; border-radius:999px; background:var(--wm-surface-3); box-shadow:none; overflow:hidden; }
.progress-bar{ box-shadow:none; transition:width .4s ease; }
.progress-bar, .progress-bar-success{ background:var(--wm-brand); }
.progress-bar-info{ background:var(--wm-info); }
.progress-bar-warning{ background:var(--wm-warning); }
.progress-bar-danger{ background:var(--wm-danger); }

/* ==========================================================================
   9. Tables, labels & badges
   ========================================================================== */
.table{ color:var(--wm-text-1); font-size:14px; margin-bottom:0; }
.table > thead > tr > th,
.table > tbody > tr > th,
.table tfoot > tr > th{
  color:var(--wm-text-3);
  font-weight:600;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.4px;
  border-bottom:1px solid var(--wm-border-strong);
  padding:11px 14px;
  text-align:left;
}
.table > tbody > tr > td{
  padding:12px 14px;
  border-top:1px solid var(--wm-border);
  vertical-align:middle;
}
.table > tbody > tr:first-child > td{ border-top:0; }
.table-striped > tbody > tr:nth-child(odd) > td,
.table-striped > tbody > tr:nth-child(odd) > th{ background:var(--wm-surface-2); }
.table-hover > tbody > tr:hover > td,
.table-hover > tbody > tr:hover > th{ background:var(--wm-brand-softer); }
.table-bordered{ border:1px solid var(--wm-border); border-radius:var(--wm-radius); }
.table-bordered > thead > tr > th,
.table-bordered > tbody > tr > td{ border:1px solid var(--wm-border); }
.table > tbody > tr.active > td,
.table > tbody > tr.active > th{ background:var(--wm-brand-soft); }
.table a{ color:var(--wm-brand); text-decoration:none; }
.table a:hover{ color:var(--wm-brand-2); text-decoration:underline; }
.table .btn{ padding:5px 10px; font-size:13px; }

/* Labels (widgets use .label label-success / -warning / -danger for value status) */
.label{
  display:inline-block;
  padding:.42em .82em;
  font-size:12px;
  font-weight:600;
  line-height:1;
  color:#fff;
  border-radius:999px;
  white-space:nowrap;
}
.label-default{ background:#CBD5E1; color:#334155; }
.label-primary{ background:var(--wm-brand); }
.label-success{ background:var(--wm-success); }
.label-info{ background:var(--wm-info); }
.label-warning{ background:var(--wm-warning); }
.label-danger{ background:var(--wm-danger); }

/* Badges (semantic .bg-* kept) */
.badge{
  display:inline-block;
  min-width:1.55em;
  padding:.28em .6em;
  font-size:11px;
  font-weight:700;
  line-height:1;
  color:#fff;
  text-align:center;
  white-space:nowrap;
  background:var(--wm-brand);
  border-radius:999px;
  vertical-align:middle;
}
.badge.bg-green, .badge.bg-success{ background:var(--wm-success); }
.badge.bg-red, .badge.bg-danger{ background:var(--wm-danger); }
.badge.bg-yellow, .badge.bg-orange{ background:var(--wm-warning); }
.badge.bg-blue{ background:var(--wm-info); }
.badge.bg-skyblue{ background:var(--wm-brand-3); }
.badge.bg-black, .badge.bg-inverse{ background:#334155; }
.badge.bg-darkslateblue{ background:#6366F1; }

/* ==========================================================================
   10. Alerts
   ========================================================================== */
.alert{
  border:1px solid transparent;
  border-radius:12px;
  padding:12px 14px;
  font-size:14px;
  box-shadow:none;
  margin-bottom:14px;
}
.alert-success{ background:var(--wm-success-soft); color:var(--wm-success-ink); border-color:#C6F2DD; }
.alert-info{ background:var(--wm-info-soft); color:var(--wm-info-ink); border-color:#BEE6FB; }
.alert-error, .alert-danger{ background:var(--wm-danger-soft); color:var(--wm-danger-ink); border-color:#FBC9D2; }
.alert-warning{ background:var(--wm-warning-soft); color:var(--wm-warning-ink); border-color:#FEDFA2; }
.alert a{ color:inherit; font-weight:600; }
.alert .close{
  float:right; color:inherit; opacity:.55; text-shadow:none;
  margin:-2px -4px 0 8px; line-height:1.4;
}
.alert .close:hover{ opacity:.9; }

/* ==========================================================================
   11. Modals
   ========================================================================== */
.modal-backdrop.in{ opacity:.5; background:#0B1220; }
.modal-content{
  background:#fff;
  border:1px solid var(--wm-border);
  border-radius:16px;
  box-shadow:var(--wm-shadow-lg);
}
.modal-header{ background:transparent; border-bottom:1px solid var(--wm-border); padding:16px 18px; }
.modal-header .modal-title{ font-size:17px; font-weight:600; color:var(--wm-text-1); }
.modal-header .close{ margin:-8px -8px 0 0; opacity:.5; text-shadow:none; }
.modal-header .close:hover{ opacity:.9; }
.modal-body{ padding:16px 18px; color:var(--wm-text-1); }
.modal-footer{ padding:12px 18px; background:var(--wm-surface-2); border-top:1px solid var(--wm-border); border-radius:0 0 16px 16px; }

/* ==========================================================================
   12. Misc shared components
   ========================================================================== */
.well{
  background:var(--wm-surface-2);
  border:1px solid var(--wm-border);
  border-radius:var(--wm-radius);
  box-shadow:none;
  padding:14px 16px;
  color:var(--wm-text-2);
}
.help{ color:var(--wm-text-3); font-style:italic; }

/* Tabs (settings pages / bar_tabs fallback) */
.nav-tabs{ border-bottom:1px solid var(--wm-border); margin-bottom:18px; background:transparent; }
.nav-tabs > li > a{
  color:var(--wm-text-2);
  font-weight:500;
  border:0;
  border-bottom:2px solid transparent;
  border-radius:0;
  margin-right:4px;
  line-height:1.4;
  padding:10px 14px;
  background:transparent;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus,
.nav-tabs > li > a:hover{
  color:var(--wm-brand-2);
  border-bottom:2px solid var(--wm-brand);
  background:transparent;
}
.tab-content{ background:transparent; }

/* Pagination */
.pagination > li > a, .pagination > li > span{
  color:var(--wm-text-2); background:#fff; border:1px solid var(--wm-border-strong);
  border-radius:8px; margin:0 2px; line-height:1.4;
}
.pagination > li > a:hover{ background:var(--wm-brand-softer); color:var(--wm-brand-2); }
.pagination > li.active > a, .pagination > li.active > span{
  background:var(--wm-brand); color:#fff; border-color:transparent;
}
.pagination > li.disabled a{ color:var(--wm-text-3); }

/* Popovers / tooltips (custom data-rel tooltips) */
.tooltip-inner{
  background:#334155; color:#fff; border-radius:8px;
  padding:6px 10px; font-size:12px; line-height:1.4;
}
.tooltip.right .arrow, .tooltip.top .arrow{
  border-top-color:#334155; border-right-color:#334155;
}
.popover{ border:1px solid var(--wm-border); box-shadow:var(--wm-shadow-lg); border-radius:10px; }
.popover-title{ background:var(--wm-surface-2); border-bottom:1px solid var(--wm-border); border-radius:8px 8px 0 0; font-weight:600; color:var(--wm-text-1); }
.popover-content{ color:var(--wm-text-1); font-size:14px; }

/* ==========================================================================
   13. Responsive niceties + print
   ========================================================================== */
@media (max-width: 991px){
  .x_panel{ padding:14px; }
  .page-title .title_left h3{ font-size:20px; }
  .panel_toolbox li a{ min-width:32px; height:32px; line-height:30px; }
}

@media print{
  .left_col, .top_nav, .sidebar-footer, .navbar.nav_title{ display:none !important; }
  body{ background:#fff; }
  .right_col{ margin:0 !important; padding:0 !important; }
  .x_panel{ box-shadow:none; border:1px solid #D9E0EC; break-inside:avoid; }
  .panel_toolbox, .btn{ display:none !important; }
}

/* ==========================================================================
   13b. Configure-widget — normalize the legacy Bootstrap-2 field markup
   --------------------------------------------------------------------------
   Every  widgets/*/views/configure.php  shares one template that still uses
   Bootstrap-2 hooks  .row-fluid / .span2 / .span10 , raw  select.span12  and
   col-* selects / text inputs, and a  table[summary="Conditions"]  variable
   editor.  Those classes are undefined under Bootstrap 3, so the controls
   render narrow/inline in the old grey style.  Each selector below is scoped
   to a configure-page-only marker (verified: none of these markers appear in
   dashboard render widgets or device views), so this themes ALL widget
   configure pages without touching anything else.  No markup change needed;
   to revert, delete this block. */

/* Page header (layout .page-title → e.g. "Configure Widget") — clear gap below before the card */
.page-title{ margin-bottom:32px; }

/* Field rows: stack the label above a full-width control (BS2 was inline) */
.row-fluid{ margin:0 0 16px; }
.row-fluid:last-child{ margin-bottom:0; }
.row-fluid > .span2{ float:none; display:block; width:auto; margin:0 0 6px; color:var(--wm-text-2); font-size:12px; font-weight:600; }
.row-fluid > .span10{ float:none; display:block; width:100%; }
/* Bootstrap grid classes (.col-md-12 etc.) on text inputs carry float:left. A float inside
   .span10 made that wrapper collapse to ~0 height, so the next row's label stacked against the
   top of the input instead of below its bottom. De-float → input stays in flow → correct gap.
   (Selects have no .col-*, which is why the gap under a dropdown was already fine.) */
.row-fluid .col-md-12, .row-fluid .col-sm-12, .row-fluid .col-xs-12{ float:none; }
/* ---- Formula code box: transparent textarea over a syntax-highlighted mirror (no toolbar) ---- */
.formula-editor{ position:relative; width:100%; box-sizing:border-box; background:#F7F8FB; border:1px solid var(--wm-border-strong); border-radius:8px; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace; }
.formula-editor:focus-within{ border-color:var(--wm-brand); box-shadow:0 0 0 3px rgba(99,102,241,.14); }
.formula-editor .f-hl, .formula-editor .f-input{ margin:0; padding:8px 10px; box-sizing:border-box; font-family:inherit; font-size:13px; line-height:1.5; white-space:pre; overflow-wrap:break-word; word-break:break-word; tab-size:4; }
.formula-editor .f-hl{ position:absolute; top:0; left:0; right:0; bottom:0; color:#334155; overflow:hidden; pointer-events:none; }
.formula-editor .f-hl .f-fn{ color:var(--wm-brand); font-weight:700; }
.formula-editor .f-hl .f-b{ font-weight:700; }
.formula-editor .f-hl .f-b.f-L0{ color:#EF4444; }   /* level 0 – red   */
.formula-editor .f-hl .f-b.f-L1{ color:#3B82F6; }   /* level 1 – blue  */
.formula-editor .f-hl .f-b.f-L2{ color:#F59E0B; }   /* level 2 – yellow*/
.formula-editor .f-hl .f-b.f-L3{ color:#10B981; }   /* level 3 – green */
.formula-editor .f-input{ position:relative; width:100%; resize:vertical; border:0; background:transparent; color:transparent; caret-color:#1E293B; outline:none; overflow:auto; }
.formula-editor .f-input::placeholder{ color:#9AA5B5; }
/* Per-variable field labels — uniform, non-collapsing gap above each (margin-collapsing had made
   some touch the control above).  Using padding → immune to collapse → consistent rhythm. */
table[summary="Conditions"] .row-fluid{ margin:0; }
table[summary="Conditions"] .row-fluid > .span2{ margin:0; padding:16px 0 6px; }

/* Raw selects / text & number inputs  →  themed .form-control look */
select.span12, select[class^="col-"], select[class*=" col-"], .row-fluid select,
input[type=text].span12, input[type=text][class^="col-"], input[type=text][class*=" col-"],
.row-fluid input[type=text], .row-fluid input[type=number]{
  display:block; width:100%; box-sizing:border-box; min-height:38px;
  padding:8px 12px; font:inherit; font-size:14px; line-height:1.5;
  color:var(--wm-text-1); background-color:var(--wm-surface);
  border:1px solid var(--wm-border-strong); border-radius:12px; outline:0;
  box-shadow:inset 0 1px 2px rgba(16,24,40,.04);
  transition:border-color .12s ease, box-shadow .12s ease;
}
/* Custom themed caret on native selects (text inputs keep none) */
select.span12, select[class^="col-"], select[class*=" col-"], .row-fluid select{
  -webkit-appearance:none; appearance:none; padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%235B6472' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat; background-position:right 14px center; background-size:10px 6px;
}
select.span12:hover, select[class^="col-"]:hover, select[class*=" col-"]:hover, .row-fluid select:hover,
input[type=text].span12:hover, input[type=text][class^="col-"]:hover, .row-fluid input[type=text]:hover, .row-fluid input[type=number]:hover{
  border-color:#B8C3D8;
}
select.span12:focus, select[class^="col-"]:focus, select[class*=" col-"]:focus, .row-fluid select:focus,
input[type=text].span12:focus, input[type=text][class^="col-"]:focus, .row-fluid input[type=text]:focus, .row-fluid input[type=number]:focus{
  border-color:var(--wm-brand); box-shadow:0 0 0 3px var(--wm-brand-ring);
}

/* Icon picker (input + toggle .btn + dropdown icon list) stays a full-width group */
.row-fluid .input-group{ display:table; width:100%; }
.row-fluid .input-group input.form-control{ float:left; width:100%; border-top-right-radius:0; border-bottom-right-radius:0; }
.row-fluid .input-group .input-group-btn{ display:table-cell; vertical-align:middle; }
.row-fluid .input-group .input-group-btn .btn{ border-top-left-radius:0; border-bottom-left-radius:0; }

/* Variable-editor table  ( table[summary="Conditions"] ) — theme the chrome */
table[summary="Conditions"]{ width:100%; border-collapse:collapse; background:var(--wm-surface); }
table[summary="Conditions"] tr:first-child > th{
  padding:11px 14px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.02em;
  color:var(--wm-text-2); background:#F6F8FC; text-align:left; vertical-align:middle;
  border-bottom:1px solid var(--wm-border);
}
table[summary="Conditions"] tr:not(:first-child) > td{
  padding:12px 14px; background:var(--wm-surface); color:var(--wm-text-1); vertical-align:top;
  border-bottom:1px solid var(--wm-border);
}
table[summary="Conditions"] tr:nth-child(even) > td{ background:#F8FAFD; }
table[summary="Conditions"] tr:last-child > td{ border-bottom:0; }
table[summary="Conditions"] .badge, table[summary="Conditions"] .badge-inverse{
  display:inline-block; padding:2px 9px; font-size:11px; font-weight:600;
  color:var(--wm-brand); background:var(--wm-brand-soft); border-radius:8px; vertical-align:middle;
}
/* Catch-all: every text/select/number control inside the editor, whatever
   its exact class — guarantees the per-widget fields are themed */
table[summary="Conditions"] select, table[summary="Conditions"] input[type=text],
table[summary="Conditions"] input[type=number], table[summary="Conditions"] textarea{
  display:inline-block; width:100%; box-sizing:border-box; min-height:38px;
  padding:8px 12px; margin:0; font:inherit; font-size:14px; line-height:1.5;
  color:var(--wm-text-1); background-color:var(--wm-surface);
  border:1px solid var(--wm-border-strong); border-radius:12px; outline:0;
  box-shadow:inset 0 1px 2px rgba(16,24,40,.04); vertical-align:middle;
}
table[summary="Conditions"] select{
  -webkit-appearance:none; appearance:none; padding-right:34px; cursor:pointer;
  background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M1 1l4 4 4-4' fill='none' stroke='%235B6472' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat:no-repeat; background-position:right 14px center; background-size:10px 6px;
}
table[summary="Conditions"] select:hover, table[summary="Conditions"] input:hover,
table[summary="Conditions"] textarea:hover{ border-color:#B8C3D8; }
table[summary="Conditions"] select:focus, table[summary="Conditions"] input:focus,
table[summary="Conditions"] textarea:focus{ border-color:var(--wm-brand); box-shadow:0 0 0 3px var(--wm-brand-ring); }

/* Native color swatch — modern replacement for the jscolor box/popup */
.row-fluid input[type="color"],
table[summary="Conditions"] input[type="color"]{
  -webkit-appearance:none;appearance:none;width:100%;height:38px;padding:4px;box-sizing:border-box;
  border:1px solid var(--wm-border-strong);border-radius:12px;background:var(--wm-surface);cursor:pointer;
}
.row-fluid input[type="color"]:hover,
table[summary="Conditions"] input[type="color"]:hover{ border-color:#B8C3D8; }
.row-fluid input[type="color"]::-webkit-color-swatch-wrapper,
table[summary="Conditions"] input[type="color"]::-webkit-color-swatch-wrapper{ padding:3px; }
.row-fluid input[type="color"]::-webkit-color-swatch,
table[summary="Conditions"] input[type="color"]::-webkit-color-swatch{ border:none;border-radius:8px; }
.row-fluid input[type="color"]::-moz-color-swatch,
table[summary="Conditions"] input[type="color"]::-moz-color-swatch{ border:none;border-radius:8px; }
/* Action dropdown — grey button, white text (per-variable row, not the icon-picker toggle) */
table[summary="Conditions"] .btn-group .btn.dropdown-toggle{
  background:#6c757d;background-image:none;color:#fff;border:1px solid #6c757d;font-weight:600;
}
table[summary="Conditions"] .btn-group .btn.dropdown-toggle:hover,
table[summary="Conditions"] .btn-group .btn.dropdown-toggle:focus,
table[summary="Conditions"] .btn-group .btn.dropdown-toggle[aria-expanded="true"]{
  background:#5a6268;background-image:none;color:#fff;border-color:#5a6268;
}
table[summary="Conditions"] .btn-group .btn.dropdown-toggle .caret{ border-top-color:#fff; }

/* Manage Subscriptions list (table[summary="Node List"]): give the per-row "Action"
   dropdown the same grey/white treatment as the widget pages, and dim Expired rows. */
table[summary="Node List"] .btn-group .btn.dropdown-toggle{
  background:#6c757d;background-image:none;color:#fff;border:1px solid #6c757d;font-weight:600;
}
table[summary="Node List"] .btn-group .btn.dropdown-toggle:hover,
table[summary="Node List"] .btn-group .btn.dropdown-toggle:focus,
table[summary="Node List"] .btn-group .btn.dropdown-toggle[aria-expanded="true"]{
  background:#5a6268;background-image:none;color:#fff;border-color:#5a6268;
}
table[summary="Node List"] .btn-group .btn.dropdown-toggle .caret{ border-top-color:#fff; }
/* "Expired" subscriptions render as tr.enabled2 (status==2) — pale row + muted text */
table[summary="Node List"] tr.enabled2 td{ background:#F3F5F8; color:#8B96A6; }
table[summary="Node List"] tr.enabled2 td strong{ color:#8B96A6; }

/* --- Manage subscriptions: 3 top stat tiles (scoped to this page via .col-lg-12) ---
   The 3 .tile-stats cards use the "3-across" grid but render full-width here.  Make the
   row flex so the three split the width equally (robust against float/width conflicts).
   Scoping to .top_tiles.col-lg-12 leaves the topbar widget & kafka stats pages alone. */
.top_tiles.col-lg-12{ display:flex; flex-wrap:wrap; gap:10px; margin-right:0; margin-left:0; margin-bottom:10px; }
.top_tiles.col-lg-12 > .animated{ flex:1 1 0; min-width:0; padding-left:0; padding-right:0; }
.top_tiles.col-lg-12 > .animated > .tile-stats{ margin-bottom:0; }
/* Remove the oversized stat icon (default is a 60px glyph inside a 20x20 frame). */
.top_tiles.col-lg-12 .tile-stats .icon{ display:none; }
@media (max-width:600px){
  .top_tiles.col-lg-12 > .animated{ flex:1 1 100%; }
}

/* ==========================================================================
   14. Session-color overrides — placed LAST so they win the cascade.
   header.php injects an inline <style> (see "session-color overrides" in
   that file) that, once a dashboard's stored colours are set (defaults
   #2a3f54 / #f7f7f7 / #e7e7e7), force the dark-navy look with !important:

     body .container.body .right_col{ background:#f7f7f7 !important }
     .left_col{ background:#2a3f54 !important }
     body    { background:#2a3f54 !important }
     .nav.side-menu>li>a, .nav.child_menu>li>a{ color:#e7e7e7 !important }

   This stylesheet links AFTER that block (see header.php), so these
   equal-specificity !important declarations beat it. Kept together here so
   the theme stays authoritative over the legacy per-dashboard colours.
   Remove this 14th section to fall back to the stored per-dashboard colours.
   ========================================================================== */
body{ background:var(--wm-canvas) !important; }
body .container.body .right_col{ background:var(--wm-canvas) !important; }
.left_col{ background:var(--wm-sidebar) !important; }

.nav .side-menu > li > a,
.nav .child_menu > li > a{ color:var(--wm-text-2) !important; }
.nav .side-menu li.active > a,
.nav .child_menu li.active > a{ color:var(--wm-danger-deep) !important; } /* r5: darker active red */


/* ==========================================================================
   15. Phase-1+2 UI (2026-09-18): restyled top bar + device dashboard header/KPI
   --------------------------------------------------------------------------
   Phase 1 = restyled top bar (search pill + avatar group) and the regrouped
   sidebar (markup lives in topnav.php: .topnav-search / .topnav-avatar /
   .nav-group-label). Phase 2 = device dashboard header + 5 KPI cards (markup
   + data in the dashboard view/controller: .device-header / .kpi-row). Every
   value uses the --wm-* scale; the accent is brand indigo (the TARGET mock's
   red is a one-line swap of --wm-brand). Delete this 15th section to revert
   to the prior chrome.
   ========================================================================== */

/* 15.1 top bar: lay out the nav_menu row (hamburger | brand | search | user+bell) */
.top_nav .nav_menu > nav{ display:flex; align-items:center; gap:14px; }
/* Site brand (logo) — left of the fixed top bar, right after the hamburger. */
.topnav-brand{ flex:0 0 auto; display:flex; align-items:center; height:56px; }
.topnav-brand a{ display:flex; align-items:center; height:32px; }
.topnav-brand img{ height:30px; width:auto; max-width:150px; object-fit:contain; display:block; }
.topnav-search{
  flex:1; max-width:460px; display:flex; align-items:center; gap:8px;
  height:40px; padding:0 14px; border-radius:var(--wm-radius);
  background:var(--wm-surface-2); border:1px solid var(--wm-border);
  color:var(--wm-text-3); transition:border-color .15s, box-shadow .15s, background .15s;
}
.topnav-search:focus-within{
  background:var(--wm-surface); border-color:var(--wm-brand);
  box-shadow:0 0 0 3px var(--wm-brand-ring);
}
.topnav-search-ico{ font-size:13px; color:var(--wm-text-3); flex:0 0 auto; }
.topnav-search input{
  flex:1; min-width:0; border:0; outline:none; background:transparent;
  font-family:var(--wm-font); font-size:13px; color:var(--wm-text-1);
}
.topnav-search input::placeholder{ color:var(--wm-text-3); }
.top_nav .nav_menu ul.navbar-right{ display:flex; align-items:center; gap:10px; margin-left:auto; width:auto; float:none; }
.top_nav .nav_menu ul.navbar-right > li.dropdown{ order:-1; } /* bell before avatar */

/* 15.2 top bar avatar group: circular initial + name + chevron */
.user-profile.dropdown-toggle{ display:flex; align-items:center; height:56px; }
.topnav-avatar{
  width:30px; height:30px; border-radius:50%; flex:0 0 auto;
  display:flex; align-items:center; justify-content:center;
  background:#6B7280; color:#fff; font-size:13px; font-weight:700; /* r5: neutral grey (was indigo brand) */
  margin-right:8px;
}
.topnav-username{ font-size:13px; font-weight:600; color:var(--wm-text-1); margin-right:4px; }
.user-profile .fa-angle-down{ font-size:11px; color:var(--wm-text-3); margin-top:2px; }

/* 15.3 sidebar group labels (Phase 1 markup: .nav-group-label) */
.nav-group-label{
  padding:10px 14px 4px; font-size:11px; font-weight:700; letter-spacing:.6px;
  text-transform:uppercase; color:var(--wm-text-3);
}

/* 15.4 device dashboard header (Phase 2) */
.device-header{
  display:flex; align-items:center; gap:20px;
  padding:16px 18px; margin-bottom:16px;
  background:transparent; border:0; border-radius:0; box-shadow:none;
}
.device-header-main{ flex:0 1 auto; min-width:0; }
.device-header-title{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.device-title{ font-size:20px; font-weight:700; color:var(--wm-text-1); letter-spacing:-.3px; }
.online-dot{ width:9px; height:9px; border-radius:50%; background:var(--wm-success); flex:0 0 auto; box-shadow:0 0 0 3px var(--wm-success-soft); }
.online-dot.offline{ background:var(--wm-danger); box-shadow:0 0 0 3px var(--wm-danger-soft); }
.online-label{ font-size:12px; font-weight:600; }
.online-label.online{ color:var(--wm-success-ink); }
.online-label.offline{ color:var(--wm-danger-ink); }
.device-subtitle{ margin-top:6px; font-size:13px; color:var(--wm-text-3); }
.device-subtitle .sep{ margin:0 6px; color:var(--wm-border-strong); }
.device-header-right{ display:flex; flex-direction:column; align-items:flex-end; gap:12px; }
.time-range-pills{ display:flex; gap:6px; flex-wrap:wrap; }
.tr-pill{
  border:1px solid var(--wm-border); background:var(--wm-surface); color:var(--wm-text-2);
  font-family:var(--wm-font); font-size:12px; font-weight:600; padding:6px 12px;
  border-radius:999px; cursor:pointer; transition:all .15s;
}
.tr-pill:hover{ border-color:var(--wm-border-strong); color:var(--wm-text-1); }
.tr-pill.active{ background:var(--wm-danger-deep); border-color:var(--wm-danger-deep); color:#fff; } /* r5: was indigo */
/* 15.4b time-range pills in the 3-zone header (device dashboard) — red active accent */
.device-header-controls{ flex:1 1 auto; display:flex; justify-content:center; min-width:0; }
.date-range-pills{ display:flex; gap:6px; flex-wrap:wrap; }
.dr-pill{
  display:inline-flex; align-items:center; gap:6px;
  border:1px solid var(--wm-border-strong); background:var(--wm-surface); color:var(--wm-text-2);
  font-family:var(--wm-font); font-size:12px; font-weight:600; padding:7px 16px;
  border-radius:8px; cursor:pointer; transition:all .15s;   /* rounded square */
}
.dr-pill i.fa{ font-size:11px; }
.dr-pill:hover{ border-color:var(--wm-danger-strong); color:var(--wm-danger-strong); }
.dr-pill.active{ background:var(--wm-danger-deep); border-color:var(--wm-danger-deep); color:#fff; box-shadow:0 2px 8px rgba(183,28,28,.32); } /* r5: darker */
.last-update-box{
  display:flex; flex-direction:column; align-items:flex-start; gap:3px; padding:2px 0;
  background:transparent; border:0; border-radius:0; min-width:0;
}
.last-update-box .lu-head{ font-size:9px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--wm-text-3); }
.last-update-box .lu-time{ font-size:12px; font-weight:700; color:var(--wm-text-1); line-height:1.2; font-variant-numeric:tabular-nums; }
.last-update-box .lu-status{ display:flex; align-items:center; gap:6px; font-size:11px; font-weight:600; }
.lu-dot{ width:7px; height:7px; border-radius:50%; background:var(--wm-success); flex:0 0 auto; }
.lu-dot.stale{ background:var(--wm-text-3); }
.last-update-box .lu-status-txt{ color:var(--wm-success); }
.last-update-box.is-stale .lu-status-txt{ color:var(--wm-text-3); }
.last-update-box.is-stale .lu-time{ color:var(--wm-text-3); }

/* 15.5 device dashboard KPI row (Phase 2) */
.kpi-row{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:14px; margin-bottom:16px; }
.kpi-card{
  padding:12px 16px; background:var(--wm-surface); border:1px solid var(--wm-border);
  border-radius:var(--wm-radius); box-shadow:var(--wm-shadow-sm);
  transition:box-shadow .15s, transform .15s;
}
.kpi-card:hover{ box-shadow:var(--wm-shadow-lg); transform:translateY(-2px); }
.kpi-top{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.kpi-icon{
  flex:0 0 24px; width:24px;
  display:flex; align-items:center; justify-content:center;
  background:transparent; color:var(--wm-danger-strong); font-size:22px;
}
.kpi-icon .fa-leaf{ color:var(--wm-success); }
.kpi-label{ font-size:12px; font-weight:600; color:var(--wm-text-3); }
.kpi-value{ display:flex; align-items:baseline; gap:6px; margin-left:32px; }
.kpi-num{ font-size:28px; font-weight:700; color:var(--wm-text-1); letter-spacing:-.5px; }
.kpi-num.muted{ color:var(--wm-text-3); font-weight:600; }
/* unit qualifiers (kW/kWh/MWh/%) — black to sit with the value */
.kpi-unit{ font-size:18px; font-weight:600; color:var(--wm-text-1); }
.kpi-sub{ margin-top:4px; margin-left:32px; font-size:12px; color:var(--wm-text-3); }
/* The linear target bar + "Remaining: X kWh" line sit on the Expected Achieved
   tile (tile.bar); all other tiles are value + sub only. */
.kpi-progress{ margin-top:4px; margin-left:32px; height:8px; background:var(--wm-surface-3); border-radius:999px; overflow:hidden; }
.kpi-progress-fill{ height:100%; background:var(--wm-danger-strong); border-radius:999px; }
.kpi-remaining{ margin-top:4px; margin-left:32px; font-size:12px; color:var(--wm-text-3); }
/* Forecast-irradiance line on the Expected Today tile (tile.forecast): a small
   cloud icon + "X.X kWh/m²" — the POA forecast the kWh estimate is built from.
   Shows only when the tile has forecast data (ng-show in the view); aligned to
   the same 32px left offset as value/sub/remaining. */
.kpi-forecast{ margin-top:4px; margin-left:32px; display:flex; align-items:center; gap:5px; font-size:13px; color:var(--wm-text-3); }
.kpi-forecast .fa-cloud{ font-size:12px; color:var(--wm-text-3); }
.kpi-forecast-num{ font-size:13px; font-weight:600; color:var(--wm-text-1); }
.kpi-forecast-unit{ font-size:11px; color:var(--wm-text-3); }
/* "· Forecast" tag on the same line as the irradiance value (solar_generation
   Expected tile): muted, small — sits inline after the kWh/m² unit. */
.kpi-forecast-tag{ font-size:11px; font-weight:600; color:var(--wm-text-3); }
/* Donut/pie WAS on the Expected Achieved tile (conic-gradient arc via ng-style,
   card-coloured centre hole). REMOVED from the view in 20260923d — these rules
   are now dead but kept harmlessly. */
.kpi-pie{ position:relative; margin-top:8px; margin-left:32px; width:48px; height:48px; border-radius:50%; }
.kpi-pie-hole{ position:absolute; top:9px; left:9px; right:9px; bottom:9px; border-radius:50%; background:var(--wm-surface); }

/* 15.6 responsive */
@media (max-width:1200px){ .kpi-row{ grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:860px){
  .kpi-row{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .device-header{ flex-direction:column; align-items:stretch; gap:12px; }
  .device-header-controls{ justify-content:flex-start; }
  .device-header-right{ align-items:flex-start; }
}
@media (max-width:560px){
  .kpi-row{ grid-template-columns:1fr; }
  .topnav-username{ display:none; }
  .topnav-search{ max-width:none; }
}

/* ==========================================================================
   15.7 Top-bar breadcrumb + right cluster & device-dashboard header
       refinements (2026-09-18e):
       (a) top bar: "Wattmon" logo -> "Sites > <site>" breadcrumb (left) and
           search + bell + user clustered on the right;
       (b) date-range pills rendered as ONE joined segmented control;
       (c) vertical divider separating the live-data box from the date-range
           pills.
       Appended last in the file so these win the cascade over §15.1 / §15.4b.
       Delete this section to revert.
   ========================================================================== */

/* (a) top bar: breadcrumb replaces the old logo; search/bell/user cluster right */
.topnav-brand{ flex:0 0 auto; display:flex; align-items:center; gap:8px; height:56px; }
.topnav-brand .wm-crumb-root{ font-size:13px; font-weight:600; color:var(--wm-text-2); text-decoration:none; }
.topnav-brand .wm-crumb-root:hover{ color:var(--wm-brand); }
.topnav-brand .wm-crumb-sep{ color:var(--wm-text-3); font-size:12px; display:inline-flex; }
.topnav-brand .wm-crumb-site{ font-size:14px; font-weight:700; color:var(--wm-text-1); }
/* push the search field (and the bell + user that follow it) to the right edge */
.topnav-search{ flex:0 0 auto; width:300px; margin-left:auto; }
.top_nav .nav_menu ul.navbar-right{ margin-left:auto; }

/* (b) date-range pills = ONE joined segmented control (shared borders, no gaps) */
.date-range-pills{ display:inline-flex; align-items:stretch; gap:0; border:1px solid var(--wm-border-strong); border-radius:8px; overflow:hidden; background:var(--wm-surface); }
.dr-pill{ border:0; border-left:1px solid var(--wm-border-strong); border-radius:0; box-shadow:none; }
.dr-pill:first-child{ border-left:0; }
.dr-pill:hover{ background:var(--wm-surface-2); color:var(--wm-danger-strong); }
.dr-pill.active{ box-shadow:none; }

/* (c) vertical divider between the live-data box and the date-range pills */
.device-header-right{ align-self:stretch; justify-content:center; border-left:1px solid var(--wm-border); padding-left:18px; }

/* small screens: drop the divider + let the search field fill the width */
@media (max-width:860px){
  .device-header-right{ border-left:0; padding-left:0; align-self:auto; }
  .topnav-search{ width:auto; }
}
@media (max-width:560px){
  .topnav-search{ width:100%; }
}

/* alert count bubble -> app red (crimson), 2026-09-18;
   r6: !important + border kill — legacy custom.css `.bg-green{...!important}` (the
   badge's markup class) beats this rule otherwise: teal #1ABB9C bg+border ("light blue") */
.top_nav .info-number .badge{ background:var(--wm-danger-strong) !important; border:0 !important; color:#fff; }

/* ==========================================================================
   15.8 Sidebar logo band + full-height sidebar (2026-09-21, rounds 3-4):
       (a) the logo sits flush at y=0 in the TOP-LEFT CORNER: the sidebar's
           legacy .navbar.nav_title band (§7: sidebar-grey bg, full-band
           logo) is the FIRST child of the column and, with the r4
           de-padding (§3: no padding-top on the outer left_col), it fills
           the corner; the fixed bar starts beside it at x=230 (md) /
           x=70 (sm), so the empty grey strip behind the bar is gone;
       (b) the top-bar strip (.topnav-logo-strip, topnav.php) is hidden on
           desktop (the band carries the logo) and only renders on mobile
           <=991px, where the base stylesheet hides the sidebar + band;
       (c) full-height column: outer left_col pinned to 100vh (§3), inner
           scrolls natively, sidebar-footer seam removed (§2).
       Appended last in the file so these win the cascade over earlier
       sections.  To revert, delete this section + the §3 fixed-column
       rule + the §3 top_nav offset rules + the token bump.
   ========================================================================== */

/* (a)+(b) desktop: the band (styled in §7) carries the logo, so hide the
   top-bar strip in both modes. */
body.nav-md .topnav-logo-strip, body.nav-sm .topnav-logo-strip{ display:none; }

/* the empty spacer <br/> under the band: gone in the flat design (all
   modes; the mobile sidebar is hidden anyway). */
body .left_col.scroll-view > br{ display:none; }

/* the strip itself: a grey band matching the sidebar, centred logo; its
   right border continues the sidebar edge line (mobile only now). */
.topnav-logo-strip{
  flex:0 0 230px; width:230px; height:56px;
  background:var(--wm-sidebar);
  display:flex; align-items:center; justify-content:center;
  padding:0 14px;
  border-right:1px solid var(--wm-border);
}
.topnav-logo-strip a{ display:block; }
.topnav-logo-strip img{ display:block; height:34px; width:auto; max-width:100%; object-fit:contain; }

/* Mobile (<=991px): the sidebar + band are hidden by the base stylesheet,
   so the strip is the only logo — show it, smaller. */
@media (max-width:991px){
  body.nav-md .topnav-logo-strip, body.nav-sm .topnav-logo-strip{ display:flex; }
  .topnav-logo-strip{ flex-basis:180px; width:180px; }
}
@media (max-width:560px){
  .topnav-logo-strip{ flex-basis:140px; width:140px; }
  .topnav-logo-strip img{ height:24px; }
}

/* ==========================================================================
   16. r7 (2026-09-21): top-bar date-range control rework
       (a) 7d/30d pills dropped (markup change in views/dashboard.php);
       (b) < / > one-day nav buttons + selected-date read-out (MM/DD/YY)
           added as extra segments of the joined segmented control (§15.7b);
       (c) the top-bar UI is a live read-out of the TopNavCtrl scope state
           that the DateRange widget drives (scope.setDate) — the widget view
           is unchanged; sync is a $watchCollection in dashboard.php.
       Delete this section + the r7 markup/JS in views/dashboard.php to revert.
   ========================================================================== */

/* (b) square-ish day-nav segments inside the joined pill control */
.dr-pill.dr-daynav{ padding:7px 11px; }
.dr-pill.dr-daynav i.fa{ font-size:13px; }
/* (b) selected-date read-out: a non-button segment (no hover), tabular digits */
.dr-date-label{
  display:inline-flex; align-items:center;
  padding:7px 12px; font-size:12px; font-weight:700; letter-spacing:.02em;
  color:var(--wm-text-1); font-variant-numeric:tabular-nums; white-space:nowrap;
  border-left:1px solid var(--wm-border-strong);
}

/* ==========================================================================
   17. r8 (2026-09-22) — breadcrumb moved INTO the fixed top bar
   The page-level second-row breadcrumb (was `ul.breadcrumb` in header.php)
   now renders in the top bar via topnav.php .topnav-brand (new .wm-crumb-link
   intermediate links + .wm-crumb-leaf active leaf, alongside the existing
   .wm-crumb-root "Home"/"Sites" root and .wm-crumb-sep separators).
   This block only constrains the brand cell so a long breadcrumb can't blow
   the bar out; it is additive and safe to delete (revert to token p).
   ========================================================================== */

/* give the brand cell a bounded width so a long crumb truncates, not reflows */
.topnav-brand{ min-width:0; max-width:44vw; overflow:hidden; }

/* intermediate breadcrumb links (e.g. "Manage Wattmons" parent items) */
.topnav-brand .wm-crumb-link{
  font-size:13px; font-weight:500; color:var(--wm-text-2);
  text-decoration:none; white-space:nowrap;
}
.topnav-brand .wm-crumb-link:hover{ color:var(--wm-brand); }

/* active leaf: heavier + ellipsis so a long last item never overflows */
.topnav-brand .wm-crumb-leaf{
  font-size:14px; font-weight:700; color:var(--wm-text-1);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0;
}

/* on phones, let the brand expand (crumb is the primary nav context) */
@media (max-width:991px){
  .topnav-brand{ flex:1 1 auto; max-width:none; }
}

/* ===================== Plant Status widget (ps-*) =====================
   Per-inverter status: online/offline (voltage presence), active power (kW),
   energy (kWh, today or period via counter diff) and fault latches, plus a
   "No active faults" summary. The KPI strip reuses .kpi-* cards; only the
   table + pill/badge styles below are new. Reuses the --wm-* tokens so it
   tracks the live light theme. */
/* Card wrapper: mirrors the framework's .x_panel card (same --wm-* tokens) so
   Plant Status looks like every other widget. Its widget type has icon='none',
   so the dashboard's else-branch never wraps it in .x_panel — this self-contained
   card restores the thin rounded border + shadow the other widgets get. */
.ps-card{
  background:var(--wm-surface);
  border:1px solid var(--wm-border);
  border-radius:var(--wm-radius);
  box-shadow:var(--wm-shadow-sm);
  padding:16px;
  margin:0 0 18px;
  transition:box-shadow .2s ease, border-color .2s ease;
}
.ps-card:hover{ box-shadow:var(--wm-shadow); border-color:var(--wm-border-strong); }
/* Card title bar: this widget's icon is 'none', so the framework's .x_panel/.x_title
   header is skipped for it — this self-rendered title mirrors .x_panel .x_title so the
   title ("Plant Status" or a custom widget title) still shows at the top of the card. */
.ps-card .ps-title{
  border-bottom:1px solid var(--wm-border);
  padding:0 0 12px;
  margin:0 0 14px;
}
.ps-card .ps-title h2{
  font-size:15px;
  font-weight:600;
  color:var(--wm-text-1);
  margin:0;
  line-height:1.35;
}
.ps-card .ps-wrap{ padding:0; }
.ps-wrap{ padding:4px 2px 2px; }

/* Plant-status header: overall health dot + "X / X Inverters Online" +
   "Plant operating normally" / "Plant fault detected" (above the KPI strip). */
.ps-header{ margin-top:2px; }
.ps-status{ display:flex; align-items:flex-start; gap:9px; }
.ps-dot{ flex:0 0 auto; width:11px; height:11px; border-radius:50%; margin-top:5px; background:var(--wm-surface-3); }
.ps-dot.ok{ background:var(--wm-success); }
.ps-dot.bad{ background:var(--wm-danger); }
.ps-status-text{ min-width:0; }
.ps-status-main{ font-size:15px; font-weight:650; color:var(--wm-text-1); line-height:1.25; }
.ps-status-sub{ margin-top:2px; font-size:13px; color:var(--wm-text-3); }
.ps-status-sub.bad{ color:var(--wm-danger-ink); }

/* per-inverter snapshot table */
.ps-table{ width:100%; border-collapse:collapse; margin-top:14px; font-size:13.5px; }
.ps-table thead th{
  text-align:left; font-weight:600; color:var(--wm-text-3); font-size:11.5px;
  letter-spacing:.03em; text-transform:uppercase; padding:7px 12px;
  border-bottom:1px solid var(--wm-border);
}
.ps-table tbody tr{ border-bottom:1px solid var(--wm-border); }
.ps-table tbody tr:last-child{ border-bottom:none; }
.ps-table td{ padding:11px 12px; vertical-align:middle; }
/* per-inverter row: status dot (green=online / red=offline) left of the name
   — replaces the old Status column pill + Serial column (2026-10-05). */
.ps-inv-cell{ display:flex; align-items:center; gap:8px; min-width:0; }
.ps-inv-dot{ flex:0 0 auto; width:9px; height:9px; border-radius:50%; background:var(--wm-surface-3); }
.ps-inv-dot.ok{ background:var(--wm-success); }
.ps-inv-dot.off{ background:var(--wm-danger); }
.ps-inv-name{ display:block; white-space:nowrap; font-weight:650; font-size:14px; color:var(--wm-text-1); }
.ps-inv-sub{ display:block; margin-top:2px; font-size:11.5px; color:var(--wm-text-3); }
.ps-serial{ color:var(--wm-text-2); font-family:monospace; font-size:12.5px; }
.ps-table td:last-child{ white-space:nowrap; }

/* online / offline status pill */
.ps-badge{
  display:inline-block; padding:3px 10px; border-radius:999px;
  font-size:12px; font-weight:600; line-height:1.2;
}
.ps-badge.ok{ color:var(--wm-success-ink); background:var(--wm-success-soft); }
.ps-badge.off{ color:var(--wm-text-3); background:var(--wm-surface-3); }

/* fault cell: 'No faults' / 'Fault detected' + decoded detail */
.ps-fault{ display:inline-block; font-weight:600; font-size:12.5px; }
.ps-fault.ok{ color:var(--wm-success-ink); }
.ps-fault.bad{ color:var(--wm-danger-ink); }
.ps-fault-detail{ display:block; margin-top:3px; font-size:11.5px; color:var(--wm-text-2); }

/* "No active faults" / "N active fault(s)" summary line */
.ps-summary{ margin-top:14px; padding:11px 14px; border-radius:var(--wm-radius-sm);
  background:var(--wm-success-soft); color:var(--wm-success-ink);
  font-weight:600; font-size:13.5px; }
.ps-summary .bad{ color:var(--wm-danger-ink); }
.ps-summary .fa-check-circle, .ps-summary .fa-exclamation-circle{ margin-right:4px; }

/* empty + fault KPI number emphasis */
.ps-empty{ margin-top:12px; color:var(--wm-text-3); font-size:13px; }
.ps-kpi .kpi-num.bad{ color:var(--wm-danger-ink); }

@media (max-width:560px){
  .ps-table{ font-size:12.5px; }
  .ps-table td{ padding:9px 8px; }
}

/* ============================================================
   Solar Conditions (Forecast) widget — titled card with a 3-column
   metric strip (Irradiance kWh/m2 / Cloud Cover % / Expected
   Generation kWh). Reuses the .ps-card/.ps-title/.ps-wrap shell so
   it matches Plant Status; the sun-icon title + metric strip below
   are new. Reuses the --wm-* tokens so it tracks the live theme. */
/* Sun icon in the card title (fa fa-sun). */
.sc-sun{ color:#f5a623; margin-right:7px; font-size:14px; }
/* 3-column metric strip: one column per metric (Irradiance / Cloud /
   Expected Generation). Collapses to a single column on narrow screens. */
.sc-metrics{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; margin-top:2px; }
.sc-metric{ min-width:0; }
/* Big value + small unit on one baseline-aligned line. A metric with no data
   renders muted (the dash placeholder text + dimmed color) via .muted. */
.sc-metric-value{ display:flex; align-items:baseline; gap:6px; font-size:26px; font-weight:750;
  color:var(--wm-text-1); letter-spacing:-.4px; line-height:1.1; }
.sc-metric-value.muted{ color:var(--wm-text-3); font-weight:600; }
.sc-metric-unit{ font-size:14px; font-weight:600; color:var(--wm-text-2); }
.sc-metric-value.muted .sc-metric-unit{ color:var(--wm-text-3); }
/* Muted label beneath the value. */
.sc-metric-label{ margin-top:6px; font-size:12px; font-weight:600; color:var(--wm-text-3); }
@media (max-width:560px){
  .sc-metrics{ grid-template-columns:1fr; gap:12px; }
  .sc-metric-value{ font-size:24px; }
}

/* ============================================================
   15. Dashboard widget grid — persistent vertical "lanes"
   dashboard.php groups clean identical-row runs into col lanes
   (.dash-lane = a full-height column, .dash-lane-item = one widget),
   so a short widget no longer leaves white space below it.
   ============================================================ */
.dash-lane-item{ margin-bottom:14px; }
.dash-lane-item:last-child{ margin-bottom:0; }
.dash-lane-item > .x_panel{ margin-bottom:0; }  /* uniform gap inside a lane */

/* ============================================================
   Energy Performance widget — self-render card: header (title +
   7d/30d/12mo/all segmented control) over a 2-column body (left =
   total + average stat blocks with delta-vs-previous-period, right =
   an ECharts generation bar chart). Reuses the .ps-card shell +
   --wm-* tokens (like Plant Status / Solar Conditions); the maroon
   accent is hard-coded (#8b1e2e) to match the mockup. */
.ep-head{ display:flex; align-items:center; justify-content:space-between; gap:14px;
  border-bottom:1px solid var(--wm-border); padding:0 0 12px; margin:0 0 14px; flex-wrap:wrap; }
.ep-head h2{ font-size:15px; font-weight:600; color:var(--wm-text-1); margin:0; line-height:1.35; }
.ep-dev{ margin-left:6px; font-size:12px; font-weight:600; color:var(--wm-text-3); }
/* segmented period control: 7 Days / 30 Days / 12 Months / All Time */
.ep-seg{ display:inline-flex; align-items:center; gap:2px; padding:3px;
  background:var(--wm-surface-3); border-radius:9px; }
.ep-seg button{ border:0; background:transparent; cursor:pointer; padding:5px 11px;
  border-radius:7px; font-size:12.5px; font-weight:600; color:var(--wm-text-2);
  transition:background .15s ease, color .15s ease; white-space:nowrap; }
.ep-seg button:hover{ color:var(--wm-text-1); }
.ep-seg button.active{ background:#8b1e2e; color:#fff; box-shadow:0 1px 3px rgba(139,30,46,.4); }
/* body: left stats column + right chart column */
.ep-body{ display:grid; grid-template-columns:220px 1fr; gap:18px; align-items:stretch; }
.ep-stats{ display:flex; flex-direction:column; gap:0; min-width:0; }
.ep-stat{ padding:4px 0 14px; border-bottom:1px solid var(--wm-border); }
.ep-stat:last-child{ border-bottom:none; padding-bottom:4px; }
.ep-stat-num{ font-size:27px; font-weight:750; color:var(--wm-text-1); letter-spacing:-.4px;
  line-height:1.1; font-variant-numeric:tabular-nums; }
.ep-stat-label{ margin-top:4px; font-size:12px; font-weight:600; color:var(--wm-text-3); }
/* delta vs previous period: green up / red down / neutral dash */
.ep-delta{ margin-top:8px; font-size:13px; font-weight:700; line-height:1; }
.ep-delta.up{ color:var(--wm-success-ink); }
.ep-delta.down{ color:var(--wm-danger-ink); }
.ep-delta.flat{ color:var(--wm-text-3); }
.ep-delta-sub{ margin-top:3px; font-size:11px; font-weight:500; color:var(--wm-text-3); }
/* chart column + empty-state overlay */
.ep-chartwrap{ position:relative; min-width:0; }
.ep-chart{ width:100%; height:260px; }
.ep-nodata{ position:absolute; top:0; left:0; right:0; bottom:0; display:flex;
  align-items:center; justify-content:center; color:var(--wm-text-3);
  font-size:13px; font-weight:600; background:var(--wm-surface); pointer-events:none; }
.ep-loading{ position:absolute; top:0; left:0; right:0; bottom:0; display:flex;
  align-items:center; justify-content:center; color:var(--wm-text-3);
  font-size:13px; font-weight:600; background:var(--wm-surface); pointer-events:none; }
@media (max-width:900px){
  .ep-body{ grid-template-columns:1fr; }
  .ep-stats{ flex-direction:row; gap:16px; }
  .ep-stat{ flex:1 1 0; border-bottom:none; border-right:1px solid var(--wm-border); padding:4px 16px 4px 0; }
  .ep-stat:last-child{ border-right:none; padding-right:0; }
}
@media (max-width:560px){
  .ep-head{ flex-direction:column; align-items:flex-start; }
  .ep-seg{ width:100%; }
  .ep-seg button{ flex:1 1 0; }
  .ep-stats{ flex-direction:column; gap:0; }
  .ep-stat{ border-right:none; border-bottom:1px solid var(--wm-border); padding:4px 0 14px; }
  .ep-stat:last-child{ border-bottom:none; }
  .ep-chart{ height:220px; }
}

/* Dashboard switcher tabs (multiple dashboards per device) */
.dash-switch-tabs{
  margin-bottom:12px;
  border-bottom:2px solid var(--wm-border);
  display:flex; gap:0;
}
.dash-switch-tabs li{
  margin-bottom:-2px;
}
.dash-switch-tabs li a{
  display:inline-block;
  padding:6px 14px 8px;
  border:1px solid transparent;
  border-radius:6px 6px 0 0;
  font-size:13px;
  color:var(--wm-text);
  text-decoration:none;
  transition:background .15s, color .15s;
}
.dash-switch-tabs li a:hover{
  background:rgba(99,102,241,.06);
  color:var(--wm-accent);
}
.dash-switch-tabs li.active a{
  background:#fff;
  color:var(--wm-accent);
  font-weight:600;
  border-color:var(--wm-border);
  border-bottom-color:#fff;
}
@media (max-width:600px){
  .dash-switch-tabs{ overflow-x:auto; }
  .dash-switch-tabs li a{ white-space:nowrap; padding:5px 10px 7px; font-size:12px; }
}
