/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   WEE BACKOFFICE PORTAL â€” THEME STYLESHEET
   Brand: WEE (West-African Economic Exchange)
   Fonts: Sora (headings/display), DM Sans (body/UI)
   Version: 1.2 Â· March 2026
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•

   TABLE OF CONTENTS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   1.  TOKENS .............. CSS custom properties (colors, type, spacing, shadows)
   2.  BASE ................ html, body, overflow
   3.  LAYOUT .............. .wee-app flex shell
   4.  SIDEBAR ............. 3-zone layout: logo (pinned), nav (scrollable), footer (pinned)
       4a. Logo ............ .wee-sidebar-logo, .wee-sidebar-collapse-btn
       4b. Nav items ....... .wee-sidebar-item, .wee-sidebar-group-toggle
       4c. Submenus ........ .wee-sidebar-submenu, .wee-sidebar-subitem
       4d. Footer .......... .wee-sidebar-env, .wee-sidebar-user, .wee-user-menu
       4e. Collapsed ....... .wee-sidebar.collapsed â€” all overrides for icon-only mode
       4f. Flyouts ......... .wee-flyout â€” JS-generated hover menus for collapsed state
   5.  MAIN ................ .wee-main margin + transitions
   6.  TOPBAR .............. .wee-topbar, search, hamburger, breadcrumb, icon buttons
   7.  NOTIFICATIONS ....... .wee-notif-panel â€” dropdown from bell icon
   8.  PAGE CONTENT ........ .wee-content, .wee-page-header, .wee-page-footer
   9.  STAT CARDS .......... .wee-stats-grid, .wee-stat-card  (+.compact modifier)
   10. CARDS ............... .wee-card, .wee-card-header/body/footer
   11. DATA TABLE .......... .wee-table-wrap (horizontal scroll), .wee-table
   12. BADGES .............. .wee-badge (.teal, .success, .warning, .error, .info, .gold, .neutral)
   13. BUTTONS ............. .wee-btn (.primary, .secondary, .ghost, .gold, .danger) (+.sm, .lg)
   14. FORMS ............... .wee-input, .wee-select, .wee-textarea, .wee-label, .wee-helper
   15. TABS ................ .wee-tabs, .wee-tab
   16. PAGINATION .......... .wee-pagination, .wee-pagination-btn
   17. CHART ............... .wee-chart-area, .wee-chart-bar (CSS-only bar chart placeholder)
   18. ACTIVITY FEED ....... .wee-activity-list, .wee-activity-item
   19. ALERTS .............. .wee-alert (.info, .success, .warning, .error)
   20. TAGS ................ .wee-tag, .wee-tag.teal
   21. PROGRESS ............ .wee-progress, .wee-progress-fill (.gold, .success)
   22. KPI ROW ............. .wee-kpi-row, .wee-kpi-label, .wee-kpi-value
   23. TOGGLE .............. .wee-toggle, .wee-toggle-track  (+.on modifier)
   24. FILTER SYSTEM
       24a. Filter bar ..... .wee-filter-bar â€” inline compact filter row (Pattern A)
       24b. Status chips ... .wee-status-chips, .wee-status-chip â€” tab-style status switcher
       24c. Filter toggle .. .wee-filter-toggle â€” button to show/hide filter panel
       24d. Filter panel ... .wee-filter-panel â€” collapsible panel with fields grid
       24e. Filter fields .. .wee-filter-fields â€” auto-fill responsive grid for filter inputs
       24f. Filter actions . .wee-filter-actions, .wee-filter-reset â€” Apply/Reset buttons
   25. GRID TOOLBAR ........ .wee-grid-toolbar â€” search + filters + actions row above table
   26. ROW ACTIONS ......... .wee-row-btn, .wee-row-more-btn â€” inline + overflow actions
   27. CONTEXT MENU ........ .wee-context-menu â€” JS-generated positioned dropdown
   28. MODALS .............. .wee-modal-overlay, .wee-modal (.sm, .lg, .xl)
   29. LOG VIEWER .......... .wee-log-list, .wee-log-item â€” inside modal for device/audit logs
   30. FORM PAGE ........... Full-page form components:
       30a. Page bar ....... .wee-form-page-bar â€” back + title + save/cancel
       30b. Sections ....... .wee-form-section â€” card with icon header
       30c. Form grid ...... .wee-form-grid â€” 2-column field layout (+.full-width)
       30d. Field types .... .wee-field, .wee-phone-input, .wee-radio-group, .wee-checkbox
       30e. File upload .... .wee-file-upload, .wee-file-item
       30f. Input group .... .wee-input-group, .wee-input-addon
       30g. Sticky footer .. .wee-form-footer â€” save/cancel pinned to bottom
   31. DETAIL PAGE ......... Read-only view components:
       31a. Header ......... .wee-detail-header â€” avatar + name + badges + actions
       31b. Metrics ........ .wee-detail-metrics â€” 4-column KPI cards
       31c. Sections ....... .wee-detail-section, .wee-detail-fields
       31d. Field display .. .wee-detail-field-label, .wee-detail-field-value (.mono, .muted)
       31e. Timeline ....... .wee-timeline â€” activity log with colored dots
   32. RESPONSIVE .......... @media breakpoints: 1200px, 900px, 600px

   NAMING CONVENTION
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   All classes prefixed with "wee-" to avoid conflicts with Bootstrap, Kendo, etc.
   Modifiers use dot notation: .wee-stat-card.gold, .wee-badge.success, .wee-btn.sm
   Layout variants: .full-width (inside grids), .compact (on parent container)

   COLOR SEMANTICS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   .teal ........ default/primary brand accent
   .success ..... completed, verified, active
   .warning ..... pending, review needed
   .error ....... failed, suspended, danger action
   .info ........ processing, informational
   .gold ........ WEE Capital tier, premium
   .neutral ..... inactive, disabled

   BREAKPOINTS
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   â‰¤1200px ...... stat cards 2-col, build info hidden
   â‰¤900px ....... sidebar â†’ off-canvas drawer, single-column layouts, form grid 1-col
   â‰¤600px ....... stat cards 1-col, search hidden, row buttons icon-only, modals full-width

   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --wee-teal:          #008B8B;
  --wee-teal-hover:    #007A7A;
  --wee-teal-active:   #006969;
  --wee-teal-light:    #00AFAF;
  --wee-teal-dim:      #006666;
  --wee-teal-ghost:    #E6F4F4;
  --wee-teal-bg:       #F0FAFA;
  --wee-charcoal:      #2C2C2C;
  --wee-charcoal-deep: #1A1A1A;
  --wee-mid:           #4A4A4A;
  --wee-grey:          #6B7280;
  --wee-grey-light:    #9CA3AF;
  --wee-rule:          #E5E7EB;
  --wee-light:         #F3F4F6;
  --wee-off:           #F8F8F8;
  --wee-white:         #FFFFFF;
  --wee-gold:          #D4AF37;
  --wee-gold-hover:    #C9A227;
  --wee-gold-light:    #FDF8E7;
  --wee-success:       #059669;
  --wee-success-light: #ECFDF5;
  --wee-error:         #DC2626;
  --wee-error-light:   #FEF2F2;
  --wee-warning:       #D97706;
  --wee-warning-light: #FFFBEB;
  --wee-info:          #2563EB;
  --wee-info-light:    #EFF6FF;
  --wee-page-bg:       #F0F1F3;
  --wee-card-bg:       #FFFFFF;
  --wee-sidebar-bg:    #1A1A1A;
  --wee-topbar-bg:     #FFFFFF;
  --wee-shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
  --wee-shadow-md:     0 4px 12px rgba(0,0,0,0.07);
  --wee-shadow-lg:     0 12px 32px rgba(0,0,0,0.10);
  --wee-shadow-card:   0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --wee-radius-sm:     4px;
  --wee-radius-md:     6px;
  --wee-radius-lg:     10px;
  --wee-radius-xl:     14px;
  --wee-radius-full:   9999px;
  --wee-font-display:  'Sora', sans-serif;
  --wee-font-body:     'DM Sans', sans-serif;
  --wee-text-xs:       11px;
  --wee-text-sm:       13px;
  --wee-text-base:     14px;
  --wee-text-md:       15px;
  --wee-text-lg:       18px;
  --wee-text-xl:       22px;
  --wee-text-2xl:      28px;
  --wee-text-3xl:      36px;
  --sidebar-width:     264px;
  --sidebar-collapsed: 68px;
  --topbar-height:     60px;
  --wee-ease:          cubic-bezier(0.4, 0, 0.2, 1);
  --wee-duration:      0.2s;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  font-family: var(--wee-font-body);
  background: var(--wee-page-bg);
  color: var(--wee-charcoal);
  line-height: 1.55;
  font-size: var(--wee-text-base);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   LAYOUT
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.wee-app { display: flex; min-height: 100vh; }


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SIDEBAR â€” 3-zone: pinned logo, scrollable nav, pinned footer
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.wee-sidebar {
  width: var(--sidebar-width);
  background: var(--wee-sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 40;
  transition: width 0.3s var(--wee-ease);
  overflow: hidden;
}

/* â”€â”€ Zone 1: Logo (pinned top) â”€â”€ */
.wee-sidebar-logo {
  height: var(--topbar-height);
  min-height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.wee-sidebar-logo > svg {
  width: 48px; height: 24px;
  fill: var(--wee-teal-light);
  flex-shrink: 0;
  transition: width 0.3s var(--wee-ease);
}

.wee-sidebar-logo-text {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-xs);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s var(--wee-ease), width 0.3s var(--wee-ease);
}

.wee-sidebar-collapse-btn {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: var(--wee-radius-md);
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  transition: all var(--wee-duration) var(--wee-ease);
}

.wee-sidebar-collapse-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
}

.wee-sidebar-collapse-btn svg {
  width: 16px; height: 16px;
  transition: transform 0.3s var(--wee-ease);
}


/* â”€â”€ Zone 2: Nav (scrollable middle) â”€â”€ */
.wee-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.wee-sidebar-nav::-webkit-scrollbar { width: 4px; }
.wee-sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.wee-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
.wee-sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

.wee-sidebar-section { padding: 16px 10px 4px; }

.wee-sidebar-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(255,255,255,0.18);
  padding: 0 8px; margin-bottom: 6px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 0.2s var(--wee-ease);
}

