/* =============================================================================
 * common.css — Unified WMS Design System
 * Plain CSS — no Tailwind required.
 * Load on every site: <link rel="stylesheet" href="/shared-ui/common.css">
 * =============================================================================
 *
 * Sections:
 *   1. Google Fonts
 *   2. CSS Variables (:root)
 *   3. Base reset & global styles
 *   4. Components
 *   5. Utilities
 * ============================================================================= */

/* ── 1. Google Fonts ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Lato:ital,wght@0,300;0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── 2. CSS Variables ────────────────────────────────────────────────────── */
:root {
  /* Fonts */
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body:    'Lato', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

    /* Ink */
    --wms-ink:       #1c0f00;
    --wms-ink2:      #3d1a00;
    --wms-ink3:      #5c2d00;
    --wms-muted:     #7a3d00;
    --wms-faint:     #a05a00;
    --wms-subtle:    #c8a060;

    /* Brand */
    --wms-gold:      #d97706;
    --wms-gold-dk:   #b45309;
    --wms-gold-xdk:  #92400e;
    --wms-amber:     #b45309;

    /* Surfaces */
    --wms-surface:   rgba(255, 252, 235, 0.72);
    --wms-surface-2: rgba(255, 250, 220, 0.55);
    --wms-surface-3: rgba(255, 255, 255, 0.55);

    /* Borders */
    --wms-line:      rgba(180, 110, 0, 0.18);
    --wms-line-md:   rgba(180, 110, 0, 0.28);
    --wms-line-str:  rgba(180, 83, 9, 0.40);

    /* Status */
    --wms-green:     #15803d;
    --wms-green-l:   rgba(21, 128, 61, 0.10);
    --wms-red:       #b91c1c;
    --wms-red-l:     rgba(185, 28, 28, 0.10);
    --wms-amber-l:   rgba(180, 83, 9, 0.10);
    --wms-teal:      #0c7a6e;
    --wms-teal-l:    rgba(12, 122, 110, 0.10);
    --wms-blue:      #1d4ed8;
    --wms-blue-l:    rgba(29, 78, 216, 0.09);
    --wms-purple:    #6d28d9;
    --wms-purple-l:  rgba(109, 40, 217, 0.09);

    /* Shadows */
    --wms-shadow-sm: 0 4px 16px rgba(120,70,0,0.08), inset 0 1px 0 rgba(255,255,255,0.70);
    --wms-shadow-md: 0 4px 24px rgba(120,70,0,0.09), inset 0 1px 0 rgba(255,255,255,0.70);
    --wms-shadow-lg: 0 8px 32px rgba(120,70,0,0.10), inset 0 1px 0 rgba(255,255,255,0.75);

    /* Radius */
    --wms-r-sm: 0.5rem;
    --wms-r-md: 0.75rem;
    --wms-r-lg: 1rem;
    --wms-r-xl: 1.25rem;

    /* Layout */
    --wms-max-w:     75rem;
    --wms-sidebar-w: 16rem;

    /* Transitions */
    --wms-t-fast: 0.14s ease;
    --wms-t-base: 0.20s ease;
    --wms-t-slow: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }

/* ── 3. Base Reset & Global Styles ──────────────────────────────────────── */
*,
  *::before,
  *::after { box-sizing: border-box; }

  html {
    scroll-behavior: smooth;
    min-height: 100vh;
    min-height: 100dvh;
  }

  body {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-wms-ink);
    background:
      linear-gradient(135deg, #fffbeb 0%, #fef3c7 30%, #fde8c8 65%, #fffdf0 100%)
      fixed;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1, h2, h3, .font-display {
    font-family: var(--font-display);
  }

  code, pre, .font-mono, .wms-mono {
    font-family: var(--font-mono);
  }

  /* Gold focus ring (accessibility) */
  :focus-visible {
    outline: 2px solid rgba(217,119,6,0.65);
    outline-offset: 2px;
  }

  /* Slim gold scrollbars */
  ::-webkit-scrollbar       { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: rgba(180,110,0,0.30); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: rgba(180,83,9,0.50); }

  @media print {
    .wms-sidebar, .wms-admin-banner, #wms-toast, .wms-bg-blobs { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
    .wms-glass { box-shadow: none !important; border: 1px solid #ddd !important; }
  }

/* ── 4. Components ───────────────────────────────────────────────────────── */
/* ════════════════════════════════════════════════════════════
     1. CSS DESIGN TOKENS (custom properties — consumed by JS
        and inline style="" where Tailwind classes can't reach)
     ════════════════════════════════════════════════════════════ */


  /* ════════════════════════════════════════════════════════════
     2. AMBIENT BACKGROUND BLOBS
     ════════════════════════════════════════════════════════════ */
  .wms-bg-blobs {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
  }
  .wms-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.85;
  }
  .wms-blob-1 {
    width: 28rem; height: 28rem;
    top: -8rem; left: -5rem;
    background: radial-gradient(ellipse, rgba(251,191,36,0.22) 0%, transparent 70%);
  }
  .wms-blob-2 {
    width: 22rem; height: 22rem;
    bottom: 0; right: -4rem;
    background: radial-gradient(ellipse, rgba(234,88,12,0.12) 0%, transparent 70%);
  }
  .wms-blob-3 {
    width: 18rem; height: 18rem;
    top: 50%; left: 33%;
    background: radial-gradient(ellipse, rgba(253,224,71,0.18) 0%, transparent 70%);
  }

  /* ════════════════════════════════════════════════════════════
     3. GLASS CARDS
     ════════════════════════════════════════════════════════════ */
  .wms-glass {
    background: var(--wms-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-r-lg);
    box-shadow: var(--wms-shadow-md);
  }
  .wms-glass-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    background: rgba(255,250,225,0.65);
    border-bottom: 1px solid var(--wms-line);
    border-radius: var(--wms-r-lg) var(--wms-r-lg) 0 0;
  }
  .wms-glass-head-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--wms-ink2);
  }
  .wms-glass-head-link {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wms-gold-dk);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.8;
    transition: opacity var(--wms-t-fast);
  }
  .wms-glass-head-link:hover { opacity: 1; text-decoration: underline; }

  /* ════════════════════════════════════════════════════════════
     4. INPUTS & FORM CONTROLS
     ════════════════════════════════════════════════════════════ */
  .wms-input {
    background: rgba(255,255,255,0.80);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(180,110,0,0.30);
    color: var(--wms-ink);
    border-radius: var(--wms-r-md);
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    width: 100%;
    transition: all var(--wms-t-base);
  }
  .wms-input:focus {
    outline: none;
    border-color: rgba(217,119,6,0.65);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
    background: rgba(255,255,255,0.96);
  }
  .wms-input::placeholder { color: var(--wms-faint); }
  .wms-input.error,
  .wms-select.error {
    border-color: rgba(220,38,38,0.65) !important;
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12) !important;
  }

  .wms-select {
    background: rgba(255,255,255,0.80);
    border: 1px solid rgba(180,110,0,0.30);
    color: var(--wms-ink);
    border-radius: var(--wms-r-md);
    padding: 0.7rem 1rem;
    font-size: 0.875rem;
    font-family: inherit;
    width: 100%;
    transition: all var(--wms-t-base);
    cursor: pointer;
  }
  .wms-select:focus {
    outline: none;
    border-color: rgba(217,119,6,0.65);
    box-shadow: 0 0 0 3px rgba(217,119,6,0.12);
  }

  .wms-textarea { resize: vertical; min-height: 6rem; }

  .wms-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wms-muted);
    margin-bottom: 0.38rem;
  }
  .wms-field-error {
    font-size: 0.72rem;
    color: var(--wms-red);
    margin-top: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
  }

  /* ════════════════════════════════════════════════════════════
     5. BUTTONS
     ════════════════════════════════════════════════════════════ */
  .wms-btn-gold {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.35rem;
    border-radius: var(--wms-r-md);
    font-size: 0.875rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(180,83,9,0.30), inset 0 1px 0 rgba(255,255,255,0.20);
    text-decoration: none;
    transition: all var(--wms-t-base);
  }
  .wms-btn-gold:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    box-shadow: 0 6px 20px rgba(180,83,9,0.38), inset 0 1px 0 rgba(255,255,255,0.25);
    transform: translateY(-1px);
  }
  .wms-btn-gold:active  { transform: translateY(0); }
  .wms-btn-gold:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

  .wms-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--wms-r-md);
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: var(--wms-surface);
    border: 1px solid var(--wms-line-md);
    color: var(--wms-ink2);
    text-decoration: none;
    transition: all var(--wms-t-fast);
    backdrop-filter: blur(8px);
  }
  .wms-btn-ghost:hover { background: rgba(217,119,6,0.09); border-color: var(--wms-line-str); }

  .wms-btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--wms-r-md);
    font-size: 0.84rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: var(--wms-red-l);
    border: 1px solid rgba(185,28,28,0.28);
    color: var(--wms-red);
    text-decoration: none;
    transition: all var(--wms-t-fast);
  }
  .wms-btn-danger:hover { background: rgba(185,28,28,0.16); border-color: rgba(185,28,28,0.45); }

  .wms-btn-success {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--wms-r-md);
    font-size: 0.84rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    background: var(--wms-green-l);
    border: 1px solid rgba(21,128,61,0.28);
    color: var(--wms-green);
    text-decoration: none;
    transition: all var(--wms-t-fast);
  }
  .wms-btn-success:hover { background: rgba(21,128,61,0.16); border-color: rgba(21,128,61,0.45); }

  .wms-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem; height: 2rem;
    border-radius: var(--wms-r-sm);
    font-size: 0.82rem;
    border: 1px solid var(--wms-line);
    background: var(--wms-surface);
    color: var(--wms-muted);
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all var(--wms-t-fast);
    flex-shrink: 0;
  }
  .wms-btn-icon:hover { background: rgba(217,119,6,0.10); color: var(--wms-gold-dk); border-color: var(--wms-line-md); }

  /* Motor control buttons */
  .nv-motor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.25rem;
    border-radius: var(--wms-r-md);
    font-size: 0.84rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: all var(--wms-t-base);
    flex: 1;
  }
  .nv-motor-btn:disabled { opacity: 0.42; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
  .nv-motor-btn-on  { background: linear-gradient(135deg,#16a34a,#15803d); color:#fff; box-shadow: 0 4px 14px rgba(21,128,61,0.28); }
  .nv-motor-btn-on:hover:not(:disabled)  { filter:brightness(1.08); transform:translateY(-1px); box-shadow: 0 6px 18px rgba(21,128,61,0.36); }
  .nv-motor-btn-off { background: linear-gradient(135deg,#dc2626,#b91c1c); color:#fff; box-shadow: 0 4px 14px rgba(185,28,28,0.26); }
  .nv-motor-btn-off:hover:not(:disabled) { filter:brightness(1.08); transform:translateY(-1px); box-shadow: 0 6px 18px rgba(185,28,28,0.34); }

  /* ════════════════════════════════════════════════════════════
     6. CHIPS & BADGES
     ════════════════════════════════════════════════════════════ */
  .wms-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
    line-height: 1.3;
  }
  .wms-chip-online  { background: var(--wms-green-l);              color: var(--wms-green);  border-color: rgba(21,128,61,0.22); }
  .wms-chip-offline { background: rgba(120,90,0,0.08);             color: var(--wms-faint);  border-color: rgba(120,90,0,0.14); }
  .wms-chip-warn    { background: var(--wms-amber-l);              color: var(--wms-amber);  border-color: rgba(180,83,9,0.22); }
  .wms-chip-danger  { background: var(--wms-red-l);                color: var(--wms-red);    border-color: rgba(185,28,28,0.22); }
  .wms-chip-info    { background: rgba(14,165,233,0.10);           color: #0369a1;           border-color: rgba(14,165,233,0.25); }
  .wms-chip-blue    { background: var(--wms-blue-l);               color: var(--wms-blue);   border-color: rgba(29,78,216,0.20); }
  .wms-chip-teal    { background: var(--wms-teal-l);               color: var(--wms-teal);   border-color: rgba(12,122,110,0.20); }
  .wms-chip-purple  { background: var(--wms-purple-l);             color: var(--wms-purple); border-color: rgba(109,40,217,0.20); }

  .wms-role-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.25rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    border: 1px solid transparent;
  }
  .wms-role-chip.superadmin, .wms-role-chip.super_admin { background:rgba(120,40,0,0.12);    color:#7c2d00;  border-color:rgba(120,40,0,0.22); }
  .wms-role-chip.admin                                  { background:rgba(180,83,9,0.12);    color:#92400e;  border-color:rgba(180,83,9,0.22); }
  .wms-role-chip.manager                                { background:rgba(109,40,217,0.09);  color:#5b21b6;  border-color:rgba(109,40,217,0.20); }
  .wms-role-chip.devowner, .wms-role-chip.device_owner  { background:rgba(29,78,216,0.09);   color:#1e40af;  border-color:rgba(29,78,216,0.20); }
  .wms-role-chip.nodeowner, .wms-role-chip.node_owner   { background:rgba(12,122,110,0.09);  color:#0f766e;  border-color:rgba(12,122,110,0.20); }
  .wms-role-chip.viewer                                 { background:rgba(120,90,0,0.10);   color:#78400a;  border-color:rgba(120,90,0,0.18); }

  .wms-class-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.62rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
  }
  .wms-class-badge.wms { background: var(--wms-blue-l);  color: var(--wms-blue); }
  .wms-class-badge.sib { background: var(--wms-teal-l);  color: var(--wms-teal); }

  .wms-access-badge {
    display: inline-block;
    padding: 0.08rem 0.42rem;
    border-radius: 4px;
    font-size: 0.58rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.04em;
    vertical-align: middle; line-height: 1.4;
  }
  .wms-access-badge.owner  { background: var(--wms-amber-l);  color: var(--wms-amber); }
  .wms-access-badge.member { background: var(--wms-purple-l); color: var(--wms-purple); }
  .wms-access-badge.admin  { background: rgba(120,40,0,0.10); color: #7c2d00; }

  /* ════════════════════════════════════════════════════════════
     7. STATUS DOTS
     ════════════════════════════════════════════════════════════ */
  .wms-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .wms-dot.online  { background: var(--wms-green); box-shadow: 0 0 5px rgba(21,128,61,0.45); }
  .wms-dot.offline { background: #c4a35a; opacity: 0.5; }
  .wms-dot.warn    { background: var(--wms-amber); }
  .wms-dot.error   { background: var(--wms-red); }
  @keyframes wmsPulse {
    0%,100% { box-shadow: 0 0 4px rgba(21,128,61,0.40); }
    50%     { box-shadow: 0 0 10px rgba(21,128,61,0.75); }
  }
  .wms-dot.pulse-on { animation: wmsPulse 2s ease-in-out infinite; }

  /* ════════════════════════════════════════════════════════════
     8. TOAST
     ════════════════════════════════════════════════════════════ */
  #wms-toast {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.7rem 1.1rem;
    border-radius: var(--wms-r-lg);
    font-size: 0.855rem; font-weight: 600;
    max-width: 22rem;
    z-index: 9999;
    border: 1px solid transparent;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    backdrop-filter: blur(16px);
    opacity: 0; transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.25s cubic-bezier(0.16,1,0.3,1);
    pointer-events: none;
  }
  #wms-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
  #wms-toast.wms-success { background:rgba(187,247,208,0.90); border-color:rgba(34,197,94,0.35);  color:#14532d; }
  #wms-toast.wms-error   { background:rgba(254,202,202,0.90); border-color:rgba(239,68,68,0.35);  color:#991b1b; }
  #wms-toast.wms-info    { background:rgba(186,230,253,0.90); border-color:rgba(14,165,233,0.35); color:#0c4a6e; }
  #wms-toast.wms-warn    { background:rgba(254,240,138,0.92); border-color:rgba(234,179,8,0.40);  color:#713f12; }

  /* ════════════════════════════════════════════════════════════
     9. BREADCRUMB
     ════════════════════════════════════════════════════════════ */
  .wms-breadcrumb {
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 0.3rem;
    font-size: 0.78rem;
    margin-bottom: 1rem;
    color: var(--wms-muted);
  }
  .wms-breadcrumb a { color: var(--wms-muted); text-decoration: none; transition: color var(--wms-t-fast); }
  .wms-breadcrumb a:hover { color: var(--wms-ink2); }
  .wms-breadcrumb .sep     { color: var(--wms-subtle); }
  .wms-breadcrumb .current { color: var(--wms-ink2); }
  header .wms-breadcrumb   { margin-bottom: 0; }

  /* ════════════════════════════════════════════════════════════
     10. TABLES
     ════════════════════════════════════════════════════════════ */
  .wms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.855rem;
  }
  .wms-table th {
    padding: 0.6rem 1rem;
    text-align: left;
    font-size: 0.67rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--wms-muted);
    border-bottom: 1px solid var(--wms-line-md);
    background: rgba(255,250,225,0.50);
    white-space: nowrap;
  }
  .wms-table td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--wms-line);
    vertical-align: middle;
    color: var(--wms-ink2);
  }
  .wms-table tr:last-child td { border-bottom: none; }
  .wms-table tr:hover td {
    background: rgba(255,248,210,0.35);
    /* refined: gold left-border reveal on hover */
    position: relative;
  }
  .wms-table-wrap { overflow-x: auto; }

  /* ════════════════════════════════════════════════════════════
     11. MODAL OVERLAY
     ════════════════════════════════════════════════════════════ */
  .wms-modal {
    position: fixed; inset: 0; z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    transition: opacity 0.20s ease;
  }
  .wms-modal.hidden { opacity: 0; pointer-events: none; }
  .wms-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(60,20,0,0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  .wms-modal-box {
    position: relative; z-index: 1;
    background: rgba(255,252,235,0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--wms-line-md);
    border-radius: var(--wms-r-xl);
    box-shadow: 0 20px 60px rgba(60,20,0,0.22), inset 0 1px 0 rgba(255,255,255,0.85);
    padding: 2rem;
    width: 100%; max-width: 26rem;
    text-align: center;
  }

  /* ════════════════════════════════════════════════════════════
     12. FLASH MESSAGES
     ════════════════════════════════════════════════════════════ */
  .wms-flash {
    border-radius: var(--wms-r-md);
    padding: 0.65rem 1rem;
    font-size: 0.85rem; font-weight: 500;
    display: flex; align-items: flex-start; gap: 0.6rem;
    margin-bottom: 1rem;
  }
  .wms-flash-error   { background:rgba(254,202,202,0.50); border:1px solid rgba(239,68,68,0.30);   color:#991b1b; backdrop-filter:blur(10px); }
  .wms-flash-success { background:rgba(187,247,208,0.50); border:1px solid rgba(34,197,94,0.30);   color:#14532d; backdrop-filter:blur(10px); }
  .wms-flash-info    { background:rgba(186,230,253,0.50); border:1px solid rgba(14,165,233,0.30);  color:#0c4a6e; backdrop-filter:blur(10px); }
  .wms-flash-warn    { background:rgba(254,240,138,0.50); border:1px solid rgba(234,179,8,0.30);   color:#713f12; backdrop-filter:blur(10px); }
  .wms-flash-danger  { background:rgba(254,202,202,0.55); border:1px solid rgba(239,68,68,0.32);   color:#991b1b; backdrop-filter:blur(10px); }

  /* ════════════════════════════════════════════════════════════
     13. STAT / KPI CARDS
     ════════════════════════════════════════════════════════════ */
  .wms-stat-card {
    position: relative; overflow: hidden;
    background: var(--wms-surface);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-r-lg);
    box-shadow: var(--wms-shadow-md);
    padding: 1.1rem 1.25rem;
    text-decoration: none; display: block; color: inherit;
    transition: box-shadow var(--wms-t-base), transform var(--wms-t-fast), border-color var(--wms-t-fast);
  }
  .wms-stat-card:hover {
    box-shadow: 0 6px 32px rgba(120,70,0,0.16), inset 0 1px 0 rgba(255,255,255,0.75);
    transform: translateY(-2px);
    border-color: var(--wms-line-md);
  }
  /* Colour accent bar — set --sc-accent on the element */
  .wms-stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--sc-accent, var(--wms-gold));
    border-radius: var(--wms-r-lg) var(--wms-r-lg) 0 0;
  }
  /* Non-link stat card */
  .wms-stat-card:not(a) { cursor: default; }
  .wms-stat-card:not(a):hover { transform: none; box-shadow: var(--wms-shadow-md); }

  .wms-stat-label {
    font-size: 0.67rem; font-weight: 700;
    color: var(--wms-muted);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
  }
  .wms-stat-value {
    font-family: var(--font-display);
    font-size: 2rem; font-weight: 700;
    color: var(--wms-ink); line-height: 1;
  }
  .wms-stat-sub {
    font-size: 0.72rem; color: var(--wms-muted);
    margin-top: 0.3rem;
    display: flex; align-items: center; gap: 0.3rem;
  }
  .wms-stat-icon {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    font-size: 1.85rem; opacity: 0.07;
    color: var(--sc-accent, var(--wms-gold));
  }

  /* ════════════════════════════════════════════════════════════
     14. EMPTY STATE
     ════════════════════════════════════════════════════════════ */
  .wms-empty {
    padding: 3rem 1.5rem; text-align: center; color: var(--wms-faint);
  }
  .wms-empty p { font-size: 0.84rem; margin: 0 0 1rem; }

  /* ════════════════════════════════════════════════════════════
     15. LAYOUT HELPERS
     ════════════════════════════════════════════════════════════ */
  .wms-page-wrap    { max-width: var(--wms-max-w); margin: 0 auto; padding: 1.5rem 1rem 4rem; }
  .wms-page-wrap-sm { max-width: 48rem;            margin: 0 auto; padding: 0 1rem 5rem; }

  .wms-split {
    display: grid;
    grid-template-columns: 1fr 20rem;
    gap: 1.25rem;
  }
  @media (max-width: 60rem) { .wms-split { grid-template-columns: 1fr; } }

  .wms-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 1rem;
  }

  /* ════════════════════════════════════════════════════════════
     16. FILTER PILLS
     ════════════════════════════════════════════════════════════ */
  .wms-filter-pill {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.32rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.75rem; font-weight: 600;
    border: 1px solid rgba(180,110,0,0.22);
    cursor: pointer;
    background: rgba(255,252,235,0.60);
    color: var(--wms-muted);
    transition: all var(--wms-t-fast);
    font-family: inherit;
  }
  .wms-filter-pill.active {
    background: rgba(255,252,235,0.96);
    color: var(--wms-ink2);
    border-color: rgba(180,110,0,0.40);
    box-shadow: 0 2px 8px rgba(120,70,0,0.10);
  }
  .wms-filter-pill:not(.active):hover { color: var(--wms-ink3); border-color: rgba(180,110,0,0.32); }

  /* ════════════════════════════════════════════════════════════
     17. ADMIN / ROLE BANNERS
     ════════════════════════════════════════════════════════════ */
  .wms-admin-banner {
    background: linear-gradient(135deg, rgba(180,83,9,0.90) 0%, rgba(120,40,0,0.90) 100%);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(251,191,36,0.25);
    border-radius: var(--wms-r-lg);
    padding: 1rem 1.4rem;
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 24px rgba(120,50,0,0.20);
    flex-wrap: wrap;
  }
  .wms-admin-banner h3 { font-family: var(--font-display); font-size: 0.95rem; font-weight: 700; margin: 0 0 0.15rem; }
  .wms-admin-banner p  { font-size: 0.78rem; opacity: 0.78; margin: 0; }
  .wms-admin-banner a  {
    margin-left: auto; flex-shrink: 0; color: #fff;
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 7px; padding: 0.38rem 0.9rem;
    font-size: 0.78rem; font-weight: 600;
    text-decoration: none; transition: background var(--wms-t-fast);
  }
  .wms-admin-banner a:hover { background: rgba(255,255,255,0.15); }

  .wms-access-notice {
    border-radius: var(--wms-r-md); padding: 0.6rem 1rem;
    font-size: 0.82rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1.25rem;
  }
  .wms-access-notice.viewer { background:rgba(180,83,9,0.08);    border:1px solid rgba(180,83,9,0.22);    color:var(--wms-amber); }
  .wms-access-notice.member { background:var(--wms-purple-l);    border:1px solid rgba(109,40,217,0.20);  color:var(--wms-purple); }

  /* ════════════════════════════════════════════════════════════
     18. SIDEBAR
     ════════════════════════════════════════════════════════════ */
  .wms-sidebar {
    width: var(--wms-sidebar-w);
    position: fixed; top: 0; left: 0;
    height: 100vh; height: 100dvh;
    z-index: 40;
    background: rgba(255,248,220,0.97);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border-right: 1px solid var(--wms-line);
    display: flex; flex-direction: column; flex-shrink: 0;
  }
  @media (min-width: 1024px) {
    .wms-sidebar {
      position: sticky; top: 0;
      height: 100vh; height: 100dvh;
      z-index: 10;
    }
  }

  /* ── Sidebar nav links ── */
  .wms-nav-link {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--wms-r-md);
    font-size: 0.845rem; font-weight: 500;
    color: var(--wms-muted);
    text-decoration: none;
    transition: all var(--wms-t-fast);
    margin: 0.1rem 0.6rem;
    position: relative;
  }
  .wms-nav-link:hover { background:rgba(217,119,6,0.09); color:var(--wms-ink2); }
  .wms-nav-link.active {
    background: linear-gradient(135deg, rgba(217,119,6,0.16) 0%, rgba(180,83,9,0.10) 100%);
    color: var(--wms-gold-dk); font-weight: 700;
    box-shadow: inset 3px 0 0 var(--wms-gold-dk);
  }

  /* Nav icon pill */
  .wms-nav-icon {
    width: 1.75rem; height: 1.75rem;
    border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem;
    background: rgba(255,248,210,0.70);
    border: 1px solid var(--wms-line);
    transition: all var(--wms-t-fast);
  }
  .wms-nav-link:hover  .wms-nav-icon { background:rgba(217,119,6,0.14); border-color:var(--wms-line-md); }
  .wms-nav-link.active .wms-nav-icon {
    background: linear-gradient(135deg,#fbbf24 0%,#d97706 100%);
    border-color: rgba(217,119,6,0.30);
    box-shadow: 0 2px 8px rgba(120,60,0,0.22);
  }

  /* Nav section label */
  .wms-nav-section {
    padding: 0.9rem 1.25rem 0.3rem;
    font-size: 0.6rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--wms-subtle);
  }

  /* Sidebar bottom user card */
  .wms-sidebar-user {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.8rem 1rem;
    text-decoration: none;
    background: rgba(255,248,210,0.50);
    border-top: 1px solid var(--wms-line);
    transition: background var(--wms-t-fast);
  }
  .wms-sidebar-user:hover { background: rgba(217,119,6,0.10); }
  .wms-sidebar-user-avatar {
    width: 2.2rem; height: 2.2rem; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,#fbbf24 0%,#d97706 100%);
    box-shadow: 0 2px 8px rgba(120,60,0,0.22);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700; color: #fff; user-select: none;
  }
  .wms-sidebar-signout {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 1rem;
    font-size: 0.8rem; font-weight: 600;
    color: var(--wms-red); text-decoration: none;
    border-radius: var(--wms-r-md);
    margin: 0.25rem 0.6rem;
    transition: background var(--wms-t-fast);
  }
  .wms-sidebar-signout:hover { background: var(--wms-red-l); }

  /* ════════════════════════════════════════════════════════════
     19. TOPBAR BUTTONS & AVATAR (from header.php <style>)
     ════════════════════════════════════════════════════════════ */
  .wms-topbar-btn {
    position: relative;
    width: 2.25rem; height: 2.25rem;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: var(--wms-r-md);
    border: 1px solid var(--wms-line);
    background: rgba(255,248,210,0.70);
    color: var(--wms-ink3);
    font-size: 1rem;
    text-decoration: none; cursor: pointer;
    transition: background var(--wms-t-fast), border-color var(--wms-t-fast);
  }
  .wms-topbar-btn:hover { background:rgba(217,119,6,0.13); border-color:var(--wms-line-md); }

  .wms-topbar-badge {
    position: absolute; top: -0.28rem; right: -0.28rem;
    min-width: 1rem; height: 1rem; padding: 0 0.18rem;
    background: var(--wms-red); color: #fff;
    font-size: 0.52rem; font-weight: 700; line-height: 1;
    border-radius: 999px; display: flex; align-items: center; justify-content: center;
    border: 1.5px solid rgba(255,252,235,0.95);
  }

  /* Avatar pill button */
  .wms-avatar-btn {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.22rem 0.6rem 0.22rem 0.22rem;
    border-radius: 999px;
    border: 1px solid var(--wms-line);
    background: rgba(255,248,210,0.70);
    cursor: pointer; font-family: inherit;
    transition: background var(--wms-t-fast), border-color var(--wms-t-fast);
  }
  .wms-avatar-btn:hover { background:rgba(217,119,6,0.12); border-color:var(--wms-line-md); }

  .wms-avatar-circle {
    width: 2rem; height: 2rem; border-radius: 50%;
    background: linear-gradient(135deg,#fbbf24 0%,#d97706 100%);
    box-shadow: 0 2px 8px rgba(120,60,0,0.22);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: #fff;
    flex-shrink: 0; user-select: none;
  }
  .wms-chevron-icon { font-size: 0.58rem; color:var(--wms-muted); transition:transform var(--wms-t-fast); }
  .wms-avatar-btn[aria-expanded="true"] .wms-chevron-icon { transform: rotate(180deg); }

  /* ── User dropdown ── */
  .wms-user-dropdown {
    position: absolute; top: calc(100% + 0.5rem); right: 0;
    min-width: 220px;
    background: rgba(255,252,240,0.98);
    backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--wms-line-md);
    border-radius: var(--wms-r-lg);
    box-shadow: 0 12px 40px rgba(120,70,0,0.18), inset 0 1px 0 rgba(255,255,255,0.85);
    z-index: 200; overflow: hidden;
    opacity: 0; transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.20s cubic-bezier(0.16,1,0.3,1);
  }
  .wms-user-dropdown.open {
    opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
  }

  .wms-dd-identity {
    padding: 1rem 1rem 0.85rem;
    background: linear-gradient(135deg,rgba(255,248,210,0.80) 0%,rgba(255,252,235,0.60) 100%);
    border-bottom: 1px solid var(--wms-line);
    display: flex; align-items: center; gap: 0.75rem;
  }
  .wms-dd-identity-avatar {
    width: 2.6rem; height: 2.6rem; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg,#fbbf24 0%,#d97706 100%);
    box-shadow: 0 3px 10px rgba(120,60,0,0.28);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; font-weight: 700; color: #fff; user-select: none;
  }
  .wms-dd-identity-name  { font-size:0.875rem; font-weight:700; color:var(--wms-ink); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .wms-dd-identity-email { font-size:0.68rem; color:var(--wms-faint); margin-top:0.08rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

  .wms-dd-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.6rem 1rem;
    font-size: 0.82rem; font-weight: 500; color: var(--wms-ink2);
    text-decoration: none;
    transition: background var(--wms-t-fast), color var(--wms-t-fast);
  }
  .wms-dd-item-icon {
    width: 1.6rem; height: 1.6rem; border-radius: 7px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    background: rgba(255,248,210,0.80);
    border: 1px solid var(--wms-line);
    transition: background var(--wms-t-fast);
  }
  .wms-dd-item:hover { background:rgba(217,119,6,0.07); color:var(--wms-ink); }
  .wms-dd-item:hover .wms-dd-item-icon { background:rgba(217,119,6,0.14); border-color:var(--wms-line-md); }
  .wms-dd-item.danger { color:var(--wms-red); }
  .wms-dd-item.danger .wms-dd-item-icon { background:var(--wms-red-l); border-color:rgba(185,28,28,0.18); }
  .wms-dd-item.danger:hover { background:var(--wms-red-l); }
  .wms-dd-divider { height:1px; background:var(--wms-line); margin:0.2rem 0; }
  .wms-dd-section { padding:0.5rem 1rem 0.2rem; font-size:0.62rem; font-weight:700; text-transform:uppercase; letter-spacing:0.08em; color:var(--wms-subtle); }

  /* ════════════════════════════════════════════════════════════
     20. ANIMATIONS
     ════════════════════════════════════════════════════════════ */
  @keyframes wmsIn     { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }
  @keyframes wmsFadeIn { from { opacity:0; }                             to { opacity:1; } }
  @keyframes wmsCardIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
  @keyframes wmsCardOut{ to   { opacity:0; transform:translateX(24px) scale(.97); } }
  @keyframes wmsSpinBtn { to { transform: rotate(360deg); } }
  @keyframes wmsShimmer { 0% { background-position:-400px 0; } 100% { background-position:400px 0; } }

  .wms-animate-in { animation: wmsIn     0.40s cubic-bezier(0.16,1,0.3,1) both; }
  .wms-fade-in    { animation: wmsFadeIn 0.30s ease both; }
  .wms-card-enter { animation: wmsCardIn 0.38s cubic-bezier(0.16,1,0.3,1) both; }
  .wms-card-exit  { animation: wmsCardOut 0.22s ease forwards; }

  .wms-d1 { animation-delay:0.06s; }
  .wms-d2 { animation-delay:0.12s; }
  .wms-d3 { animation-delay:0.18s; }
  .wms-d4 { animation-delay:0.24s; }
  .wms-d5 { animation-delay:0.30s; }

  /* ════════════════════════════════════════════════════════════
     21. SPECIALISED COMPONENTS (node/sensor views)
     ════════════════════════════════════════════════════════════ */

  /* Error panels */
  .wms-error-panel {
    display: flex; align-items: flex-start; gap: 0.55rem;
    background: var(--wms-red-l); border: 1px solid rgba(185,28,28,0.25);
    border-radius: var(--wms-r-md); padding: 0.65rem 0.9rem; margin-bottom: 0.85rem;
  }
  .wms-error-panel.compact { padding:0.42rem 0.65rem; margin-bottom:0.5rem; font-size:0.78rem; }
  .wms-err-icon   { font-size:0.9rem; flex-shrink:0; margin-top:0.1rem; }
  .wms-err-chips  { display:flex; flex-wrap:wrap; gap:0.3rem; }
  .wms-err-chip   { display:inline-flex; flex-direction:column; padding:0.2rem 0.55rem; border-radius:5px; font-family:var(--font-mono); background:rgba(220,38,38,0.10); color:var(--wms-red); border:1px solid rgba(185,28,28,0.26); cursor:default; }
  .wms-err-code   { font-size:0.66rem; font-weight:700; line-height:1.3; }
  .wms-err-desc   { font-size:0.60rem; font-weight:400; opacity:0.78; margin-top:0.06rem; line-height:1.2; }

  /* Poll dot */
  #nv-poll-dot {
    width:6px; height:6px; border-radius:50%;
    background:var(--wms-green); display:inline-block;
    transition:background 0.3s, opacity 0.3s; opacity:0.8;
  }
  #nv-poll-dot.stale { background:var(--wms-muted); opacity:0.4; }

  /* Trend / rate badges */
  .nv-trend-row  { display:flex; align-items:center; flex-wrap:wrap; gap:0.45rem; font-size:0.82rem; }
  .nv-rate-badge { display:inline-flex; align-items:center; gap:0.25rem; padding:0.18rem 0.55rem; border-radius:5px; font-size:0.72rem; font-family:var(--font-mono); font-weight:700; }
  .nv-rate-rising  { background:rgba(21,128,61,0.10);  color:var(--wms-green); }
  .nv-rate-falling { background:rgba(185,28,28,0.10);  color:var(--wms-red); }
  .nv-rate-stable  { background:rgba(180,83,9,0.10);   color:var(--wms-amber); }
  .nv-vol-badge    { font-size:0.68rem; font-family:var(--font-mono); color:var(--wms-subtle); padding:0.1rem 0.4rem; border:1px dashed rgba(180,110,0,0.25); border-radius:4px; }

  /* Progress bar */
  .wms-progress-wrap { width:100%; height:6px; border-radius:999px; background:rgba(180,110,0,0.12); overflow:hidden; }
  .wms-progress-fill { height:100%; border-radius:999px; transition:width 0.7s ease; min-width:4px; }

  /* Skeleton shimmer */
  .wms-skeleton {
    background: linear-gradient(90deg, rgba(180,110,0,0.06) 25%, rgba(180,110,0,0.12) 50%, rgba(180,110,0,0.06) 75%);
    background-size: 800px 100%;
    animation: wmsShimmer 1.4s ease-in-out infinite;
    border-radius: var(--wms-r-md);
  }

  /* Stale overlay */
  .wms-stale-overlay {
    position:absolute; top:0.5rem; right:0.5rem;
    padding:0.18rem 0.55rem; border-radius:5px;
    font-size:0.65rem; font-weight:700;
    background:rgba(120,90,0,0.08); color:var(--wms-muted);
    border:1px solid rgba(120,90,0,0.18); pointer-events:none;
  }

  /* Command status */
  .cmd-ack-ok      { color:var(--wms-green);  font-weight:700; font-family:monospace; }
  .cmd-ack-fail    { color:var(--wms-red);    font-weight:700; font-family:monospace; }
  .cmd-ack-timeout { color:var(--wms-muted);  font-family:monospace; }
  .cmd-ack-pending { color:var(--wms-amber);  font-family:monospace; }

  /* Input error state */
  .wms-input.error,
  .wms-select.error { border-color:rgba(220,38,38,0.65)!important; box-shadow:0 0 0 3px rgba(220,38,38,0.12)!important; }

  /* Alert page card */
  .wms-alert-card {
    position:relative; overflow:hidden;
    background:var(--wms-surface);
    backdrop-filter:blur(20px); -webkit-backdrop-filter:blur(20px);
    border:1px solid var(--wms-line);
    box-shadow:var(--wms-shadow-md);
    border-radius:var(--wms-r-lg);
    transition:box-shadow var(--wms-t-base), border-color var(--wms-t-base), opacity var(--wms-t-fast);
  }
  .wms-alert-card:not(.is-acked):hover { border-color:var(--wms-line-md); box-shadow:var(--wms-shadow-lg); }
  .wms-alert-card.is-acked { opacity:0.46; }

  /* Misc shared */
  .cell-mono { font-family:var(--font-mono); font-size:0.78rem; color:var(--wms-ink3); }
  .wms-bg-gradient { background:linear-gradient(135deg,#fffbeb 0%,#fef3c7 30%,#fde8c8 65%,#fffdf0 100%); background-attachment:fixed; }
  .wms-icon { font-size:1rem; width:1.25rem; text-align:center; flex-shrink:0; display:inline-flex; align-items:center; justify-content:center; }

  /* ════════════════════════════════════════════════════════════
     22. RESPONSIVE UTILITIES
     ════════════════════════════════════════════════════════════ */
  @media (max-width: 640px) {
    .wms-hide-mobile { display:none !important; }
    .wms-stat-value  { font-size:1.5rem; }
  }
  @media (min-width: 640px) {
    .wms-hide-desktop { display:none !important; }
  }

  /* Print extras */
  @media print {
    .wms-err-chip { border:1px solid #ccc !important; background:none !important; }
    .wms-err-desc { display:inline !important; margin-left:4px; }
    #nv-poll-dot, .nv-vol-badge { display:none !important; }
  }


  /* ── Tab system (profile_view, settings_view) ────────────────────────── */
  .wv-tabs {
    display: flex; gap: 0.15rem;
    border-bottom: 2px solid var(--wms-line);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .wv-tab {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: none; background: none;
    cursor: pointer;
    font-size: 0.84rem; font-weight: 500;
    color: var(--wms-muted);
    font-family: inherit; white-space: nowrap;
    text-decoration: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    transition: color var(--wms-t-fast), border-color var(--wms-t-fast), background var(--wms-t-fast);
  }
  .wv-tab:hover  { color: var(--wms-ink2); background: rgba(180,110,0,0.06); }
  .wv-tab.active { color: var(--wms-gold-dk); border-bottom-color: var(--wms-gold); font-weight: 700; }
  .wv-tab-badge  { background: #dc2626; color: #fff; border-radius: 999px; padding: 0.04rem 0.42rem; font-size: 0.6rem; font-weight: 700; }
  /* .wv-tab-pane visibility is controlled by JS (style.display) — no CSS rule needed */

  /* ── Card system (profile_view, settings_view) ───────────────────────── */
  .wv-card {
    background: var(--wms-surface);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-r-lg);
    box-shadow: var(--wms-shadow-sm);
    overflow: hidden; margin-bottom: 1.1rem;
  }
  .wv-card-head {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.82rem 1.25rem;
    border-bottom: 1px solid var(--wms-line);
    background: var(--wms-surface-2);
  }
  .wv-card-icon {
    width: 2rem; height: 2rem; border-radius: 0.5rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    background: rgba(217,119,6,0.12); color: var(--wms-gold-dk);
  }
  .wv-card-head-title { font-size: 0.875rem; font-weight: 700; color: var(--wms-ink2); margin: 0; }
  .wv-card-head-sub   { font-size: 0.72rem;  color: var(--wms-muted); margin: 0.1rem 0 0; }
  .wv-card-body       { padding: 1.25rem; }

  /* ── Key-value rows inside settings cards ────────────────────────────── */
  .wv-row       { display: flex; justify-content: space-between; align-items: center; padding: 0.58rem 0; border-bottom: 1px solid rgba(180,110,0,0.08); font-size: 0.84rem; }
  .wv-row:last-child { border-bottom: none; }
  .wv-row-lbl   { font-size: 0.72rem; font-weight: 700; color: var(--wms-faint); text-transform: uppercase; letter-spacing: 0.06em; }
  .wv-row-val   { color: var(--wms-ink2); font-weight: 500; }
  .wv-mono      { font-family: var(--font-mono); font-size: 0.8rem; background: rgba(180,110,0,0.08); padding: 0.15rem 0.5rem; border-radius: 5px; border: 1px solid var(--wms-line-md); color: var(--wms-ink2); }
  .wv-g2        { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .wv-g3        { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.72rem; }
  @media (max-width: 560px) { .wv-g2, .wv-g3 { grid-template-columns: 1fr; } }

  /* ── Stat tile (device_view, node_view) ──────────────────────────────── */
  .stat-tile {
    background: var(--wms-surface-2);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-r-md);
    padding: 0.9rem; text-align: center;
  }
  .stat-tile-val, .stat-tile .st-value {
    font-family: var(--font-display);
    font-size: 1.55rem; font-weight: 700;
    color: var(--wms-ink2); line-height: 1.1;
  }
  .stat-tile-lbl, .stat-tile .st-label {
    font-size: 0.68rem; color: var(--wms-muted);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.28rem;
  }
  .stat-tile .st-unit { font-size: 0.72rem; color: var(--wms-muted); }

  /* ── Info grid (device detail panels) ───────────────────────────────── */
  .info-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 1.5rem; }
  .info-row-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--wms-muted); margin-bottom: 0.12rem; }
  .info-row-val   { font-size: 0.78rem; font-family: var(--font-mono); color: var(--wms-ink2); }

  /* ── Page title bar (used in settings, profile, users, support) ──────── */
  .wms-titlebar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
  }
  .wms-page-icon {
    width: 2.75rem; height: 2.75rem;
    border-radius: var(--wms-r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    background: linear-gradient(135deg, rgba(217,119,6,0.18), rgba(180,83,9,0.12));
    border: 1px solid rgba(180,110,0,0.22);
  }

  /* ── Progress bar variants (device_view uses .wms-progress, node uses fill-track) */
  .wms-progress {
    width: 100%; height: 8px; border-radius: 999px;
    background: rgba(180,110,0,0.12); overflow: hidden; margin: 0.6rem 0;
  }
  .wms-progress-fill-bar { height: 100%; border-radius: 999px; transition: width 0.7s ease; min-width: 4px; }
  .fill-green { background: linear-gradient(90deg, #34d399, #15803d); }
  .fill-red   { background: linear-gradient(90deg, #f87171, #b91c1c); }

  /* ── Dashboard device card rows ──────────────────────────────────────── */
  .dbd-card {
    display: flex; align-items: stretch;
    border-bottom: 1px solid rgba(180,110,0,0.09);
    transition: background var(--wms-t-fast);
  }
  .dbd-card:last-child { border-bottom: none; }
  .dbd-card:hover { background: rgba(255,248,210,0.40); }
  .dbd-stripe     { width: 3px; flex-shrink: 0; }
  .dbd-stripe.on  { background: var(--wms-green); }
  .dbd-stripe.off { background: rgba(180,110,0,0.18); }
  .dbd-body   { flex: 1; min-width: 0; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.22rem; }
  .dbd-top    { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
  .dbd-name   { font-size: 0.83rem; font-weight: 700; color: var(--wms-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; flex: 1; min-width: 0; }
  .dbd-name:hover { color: var(--wms-gold-dk); }
  .dbd-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
  .dbd-meta   { font-size: 0.67rem; color: var(--wms-faint); display: flex; align-items: center; gap: 0.3rem; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
  .dbd-time   { font-size: 0.63rem; color: var(--wms-faint); font-family: var(--font-mono); white-space: nowrap; flex-shrink: 0; }
  .dbd-actions { display: flex; gap: 0.22rem; padding: 0 0.6rem 0 0; align-self: center; flex-shrink: 0; }
  .dbd-btn    { width: 1.55rem; height: 1.55rem; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; text-decoration: none; color: var(--wms-muted); background: rgba(255,248,210,0.60); border: 1px solid rgba(180,110,0,0.16); transition: all var(--wms-t-fast); }
  .dbd-btn:hover { color: var(--wms-gold-dk); background: rgba(217,119,6,0.12); border-color: rgba(180,83,9,0.28); }
  .dbd-section { display: flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.8rem; background: var(--wms-surface-2); border-bottom: 1px solid rgba(180,110,0,0.09); }
  .dbd-section-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
  .dbd-section-lbl { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

  /* ── Alert row (dashboard panel + alerts page) ───────────────────────── */
  .alr-row       { display: flex; gap: 0.7rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid rgba(180,110,0,0.10); transition: background var(--wms-t-fast); text-decoration: none; color: inherit; }
  .alr-row:last-child { border-bottom: none; }
  .alr-row:hover { background: rgba(255,248,210,0.40); }
  .alr-row-body  { flex: 1; min-width: 0; }
  .alr-row-title { font-size: 0.83rem; font-weight: 600; color: var(--wms-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .alr-row-meta  { font-size: 0.68rem; color: var(--wms-faint); margin-top: 0.1rem; display: flex; align-items: center; gap: 0.35rem; }
  .alr-row-time  { font-size: 0.68rem; color: var(--wms-faint); white-space: nowrap; flex-shrink: 0; }

  /* ── Quick-action grid (dashboard) ──────────────────────────────────── */
  .qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; padding: 1rem 1.1rem; }
  .qa-btn  { display: flex; align-items: center; gap: 0.55rem; padding: 0.65rem 0.8rem; border-radius: 0.65rem; background: rgba(255,252,235,0.60); border: 1px solid var(--wms-line); font-size: 0.8rem; font-weight: 600; color: var(--wms-ink3); text-decoration: none; transition: all var(--wms-t-fast); }
  .qa-btn:hover { background: rgba(217,119,6,0.10); border-color: var(--wms-line-md); color: var(--wms-ink2); }
  .qa-icon { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; }

  /* ── Device class breakdown pills (dashboard) ────────────────────────── */
  .breakdown { display: flex; gap: 0.5rem; padding: 0.85rem 1.1rem; border-top: 1px solid var(--wms-line); }
  .bp-pill    { flex: 1; text-align: center; padding: 0.5rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; }
  .bp-pill .bp-val { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; display: block; line-height: 1; }
  .bp-pill .bp-lbl { font-size: 0.62rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.04em; }
  .bp-wms { background: var(--wms-blue-l);  color: var(--wms-blue); }
  .bp-sib { background: var(--wms-teal-l);  color: var(--wms-teal); }
  .bp-cmd { background: var(--wms-amber-l); color: var(--wms-amber); }

  /* ── Wv-in stagger animations (settings/profile) ─────────────────────── */
  @keyframes wvIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
  .wv-in   { animation: wvIn 0.38s cubic-bezier(0.16,1,0.3,1) both; }
  .wv-d1   { animation-delay: 0.05s; }
  .wv-d2   { animation-delay: 0.10s; }
  .wv-d3   { animation-delay: 0.15s; }
  .wv-d4   { animation-delay: 0.20s; }
  .wv-d5   { animation-delay: 0.25s; }

  /* ── Dashboard-specific layout ───────────────────────────────────────── */
  .dash-cols { display: grid; grid-template-columns: 1fr 20rem; gap: 1.25rem; margin-bottom: 1.5rem; }
  @media (max-width: 60rem) { .dash-cols { grid-template-columns: 1fr; } }

  .wms-stat-icon-utf { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 2rem; opacity: 0.10; pointer-events: none; user-select: none; }



  /* ── Alert card (alerts_view list) ──────────────────────────────────── */
  .alr-card {
    position: relative; overflow: hidden;
    background: var(--wms-surface);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--wms-line);
    box-shadow: var(--wms-shadow-md);
    border-radius: var(--wms-r-lg);
    transition: box-shadow var(--wms-t-base), border-color var(--wms-t-base), opacity var(--wms-t-fast), transform var(--wms-t-fast);
  }
  .alr-card:not(.is-acked):hover {
    border-color: var(--wms-line-md);
    box-shadow: var(--wms-shadow-lg);
    transform: translateY(-1px);
  }
  .alr-card.is-acked { opacity: 0.45; }

  /* ── Alert action buttons ────────────────────────────────────────────── */
  .alr-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.28rem 0.65rem; border-radius: 8px;
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    border: 1px solid; transition: all var(--wms-t-fast);
  }
  .alr-btn:disabled { opacity: 0.42; cursor: not-allowed; }
  .alr-btn-ack { background:rgba(21,128,61,0.08); border-color:rgba(21,128,61,0.28); color:var(--wms-green); }
  .alr-btn-ack:not(:disabled):hover { background:rgba(21,128,61,0.16); border-color:rgba(21,128,61,0.45); }
  .alr-btn-del { background:var(--wms-red-l); border-color:rgba(185,28,28,0.22); color:var(--wms-red); }
  .alr-btn-del:not(:disabled):hover { background:rgba(185,28,28,0.14); border-color:rgba(185,28,28,0.40); }

  .alr-btn-spin {
    display: inline-block; width: 0.7rem; height: 0.7rem;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: wmsSpinBtn 0.7s linear infinite;
    vertical-align: middle;
  }
  @keyframes wmsSpinBtn { to { transform: rotate(360deg); } }

  /* ── Bulk action buttons (toolbar) ──────────────────────────────────── */
  .bulk-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.38rem 0.85rem; border-radius: var(--wms-r-md);
    font-size: 0.77rem; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 1px solid; transition: all var(--wms-t-fast);
    text-decoration: none;
  }
  .bulk-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .bulk-btn-ghost  { background:var(--wms-surface); border-color:var(--wms-line); color:var(--wms-ink3); }
  .bulk-btn-ghost:hover  { background:rgba(217,119,6,0.09); border-color:var(--wms-line-md); color:var(--wms-ink2); }
  .bulk-btn-danger { background:var(--wms-red-l); border-color:rgba(185,28,28,0.22); color:var(--wms-red); }
  .bulk-btn-danger:hover { background:rgba(185,28,28,0.14); border-color:rgba(185,28,28,0.40); }

  /* ── Card entrance/exit animations ──────────────────────────────────── */
  @keyframes cardIn  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
  @keyframes cardOut { to   { opacity:0; transform:translateX(28px) scale(0.97); } }
  .card-enter { animation: cardIn  0.38s cubic-bezier(0.16,1,0.3,1) both; }
  .card-exit  { animation: cardOut 0.22s ease forwards; }

  /* Staggered list entrance — first 8 cards */
  .alr-list > .alr-card:nth-child(1)  { animation-delay: 0.045s; }
  .alr-list > .alr-card:nth-child(2)  { animation-delay: 0.090s; }
  .alr-list > .alr-card:nth-child(3)  { animation-delay: 0.135s; }
  .alr-list > .alr-card:nth-child(4)  { animation-delay: 0.180s; }
  .alr-list > .alr-card:nth-child(5)  { animation-delay: 0.225s; }
  .alr-list > .alr-card:nth-child(6)  { animation-delay: 0.270s; }
  .alr-list > .alr-card:nth-child(7)  { animation-delay: 0.315s; }
  .alr-list > .alr-card:nth-child(8)  { animation-delay: 0.360s; }
  .alr-list > .alr-card:nth-child(n+9){ animation-delay: 0.360s; }

  /* ── Alert detail page ───────────────────────────────────────────────── */

  /* Monospace preformatted payload block */
  .glass-pre {
    background: rgba(255,248,220,0.60);
    border-top: 1px solid var(--wms-line);
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.78rem; line-height: 1.65;
    font-family: var(--font-mono);
    color: var(--wms-ink);
    margin: 0;
    border-radius: 0 0 var(--wms-r-lg) var(--wms-r-lg);
  }

  /* Metadata grid */
  .det-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(180,110,0,0.12);
  }
  @media (max-width: 580px) { .det-grid { grid-template-columns: repeat(2, 1fr); } }

  .det-cell {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(8px);
    padding: 0.85rem 1rem;
  }
  .det-cell-lbl {
    font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.07em;
    font-weight: 700; color: var(--wms-muted); margin: 0 0 0.28rem;
  }
  .det-cell-val {
    font-size: 0.82rem; font-weight: 600; color: var(--wms-ink); margin: 0;
  }

  /* Ack status pill */
  .ack-pill {
    font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 0.2rem 0.65rem; border-radius: 6px;
    display: inline-block;
  }
  .ack-pill-pending { background:var(--wms-amber-l); color:var(--wms-amber); border:1px solid rgba(180,83,9,0.28); }
  .ack-pill-done    { background:var(--wms-green-l); color:var(--wms-green); border:1px solid rgba(21,128,61,0.25); }

  /* Detail action buttons */
  .det-action-btn {
    display: inline-flex; align-items: center; gap: 0.38rem;
    padding: 0.45rem 1rem; border-radius: var(--wms-r-md);
    font-size: 0.8rem; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 1px solid; transition: all var(--wms-t-fast);
  }
  .det-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .det-btn-ack { background:var(--wms-green-l); border-color:rgba(21,128,61,0.28); color:var(--wms-green); }
  .det-btn-ack:not(:disabled):hover { background:rgba(21,128,61,0.16); border-color:rgba(21,128,61,0.45); }
  .det-btn-del { background:var(--wms-red-l); border-color:rgba(185,28,28,0.22); color:var(--wms-red); }
  .det-btn-del:not(:disabled):hover { background:rgba(185,28,28,0.14); border-color:rgba(185,28,28,0.40); }

  .det-btn-spin {
    display: inline-block; width: 0.72rem; height: 0.72rem;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: wmsSpinDet 0.7s linear infinite;
    vertical-align: middle;
  }
  @keyframes wmsSpinDet { to { transform: rotate(360deg); } }

  /* Copy button */
  .copy-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; color: var(--wms-muted);
    font-family: var(--font-mono);
    background: none; border: none; cursor: pointer;
    padding: 0.2rem 0.4rem; border-radius: 5px;
    transition: color var(--wms-t-fast), background var(--wms-t-fast);
  }
  .copy-btn:hover { color:var(--wms-gold-dk); background:rgba(217,119,6,0.09); }

  /* Stagger helper for detail page sections */
  .s-enter { animation: wmsIn 0.42s cubic-bezier(0.16,1,0.3,1) both; }
  .s1 { animation-delay: 0.04s; }
  .s2 { animation-delay: 0.09s; }
  .s3 { animation-delay: 0.14s; }
  .s4 { animation-delay: 0.19s; }
  .s5 { animation-delay: 0.24s; }


  /* ── Shared auth entrance animations ────────────────────────────────── */
  /* login uses l-*, register uses rg-* — both alias the same keyframe */
  .l-enter,
  .rg-enter { animation: wmsIn 0.48s cubic-bezier(0.16,1,0.3,1) both; }
  .l-d1, .rg-d1 { animation-delay: 0.05s; }
  .l-d2, .rg-d2 { animation-delay: 0.13s; }
  .l-d3, .rg-d3 { animation-delay: 0.22s; }

  /* ── Auth glass card ─────────────────────────────────────────────────── */
  /* login-card: narrower, more rounded — max-w-sm container */
  .login-card {
    background: rgba(255,252,235,0.82);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(217,119,6,0.22);
    box-shadow: 0 8px 32px rgba(120,70,0,0.13), inset 0 1px 0 rgba(255,255,255,0.82);
    border-radius: 1.5rem;
    padding: 1.75rem;
  }

  /* reg-card: wider, header strip — max-w-lg container */
  .reg-card {
    background: rgba(255,252,235,0.82);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(217,119,6,0.22);
    box-shadow: 0 12px 48px rgba(120,70,0,0.13), inset 0 1px 0 rgba(255,255,255,0.82);
    border-radius: 1.25rem;
    overflow: hidden;
  }

  /* ── Brand icon wrapper ──────────────────────────────────────────────── */
  .login-icon-wrap {
    width: 4rem; height: 4rem;
    border-radius: 1rem;
    background: rgba(255,248,225,0.60);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(251,191,36,0.38);
    box-shadow: 0 4px 16px rgba(180,100,0,0.15), inset 0 1px 0 rgba(255,255,255,0.65);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .login-icon-wrap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(180,100,0,0.20), inset 0 1px 0 rgba(255,255,255,0.70);
  }

  /* ── Flash messages (auth-page variants) ────────────────────────────── */
  /* These sit outside the card — slightly different from .wms-flash */
  .login-flash {
    display: flex; align-items: flex-start; gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: var(--wms-r-md);
    font-size: 0.85rem; font-weight: 500;
    margin-bottom: 1.25rem;
  }
  .login-flash-error {
    background: rgba(254,202,202,0.60);
    border: 1px solid rgba(239,68,68,0.30);
    color: #991b1b;
    backdrop-filter: blur(8px);
  }
  .login-flash-success {
    background: rgba(187,247,208,0.60);
    border: 1px solid rgba(34,197,94,0.30);
    color: #14532d;
    backdrop-filter: blur(8px);
  }
  .login-flash-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.4; }

  /* ── Divider ─────────────────────────────────────────────────────────── */
  .login-divider {
    border: none;
    border-top: 1px solid rgba(180,110,0,0.14);
    margin: 0.25rem 0;
  }

  /* ── Full-width submit modifier ──────────────────────────────────────── */
  .login-submit {
    width: 100%; justify-content: center;
    padding-top: 0.72rem; padding-bottom: 0.72rem;
    font-size: 0.92rem; letter-spacing: 0.03em;
  }

  /* ── Password visibility toggle ──────────────────────────────────────── */
  .pwd-toggle {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    font-size: 1rem; line-height: 1; opacity: 0.45;
    background: none; border: none; cursor: pointer; padding: 0.15rem;
    border-radius: 4px;
    transition: opacity var(--wms-t-fast), background var(--wms-t-fast);
  }
  .pwd-toggle:hover { opacity: 0.85; background: rgba(180,110,0,0.08); }

  /* ── CAPTCHA image ───────────────────────────────────────────────────── */
  .captcha-img {
    height: 3rem; border-radius: 0.75rem; object-fit: cover;
    border: 1px solid rgba(180,110,0,0.28);
    flex-shrink: 0; cursor: pointer;
    transition: opacity var(--wms-t-fast), border-color var(--wms-t-fast);
  }
  .captcha-img:hover { opacity: 0.88; border-color: rgba(180,110,0,0.45); }

  /* ── Checkbox (gold accent) ──────────────────────────────────────────── */
  .wms-checkbox {
    width: 1rem; height: 1rem;
    border-radius: 0.25rem;
    accent-color: #d97706;
    cursor: pointer; flex-shrink: 0;
  }

  /* ── Two-column field grid (register) ───────────────────────────────── */
  .two-col { display: grid; gap: 1rem; }
  @media (min-width: 560px) { .two-col { grid-template-columns: 1fr 1fr; } }

  /* ── Password strength bar ───────────────────────────────────────────── */
  .str-track {
    height: 3px; background: rgba(180,110,0,0.14);
    border-radius: 3px; margin-top: 0.35rem; overflow: hidden;
  }
  .str-fill {
    height: 100%; border-radius: 3px;
    width: 0; transition: width 0.3s ease, background 0.3s ease;
  }

  /* ── Optional label modifier ─────────────────────────────────────────── */
  .opt-label {
    font-weight: 400; text-transform: none;
    letter-spacing: 0; color: var(--wms-faint);
  }

/* ── 5. Utilities ────────────────────────────────────────────────────────── */
.font-display { font-family: var(--font-display); }
  .font-body    { font-family: var(--font-body); }
  .font-mono    { font-family: var(--font-mono); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 2 — SHARED CROSS-VIEW COMPONENTS
   All classes below appear in 2+ view files. Defining them here once
   removes the need for repeated <style> blocks in individual views.
   ═══════════════════════════════════════════════════════════════════════════ */

@layer components {

  /* ── Tab system (profile_view, settings_view) ────────────────────────── */
  .wv-tabs {
    display: flex; gap: 0.15rem;
    border-bottom: 2px solid var(--wms-line);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .wv-tab {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border: none; background: none;
    cursor: pointer;
    font-size: 0.84rem; font-weight: 500;
    color: var(--wms-muted);
    font-family: inherit; white-space: nowrap;
    text-decoration: none;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -2px;
    border-radius: 8px 8px 0 0;
    transition: color var(--wms-t-fast), border-color var(--wms-t-fast), background var(--wms-t-fast);
  }
  .wv-tab:hover  { color: var(--wms-ink2); background: rgba(180,110,0,0.06); }
  .wv-tab.active { color: var(--wms-gold-dk); border-bottom-color: var(--wms-gold); font-weight: 700; }
  .wv-tab-badge  { background: #dc2626; color: #fff; border-radius: 999px; padding: 0.04rem 0.42rem; font-size: 0.6rem; font-weight: 700; }
  /* .wv-tab-pane visibility is controlled by JS (style.display) — no CSS rule needed */

  /* ── Card system (profile_view, settings_view) ───────────────────────── */
  .wv-card {
    background: var(--wms-surface);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-r-lg);
    box-shadow: var(--wms-shadow-sm);
    overflow: hidden; margin-bottom: 1.1rem;
  }
  .wv-card-head {
    display: flex; align-items: center; gap: 0.65rem;
    padding: 0.82rem 1.25rem;
    border-bottom: 1px solid var(--wms-line);
    background: var(--wms-surface-2);
  }
  .wv-card-icon {
    width: 2rem; height: 2rem; border-radius: 0.5rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem;
    background: rgba(217,119,6,0.12); color: var(--wms-gold-dk);
  }
  .wv-card-head-title { font-size: 0.875rem; font-weight: 700; color: var(--wms-ink2); margin: 0; }
  .wv-card-head-sub   { font-size: 0.72rem;  color: var(--wms-muted); margin: 0.1rem 0 0; }
  .wv-card-body       { padding: 1.25rem; }

  /* ── Key-value rows inside settings cards ────────────────────────────── */
  .wv-row       { display: flex; justify-content: space-between; align-items: center; padding: 0.58rem 0; border-bottom: 1px solid rgba(180,110,0,0.08); font-size: 0.84rem; }
  .wv-row:last-child { border-bottom: none; }
  .wv-row-lbl   { font-size: 0.72rem; font-weight: 700; color: var(--wms-faint); text-transform: uppercase; letter-spacing: 0.06em; }
  .wv-row-val   { color: var(--wms-ink2); font-weight: 500; }
  .wv-mono      { font-family: var(--font-mono); font-size: 0.8rem; background: rgba(180,110,0,0.08); padding: 0.15rem 0.5rem; border-radius: 5px; border: 1px solid var(--wms-line-md); color: var(--wms-ink2); }
  .wv-g2        { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
  .wv-g3        { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.72rem; }
  @media (max-width: 560px) { .wv-g2, .wv-g3 { grid-template-columns: 1fr; } }

  /* ── Stat tile (device_view, node_view) ──────────────────────────────── */
  .stat-tile {
    background: var(--wms-surface-2);
    border: 1px solid var(--wms-line);
    border-radius: var(--wms-r-md);
    padding: 0.9rem; text-align: center;
  }
  .stat-tile-val, .stat-tile .st-value {
    font-family: var(--font-display);
    font-size: 1.55rem; font-weight: 700;
    color: var(--wms-ink2); line-height: 1.1;
  }
  .stat-tile-lbl, .stat-tile .st-label {
    font-size: 0.68rem; color: var(--wms-muted);
    text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.28rem;
  }
  .stat-tile .st-unit { font-size: 0.72rem; color: var(--wms-muted); }

  /* ── Info grid (device detail panels) ───────────────────────────────── */
  .info-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 1.5rem; }
  .info-row-label { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--wms-muted); margin-bottom: 0.12rem; }
  .info-row-val   { font-size: 0.78rem; font-family: var(--font-mono); color: var(--wms-ink2); }

  /* ── Page title bar (used in settings, profile, users, support) ──────── */
  .wms-titlebar {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem;
  }
  .wms-page-icon {
    width: 2.75rem; height: 2.75rem;
    border-radius: var(--wms-r-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    background: linear-gradient(135deg, rgba(217,119,6,0.18), rgba(180,83,9,0.12));
    border: 1px solid rgba(180,110,0,0.22);
  }

  /* ── Progress bar variants (device_view uses .wms-progress, node uses fill-track) */
  .wms-progress {
    width: 100%; height: 8px; border-radius: 999px;
    background: rgba(180,110,0,0.12); overflow: hidden; margin: 0.6rem 0;
  }
  .wms-progress-fill-bar { height: 100%; border-radius: 999px; transition: width 0.7s ease; min-width: 4px; }
  .fill-green { background: linear-gradient(90deg, #34d399, #15803d); }
  .fill-red   { background: linear-gradient(90deg, #f87171, #b91c1c); }

  /* ── Dashboard device card rows ──────────────────────────────────────── */
  .dbd-card {
    display: flex; align-items: stretch;
    border-bottom: 1px solid rgba(180,110,0,0.09);
    transition: background var(--wms-t-fast);
  }
  .dbd-card:last-child { border-bottom: none; }
  .dbd-card:hover { background: rgba(255,248,210,0.40); }
  .dbd-stripe     { width: 3px; flex-shrink: 0; }
  .dbd-stripe.on  { background: var(--wms-green); }
  .dbd-stripe.off { background: rgba(180,110,0,0.18); }
  .dbd-body   { flex: 1; min-width: 0; padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.22rem; }
  .dbd-top    { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
  .dbd-name   { font-size: 0.83rem; font-weight: 700; color: var(--wms-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; flex: 1; min-width: 0; }
  .dbd-name:hover { color: var(--wms-gold-dk); }
  .dbd-bottom { display: flex; align-items: center; justify-content: space-between; gap: 0.4rem; }
  .dbd-meta   { font-size: 0.67rem; color: var(--wms-faint); display: flex; align-items: center; gap: 0.3rem; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
  .dbd-time   { font-size: 0.63rem; color: var(--wms-faint); font-family: var(--font-mono); white-space: nowrap; flex-shrink: 0; }
  .dbd-actions { display: flex; gap: 0.22rem; padding: 0 0.6rem 0 0; align-self: center; flex-shrink: 0; }
  .dbd-btn    { width: 1.55rem; height: 1.55rem; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; font-size: 0.72rem; text-decoration: none; color: var(--wms-muted); background: rgba(255,248,210,0.60); border: 1px solid rgba(180,110,0,0.16); transition: all var(--wms-t-fast); }
  .dbd-btn:hover { color: var(--wms-gold-dk); background: rgba(217,119,6,0.12); border-color: rgba(180,83,9,0.28); }
  .dbd-section { display: flex; align-items: center; gap: 0.45rem; padding: 0.38rem 0.8rem; background: var(--wms-surface-2); border-bottom: 1px solid rgba(180,110,0,0.09); }
  .dbd-section-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
  .dbd-section-lbl { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }

  /* ── Alert row (dashboard panel + alerts page) ───────────────────────── */
  .alr-row       { display: flex; gap: 0.7rem; padding: 0.8rem 1.1rem; border-bottom: 1px solid rgba(180,110,0,0.10); transition: background var(--wms-t-fast); text-decoration: none; color: inherit; }
  .alr-row:last-child { border-bottom: none; }
  .alr-row:hover { background: rgba(255,248,210,0.40); }
  .alr-row-body  { flex: 1; min-width: 0; }
  .alr-row-title { font-size: 0.83rem; font-weight: 600; color: var(--wms-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .alr-row-meta  { font-size: 0.68rem; color: var(--wms-faint); margin-top: 0.1rem; display: flex; align-items: center; gap: 0.35rem; }
  .alr-row-time  { font-size: 0.68rem; color: var(--wms-faint); white-space: nowrap; flex-shrink: 0; }

  /* ── Quick-action grid (dashboard) ──────────────────────────────────── */
  .qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; padding: 1rem 1.1rem; }
  .qa-btn  { display: flex; align-items: center; gap: 0.55rem; padding: 0.65rem 0.8rem; border-radius: 0.65rem; background: rgba(255,252,235,0.60); border: 1px solid var(--wms-line); font-size: 0.8rem; font-weight: 600; color: var(--wms-ink3); text-decoration: none; transition: all var(--wms-t-fast); }
  .qa-btn:hover { background: rgba(217,119,6,0.10); border-color: var(--wms-line-md); color: var(--wms-ink2); }
  .qa-icon { width: 30px; height: 30px; border-radius: 7px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 0.78rem; }

  /* ── Device class breakdown pills (dashboard) ────────────────────────── */
  .breakdown { display: flex; gap: 0.5rem; padding: 0.85rem 1.1rem; border-top: 1px solid var(--wms-line); }
  .bp-pill    { flex: 1; text-align: center; padding: 0.5rem; border-radius: 8px; font-size: 0.75rem; font-weight: 600; }
  .bp-pill .bp-val { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; display: block; line-height: 1; }
  .bp-pill .bp-lbl { font-size: 0.62rem; opacity: 0.75; text-transform: uppercase; letter-spacing: 0.04em; }
  .bp-wms { background: var(--wms-blue-l);  color: var(--wms-blue); }
  .bp-sib { background: var(--wms-teal-l);  color: var(--wms-teal); }
  .bp-cmd { background: var(--wms-amber-l); color: var(--wms-amber); }

  /* ── Wv-in stagger animations (settings/profile) ─────────────────────── */
  @keyframes wvIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
  .wv-in   { animation: wvIn 0.38s cubic-bezier(0.16,1,0.3,1) both; }
  .wv-d1   { animation-delay: 0.05s; }
  .wv-d2   { animation-delay: 0.10s; }
  .wv-d3   { animation-delay: 0.15s; }
  .wv-d4   { animation-delay: 0.20s; }
  .wv-d5   { animation-delay: 0.25s; }

  /* ── Dashboard-specific layout ───────────────────────────────────────── */
  .dash-cols { display: grid; grid-template-columns: 1fr 20rem; gap: 1.25rem; margin-bottom: 1.5rem; }
  @media (max-width: 60rem) { .dash-cols { grid-template-columns: 1fr; } }

  .wms-stat-icon-utf { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-size: 2rem; opacity: 0.10; pointer-events: none; user-select: none; }

}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 4 — ALERTS PAGE COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

@layer components {

  /* ── Alert card (alerts_view list) ──────────────────────────────────── */
  .alr-card {
    position: relative; overflow: hidden;
    background: var(--wms-surface);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--wms-line);
    box-shadow: var(--wms-shadow-md);
    border-radius: var(--wms-r-lg);
    transition: box-shadow var(--wms-t-base), border-color var(--wms-t-base), opacity var(--wms-t-fast), transform var(--wms-t-fast);
  }
  .alr-card:not(.is-acked):hover {
    border-color: var(--wms-line-md);
    box-shadow: var(--wms-shadow-lg);
    transform: translateY(-1px);
  }
  .alr-card.is-acked { opacity: 0.45; }

  /* ── Alert action buttons ────────────────────────────────────────────── */
  .alr-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.28rem 0.65rem; border-radius: 8px;
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
    border: 1px solid; transition: all var(--wms-t-fast);
  }
  .alr-btn:disabled { opacity: 0.42; cursor: not-allowed; }
  .alr-btn-ack { background:rgba(21,128,61,0.08); border-color:rgba(21,128,61,0.28); color:var(--wms-green); }
  .alr-btn-ack:not(:disabled):hover { background:rgba(21,128,61,0.16); border-color:rgba(21,128,61,0.45); }
  .alr-btn-del { background:var(--wms-red-l); border-color:rgba(185,28,28,0.22); color:var(--wms-red); }
  .alr-btn-del:not(:disabled):hover { background:rgba(185,28,28,0.14); border-color:rgba(185,28,28,0.40); }

  .alr-btn-spin {
    display: inline-block; width: 0.7rem; height: 0.7rem;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: wmsSpinBtn 0.7s linear infinite;
    vertical-align: middle;
  }
  @keyframes wmsSpinBtn { to { transform: rotate(360deg); } }

  /* ── Bulk action buttons (toolbar) ──────────────────────────────────── */
  .bulk-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.38rem 0.85rem; border-radius: var(--wms-r-md);
    font-size: 0.77rem; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 1px solid; transition: all var(--wms-t-fast);
    text-decoration: none;
  }
  .bulk-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .bulk-btn-ghost  { background:var(--wms-surface); border-color:var(--wms-line); color:var(--wms-ink3); }
  .bulk-btn-ghost:hover  { background:rgba(217,119,6,0.09); border-color:var(--wms-line-md); color:var(--wms-ink2); }
  .bulk-btn-danger { background:var(--wms-red-l); border-color:rgba(185,28,28,0.22); color:var(--wms-red); }
  .bulk-btn-danger:hover { background:rgba(185,28,28,0.14); border-color:rgba(185,28,28,0.40); }

  /* ── Card entrance/exit animations ──────────────────────────────────── */
  @keyframes cardIn  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }
  @keyframes cardOut { to   { opacity:0; transform:translateX(28px) scale(0.97); } }
  .card-enter { animation: cardIn  0.38s cubic-bezier(0.16,1,0.3,1) both; }
  .card-exit  { animation: cardOut 0.22s ease forwards; }

  /* Staggered list entrance — first 8 cards */
  .alr-list > .alr-card:nth-child(1)  { animation-delay: 0.045s; }
  .alr-list > .alr-card:nth-child(2)  { animation-delay: 0.090s; }
  .alr-list > .alr-card:nth-child(3)  { animation-delay: 0.135s; }
  .alr-list > .alr-card:nth-child(4)  { animation-delay: 0.180s; }
  .alr-list > .alr-card:nth-child(5)  { animation-delay: 0.225s; }
  .alr-list > .alr-card:nth-child(6)  { animation-delay: 0.270s; }
  .alr-list > .alr-card:nth-child(7)  { animation-delay: 0.315s; }
  .alr-list > .alr-card:nth-child(8)  { animation-delay: 0.360s; }
  .alr-list > .alr-card:nth-child(n+9){ animation-delay: 0.360s; }

  /* ── Alert detail page ───────────────────────────────────────────────── */

  /* Monospace preformatted payload block */
  .glass-pre {
    background: rgba(255,248,220,0.60);
    border-top: 1px solid var(--wms-line);
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    font-size: 0.78rem; line-height: 1.65;
    font-family: var(--font-mono);
    color: var(--wms-ink);
    margin: 0;
    border-radius: 0 0 var(--wms-r-lg) var(--wms-r-lg);
  }

  /* Metadata grid */
  .det-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: rgba(180,110,0,0.12);
  }
  @media (max-width: 580px) { .det-grid { grid-template-columns: repeat(2, 1fr); } }

  .det-cell {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(8px);
    padding: 0.85rem 1rem;
  }
  .det-cell-lbl {
    font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.07em;
    font-weight: 700; color: var(--wms-muted); margin: 0 0 0.28rem;
  }
  .det-cell-val {
    font-size: 0.82rem; font-weight: 600; color: var(--wms-ink); margin: 0;
  }

  /* Ack status pill */
  .ack-pill {
    font-size: 0.67rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.06em; padding: 0.2rem 0.65rem; border-radius: 6px;
    display: inline-block;
  }
  .ack-pill-pending { background:var(--wms-amber-l); color:var(--wms-amber); border:1px solid rgba(180,83,9,0.28); }
  .ack-pill-done    { background:var(--wms-green-l); color:var(--wms-green); border:1px solid rgba(21,128,61,0.25); }

  /* Detail action buttons */
  .det-action-btn {
    display: inline-flex; align-items: center; gap: 0.38rem;
    padding: 0.45rem 1rem; border-radius: var(--wms-r-md);
    font-size: 0.8rem; font-weight: 600; font-family: inherit;
    cursor: pointer; border: 1px solid; transition: all var(--wms-t-fast);
  }
  .det-action-btn:disabled { opacity: 0.45; cursor: not-allowed; }
  .det-btn-ack { background:var(--wms-green-l); border-color:rgba(21,128,61,0.28); color:var(--wms-green); }
  .det-btn-ack:not(:disabled):hover { background:rgba(21,128,61,0.16); border-color:rgba(21,128,61,0.45); }
  .det-btn-del { background:var(--wms-red-l); border-color:rgba(185,28,28,0.22); color:var(--wms-red); }
  .det-btn-del:not(:disabled):hover { background:rgba(185,28,28,0.14); border-color:rgba(185,28,28,0.40); }

  .det-btn-spin {
    display: inline-block; width: 0.72rem; height: 0.72rem;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: wmsSpinDet 0.7s linear infinite;
    vertical-align: middle;
  }
  @keyframes wmsSpinDet { to { transform: rotate(360deg); } }

  /* Copy button */
  .copy-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.72rem; color: var(--wms-muted);
    font-family: var(--font-mono);
    background: none; border: none; cursor: pointer;
    padding: 0.2rem 0.4rem; border-radius: 5px;
    transition: color var(--wms-t-fast), background var(--wms-t-fast);
  }
  .copy-btn:hover { color:var(--wms-gold-dk); background:rgba(217,119,6,0.09); }

  /* Stagger helper for detail page sections */
  .s-enter { animation: wmsIn 0.42s cubic-bezier(0.16,1,0.3,1) both; }
  .s1 { animation-delay: 0.04s; }
  .s2 { animation-delay: 0.09s; }
  .s3 { animation-delay: 0.14s; }
  .s4 { animation-delay: 0.19s; }
  .s5 { animation-delay: 0.24s; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHASE 5 — AUTH PAGE COMPONENTS (login, register)
   Shared by login_view.php and register_view.php — standalone pages,
   no header.php / footer.php. Both use the same glass card + blob bg.
   ═══════════════════════════════════════════════════════════════════════════ */

@layer components {

  /* ── Shared auth entrance animations ────────────────────────────────── */
  /* login uses l-*, register uses rg-* — both alias the same keyframe */
  .l-enter,
  .rg-enter { animation: wmsIn 0.48s cubic-bezier(0.16,1,0.3,1) both; }
  .l-d1, .rg-d1 { animation-delay: 0.05s; }
  .l-d2, .rg-d2 { animation-delay: 0.13s; }
  .l-d3, .rg-d3 { animation-delay: 0.22s; }

  /* ── Auth glass card ─────────────────────────────────────────────────── */
  /* login-card: narrower, more rounded — max-w-sm container */
  .login-card {
    background: rgba(255,252,235,0.82);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(217,119,6,0.22);
    box-shadow: 0 8px 32px rgba(120,70,0,0.13), inset 0 1px 0 rgba(255,255,255,0.82);
    border-radius: 1.5rem;
    padding: 1.75rem;
  }

  /* reg-card: wider, header strip — max-w-lg container */
  .reg-card {
    background: rgba(255,252,235,0.82);
    backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(217,119,6,0.22);
    box-shadow: 0 12px 48px rgba(120,70,0,0.13), inset 0 1px 0 rgba(255,255,255,0.82);
    border-radius: 1.25rem;
    overflow: hidden;
  }

  /* ── Brand icon wrapper ──────────────────────────────────────────────── */
  .login-icon-wrap {
    width: 4rem; height: 4rem;
    border-radius: 1rem;
    background: rgba(255,248,225,0.60);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(251,191,36,0.38);
    box-shadow: 0 4px 16px rgba(180,100,0,0.15), inset 0 1px 0 rgba(255,255,255,0.65);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.6rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  .login-icon-wrap:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(180,100,0,0.20), inset 0 1px 0 rgba(255,255,255,0.70);
  }

  /* ── Flash messages (auth-page variants) ────────────────────────────── */
  /* These sit outside the card — slightly different from .wms-flash */
  .login-flash {
    display: flex; align-items: flex-start; gap: 0.6rem;
    padding: 0.7rem 1rem;
    border-radius: var(--wms-r-md);
    font-size: 0.85rem; font-weight: 500;
    margin-bottom: 1.25rem;
  }
  .login-flash-error {
    background: rgba(254,202,202,0.60);
    border: 1px solid rgba(239,68,68,0.30);
    color: #991b1b;
    backdrop-filter: blur(8px);
  }
  .login-flash-success {
    background: rgba(187,247,208,0.60);
    border: 1px solid rgba(34,197,94,0.30);
    color: #14532d;
    backdrop-filter: blur(8px);
  }
  .login-flash-icon { font-size: 1rem; flex-shrink: 0; line-height: 1.4; }

  /* ── Divider ─────────────────────────────────────────────────────────── */
  .login-divider {
    border: none;
    border-top: 1px solid rgba(180,110,0,0.14);
    margin: 0.25rem 0;
  }

  /* ── Full-width submit modifier ──────────────────────────────────────── */
  .login-submit {
    width: 100%; justify-content: center;
    padding-top: 0.72rem; padding-bottom: 0.72rem;
    font-size: 0.92rem; letter-spacing: 0.03em;
  }

  /* ── Password visibility toggle ──────────────────────────────────────── */
  .pwd-toggle {
    position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
    font-size: 1rem; line-height: 1; opacity: 0.45;
    background: none; border: none; cursor: pointer; padding: 0.15rem;
    border-radius: 4px;
    transition: opacity var(--wms-t-fast), background var(--wms-t-fast);
  }
  .pwd-toggle:hover { opacity: 0.85; background: rgba(180,110,0,0.08); }

  /* ── CAPTCHA image ───────────────────────────────────────────────────── */
  .captcha-img {
    height: 3rem; border-radius: 0.75rem; object-fit: cover;
    border: 1px solid rgba(180,110,0,0.28);
    flex-shrink: 0; cursor: pointer;
    transition: opacity var(--wms-t-fast), border-color var(--wms-t-fast);
  }
  .captcha-img:hover { opacity: 0.88; border-color: rgba(180,110,0,0.45); }

  /* ── Checkbox (gold accent) ──────────────────────────────────────────── */
  .wms-checkbox {
    width: 1rem; height: 1rem;
    border-radius: 0.25rem;
    accent-color: #d97706;
    cursor: pointer; flex-shrink: 0;
  }

  /* ── Two-column field grid (register) ───────────────────────────────── */
  .two-col { display: grid; gap: 1rem; }
  @media (min-width: 560px) { .two-col { grid-template-columns: 1fr 1fr; } }

  /* ── Password strength bar ───────────────────────────────────────────── */
  .str-track {
    height: 3px; background: rgba(180,110,0,0.14);
    border-radius: 3px; margin-top: 0.35rem; overflow: hidden;
  }
  .str-fill {
    height: 100%; border-radius: 3px;
    width: 0; transition: width 0.3s ease, background 0.3s ease;
  }

  /* ── Optional label modifier ─────────────────────────────────────────── */
  .opt-label {
    font-weight: 400; text-transform: none;
    letter-spacing: 0; color: var(--wms-faint);
  }