/* Sidebar items */
.wee-sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--wee-radius-md);
  color: rgba(255,255,255,0.45);
  font-size: var(--wee-text-sm); font-weight: 500;
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.wee-sidebar-item:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.75); }
.wee-sidebar-item.active { background: rgba(0,175,175,0.12); color: var(--wee-teal-light); }
.wee-sidebar-item.active::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; background: var(--wee-teal-light); border-radius: 0 3px 3px 0; }
.wee-sidebar-item > svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
.wee-sidebar-item.active > svg { opacity: 1; }
.wee-sidebar-item-text { flex: 1; min-width: 0; overflow: hidden; transition: opacity 0.2s var(--wee-ease), width 0.3s var(--wee-ease); }

/* Tooltip spans are data-only for the JS flyout â€” always hidden in DOM */
.wee-sidebar-tooltip { display: none; }

.wee-sidebar-badge {
  background: var(--wee-teal); color: var(--wee-white);
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--wee-radius-full);
  min-width: 20px; text-align: center; flex-shrink: 0;
  transition: opacity 0.2s var(--wee-ease), width 0.2s var(--wee-ease);
}

.wee-sidebar-badge.gold { background: var(--wee-gold); color: var(--wee-charcoal-deep); }


/* â”€â”€ Submenu â”€â”€ */
.wee-sidebar-group-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  border-radius: var(--wee-radius-md);
  color: rgba(255,255,255,0.45);
  font-size: var(--wee-text-sm); font-weight: 500;
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
  white-space: nowrap; overflow: hidden;
  width: 100%; border: none; background: transparent;
  text-align: left; font-family: var(--wee-font-body);
}

.wee-sidebar-group-toggle:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.75); }
.wee-sidebar-group-toggle > svg { width: 18px; height: 18px; flex-shrink: 0; opacity: 0.6; }
.wee-sidebar-group-toggle .wee-sidebar-item-text { flex: 1; overflow: hidden; }

.wee-sidebar-chevron {
  width: 16px; height: 16px; flex-shrink: 0; opacity: 0.3;
  transition: transform 0.25s var(--wee-ease), opacity 0.2s var(--wee-ease);
}

.wee-sidebar-group.open .wee-sidebar-chevron { transform: rotate(90deg); }
.wee-sidebar-group.open .wee-sidebar-group-toggle { color: rgba(255,255,255,0.7); }
.wee-sidebar-group.open .wee-sidebar-group-toggle > svg { opacity: 0.8; }

.wee-sidebar-submenu {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s var(--wee-ease);
}

.wee-sidebar-group.open .wee-sidebar-submenu { max-height: 400px; }

.wee-sidebar-subitem {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 42px;
  border-radius: var(--wee-radius-md);
  color: rgba(255,255,255,0.35);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
}

.wee-sidebar-subitem::before {
  content: ''; position: absolute;
  left: 26px; top: 50%;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  transform: translateY(-50%);
  transition: background var(--wee-duration) var(--wee-ease);
}

.wee-sidebar-subitem:hover { color: rgba(255,255,255,0.7); background: rgba(255,255,255,0.04); }
.wee-sidebar-subitem:hover::before { background: rgba(255,255,255,0.4); }
.wee-sidebar-subitem.active { color: var(--wee-teal-light); }
.wee-sidebar-subitem.active::before { background: var(--wee-teal-light); }


/* â”€â”€ Zone 3: Footer (pinned bottom) â”€â”€ */
.wee-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.wee-sidebar-env {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  overflow: hidden;
}

.wee-sidebar-env-tag {
  font-family: var(--wee-font-display);
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 3px;
  flex-shrink: 0;
}

.wee-sidebar-env-tag.dev      { background: rgba(251,191,36,0.15); color: #FBBF24; }
.wee-sidebar-env-tag.staging  { background: rgba(167,139,250,0.15); color: #A78BFA; }
.wee-sidebar-env-tag.uat      { background: rgba(96,165,250,0.15); color: #60A5FA; }
.wee-sidebar-env-tag.prod     { background: rgba(0,175,175,0.15); color: var(--wee-teal-light); }

.wee-sidebar-env-meta {
  font-size: 10px; color: rgba(255,255,255,0.2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.wee-sidebar-env-meta span { color: rgba(255,255,255,0.35); }

.wee-sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--wee-duration) var(--wee-ease);
  overflow: hidden;
}

.wee-sidebar-user:hover { background: rgba(255,255,255,0.05); }

.wee-sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: var(--wee-radius-full);
  background: var(--wee-teal);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--wee-font-display);
  font-size: 12px; font-weight: 700; color: var(--wee-white);
  flex-shrink: 0;
}

.wee-sidebar-user-info { overflow: hidden; transition: opacity 0.2s var(--wee-ease), width 0.3s var(--wee-ease); }
.wee-sidebar-user-name { font-size: var(--wee-text-sm); font-weight: 600; color: rgba(255,255,255,0.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wee-sidebar-user-role { font-size: var(--wee-text-xs); color: rgba(255,255,255,0.3); white-space: nowrap; }

/* â”€â”€ User menu popover â”€â”€ */
.wee-sidebar-user-wrapper {
  position: relative;
}

.wee-user-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 10px;
  right: 10px;
  background: var(--wee-charcoal);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--wee-radius-lg);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  z-index: 60;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.2s var(--wee-ease);
}

.wee-user-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wee-user-menu-header {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.wee-user-menu-name {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-sm);
  font-weight: 700;
  color: rgba(255,255,255,0.9);
}

.wee-user-menu-email {
  font-size: var(--wee-text-xs);
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}

.wee-user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: var(--wee-text-sm);
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.15s var(--wee-ease);
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--wee-font-body);
}

.wee-user-menu-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.wee-user-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  flex-shrink: 0;
}

.wee-user-menu-item:hover svg { opacity: 0.8; }

.wee-user-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.06);
}

.wee-user-menu-item.danger { color: rgba(220,80,80,0.8); }
.wee-user-menu-item.danger:hover { color: #EF4444; background: rgba(239,68,68,0.08); }
.wee-user-menu-item.danger svg { color: currentColor; }

/* Collapsed: position flyout to the right instead */
.wee-sidebar.collapsed .wee-user-menu {
  left: calc(var(--sidebar-collapsed) + 6px);
  right: auto;
  bottom: 0;
  min-width: 200px;
  position: fixed;
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SIDEBAR â€” COLLAPSED STATE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.wee-sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Logo: stack vertically */
.wee-sidebar.collapsed .wee-sidebar-logo {
  padding: 0;
  flex-direction: column;
  align-items: center;
  gap: 0;
  height: auto;
  min-height: auto;
}

.wee-sidebar.collapsed .wee-sidebar-logo > svg {
  width: 32px; height: 16px;
  margin: 16px 0 6px 0;
}

.wee-sidebar.collapsed .wee-sidebar-logo-text {
  display: none;
}

.wee-sidebar.collapsed .wee-sidebar-collapse-btn {
  margin: 0 0 12px 0;
  position: static;
  width: 24px; height: 24px;
}

.wee-sidebar.collapsed .wee-sidebar-collapse-btn svg {
  transform: rotate(180deg);
}

/* Nav sections â€” tighten spacing */
.wee-sidebar.collapsed .wee-sidebar-section {
  padding: 10px 0 2px;
}

.wee-sidebar.collapsed .wee-sidebar-section-title {
  display: none;
}

/* â”€â”€ Uniform collapsed item box â”€â”€
   Both .wee-sidebar-item and .wee-sidebar-group-toggle
   become identical 44x44 centered icon buttons */
.wee-sidebar.collapsed .wee-sidebar-item,
.wee-sidebar.collapsed .wee-sidebar-group-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 2px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-radius: var(--wee-radius-lg);
  position: relative;
  overflow: visible;
}

/* Hide all text / badges / chevrons */
.wee-sidebar.collapsed .wee-sidebar-item-text,
.wee-sidebar.collapsed .wee-sidebar-badge,
.wee-sidebar.collapsed .wee-sidebar-chevron,
.wee-sidebar.collapsed .wee-sidebar-tooltip {
  display: none;
}

/* Active bar repositioned for centered box */
.wee-sidebar.collapsed .wee-sidebar-item.active::before {
  left: -2px;
  top: 10px;
  bottom: 10px;
  width: 3px;
}

/* Submenus hidden */
.wee-sidebar.collapsed .wee-sidebar-submenu {
  max-height: 0 !important;
}

/* Icons get slightly larger in collapsed mode */
.wee-sidebar.collapsed .wee-sidebar-item > svg,
.wee-sidebar.collapsed .wee-sidebar-group-toggle > svg {
  width: 20px;
  height: 20px;
}

/* Footer: centered */
.wee-sidebar.collapsed .wee-sidebar-env {
  padding: 10px 0;
  justify-content: center;
}

.wee-sidebar.collapsed .wee-sidebar-env-meta {
  display: none;
}

.wee-sidebar.collapsed .wee-sidebar-user {
  padding: 12px 0;
  justify-content: center;
  gap: 0;
}

.wee-sidebar.collapsed .wee-sidebar-user-info {
  display: none;
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   SIDEBAR â€” FLOATING FLYOUT (collapsed hover)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.wee-flyout {
  position: fixed;
  left: calc(var(--sidebar-collapsed) + 6px);
  background: var(--wee-charcoal);
  border-radius: var(--wee-radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
  z-index: 200;
  min-width: 180px;
  overflow: hidden;
  animation: wee-flyout-in 0.15s var(--wee-ease);
  pointer-events: auto;
}

@keyframes wee-flyout-in {
  from { opacity: 0; transform: translateX(-4px); }
  to   { opacity: 1; transform: translateX(0); }
}

.wee-flyout-header {
  padding: 10px 16px;
  font-family: var(--wee-font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--wee-teal-light);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.3px;
}

/* Flyout for simple items (tooltip style, no subitems) */
.wee-flyout.simple {
  min-width: auto;
  border-radius: var(--wee-radius-md);
}

.wee-flyout.simple .wee-flyout-header {
  border-bottom: none;
  padding: 7px 14px;
  font-size: 12px;
  color: var(--wee-white);
  font-family: var(--wee-font-body);
  font-weight: 600;
}

/* Flyout submenu links */
.wee-flyout-link {
  display: block;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: all 0.12s var(--wee-ease);
  cursor: pointer;
  border-left: 2px solid transparent;
}

.wee-flyout-link:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  border-left-color: rgba(255,255,255,0.15);
}

.wee-flyout-link.active {
  color: var(--wee-teal-light);
  background: rgba(0,175,175,0.08);
  border-left-color: var(--wee-teal-light);
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MAIN
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
.wee-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  transition: margin-left 0.3s var(--wee-ease);
}

.wee-sidebar.collapsed ~ .wee-main,
.wee-app.sidebar-collapsed .wee-main {
  margin-left: var(--sidebar-collapsed);
}


/* â”€â”€ TOPBAR â”€â”€ */
.wee-topbar {
  height: var(--topbar-height);
  background: var(--wee-topbar-bg);
  border-bottom: 1px solid var(--wee-rule);
  display: flex; align-items: center;
  padding: 0 28px; gap: 16px;
  position: sticky; top: 0; z-index: 30;
  box-shadow: var(--wee-shadow-sm);
}

.wee-hamburger {
  display: none;
  width: 36px; height: 36px;
  border-radius: var(--wee-radius-md);
  border: 1px solid var(--wee-rule);
  background: var(--wee-white);
  align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
}

.wee-hamburger svg { width: 20px; height: 20px; color: var(--wee-charcoal); }

.wee-topbar-title { font-family: var(--wee-font-display); font-size: var(--wee-text-lg); font-weight: 700; color: var(--wee-charcoal); letter-spacing: -0.3px; white-space: nowrap; }

.wee-topbar-breadcrumb { font-size: var(--wee-text-sm); color: var(--wee-grey); display: flex; align-items: center; gap: 6px; }
.wee-topbar-breadcrumb a { color: var(--wee-teal); text-decoration: none; font-weight: 500; }
.wee-topbar-breadcrumb a:hover { text-decoration: underline; }

.wee-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.wee-topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--wee-light); border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-md); padding: 7px 12px; min-width: 240px;
  transition: all var(--wee-duration) var(--wee-ease);
}

.wee-topbar-search:focus-within { border-color: var(--wee-teal); background: var(--wee-white); box-shadow: 0 0 0 3px var(--wee-teal-ghost); }
.wee-topbar-search input { border: none; background: transparent; font-family: var(--wee-font-body); font-size: var(--wee-text-sm); color: var(--wee-charcoal); outline: none; width: 100%; }
.wee-topbar-search input::placeholder { color: var(--wee-grey-light); }
.wee-topbar-search svg { width: 16px; height: 16px; color: var(--wee-grey-light); flex-shrink: 0; }

.wee-topbar-icon-btn {
  width: 36px; height: 36px;
  border-radius: var(--wee-radius-md);
  border: 1px solid var(--wee-rule); background: var(--wee-white);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
  transition: all var(--wee-duration) var(--wee-ease); flex-shrink: 0;
}

.wee-topbar-icon-btn:hover { background: var(--wee-light); border-color: var(--wee-grey-light); }
.wee-topbar-icon-btn svg { width: 18px; height: 18px; color: var(--wee-grey); }
.wee-topbar-icon-btn .wee-notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: var(--wee-error); border-radius: 50%; border: 2px solid var(--wee-white); }


/* â”€â”€ PAGE CONTENT â”€â”€ */
.wee-content { padding: 28px; flex: 1; min-width: 0; overflow-x: hidden; }

/* â”€â”€ PAGE FOOTER â”€â”€ */
.wee-page-footer {
  padding: 20px 28px;
  border-top: 1px solid var(--wee-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--wee-text-xs);
  color: var(--wee-grey-light);
  flex-wrap: wrap;
}

.wee-page-footer a {
  color: var(--wee-grey);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--wee-duration) var(--wee-ease);
}

.wee-page-footer a:hover { color: var(--wee-teal); }
.wee-page-header { margin-bottom: 24px; }
.wee-page-header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wee-page-title { font-family: var(--wee-font-display); font-size: var(--wee-text-2xl); font-weight: 800; color: var(--wee-charcoal); letter-spacing: -0.8px; }
.wee-page-subtitle { font-size: var(--wee-text-base); color: var(--wee-grey); margin-top: 4px; line-height: 1.5; }


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   COMPONENT LIBRARY
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Stat cards */
.wee-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; min-width: 0; }
.wee-stat-card { background: var(--wee-card-bg); border: 1px solid var(--wee-rule); border-radius: var(--wee-radius-lg); padding: 20px 22px; position: relative; overflow: hidden; transition: all var(--wee-duration) var(--wee-ease); box-shadow: var(--wee-shadow-card); }
.wee-stat-card:hover { box-shadow: var(--wee-shadow-md); transform: translateY(-1px); }

/* Compact variant â€” add .compact to .wee-stats-grid */
.wee-stats-grid.compact { gap: 10px; }
.wee-stats-grid.compact .wee-stat-card { padding: 12px 16px; }
.wee-stats-grid.compact .wee-stat-label { font-size: 10px; margin-bottom: 4px; }
.wee-stats-grid.compact .wee-stat-value { font-size: var(--wee-text-lg); margin-bottom: 4px; letter-spacing: -0.5px; }
.wee-stats-grid.compact .wee-stat-icon { width: 32px; height: 32px; top: 12px; right: 12px; }
.wee-stats-grid.compact .wee-stat-icon svg { width: 16px; height: 16px; }

.wee-stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--wee-teal); }
.wee-stat-card.gold::before { background: var(--wee-gold); }
.wee-stat-card.success::before { background: var(--wee-success); }
.wee-stat-card.warning::before { background: var(--wee-warning); }
.wee-stat-card.error::before { background: var(--wee-error); }
.wee-stat-label { font-size: var(--wee-text-xs); font-weight: 600; color: var(--wee-grey); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.wee-stat-value { font-family: var(--wee-font-display); font-size: var(--wee-text-2xl); font-weight: 800; color: var(--wee-charcoal); letter-spacing: -1px; line-height: 1; margin-bottom: 8px; }
.wee-stat-change { font-size: var(--wee-text-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: var(--wee-radius-full); }
.wee-stat-change.up { color: var(--wee-success); background: var(--wee-success-light); }
.wee-stat-change.down { color: var(--wee-error); background: var(--wee-error-light); }
.wee-stat-icon { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: var(--wee-radius-md); display: flex; align-items: center; justify-content: center; background: var(--wee-teal-ghost); }
.wee-stat-card.gold .wee-stat-icon { background: var(--wee-gold-light); }
.wee-stat-card.success .wee-stat-icon { background: var(--wee-success-light); }
.wee-stat-card.warning .wee-stat-icon { background: var(--wee-warning-light); }
.wee-stat-card.error .wee-stat-icon { background: var(--wee-error-light); }
.wee-stat-icon svg { width: 20px; height: 20px; color: var(--wee-teal); }
.wee-stat-card.gold .wee-stat-icon svg { color: var(--wee-gold); }
.wee-stat-card.success .wee-stat-icon svg { color: var(--wee-success); }
.wee-stat-card.warning .wee-stat-icon svg { color: var(--wee-warning); }
.wee-stat-card.error .wee-stat-icon svg { color: var(--wee-error); }

/* Cards */
.wee-card { background: var(--wee-card-bg); border: 1px solid var(--wee-rule); border-radius: var(--wee-radius-lg); box-shadow: var(--wee-shadow-card); overflow: hidden; max-width: 100%; }
.wee-card-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--wee-rule); gap: 12px; flex-wrap: wrap; }
.wee-card-title { font-family: var(--wee-font-display); font-size: var(--wee-text-md); font-weight: 700; color: var(--wee-charcoal); letter-spacing: -0.2px; }
.wee-card-body { padding: 22px; }
.wee-card-footer { padding: 14px 22px; border-top: 1px solid var(--wee-rule); background: var(--wee-off); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wee-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }

/* Table */
.wee-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wee-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--wee-text-sm); min-width: 700px; }
.wee-table thead th { background: var(--wee-off); color: var(--wee-grey); font-weight: 600; font-size: var(--wee-text-xs); letter-spacing: 0.5px; text-transform: uppercase; text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--wee-rule); white-space: nowrap; position: sticky; top: 0; }
.wee-table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--wee-rule); color: var(--wee-mid); vertical-align: middle; }
.wee-table tbody tr { transition: background var(--wee-duration) var(--wee-ease); }
.wee-table tbody tr:hover { background: var(--wee-teal-bg); }
.wee-table tbody tr:last-child td { border-bottom: none; }
.wee-table td.primary { color: var(--wee-charcoal); font-weight: 600; }
.wee-table td.mono { font-family: 'DM Mono', 'SF Mono', monospace; font-size: 12px; letter-spacing: 0.3px; color: var(--wee-grey); }
.wee-table td .wee-user-cell { display: flex; align-items: center; gap: 10px; }
.wee-table td .wee-user-cell-avatar { width: 30px; height: 30px; border-radius: var(--wee-radius-full); background: var(--wee-teal-ghost); display: flex; align-items: center; justify-content: center; font-family: var(--wee-font-display); font-size: 11px; font-weight: 700; color: var(--wee-teal); flex-shrink: 0; }
.wee-table td .wee-user-cell-name { font-weight: 600; color: var(--wee-charcoal); line-height: 1.2; }
.wee-table td .wee-user-cell-sub { font-size: var(--wee-text-xs); color: var(--wee-grey-light); }

/* Badges */
.wee-badge { display: inline-flex; align-items: center; gap: 5px; font-size: var(--wee-text-xs); font-weight: 600; padding: 3px 10px; border-radius: var(--wee-radius-full); white-space: nowrap; }
.wee-badge-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.wee-badge.teal { background: var(--wee-teal-ghost); color: var(--wee-teal); }
.wee-badge.teal .wee-badge-dot { background: var(--wee-teal); }
.wee-badge.success { background: var(--wee-success-light); color: var(--wee-success); }
.wee-badge.success .wee-badge-dot { background: var(--wee-success); }
.wee-badge.warning { background: var(--wee-warning-light); color: var(--wee-warning); }
.wee-badge.warning .wee-badge-dot { background: var(--wee-warning); }
.wee-badge.error { background: var(--wee-error-light); color: var(--wee-error); }
.wee-badge.error .wee-badge-dot { background: var(--wee-error); }
.wee-badge.info { background: var(--wee-info-light); color: var(--wee-info); }
.wee-badge.info .wee-badge-dot { background: var(--wee-info); }
.wee-badge.gold { background: var(--wee-gold-light); color: var(--wee-gold-hover); }
.wee-badge.gold .wee-badge-dot { background: var(--wee-gold); }
.wee-badge.neutral { background: var(--wee-light); color: var(--wee-grey); }
.wee-badge.neutral .wee-badge-dot { background: var(--wee-grey-light); }

/* Buttons */
.wee-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-family: var(--wee-font-body); font-size: var(--wee-text-sm); font-weight: 600; padding: 8px 18px; border-radius: var(--wee-radius-md); border: 1px solid transparent; cursor: pointer; transition: all var(--wee-duration) var(--wee-ease); white-space: nowrap; text-decoration: none; line-height: 1.4; }
.wee-btn svg { width: 16px; height: 16px; }
.wee-btn-primary { background: var(--wee-teal); color: var(--wee-white); border-color: var(--wee-teal); }
.wee-btn-primary:hover { background: var(--wee-teal-hover); border-color: var(--wee-teal-hover); box-shadow: 0 2px 8px rgba(0,139,139,0.3); }
.wee-btn-secondary { background: var(--wee-white); color: var(--wee-charcoal); border-color: var(--wee-rule); }
.wee-btn-secondary:hover { background: var(--wee-light); border-color: var(--wee-grey-light); }
.wee-btn-ghost { background: transparent; color: var(--wee-teal); border-color: transparent; }
.wee-btn-ghost:hover { background: var(--wee-teal-ghost); }
.wee-btn-gold { background: var(--wee-gold); color: var(--wee-charcoal-deep); border-color: var(--wee-gold); }
.wee-btn-gold:hover { background: var(--wee-gold-hover); box-shadow: 0 2px 8px rgba(212,175,55,0.35); }
.wee-btn-danger { background: var(--wee-error); color: var(--wee-white); border-color: var(--wee-error); }
.wee-btn-danger:hover { background: #B91C1C; }
.wee-btn-sm { font-size: var(--wee-text-xs); padding: 0 12px; height: 32px; }
.wee-btn-icon { padding: 8px; }

/* Forms */
.wee-form-group { margin-bottom: 18px; }
.wee-label { display: block; font-size: var(--wee-text-sm); font-weight: 600; color: var(--wee-charcoal); margin-bottom: 6px; }
.wee-input, .wee-select, .wee-textarea { width: 100%; font-family: var(--wee-font-body); font-size: var(--wee-text-base); color: var(--wee-charcoal); background: var(--wee-white); border: 1px solid var(--wee-rule); border-radius: var(--wee-radius-md); padding: 9px 14px; outline: none; transition: all var(--wee-duration) var(--wee-ease); }
.wee-input:focus, .wee-select:focus, .wee-textarea:focus { border-color: var(--wee-teal); box-shadow: 0 0 0 3px var(--wee-teal-ghost); }
.wee-input::placeholder { color: var(--wee-grey-light); }
.wee-input.error { border-color: var(--wee-error); }
.wee-input.error:focus { box-shadow: 0 0 0 3px var(--wee-error-light); }
.wee-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236B7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.wee-helper { font-size: var(--wee-text-xs); color: var(--wee-grey); margin-top: 4px; }
.wee-helper.error { color: var(--wee-error); }

/* Tabs */
.wee-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--wee-rule); margin-bottom: 22px; }
.wee-tab { padding: 10px 18px; font-size: var(--wee-text-sm); font-weight: 600; color: var(--wee-grey); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--wee-duration) var(--wee-ease); white-space: nowrap; }
.wee-tab:hover { color: var(--wee-charcoal); }
.wee-tab.active { color: var(--wee-teal); border-bottom-color: var(--wee-teal); }
/* Count beside a tab label, for a tab whose contents are a list worth sizing up front.
   Shown only when the number is interesting - see the Billers tab, which omits it at 1. */
.wee-tab-count { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: var(--wee-radius-full); background: var(--wee-light); color: var(--wee-mid); font-size: var(--wee-text-xs); font-weight: 600; vertical-align: 1px; }
.wee-tab.active .wee-tab-count { background: var(--wee-teal); color: var(--wee-white); }

/* Pagination */
.wee-pagination { display: flex; align-items: center; gap: 4px; font-size: var(--wee-text-sm); }
.wee-pagination-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--wee-radius-md); border: 1px solid var(--wee-rule); background: var(--wee-white); color: var(--wee-grey); font-size: var(--wee-text-sm); font-weight: 500; cursor: pointer; transition: all var(--wee-duration) var(--wee-ease); }
.wee-pagination-btn:hover { background: var(--wee-light); color: var(--wee-charcoal); }
.wee-pagination-btn.active { background: var(--wee-teal); border-color: var(--wee-teal); color: var(--wee-white); font-weight: 700; }
.wee-pagination-info { font-size: var(--wee-text-sm); color: var(--wee-grey); }

/* Chart */
.wee-chart-area { width: 100%; height: 260px; background: repeating-linear-gradient(0deg, transparent, transparent 49px, var(--wee-rule) 49px, var(--wee-rule) 50px); position: relative; display: flex; align-items: flex-end; gap: 12px; padding: 0 8px; }
.wee-chart-bar { flex: 1; background: linear-gradient(180deg, var(--wee-teal) 0%, var(--wee-teal-dim) 100%); border-radius: var(--wee-radius-sm) var(--wee-radius-sm) 0 0; min-height: 16px; position: relative; transition: all 0.3s var(--wee-ease); opacity: 0.85; }
.wee-chart-bar:hover { opacity: 1; transform: scaleY(1.02); transform-origin: bottom; }
.wee-chart-bar.gold { background: linear-gradient(180deg, var(--wee-gold) 0%, var(--wee-gold-hover) 100%); }
.wee-chart-bar-label { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--wee-grey); font-weight: 500; white-space: nowrap; }
.wee-chart-bar-value { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-family: var(--wee-font-display); font-size: 10px; font-weight: 700; color: var(--wee-charcoal); white-space: nowrap; }

/* Activity */
.wee-activity-list { list-style: none; }
.wee-activity-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--wee-rule); }
.wee-activity-item:last-child { border-bottom: none; }
.wee-activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--wee-teal); margin-top: 6px; flex-shrink: 0; }
.wee-activity-dot.gold { background: var(--wee-gold); }
.wee-activity-dot.success { background: var(--wee-success); }
.wee-activity-dot.error { background: var(--wee-error); }
.wee-activity-text { font-size: var(--wee-text-sm); color: var(--wee-mid); line-height: 1.5; }
.wee-activity-text strong { color: var(--wee-charcoal); font-weight: 600; }
.wee-activity-time { font-size: var(--wee-text-xs); color: var(--wee-grey-light); margin-top: 3px; }

/* Alert */
.wee-alert { display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--wee-radius-md); border-left: 3px solid; font-size: var(--wee-text-sm); margin-bottom: 16px; }
.wee-alert.info { background: var(--wee-info-light); border-color: var(--wee-info); color: var(--wee-info); }
.wee-alert.success { background: var(--wee-success-light); border-color: var(--wee-success); color: var(--wee-success); }
.wee-alert.warning { background: var(--wee-warning-light); border-color: var(--wee-warning); color: var(--wee-warning); }
.wee-alert.error { background: var(--wee-error-light); border-color: var(--wee-error); color: var(--wee-error); }
.wee-alert-title { font-weight: 700; margin-bottom: 2px; }
.wee-alert-text { color: var(--wee-mid); line-height: 1.5; }
.wee-prose { color: var(--wee-mid); line-height: 1.7; }
.wee-prose h3 { margin: 0 0 10px; font-family: var(--wee-font-display); font-size: var(--wee-text-lg); color: var(--wee-charcoal); }
.wee-prose p { margin: 0 0 12px; }
.wee-prose p:last-child { margin-bottom: 0; }
.wee-special-page { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; padding: 32px 0; }
.wee-special-card { width: 100%; max-width: 760px; background: var(--wee-card-bg); border: 1px solid var(--wee-rule); border-radius: var(--wee-radius-xl); box-shadow: var(--wee-shadow-card); padding: 36px; text-align: center; }
.wee-special-card-error { position: relative; overflow: hidden; }
.wee-special-card-error::after { content: ""; position: absolute; inset: auto -120px -120px auto; width: 260px; height: 260px; background: radial-gradient(circle, rgba(220,38,38,0.08) 0%, transparent 70%); pointer-events: none; }
.wee-special-icon { width: 72px; height: 72px; margin: 0 auto 18px; border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--wee-error-light); color: var(--wee-error); font-size: 30px; }
.wee-special-eyebrow { margin-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: 1.8px; text-transform: uppercase; color: var(--wee-grey-light); }
.wee-special-title { margin: 0 0 10px; font-family: var(--wee-font-display); font-size: 34px; line-height: 1.1; color: var(--wee-charcoal); letter-spacing: -1px; }
.wee-special-text { margin: 0 auto 20px; max-width: 560px; color: var(--wee-grey); line-height: 1.7; }
.wee-special-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 22px 0 24px; }
.wee-special-note { text-align: left; max-width: 620px; margin: 0 auto; position: relative; z-index: 1; }
.wee-code-pill { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; background: var(--wee-light); border: 1px solid var(--wee-rule); border-radius: 999px; padding: 3px 10px; color: var(--wee-charcoal); }
/* Read-only JSON/code viewer block, e.g. request/response payloads inside a modal. */
.wee-code-block { max-height: 260px; overflow: auto; background: var(--wee-light); border: 1px solid var(--wee-rule); border-radius: var(--wee-radius-sm); padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: var(--wee-text-xs); white-space: pre-wrap; word-break: break-word; color: var(--wee-charcoal); }

/* Tags */
.wee-tag { display: inline-flex; align-items: center; gap: 5px; font-size: var(--wee-text-xs); font-weight: 500; padding: 3px 10px; border-radius: var(--wee-radius-sm); background: var(--wee-light); color: var(--wee-grey); border: 1px solid var(--wee-rule); }
.wee-tag.teal { background: var(--wee-teal-ghost); color: var(--wee-teal); border-color: transparent; }

/* Progress */
.wee-progress { width: 100%; height: 6px; background: var(--wee-light); border-radius: var(--wee-radius-full); overflow: hidden; }
.wee-progress-fill { height: 100%; border-radius: var(--wee-radius-full); background: var(--wee-teal); transition: width 0.6s var(--wee-ease); }
.wee-progress-fill.gold { background: var(--wee-gold); }

/* KPI */
.wee-kpi-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--wee-rule); font-size: var(--wee-text-sm); }
.wee-kpi-row:last-child { border-bottom: none; }
.wee-kpi-label { color: var(--wee-grey); }
.wee-kpi-value { font-family: var(--wee-font-display); font-weight: 700; color: var(--wee-charcoal); }

/* Dashboard */
.wee-dashboard-section { margin-bottom: 24px; }
.wee-dashboard-card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wee-dashboard-grid { display: grid; gap: 16px; }
.wee-dashboard-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wee-dashboard-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wee-dashboard-grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr); }
.wee-dashboard-stat-title { font-size: var(--wee-text-sm); color: var(--wee-grey); font-weight: 600; margin-bottom: 10px; }
.wee-dashboard-stat-pair { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.wee-dashboard-stat-main { font-family: var(--wee-font-display); font-size: var(--wee-text-2xl); font-weight: 800; color: var(--wee-charcoal); letter-spacing: -1px; line-height: 1; }
.wee-dashboard-stat-sub { font-size: var(--wee-text-sm); font-weight: 700; }
.wee-dashboard-stat-sub.success { color: var(--wee-success); }
.wee-dashboard-chart { position: relative; height: 300px; }
.wee-dashboard-links { display: flex; flex-direction: column; gap: 10px; }
.wee-dashboard-link { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--wee-rule); border-radius: var(--wee-radius-md); background: var(--wee-off); color: var(--wee-charcoal); text-decoration: none; transition: all var(--wee-duration) var(--wee-ease); }
.wee-dashboard-link:hover { background: var(--wee-card-bg); border-color: var(--wee-teal-soft); box-shadow: var(--wee-shadow-sm); transform: translateY(-1px); color: var(--wee-charcoal); }
.wee-dashboard-link-icon { width: 36px; height: 36px; border-radius: var(--wee-radius-md); background: var(--wee-teal-ghost); color: var(--wee-teal); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wee-dashboard-link-text { flex: 1; font-size: var(--wee-text-sm); font-weight: 600; }
.wee-dashboard-link-arrow { color: var(--wee-grey-light); font-size: var(--wee-text-xs); }

/* Toggle */
.wee-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: var(--wee-text-sm); color: var(--wee-mid); }
.wee-toggle-track { width: 38px; height: 22px; border-radius: var(--wee-radius-full); background: var(--wee-rule); position: relative; transition: background var(--wee-duration) var(--wee-ease); }
.wee-toggle-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--wee-white); box-shadow: 0 1px 3px rgba(0,0,0,0.15); transition: transform var(--wee-duration) var(--wee-ease); }
.wee-toggle.on .wee-toggle-track { background: var(--wee-teal); }
.wee-toggle.on .wee-toggle-track::after { transform: translateX(16px); }


/* â”€â”€ FILTER BAR (shared base) â”€â”€ */
.wee-filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--wee-rule);
  flex-wrap: wrap;
  background: var(--wee-off);
  overflow: hidden;
}

.wee-filter-bar .wee-input,
.wee-filter-bar .wee-select,
.wee-filter-panel .wee-input,
.wee-filter-panel .wee-select {
  width: auto;
  min-width: 160px;
  padding: 7px 12px;
  font-size: var(--wee-text-sm);
  background: var(--wee-white);
}

.wee-filter-bar .wee-select,
.wee-filter-panel .wee-select {
  padding-right: 32px;
}

.wee-filter-search {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--wee-white);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-md);
  padding: 7px 12px;
  min-width: 200px;
  transition: all var(--wee-duration) var(--wee-ease);
}

.wee-filter-search:focus-within {
  border-color: var(--wee-teal);
  box-shadow: 0 0 0 3px var(--wee-teal-ghost);
}

.wee-filter-search input {
  border: none;
  background: transparent;
  font-family: var(--wee-font-body);
  font-size: var(--wee-text-sm);
  color: var(--wee-charcoal);
  outline: none;
  width: 100%;
}

.wee-filter-search input::placeholder { color: var(--wee-grey-light); }
.wee-filter-search svg { width: 14px; height: 14px; color: var(--wee-grey-light); flex-shrink: 0; }

.wee-filter-spacer { flex: 1; }

.wee-filter-count {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey);
  white-space: nowrap;
}

.wee-filter-count strong { color: var(--wee-charcoal); font-weight: 700; }


/* â”€â”€ STATUS CHIPS (tabs above grid) â”€â”€ */
.wee-status-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--wee-rule);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.wee-status-chips::-webkit-scrollbar { display: none; }

.wee-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--wee-radius-full);
  border: 1px solid var(--wee-rule);
  background: var(--wee-white);
  font-size: var(--wee-text-xs);
  font-weight: 600;
  color: var(--wee-grey);
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
  white-space: nowrap;
  font-family: var(--wee-font-body);
}

.wee-status-chip:hover {
  border-color: var(--wee-grey-light);
  color: var(--wee-charcoal);
  background: var(--wee-light);
}

.wee-status-chip.active {
  background: var(--wee-teal);
  border-color: var(--wee-teal);
  color: var(--wee-white);
}

.wee-status-chip .wee-chip-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--wee-radius-full);
  background: rgba(0,0,0,0.08);
  min-width: 18px;
  text-align: center;
}

.wee-status-chip.active .wee-chip-count {
  background: rgba(255,255,255,0.2);
}


/* â”€â”€ FILTER TOGGLE BUTTON (for B.1) â”€â”€ */
.wee-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  height: 32px;
  border-radius: var(--wee-radius-md);
  border: 1px solid var(--wee-rule);
  background: var(--wee-white);
  font-family: var(--wee-font-body);
  font-size: var(--wee-text-xs);
  font-weight: 600;
  color: var(--wee-grey);
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
}

.wee-filter-toggle:hover {
  border-color: var(--wee-grey-light);
  color: var(--wee-charcoal);
}

.wee-filter-toggle.active {
  border-color: var(--wee-teal);
  color: var(--wee-teal);
  background: var(--wee-teal-ghost);
}

.wee-filter-toggle svg { width: 14px; height: 14px; }

.wee-filter-toggle-count {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--wee-radius-full);
  background: var(--wee-teal);
  color: var(--wee-white);
  min-width: 16px;
  text-align: center;
  line-height: 1.4;
}


/* â”€â”€ FILTER PANEL (B.1 â€” toggle) â”€â”€ */
.wee-filter-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s var(--wee-ease);
  border-bottom: 1px solid transparent;
}

.wee-filter-panel.open {
  max-height: 400px;
  border-bottom-color: var(--wee-rule);
}

.wee-filter-panel-inner {
  padding: 16px 22px;
  background: var(--wee-off);
}


/* â”€â”€ FILTER GRID (fields layout inside panels) â”€â”€ */
.wee-filter-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  align-items: end;
}

.wee-filter-field label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--wee-grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.wee-filter-field .wee-input,
.wee-filter-field .wee-select {
  width: 100%;
  min-width: 0;
}

/* Filter/Reset action row */
.wee-filter-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 14px;
}

.wee-filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--wee-font-body);
  font-size: var(--wee-text-xs);
  font-weight: 600;
  color: var(--wee-grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--wee-duration) var(--wee-ease);
}

.wee-filter-reset:hover { color: var(--wee-error); }
.wee-filter-reset svg { width: 13px; height: 13px; }


/* â”€â”€ GRID TOOLBAR â”€â”€ */
.wee-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--wee-rule);
  flex-wrap: wrap;
}

.wee-grid-toolbar-left,
.wee-grid-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.wee-grid-toolbar-title {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-md);
  font-weight: 700;
  color: var(--wee-charcoal);
  letter-spacing: -0.2px;
  margin-right: 8px;
}


/* â”€â”€ ROW ACTIONS â”€â”€ */
.wee-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.wee-row-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: var(--wee-font-body);
  font-size: 11px;
  font-weight: 600;
  padding: 0 10px;
  height: 28px;
  border-radius: var(--wee-radius-sm);
  border: 1px solid var(--wee-rule);
  background: var(--wee-white);
  color: var(--wee-grey);
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
  white-space: nowrap;
}

.wee-row-btn:hover {
  background: var(--wee-light);
  color: var(--wee-charcoal);
  border-color: var(--wee-grey-light);
}

.wee-row-btn svg { width: 13px; height: 13px; }

.wee-row-btn.primary {
  background: var(--wee-teal-ghost);
  border-color: transparent;
  color: var(--wee-teal);
}

.wee-row-btn.primary:hover {
  background: var(--wee-teal);
  color: var(--wee-white);
}

.wee-row-btn.danger {
  background: var(--wee-error-light);
  border-color: transparent;
  color: var(--wee-error);
}

.wee-row-btn.danger:hover {
  background: var(--wee-error);
  color: var(--wee-white);
}

/* 3-dot overflow button â€” same height as row-btn */
.wee-row-more {
  position: relative;
}

.wee-row-more-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--wee-radius-sm);
  border: 1px solid var(--wee-rule);
  background: var(--wee-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: var(--wee-grey);
  transition: all var(--wee-duration) var(--wee-ease);
  letter-spacing: 1px;
  line-height: 1;
}

.wee-row-more-btn:hover {
  background: var(--wee-light);
  color: var(--wee-charcoal);
}


/* â”€â”€ CONTEXT MENU â”€â”€ */
.wee-context-menu {
  position: fixed;
  background: var(--wee-white);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  box-shadow: var(--wee-shadow-lg);
  z-index: 200;
  min-width: 180px;
  padding: 6px 0;
  animation: wee-ctx-in 0.12s var(--wee-ease);
}

@keyframes wee-ctx-in {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.wee-context-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: var(--wee-text-sm);
  font-weight: 500;
  color: var(--wee-mid);
  cursor: pointer;
  transition: all 0.1s var(--wee-ease);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--wee-font-body);
}

.wee-context-menu-item:hover {
  background: var(--wee-light);
  color: var(--wee-charcoal);
}

.wee-context-menu-item svg {
  width: 15px;
  height: 15px;
  color: var(--wee-grey-light);
  flex-shrink: 0;
}

.wee-context-menu-item:hover svg { color: var(--wee-grey); }

.wee-context-menu-divider {
  height: 1px;
  background: var(--wee-rule);
  margin: 4px 0;
}

.wee-context-menu-item.danger { color: var(--wee-error); }
.wee-context-menu-item.danger svg { color: var(--wee-error); }
.wee-context-menu-item.danger:hover { background: var(--wee-error-light); }


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   FORM PAGE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Page bar (back + title + actions) â”€â”€ */
.wee-form-page-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.wee-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--wee-font-body);
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-grey);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: color var(--wee-duration) var(--wee-ease);
}

.wee-back-btn:hover { color: var(--wee-teal); }
.wee-back-btn svg { width: 18px; height: 18px; }

.wee-form-page-title {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-2xl);
  font-weight: 800;
  color: var(--wee-charcoal);
  letter-spacing: -0.8px;
  flex: 1;
}

.wee-form-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}


/* â”€â”€ Form container â”€â”€ */
.wee-form-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  /* Sticky footers are rendered after the form container, so the page needs
     reserved bottom space to keep the last section visible while scrolling. */
  padding-bottom: var(--wee-form-footer-space, 104px);
}


/* â”€â”€ Form section (fieldset) â”€â”€ */
.wee-form-section {
  background: var(--wee-card-bg);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  box-shadow: var(--wee-shadow-card);
  overflow: hidden;
}

.wee-form-section-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--wee-rule);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.wee-form-section-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--wee-radius-md);
  background: var(--wee-teal-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.wee-form-section-icon svg {
  width: 18px;
  height: 18px;
  color: var(--wee-teal);
}

.wee-form-section-icon.gold { background: var(--wee-gold-light); }
.wee-form-section-icon.gold svg { color: var(--wee-gold); }

.wee-form-section-title {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-md);
  font-weight: 700;
  color: var(--wee-charcoal);
  letter-spacing: -0.2px;
}

.wee-form-section-desc {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey);
  margin-top: 2px;
  line-height: 1.4;
}

.wee-form-section-body {
  padding: 24px;
}


/* â”€â”€ Form grid (2-column by default) â”€â”€ */
.wee-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 24px;
}

.wee-form-grid .full-width {
  grid-column: 1 / -1;
}


/* â”€â”€ Form field with label â”€â”€ */
.wee-field {
  display: flex;
  flex-direction: column;
}

.wee-field-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-charcoal);
  margin-bottom: 6px;
}

.wee-field-required {
  color: var(--wee-error);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
}

.wee-field-hint {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey-light);
  margin-top: 4px;
  line-height: 1.4;
}


/* â”€â”€ Phone input with prefix â”€â”€ */
.wee-phone-input {
  display: flex;
  gap: 0;
}

.wee-phone-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--wee-light);
  border: 1px solid var(--wee-rule);
  border-right: none;
  border-radius: var(--wee-radius-md) 0 0 var(--wee-radius-md);
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-grey);
  white-space: nowrap;
}

.wee-phone-input .wee-input {
  border-radius: 0 var(--wee-radius-md) var(--wee-radius-md) 0;
}


/* â”€â”€ Radio group â”€â”€ */
.wee-radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.wee-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: var(--wee-text-sm);
  color: var(--wee-mid);
  transition: color var(--wee-duration) var(--wee-ease);
}

.wee-radio:hover { color: var(--wee-charcoal); }

.wee-radio input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--wee-teal);
  cursor: pointer;
  margin: 0;
}


/* â”€â”€ Checkbox (single) â”€â”€ */
.wee-checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: var(--wee-text-sm);
  color: var(--wee-mid);
  line-height: 1.5;
}

.wee-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--wee-teal);
  cursor: pointer;
  margin: 0;
  margin-top: 1px;
  flex-shrink: 0;
}


/* â”€â”€ File upload area â”€â”€ */
.wee-file-upload {
  border: 2px dashed var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--wee-duration) var(--wee-ease);
  background: var(--wee-off);
}

.wee-file-upload:hover {
  border-color: var(--wee-teal);
  background: var(--wee-teal-bg);
}

.wee-file-upload-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--wee-radius-full);
  background: var(--wee-teal-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.wee-file-upload-icon svg {
  width: 20px;
  height: 20px;
  color: var(--wee-teal);
}

.wee-file-upload-text {
  font-size: var(--wee-text-sm);
  color: var(--wee-grey);
}

.wee-file-upload-text strong {
  color: var(--wee-teal);
  font-weight: 600;
}

.wee-file-upload-hint {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey-light);
  margin-top: 4px;
}

/* â”€â”€ Image picker (Wee/_ImagePicker) â”€â”€
   Preview thumbnail beside a compact drop zone. The file input stays in the DOM and
   focusable (wrapped by its label) rather than display:none, so it remains reachable
   by keyboard; it is only visually collapsed. */
.wee-image-picker-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
}

.wee-image-picker-preview {
  flex: none;
  width: 76px;
  height: 76px;
  border-radius: var(--wee-radius-md);
  border: 1px solid var(--wee-rule);
  background: var(--wee-off);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wee-image-picker-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wee-image-picker-empty {
  color: var(--wee-grey-light);
  font-size: 22px;
}

.wee-image-picker .wee-file-upload {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
}

.wee-image-picker .wee-file-upload i {
  color: var(--wee-teal);
  font-size: 15px;
}

.wee-image-picker-cta {
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-teal);
}

.wee-image-picker-name {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey-light);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wee-image-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wee-image-picker .wee-file-upload:focus-within {
  border-color: var(--wee-teal);
  background: var(--wee-teal-bg);
}

.wee-image-picker-error {
  font-size: var(--wee-text-xs);
  margin-top: 4px;
}

/* Uploaded file preview */
.wee-file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--wee-off);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-md);
  margin-top: 10px;
}

.wee-file-item-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--wee-radius-md);
  background: var(--wee-teal-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wee-file-item-icon svg { width: 16px; height: 16px; color: var(--wee-teal); }

.wee-file-item-info { flex: 1; min-width: 0; }
.wee-file-item-name { font-size: var(--wee-text-sm); font-weight: 600; color: var(--wee-charcoal); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wee-file-item-size { font-size: var(--wee-text-xs); color: var(--wee-grey-light); }

.wee-file-item-remove {
  width: 24px; height: 24px;
  border-radius: var(--wee-radius-sm);
  border: none;
  background: none;
  color: var(--wee-grey-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--wee-duration) var(--wee-ease);
}

.wee-file-item-remove:hover { color: var(--wee-error); background: var(--wee-error-light); }
.wee-file-item-remove svg { width: 14px; height: 14px; }


/* â”€â”€ Sticky form footer â”€â”€ */
.wee-form-footer {
  position: sticky;
  bottom: 0;
  background: var(--wee-white);
  border-top: 1px solid var(--wee-rule);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.04);
  z-index: 10;
  margin: 0 -28px -28px;
}

.wee-form-footer-left {
  margin-right: auto;
  font-size: var(--wee-text-xs);
  color: var(--wee-grey-light);
}

/* Form page embedded in a workspace tab (_LayoutBare + .wee-embed-content).
   The bare layout has no content padding, so the footer's negative gutters —
   which exist to bleed it to the edges of .wee-content's 28px padding — would
   push it past the iframe's width and add a second, horizontal scrollbar. The
   reserved footer space is unnecessary too: the tab is sized to the viewport,
   so the host iframe already owns the only scrollbar. */
.wee-embed-content .wee-form-container { padding-bottom: 0; }
.wee-embed-content .wee-form-footer { margin: 0; }


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   MODALS
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

.wee-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s var(--wee-ease);
}

.wee-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.wee-modal {
  background: var(--wee-white);
  border-radius: var(--wee-radius-xl);
  box-shadow: var(--wee-shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s var(--wee-ease);
}

.wee-modal-overlay.open .wee-modal {
  transform: translateY(0) scale(1);
}

.wee-modal.sm { max-width: 400px; }
.wee-modal.lg { max-width: 680px; }
.wee-modal.xl { max-width: 900px; }

/* Placeholder shown while a modal body is being fetched. */
.wee-modal-loading { padding: 32px; text-align: center; font-size: var(--wee-text-sm); color: var(--wee-grey); }

.wee-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--wee-rule);
  flex-shrink: 0;
  gap: 12px;
}

.wee-modal-title {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-lg);
  font-weight: 700;
  color: var(--wee-charcoal);
  letter-spacing: -0.3px;
}

.wee-modal-subtitle {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey);
  margin-top: 2px;
}

.wee-modal-close {
  width: 32px; height: 32px;
  border-radius: var(--wee-radius-md);
  border: none;
  background: var(--wee-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--wee-grey);
  flex-shrink: 0;
  transition: all var(--wee-duration) var(--wee-ease);
  font-size: 16px;
}

.wee-modal-close:hover { background: var(--wee-rule); color: var(--wee-charcoal); }

.wee-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.wee-modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--wee-rule);
  background: var(--wee-off);
  border-radius: 0 0 var(--wee-radius-xl) var(--wee-radius-xl);
  flex-shrink: 0;
}

.wee-modal-footer-left { margin-right: auto; }

/* â”€â”€ Log viewer inside modal â”€â”€ */
.wee-log-list { list-style: none; font-size: var(--wee-text-sm); }

.wee-log-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--wee-rule);
  align-items: flex-start;
}

.wee-log-item:last-child { border-bottom: none; }

.wee-log-time {
  font-family: 'DM Mono', 'SF Mono', monospace;
  font-size: 11px;
  color: var(--wee-grey-light);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 110px;
  padding-top: 1px;
}

.wee-log-level {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.5px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 3px;
  flex-shrink: 0; min-width: 42px; text-align: center;
}

.wee-log-level.info    { background: var(--wee-info-light); color: var(--wee-info); }
.wee-log-level.success { background: var(--wee-success-light); color: var(--wee-success); }
.wee-log-level.warn    { background: var(--wee-warning-light); color: var(--wee-warning); }
.wee-log-level.error   { background: var(--wee-error-light); color: var(--wee-error); }
.wee-log-level.debug   { background: var(--wee-light); color: var(--wee-grey); }

.wee-log-msg { color: var(--wee-mid); line-height: 1.5; flex: 1; min-width: 0; }
.wee-log-msg strong { color: var(--wee-charcoal); font-weight: 600; }
.wee-log-msg code {
  font-family: 'DM Mono', 'SF Mono', monospace;
  font-size: 11px;
  background: var(--wee-light);
  padding: 1px 5px; border-radius: 3px;
  color: var(--wee-teal-dim);
}

.wee-log-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 1px solid var(--wee-rule);
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .wee-modal { margin: 12px; max-height: calc(100vh - 24px); }
  .wee-modal-header { padding: 14px 16px; }
  .wee-modal-body { padding: 16px; }
  .wee-modal-footer { padding: 12px 16px; }
  .wee-log-time { min-width: auto; }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   DETAIL PAGE (read-only view)
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* â”€â”€ Detail header (identity + actions) â”€â”€ */
.wee-detail-header {
  background: var(--wee-card-bg);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  box-shadow: var(--wee-shadow-card);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.wee-detail-avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--wee-radius-full);
  background: var(--wee-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--wee-font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--wee-white);
  flex-shrink: 0;
}

.wee-detail-avatar.gold {
  background: linear-gradient(135deg, var(--wee-gold), var(--wee-gold-hover));
}

.wee-detail-identity {
  flex: 1;
  min-width: 0;
}

.wee-detail-name {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-xl);
  font-weight: 800;
  color: var(--wee-charcoal);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.wee-detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.wee-detail-id {
  font-family: 'DM Mono', 'SF Mono', monospace;
  font-size: var(--wee-text-xs);
  color: var(--wee-grey);
  letter-spacing: 0.3px;
}

.wee-detail-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--wee-grey-light);
  flex-shrink: 0;
}

.wee-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}


/* â”€â”€ Detail metrics row â”€â”€ */
.wee-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.wee-detail-metric {
  background: var(--wee-card-bg);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  padding: 18px 20px;
  box-shadow: var(--wee-shadow-card);
  text-align: center;
}

.wee-detail-metric-value {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-xl);
  font-weight: 800;
  color: var(--wee-charcoal);
  letter-spacing: -0.5px;
  line-height: 1;
  margin-bottom: 4px;
}

.wee-detail-metric-label {
  font-size: var(--wee-text-xs);
  color: var(--wee-grey);
  font-weight: 500;
}


/* â”€â”€ Detail sections (read-only cards) â”€â”€ */
.wee-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.wee-detail-section {
  background: var(--wee-card-bg);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  box-shadow: var(--wee-shadow-card);
  overflow: hidden;
}

.wee-detail-section.full-width {
  grid-column: 1 / -1;
}

.wee-detail-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--wee-rule);
}

.wee-detail-section-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--wee-radius-md);
  background: var(--wee-teal-ghost);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wee-detail-section-icon svg { width: 14px; height: 14px; color: var(--wee-teal); }
.wee-detail-section-icon.gold { background: var(--wee-gold-light); }
.wee-detail-section-icon.gold svg { color: var(--wee-gold); }

.wee-detail-section-title {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-sm);
  font-weight: 700;
  color: var(--wee-charcoal);
}

.wee-detail-section-body {
  padding: 18px 20px;
}


/* â”€â”€ Read-only field pairs â”€â”€ */
.wee-detail-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.wee-detail-fields .full-width { grid-column: 1 / -1; }

.wee-detail-field {}

.wee-detail-field-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--wee-grey-light);
  margin-bottom: 3px;
}

.wee-detail-field-value {
  font-size: var(--wee-text-sm);
  font-weight: 500;
  color: var(--wee-charcoal);
  line-height: 1.5;
}

.wee-detail-field-value.mono {
  font-family: 'DM Mono', 'SF Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: var(--wee-grey);
}

.wee-detail-field-value.muted {
  color: var(--wee-grey-light);
  font-style: italic;
}


/* â”€â”€ Timeline / Activity â”€â”€ */
.wee-timeline {
  list-style: none;
}

.wee-timeline-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  position: relative;
}

.wee-timeline-item:not(:last-child) { border-bottom: 1px solid var(--wee-rule); }

.wee-timeline-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  padding-top: 2px;
}

.wee-timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--wee-teal);
  background: var(--wee-white);
  flex-shrink: 0;
}

.wee-timeline-dot.filled { background: var(--wee-teal); }
.wee-timeline-dot.gold   { border-color: var(--wee-gold); }
.wee-timeline-dot.gold.filled { background: var(--wee-gold); }
.wee-timeline-dot.success { border-color: var(--wee-success); }
.wee-timeline-dot.success.filled { background: var(--wee-success); }
.wee-timeline-dot.error   { border-color: var(--wee-error); }
.wee-timeline-dot.error.filled { background: var(--wee-error); }

.wee-timeline-body { flex: 1; min-width: 0; }

.wee-timeline-text {
  font-size: var(--wee-text-sm);
  color: var(--wee-mid);
  line-height: 1.5;
}

.wee-timeline-text strong { color: var(--wee-charcoal); font-weight: 600; }

.wee-timeline-time {
  font-size: 10px;
  color: var(--wee-grey-light);
  margin-top: 2px;
}


/* â”€â”€ Input group (prefix/suffix) â”€â”€ */
.wee-input-group {
  display: flex;
}

.wee-input-addon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: var(--wee-light);
  border: 1px solid var(--wee-rule);
  font-size: var(--wee-text-sm);
  font-weight: 500;
  color: var(--wee-grey);
  white-space: nowrap;
}

.wee-input-addon:first-child {
  border-right: none;
  border-radius: var(--wee-radius-md) 0 0 var(--wee-radius-md);
}

.wee-input-addon:last-child {
  border-left: none;
  border-radius: 0 var(--wee-radius-md) var(--wee-radius-md) 0;
}

.wee-input-group .wee-input {
  border-radius: 0;
}

.wee-input-group .wee-input:first-child { border-radius: var(--wee-radius-md) 0 0 var(--wee-radius-md); }
.wee-input-group .wee-input:last-child { border-radius: 0 var(--wee-radius-md) var(--wee-radius-md) 0; }


/* Mobile overlay */
.wee-sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 35; opacity: 0; transition: opacity 0.3s var(--wee-ease); }
.wee-sidebar-overlay.visible { opacity: 1; }


/* â”€â”€ NOTIFICATIONS PANEL â”€â”€ */
.wee-notif-wrapper {
  position: relative;
}

.wee-notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 380px;
  max-height: 480px;
  background: var(--wee-white);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  box-shadow: var(--wee-shadow-lg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s var(--wee-ease);
}

.wee-notif-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wee-notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--wee-rule);
  flex-shrink: 0;
}

.wee-notif-title {
  font-family: var(--wee-font-display);
  font-size: var(--wee-text-md);
  font-weight: 700;
  color: var(--wee-charcoal);
}

.wee-notif-count {
  font-size: 10px;
  font-weight: 700;
  background: var(--wee-error);
  color: var(--wee-white);
  padding: 2px 8px;
  border-radius: var(--wee-radius-full);
}

.wee-notif-mark {
  font-size: var(--wee-text-xs);
  color: var(--wee-teal);
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--wee-font-body);
}

.wee-notif-mark:hover { text-decoration: underline; }

.wee-notif-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  max-height: 340px;
}

.wee-notif-list::-webkit-scrollbar { width: 4px; }
.wee-notif-list::-webkit-scrollbar-thumb { background: var(--wee-rule); border-radius: 4px; }

.wee-notif-entry {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--wee-rule);
  cursor: pointer;
  transition: background var(--wee-duration) var(--wee-ease);
}

.wee-notif-entry:hover { background: var(--wee-off); }
.wee-notif-entry:last-child { border-bottom: none; }

.wee-notif-entry.unread { background: var(--wee-teal-bg); }
.wee-notif-entry.unread:hover { background: var(--wee-teal-ghost); }

.wee-notif-icon {
  width: 32px; height: 32px;
  border-radius: var(--wee-radius-full);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.wee-notif-icon.teal    { background: var(--wee-teal-ghost); }
.wee-notif-icon.gold    { background: var(--wee-gold-light); }
.wee-notif-icon.success { background: var(--wee-success-light); }
.wee-notif-icon.error   { background: var(--wee-error-light); }
.wee-notif-icon.warning { background: var(--wee-warning-light); }

.wee-notif-body { flex: 1; min-width: 0; }

.wee-notif-text {
  font-size: var(--wee-text-sm);
  color: var(--wee-mid);
  line-height: 1.45;
}

.wee-notif-text strong { color: var(--wee-charcoal); font-weight: 600; }

.wee-notif-meta {
  font-size: 10px;
  color: var(--wee-grey-light);
  margin-top: 3px;
}

.wee-notif-unread-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--wee-teal);
  flex-shrink: 0;
  margin-top: 6px;
}

.wee-notif-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--wee-rule);
  text-align: center;
  flex-shrink: 0;
}

.wee-notif-footer a {
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-teal);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.wee-notif-footer a:hover { text-decoration: underline; }

.wee-notif-empty {
  padding: 40px 18px;
  text-align: center;
  color: var(--wee-grey-light);
  font-size: var(--wee-text-sm);
}

@media (max-width: 600px) {
  .wee-notif-panel { width: calc(100vw - 32px); right: -8px; }
}


/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   RESPONSIVE
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */
@media (max-width: 1200px) {
  .wee-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .wee-dashboard-card-grid { grid-template-columns: repeat(2, 1fr); }
  .wee-dashboard-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wee-dashboard-grid-2-1 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .wee-sidebar { transform: translateX(-100%); width: 264px !important; }
  .wee-sidebar.open { transform: translateX(0); box-shadow: 8px 0 32px rgba(0,0,0,0.3); }
  .wee-sidebar.open.collapsed { width: 264px !important; }
  .wee-sidebar.open .wee-sidebar-logo { flex-direction: row !important; padding: 0 16px !important; height: var(--topbar-height) !important; min-height: var(--topbar-height) !important; }
  .wee-sidebar.open .wee-sidebar-logo > svg { width: 48px !important; height: 24px !important; margin: 0 !important; }
  .wee-sidebar.open .wee-sidebar-logo-text { display: inline !important; }
  .wee-sidebar.open .wee-sidebar-section { padding: 16px 10px 4px !important; }
  .wee-sidebar.open .wee-sidebar-section-title { display: block !important; margin-bottom: 6px !important; padding: 0 8px !important; }
  .wee-sidebar.open .wee-sidebar-item,
  .wee-sidebar.open .wee-sidebar-group-toggle { width: 100% !important; height: auto !important; padding: 9px 12px !important; justify-content: flex-start !important; gap: 12px !important; margin: 0 !important; }
  .wee-sidebar.open .wee-sidebar-item-text,
  .wee-sidebar.open .wee-sidebar-badge,
  .wee-sidebar.open .wee-sidebar-chevron { display: inline-flex !important; }
  .wee-sidebar.open .wee-sidebar-badge { padding: 2px 7px !important; min-width: 20px !important; }
  .wee-sidebar.open .wee-sidebar-chevron { opacity: 0.3 !important; width: 16px !important; }
  .wee-sidebar.open .wee-sidebar-env { display: flex !important; padding: 10px 16px !important; justify-content: flex-start !important; }
  .wee-sidebar.open .wee-sidebar-env-meta { display: block !important; }
  .wee-sidebar.open .wee-sidebar-user { padding: 12px 16px !important; justify-content: flex-start !important; gap: 10px !important; }
  .wee-sidebar.open .wee-sidebar-user-info { display: block !important; }
  .wee-sidebar.open .wee-sidebar-collapse-btn { display: none; }
  .wee-sidebar.open .wee-sidebar-tooltip { display: none !important; }
  .wee-sidebar-overlay { display: block; }
  .wee-main { margin-left: 0 !important; }
  .wee-hamburger { display: flex; }
  .wee-topbar { padding: 0 16px; gap: 10px; }
  .wee-topbar-breadcrumb { display: none; }
  .wee-topbar-search { min-width: 0; flex: 1; }
  .wee-content { padding: 20px 16px; }
  .wee-page-footer { padding: 16px; }
  .wee-two-col { grid-template-columns: 1fr; }
  .wee-page-header-row { flex-direction: column; align-items: flex-start; }
  .wee-page-title { font-size: var(--wee-text-xl); }
  .wee-filter-bar { padding: 12px 16px; }
  .wee-filter-search { min-width: 100%; }
  .wee-grid-toolbar { padding: 12px 16px; }
  .wee-filter-panel-inner { padding: 14px 16px; }
  .wee-status-chips { padding: 10px 16px; gap: 4px; }
  .wee-form-grid { grid-template-columns: 1fr; }
  .wee-form-section-body { padding: 18px 16px; }
  .wee-form-section-header { padding: 14px 16px; }
  .wee-form-page-bar { gap: 10px; }
  .wee-form-page-title { font-size: var(--wee-text-xl); }
  .wee-detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .wee-detail-grid { grid-template-columns: 1fr; }
  .wee-detail-header { padding: 18px 16px; }
  .wee-detail-section-body { padding: 16px; }
  .wee-detail-fields { grid-template-columns: 1fr 1fr; }
  .wee-form-footer { padding: 14px 16px; margin: 0 -16px -20px; }
  .wee-form-container { padding-bottom: var(--wee-form-footer-space, 120px); }
}

@media (max-width: 600px) {
  .wee-stats-grid { grid-template-columns: 1fr; gap: 10px; }
  .wee-dashboard-card-grid { grid-template-columns: 1fr; gap: 10px; }
  .wee-dashboard-grid-2,
  .wee-dashboard-grid-3,
  .wee-dashboard-grid-2-1 { grid-template-columns: 1fr; }
  .wee-stat-value { font-size: var(--wee-text-xl); }
  .wee-dashboard-stat-main { font-size: var(--wee-text-xl); }
  .wee-topbar-search { display: none; }
  .wee-topbar-title { font-size: var(--wee-text-md); }
  .wee-card-header { padding: 14px 16px; }
  .wee-card-body { padding: 16px; }
  .wee-card-footer { padding: 12px 16px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .wee-pagination { flex-wrap: wrap; }
  .wee-chart-area { height: 180px; }
  .wee-dashboard-chart { height: 240px; }
  .wee-btn { padding: 7px 14px; font-size: 12px; }
  .wee-page-footer { flex-direction: column; text-align: center; gap: 4px; }
  .wee-row-btn span { display: none; }
  .wee-row-btn { padding: 5px; }
  .wee-filter-bar .wee-select { min-width: 100%; }
  .wee-filter-fields { grid-template-columns: 1fr; }
  .wee-grid-toolbar { flex-direction: column; align-items: flex-start; }
  .wee-status-chip { font-size: 10px; padding: 5px 10px; }
  .wee-form-page-bar { flex-direction: column; align-items: flex-start; }
  .wee-form-page-actions { width: 100%; }
  .wee-form-page-actions .wee-btn { flex: 1; }
  .wee-form-footer { flex-wrap: wrap; }
  .wee-form-container { padding-bottom: var(--wee-form-footer-space, 148px); }
  .wee-radio-group { flex-direction: column; gap: 10px; }
  .wee-detail-metrics { grid-template-columns: 1fr 1fr; gap: 8px; }
  .wee-detail-metric { padding: 14px; }
  .wee-detail-metric-value { font-size: var(--wee-text-lg); }
  .wee-detail-fields { grid-template-columns: 1fr; }
  .wee-detail-avatar { width: 48px; height: 48px; font-size: 18px; }
  .wee-detail-name { font-size: var(--wee-text-lg); }
  .wee-detail-actions { width: 100%; }
}


/* ============================================================================
   SPLIT PANE (master-detail)
   A record list beside the detail of whichever row is selected - the shape a
   mail client or a cloud billing console uses. Reach for it when one parent
   owns many children and the point of the screen is moving between them
   rather than reading any one of them in depth.
   The detail side is usually an iframe hosting an existing page, so the grid
   that already knows how to render those children is reused rather than
   reimplemented. Height comes from --wee-split-height so the host page can
   size it against the viewport and let the two panes scroll independently.
   ============================================================================ */
.wee-split {
  display: grid;
  /* List-only until something is picked, so the first thing on screen is the whole list at full
     width rather than a narrow column beside an empty pane. Choosing a record is what splits it. */
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  height: var(--wee-split-height, 620px);
  min-height: 320px;
}

.wee-split.has-selection { grid-template-columns: 360px minmax(0, 1fr); }

.wee-split-list,
.wee-split-detail {
  display: flex;
  flex-direction: column;
  /* Height is set from JS against the real viewport (see the reference page), because this shell
     is usually inside an iframe where a fixed vh calculation leaves a gap at the bottom. */
  min-width: 0;
  min-height: 0;
  background: var(--wee-card-bg);
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-lg);
  box-shadow: var(--wee-shadow-card);
  overflow: hidden;
}

/* The detail pane does not exist until there is something to put in it. Written as a :not() so it
   outranks the shared `.wee-split-list, .wee-split-detail { display: flex }` above regardless of
   source order — at equal specificity that rule wins and the empty pane renders under the list. */
.wee-split:not(.has-selection) .wee-split-detail { display: none; }

.wee-split-list-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--wee-rule);
}

.wee-split-search {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-md);
  font-family: var(--wee-font-body);
  font-size: var(--wee-text-sm);
}

.wee-split-search:focus {
  outline: none;
  border-color: var(--wee-teal);
  box-shadow: 0 0 0 3px var(--wee-teal-ghost);
}

.wee-split-count { font-size: var(--wee-text-xs); color: var(--wee-grey); }

.wee-split-list-body { flex: 1; min-height: 0; overflow-y: auto; }

.wee-split-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--wee-rule);
  background: none;
  font-family: var(--wee-font-body);
  text-align: left;
  cursor: pointer;
}

.wee-split-item:hover { background: var(--wee-off); }
.wee-split-item:focus-visible { outline: 2px solid var(--wee-teal); outline-offset: -2px; }

.wee-split-item.active {
  background: var(--wee-teal-bg);
  box-shadow: inset 3px 0 0 var(--wee-teal);
}

.wee-split-item-main { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }

.wee-split-item-title {
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-charcoal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wee-split-item-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--wee-text-xs);
  color: var(--wee-grey);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wee-split-item-dot {
  flex: none;
  width: 3px;
  height: 3px;
  border-radius: var(--wee-radius-full);
  background: var(--wee-grey-light);
}

.wee-split-item-meta { display: flex; align-items: center; gap: 6px; flex: none; }

.wee-split-item-badge {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: var(--wee-radius-full);
  background: var(--wee-light);
  color: var(--wee-mid);
  font-size: var(--wee-text-xs);
  font-weight: 600;
  text-align: center;
}

.wee-split-item.active .wee-split-item-badge { background: var(--wee-teal); color: var(--wee-white); }

/* A child count of zero is normally a job that did not finish - a seed that
   stopped half way, an import that dropped rows - so it is called out rather
   than left to read as a quiet nothing. */
.wee-split-item-badge.empty { background: var(--wee-warning-light); color: var(--wee-warning); }

.wee-split-item-status { font-size: var(--wee-text-xs); color: var(--wee-warning); }

.wee-split-list-empty {
  padding: 16px 12px;
  font-size: var(--wee-text-sm);
  color: var(--wee-grey);
  text-align: center;
}

.wee-split-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--wee-rule);
}

.wee-split-detail-identity { min-width: 0; }

.wee-split-detail-name {
  font-size: var(--wee-text-md);
  font-weight: 600;
  color: var(--wee-charcoal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wee-split-detail-sub { font-size: var(--wee-text-xs); color: var(--wee-grey); }
.wee-split-detail-actions { display: flex; gap: 8px; flex: none; }

/* Clears the selection and returns to the full-width list. Carries the weight on narrow screens,
   where the list is hidden entirely while a record is open. */
.wee-split-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--wee-rule);
  border-radius: var(--wee-radius-md);
  background: var(--wee-white);
  color: var(--wee-grey);
  font-size: var(--wee-text-base);
  line-height: 1;
  cursor: pointer;
}
.wee-split-close:hover { background: var(--wee-off); color: var(--wee-charcoal); }

.wee-split-frame { flex: 1; min-height: 0; width: 100%; border: 0; display: block; }

.wee-split-placeholder { padding: 24px; text-align: center; }
.wee-split-placeholder-title {
  margin-bottom: 4px;
  font-size: var(--wee-text-sm);
  font-weight: 600;
  color: var(--wee-charcoal);
}
.wee-split-placeholder-text { font-size: var(--wee-text-sm); color: var(--wee-grey); }

/* Below this width the two panes stop being readable side by side, so the list
   becomes a short scroller above the detail instead. */
@media (max-width: 1024px) {
  /* Too narrow for two panes: the list stands alone, and picking a record replaces it with the
     detail rather than squeezing both. The detail's close control is what gets back to the list. */
  .wee-split,
  .wee-split.has-selection { grid-template-columns: 1fr; }
  .wee-split.has-selection .wee-split-list { display: none; }
}

/* ============================================================================
   PARTY CHIPS
   A small uppercase tag naming which kind of actor a grid cell is about, set
   beside the value it qualifies. Started as the Sender/Receiver columns of the
   ledger transactions grid and is shared because the colours are a vocabulary:
   teal means customer and gold means agent wherever they appear, so a second
   grid using them must not pick its own.
   Also serves as a standalone set - see the biller services grid, which uses
   the chips alone to say which apps list a service.
   ============================================================================ */
.cell-muted { color: var(--wee-grey-light); }  /* a grid cell with nothing in it, usually an em dash */

.party-cell { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.party-chip {
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--wee-light, #eef2f4);
  color: var(--wee-charcoal, #374151);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.party-chip.party-customer { background: rgba(0,139,139,.12); color: var(--wee-teal, #008b8b); }
.party-chip.party-agent    { background: rgba(180,134,11,.14); color: #9a6a00; }
.party-chip.party-partner  { background: rgba(99,102,241,.14); color: #4f46e5; }
.party-chip.party-external { background: rgba(107,114,128,.14); color: #4b5563; }
