/*
 * Cirrel-inspired CRM skin
 * -----------------------
 * Visual-only layer: keep navigation, records, forms, and actions in the CRM.
 * Layout rules that define the desktop/mobile shells remain in revamp-dark-ui.css.
 */

/* 1. Theme tokens and ambient canvas */
body.ea360-interface[data-theme="dark"] {
  --cirrel-bg: #070a10;
  --cirrel-surface: rgba(17, 24, 39, .78);
  --cirrel-surface-raised: rgba(23, 32, 51, .84);
  --cirrel-surface-deep: rgba(10, 15, 26, .88);
  --cirrel-line: rgba(176, 197, 239, .15);
  --cirrel-line-strong: rgba(126, 167, 255, .3);
  --cirrel-blue: #4387ff;
  --cirrel-cyan: #30c8ee;
  --cirrel-green: #31d8aa;
  --cirrel-gold: #f0b24d;
  --cirrel-violet: #a58cff;
  --cirrel-text: #f3f6fc;
  --cirrel-muted: #a5b0c4;
  --cirrel-radius: 20px;
  --cirrel-blur: 22px;
  --cirrel-shadow: 0 18px 46px rgba(0, 0, 0, .22);

  --revamp-bg: var(--cirrel-bg);
  --revamp-surface: var(--cirrel-surface-deep);
  --revamp-card: var(--cirrel-surface);
  --revamp-card-soft: var(--cirrel-surface-raised);
  --revamp-line: var(--cirrel-line);
  --revamp-blue: var(--cirrel-blue);
  --revamp-cyan: var(--cirrel-cyan);
  --bg: var(--cirrel-bg);
  --paper: var(--cirrel-surface-deep);
  --line: var(--cirrel-line);
  --ink: var(--cirrel-text);
  --muted: var(--cirrel-muted);

  color: var(--cirrel-text) !important;
  color-scheme: dark;
  background: var(--cirrel-bg) !important;
}

body.ea360-interface[data-theme="dark"]::before {
  content: "";
  position: fixed;
  z-index: 0;
  inset: -12vh -10vw;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 84% 7%, rgba(240, 178, 77, .16), transparent 24%),
    radial-gradient(ellipse at 99% 54%, rgba(48, 200, 238, .13), transparent 28%),
    radial-gradient(ellipse at 7% 42%, rgba(67, 135, 255, .17), transparent 30%),
    radial-gradient(ellipse at 53% 100%, rgba(49, 216, 170, .1), transparent 28%);
  filter: blur(28px);
  animation: cirrel-ambient 28s ease-in-out infinite alternate;
}

body.ea360-interface[data-theme="dark"] .shell {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

body.ea360-interface[data-theme="dark"] .shell > main {
  background: transparent !important;
}

/* 2. Navigation and quick-action glass */
body.ea360-interface[data-theme="dark"] .shell > aside {
  background: linear-gradient(180deg, rgba(14, 21, 36, .9), rgba(8, 13, 24, .86)) !important;
  border-color: var(--cirrel-line) !important;
  backdrop-filter: blur(var(--cirrel-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--cirrel-blur)) saturate(140%);
}

body.ea360-interface[data-theme="dark"] .shell > aside nav button {
  border-radius: 12px !important;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

body.ea360-interface[data-theme="dark"] .shell > aside nav button:hover {
  transform: translateX(2px);
  background: rgba(131, 160, 222, .1) !important;
}

body.ea360-interface[data-theme="dark"] .shell > aside nav button.active {
  color: #fff !important;
  background: linear-gradient(105deg, rgba(49, 112, 229, .54), rgba(35, 75, 147, .3)) !important;
  border: 1px solid var(--cirrel-line-strong) !important;
  box-shadow: inset 3px 0 var(--cirrel-blue), 0 8px 25px rgba(25, 74, 174, .18) !important;
}

body.ea360-interface[data-theme="dark"] .shell > aside nav button.active .nav-icon {
  color: #b4d2ff !important;
}

body.ea360-interface[data-theme="dark"] .shell > main > #commandBar,
body.ea360-interface[data-theme="dark"] .commandbar {
  background: rgba(15, 22, 37, .78) !important;
  border: 1px solid var(--cirrel-line) !important;
  border-radius: 19px !important;
  box-shadow: 0 14px 42px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .07) !important;
  backdrop-filter: blur(var(--cirrel-blur)) saturate(145%) !important;
  -webkit-backdrop-filter: blur(var(--cirrel-blur)) saturate(145%) !important;
}

body.ea360-interface[data-theme="dark"] .command-search {
  background: rgba(25, 34, 54, .78) !important;
  border-color: var(--cirrel-line) !important;
  border-radius: 13px !important;
}

body.ea360-interface[data-theme="dark"] .command-actions button,
body.ea360-interface[data-theme="dark"] #app button {
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

body.ea360-interface[data-theme="dark"] .command-new,
body.ea360-interface[data-theme="dark"] .primary,
body.ea360-interface[data-theme="dark"] .mobile-fab,
body.ea360-interface[data-theme="dark"] .home-primary {
  color: #fff !important;
  background: linear-gradient(125deg, #3478f4, #5794ff) !important;
  border-color: #75a5ff !important;
  box-shadow: 0 8px 25px rgba(54, 119, 244, .25), inset 0 1px rgba(255, 255, 255, .2) !important;
}

body.ea360-interface[data-theme="dark"] .command-new:hover,
body.ea360-interface[data-theme="dark"] .primary:hover,
body.ea360-interface[data-theme="dark"] .home-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 30px rgba(54, 119, 244, .34) !important;
}

/* 3. Frosted surfaces used across CRM workspaces */
body.ea360-interface[data-theme="dark"] :is(
  .panel, .stat, .document-card, .client-card, .department-card,
  .work-queue-panel, .recent-work-panel, .work-metric, .command-card,
  .command-kpi, .attention-panel, .client360-panel, .home-card,
  .home-summary-strip > button, .home-work-hero, .home-account-totals > button,
  .pipeline .lane, .lead-card, .client360-grid article, .pipeline-step,
  .workflow-overview .workday-hero
) {
  background: linear-gradient(145deg, rgba(28, 37, 59, .84), rgba(16, 23, 39, .78)) !important;
  border: 1px solid var(--cirrel-line) !important;
  border-radius: var(--cirrel-radius) !important;
  box-shadow: var(--cirrel-shadow), inset 0 1px rgba(255, 255, 255, .065) !important;
  backdrop-filter: blur(18px) saturate(132%);
  -webkit-backdrop-filter: blur(18px) saturate(132%);
}

body.ea360-interface[data-theme="dark"] :is(.attention-card, .home-focus-item, .home-allocation-row, .home-flow-stage, .home-status-bar-row, .home-project-table tr) {
  background: rgba(12, 19, 32, .68) !important;
  border-color: rgba(176, 197, 239, .12) !important;
}

body.ea360-interface[data-theme="dark"] :is(.home-focus-item, .home-allocation-row, .home-flow-stage, .home-status-bar-row):hover {
  background: rgba(43, 67, 113, .48) !important;
}

/* 4. Dashboard hierarchy and Cirrel-inspired ambient accent */
body.ea360-interface[data-theme="dark"] .home-dashboard {
  position: relative;
  isolation: isolate;
  gap: 20px !important;
}

body.ea360-interface[data-theme="dark"] .home-dashboard::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -30px;
  right: 7%;
  width: clamp(130px, 17vw, 250px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 30%, rgba(255, 220, 142, .82), rgba(221, 153, 44, .5) 28%, rgba(221, 153, 44, .12) 57%, transparent 72%);
  filter: blur(7px);
  opacity: .62;
}

body.ea360-interface[data-theme="dark"] .home-dashboard-head {
  align-items: flex-end !important;
  gap: 20px !important;
  padding: 4px 2px 2px;
}

body.ea360-interface[data-theme="dark"] .home-dashboard-head h1 {
  font-size: clamp(30px, 3vw, 44px) !important;
  letter-spacing: -.045em !important;
}

body.ea360-interface[data-theme="dark"] .home-dashboard-head p {
  color: #aeb9cd !important;
  font-size: 15px !important;
}

body.ea360-interface[data-theme="dark"] :is(.home-breadcrumb, .home-eyebrow, .eyebrow) {
  color: #64cfff !important;
  letter-spacing: .13em !important;
}

body.ea360-interface[data-theme="dark"] :is(.home-header-actions button, .home-card-head > button, .home-focus-actions button, .home-status-foot button, .home-open-project) {
  color: #e9effc !important;
  background: rgba(27, 35, 55, .76) !important;
  border: 1px solid var(--cirrel-line-strong) !important;
  border-radius: 13px !important;
}

body.ea360-interface[data-theme="dark"] .home-summary-strip {
  gap: 12px !important;
}

body.ea360-interface[data-theme="dark"] .home-summary-strip > button {
  min-height: 78px;
  padding: 14px 16px !important;
  border-radius: 17px !important;
}

body.ea360-interface[data-theme="dark"] .home-overview-grid {
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, .86fr) !important;
  gap: 16px !important;
}

body.ea360-interface[data-theme="dark"] :is(.home-secondary-grid, .home-lower-grid) {
  gap: 16px !important;
}

body.ea360-interface[data-theme="dark"] .home-card {
  padding: 22px !important;
  border-radius: 22px !important;
}

body.ea360-interface[data-theme="dark"] .home-work-hero {
  background: linear-gradient(145deg, rgba(12, 19, 35, .94), rgba(12, 17, 31, .82)) !important;
  border-color: rgba(147, 173, 237, .18) !important;
}

body.ea360-interface[data-theme="dark"] .home-work-progress {
  filter: drop-shadow(0 0 14px rgba(48, 200, 238, .2));
}

body.ea360-interface[data-theme="dark"] .home-period-switch {
  padding: 4px !important;
  background: rgba(10, 15, 27, .68) !important;
  border: 1px solid var(--cirrel-line) !important;
  border-radius: 15px !important;
}

body.ea360-interface[data-theme="dark"] .home-period-switch button {
  border-radius: 11px !important;
}

body.ea360-interface[data-theme="dark"] .home-period-switch button.active {
  color: #fff !important;
  background: linear-gradient(125deg, #3478f4, #5794ff) !important;
  box-shadow: 0 5px 16px rgba(54, 119, 244, .26) !important;
}

/* 5. Tables, forms, and dialogs stay readable above the translucent layers */
body.ea360-interface[data-theme="dark"] :is(.tablewrap, .revamp-table-wrap, .home-project-table-wrap, .documents-panel .toolbar, .toolbar, .filter-buttons) {
  background: rgba(12, 18, 31, .76) !important;
  border-color: var(--cirrel-line) !important;
  border-radius: 16px !important;
}

body.ea360-interface[data-theme="dark"] table th {
  color: #c3cee2 !important;
  background: rgba(38, 50, 77, .82) !important;
}

body.ea360-interface[data-theme="dark"] table td {
  border-bottom-color: rgba(177, 194, 230, .12) !important;
}

body.ea360-interface[data-theme="dark"] :is(input, select, textarea) {
  color: #f2f5fb !important;
  background: rgba(13, 19, 33, .82) !important;
  border-color: rgba(177, 194, 230, .2) !important;
  border-radius: 12px !important;
}

body.ea360-interface[data-theme="dark"] :is(input, select, textarea):focus-visible {
  border-color: #70a3ff !important;
  box-shadow: 0 0 0 3px rgba(74, 131, 255, .2) !important;
  outline: none;
}

body.ea360-interface[data-theme="dark"] .badge,
body.ea360-interface[data-theme="dark"] .home-status {
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 999px;
}

body.ea360-interface[data-theme="dark"] dialog {
  background: rgba(13, 19, 33, .97) !important;
  border-color: var(--cirrel-line) !important;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

/* 6. Smaller screens */
@media (max-width: 1100px) {
  body.ea360-interface[data-theme="dark"] .home-overview-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.ea360-interface[data-theme="dark"] .home-focus-card {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  body.ea360-interface[data-theme="dark"]::before {
    inset: -5vh -40vw;
    background:
      radial-gradient(ellipse at 90% 7%, rgba(240, 178, 77, .14), transparent 30%),
      radial-gradient(ellipse at 100% 55%, rgba(48, 200, 238, .12), transparent 35%),
      radial-gradient(ellipse at 0% 45%, rgba(67, 135, 255, .14), transparent 32%),
      radial-gradient(ellipse at 55% 100%, rgba(49, 216, 170, .09), transparent 34%);
    filter: blur(28px);
  }

  body.ea360-interface[data-theme="dark"] .shell > aside {
    background: rgba(12, 17, 30, .82) !important;
    border-bottom-color: var(--cirrel-line) !important;
  }

  body.ea360-interface[data-theme="dark"] .shell > main > #commandBar {
    padding: 8px !important;
    background: rgba(17, 23, 39, .82) !important;
    border: 1px solid var(--cirrel-line) !important;
    border-radius: 18px !important;
  }

  body.ea360-interface[data-theme="dark"] .command-search {
    border-radius: 13px !important;
  }

  body.ea360-interface[data-theme="dark"] .home-dashboard {
    gap: 15px !important;
  }

  body.ea360-interface[data-theme="dark"] .home-dashboard::before {
    top: 0;
    right: -12px;
    width: 130px;
    opacity: .42;
  }

  body.ea360-interface[data-theme="dark"] .home-dashboard-head {
    padding: 3px 2px 0;
  }

  body.ea360-interface[data-theme="dark"] .home-dashboard-head h1 {
    font-size: clamp(29px, 8vw, 36px) !important;
  }

  body.ea360-interface[data-theme="dark"] .home-dashboard-head p {
    color: #aeb9cd !important;
    font-size: 14px !important;
    line-height: 1.5;
  }

  body.ea360-interface[data-theme="dark"] .home-summary-strip {
    gap: 9px !important;
  }

  body.ea360-interface[data-theme="dark"] .home-summary-strip > button {
    border-radius: 15px !important;
  }

  body.ea360-interface[data-theme="dark"] .home-card {
    padding: 17px !important;
    border-radius: 20px !important;
  }

  body.ea360-interface[data-theme="dark"] .home-overview-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.ea360-interface[data-theme="dark"] .home-card-head {
    align-items: flex-start !important;
  }

  body.ea360-interface[data-theme="dark"] .home-period-switch {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.ea360-interface[data-theme="dark"] .home-period-switch button {
    min-height: 42px !important;
  }

  body.ea360-interface[data-theme="dark"] #mobileNav {
    background: rgba(11, 16, 29, .84) !important;
    border: 1px solid rgba(175, 197, 244, .2) !important;
    border-radius: 24px !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .43), inset 0 1px rgba(255, 255, 255, .07) !important;
    backdrop-filter: blur(24px) saturate(145%);
    -webkit-backdrop-filter: blur(24px) saturate(145%);
  }

  body.ea360-interface[data-theme="dark"] #mobileNav button.active {
    color: #9bd3ff !important;
    background: rgba(60, 104, 190, .34) !important;
    border-radius: 15px !important;
  }
}

/* 7. Motion, focus, and operating-system accessibility preferences */
@keyframes cirrel-ambient {
  from { transform: translate3d(-1.2%, 0, 0) scale(1); }
  to { transform: translate3d(1.2%, 1%, 0) scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  body.ea360-interface[data-theme="dark"]::before {
    animation: none !important;
  }

  body.ea360-interface[data-theme="dark"] *,
  body.ea360-interface[data-theme="dark"] *::before,
  body.ea360-interface[data-theme="dark"] *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 8. Cirrel's real app-shell language: a floating, foldable side rail and a
   persistent glass command dock. Keep the CRM's existing routes and actions. */
body.ea360-interface {
  --cirrel-sidebar-width: 258px;
  --cirrel-sidebar-gap: 16px;
  --cirrel-glass-edge: rgba(205, 219, 250, .18);
  --cirrel-glass-hi: rgba(255, 255, 255, .085);
  --cirrel-glass-bg: rgba(19, 27, 44, .66);
  --cirrel-control-bg: rgba(10, 16, 29, .48);
  --cirrel-sidebar-bg: linear-gradient(155deg, rgba(24, 37, 64, .86), rgba(10, 17, 31, .78));
  background:
    radial-gradient(ellipse at 82% 8%, rgba(240, 178, 77, .10), transparent 28%),
    radial-gradient(ellipse at 96% 64%, rgba(48, 200, 238, .11), transparent 31%),
    radial-gradient(ellipse at 14% 42%, rgba(67, 135, 255, .16), transparent 34%),
    radial-gradient(ellipse at 54% 100%, rgba(49, 216, 170, .075), transparent 31%),
    #070a10 !important;
  transition: background-color .3s ease, color .25s ease;
}

body.ea360-interface::before {
  inset: -4vh -4vw !important;
  z-index: 0 !important;
  background:
    radial-gradient(circle clamp(250px, 25vw, 450px) at 7% 73%, #75b7ff 0, #236fd7 48%, #0c438f 82%, transparent 100%),
    radial-gradient(circle clamp(220px, 18vw, 330px) at 82% 0%, #ffc15f 0, #d88931 54%, #854922 85%, transparent 100%),
    radial-gradient(circle clamp(270px, 27vw, 480px) at 98% 87%, #66edf1 0, #25bdcf 49%, #087b8b 83%, transparent 100%),
    radial-gradient(circle clamp(180px, 15vw, 270px) at 52% 96%, #6ef0b7 0, #27bc82 52%, #08724f 86%, transparent 100%),
    radial-gradient(circle clamp(120px, 10vw, 175px) at 66% 70%, #f1f5ff 0, #aebcd8 54%, #667795 88%, transparent 100%) !important;
  filter: saturate(120%) !important;
  animation: cirrel-orbit 36s ease-in-out infinite alternate !important;
}

body.ea360-interface .shell,
body.ea360-interface .shell.sidebar-collapsed {
  --cirrel-sidebar-width: 258px;
  display: block !important;
  min-height: 100dvh !important;
  height: auto !important;
  overflow: visible !important;
  background: transparent !important;
}

body.ea360-interface .shell.sidebar-collapsed { --cirrel-sidebar-width: 82px; }

@media (min-width: 721px) {
  body.ea360-interface .shell > aside {
    position: fixed !important;
    inset: var(--cirrel-sidebar-gap) auto var(--cirrel-sidebar-gap) var(--cirrel-sidebar-gap) !important;
    z-index: 140 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 16px !important;
    width: var(--cirrel-sidebar-width) !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 16px 13px !important;
    overflow: hidden !important;
    color: var(--cirrel-text) !important;
    background: var(--cirrel-sidebar-bg) !important;
    border: 1px solid var(--cirrel-glass-edge) !important;
    border-radius: 24px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .3), inset 0 1px var(--cirrel-glass-hi) !important;
    backdrop-filter: blur(30px) saturate(155%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(155%) !important;
    transition: width .34s cubic-bezier(.2,.8,.2,1), background .25s ease, border-color .25s ease !important;
  }

  body.ea360-interface .shell > aside .sidehead {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    min-height: 49px !important;
    height: auto !important;
    padding: 0 4px 12px !important;
    border-bottom: 1px solid var(--cirrel-glass-edge) !important;
  }

  body.ea360-interface .shell > aside .brand.brand-logo {
    display: flex !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  body.ea360-interface .shell > aside .brand.brand-logo img {
    width: 172px !important;
    max-width: 100% !important;
    max-height: 42px !important;
    object-fit: contain !important;
    object-position: left center !important;
    filter: brightness(0) invert(1) !important;
  }

  body.ea360-interface .shell > aside .sidebar-toggle {
    display: grid !important;
    flex: 0 0 38px !important;
    place-items: center !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    color: var(--cirrel-text) !important;
    background: var(--cirrel-control-bg) !important;
    border: 1px solid var(--cirrel-glass-edge) !important;
    border-radius: 12px !important;
  }

  body.ea360-interface .shell > aside > #nav {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 4px !important;
    width: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    padding: 2px 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(180, 204, 249, .28) transparent !important;
  }

  body.ea360-interface .shell > aside > #nav .ea-nav-heading {
    display: block !important;
    padding: 14px 10px 5px !important;
    color: rgba(195, 210, 239, .65) !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    letter-spacing: .13em !important;
    text-transform: uppercase !important;
  }

  body.ea360-interface .shell > aside > #nav > button {
    position: relative !important;
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 0 11px !important;
    color: #c8d2e7 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    font-size: 13px !important;
    font-weight: 620 !important;
    text-align: left !important;
    white-space: nowrap !important;
    transition: background .22s ease, border-color .22s ease, color .22s ease, transform .22s ease !important;
  }

  body.ea360-interface .shell > aside > #nav > button .nav-icon {
    display: inline-grid !important;
    flex: 0 0 20px !important;
    place-items: center !important;
    width: 20px !important;
    color: #a8bbdd !important;
    font-size: 17px !important;
  }

  body.ea360-interface .shell > aside > #nav > button:hover {
    color: #fff !important;
    background: rgba(147, 178, 232, .105) !important;
    border-color: rgba(206, 220, 248, .1) !important;
    transform: translateX(2px) !important;
  }

  body.ea360-interface .shell > aside > #nav > button.active {
    color: #f6f9ff !important;
    background: linear-gradient(105deg, rgba(60, 121, 236, .34), rgba(48, 92, 165, .18)) !important;
    border-color: rgba(114, 161, 250, .34) !important;
    box-shadow: inset 3px 0 #72a8ff, 0 8px 24px rgba(29, 76, 161, .12) !important;
  }

  body.ea360-interface .shell > aside > #nav > button.active .nav-icon { color: #80d7ef !important; }
  body.ea360-interface .shell > aside > #nav .nav-count { margin-left: auto !important; }
  body.ea360-interface .shell > aside > footer {
    display: block !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    padding: 12px 7px 2px !important;
    color: rgba(194, 206, 229, .62) !important;
    border-top: 1px solid var(--cirrel-glass-edge) !important;
    font-size: 11px !important;
    line-height: 1.5 !important;
  }

  body.ea360-interface .shell > main > #commandBar {
    position: fixed !important;
    inset: 16px 16px auto calc(var(--cirrel-sidebar-width) + 32px) !important;
    z-index: 160 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: left .34s cubic-bezier(.2,.8,.2,1), right .25s ease !important;
  }

  body.ea360-interface .commandbar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 64px !important;
    margin: 0 !important;
    padding: 9px 11px !important;
    background: rgba(16, 23, 39, .66) !important;
    border: 1px solid var(--cirrel-glass-edge) !important;
    border-radius: 21px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .22), inset 0 1px var(--cirrel-glass-hi) !important;
    backdrop-filter: blur(28px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(150%) !important;
  }

  body.ea360-interface .command-search {
    flex: 1 1 180px !important;
    min-width: 90px !important;
    height: 44px !important;
    min-height: 44px !important;
    background: rgba(8, 14, 27, .46) !important;
    border: 1px solid rgba(186, 205, 243, .16) !important;
    border-radius: 14px !important;
  }

  body.ea360-interface .command-actions { gap: 7px !important; }
  body.ea360-interface .command-actions button {
    min-height: 42px !important;
    height: 42px !important;
    border-radius: 13px !important;
  }

  body.ea360-interface .shell > main {
    width: auto !important;
    min-width: 0 !important;
    min-height: 100dvh !important;
    margin: 0 0 0 calc(var(--cirrel-sidebar-width) + 28px) !important;
    padding: 108px 24px 42px !important;
    overflow: visible !important;
    background: transparent !important;
    transition: margin-left .34s cubic-bezier(.2,.8,.2,1) !important;
  }

  body.ea360-interface #mobileNav { display: none !important; }

  body.ea360-interface .shell.sidebar-collapsed > aside .brand.brand-logo { display: none !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside .sidehead { justify-content: center !important; padding-inline: 0 !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav .ea-nav-heading,
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav .nav-label { display: none !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav > button { justify-content: center !important; padding: 0 !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav > button .nav-icon { flex-basis: 22px !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav .nav-count { position: absolute !important; top: 2px !important; right: 3px !important; margin: 0 !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside > footer { display: none !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside { min-width: 82px !important; max-width: 82px !important; }
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav,
  body.ea360-interface .shell.sidebar-collapsed > aside > #nav > button { min-width: 0 !important; }

  @media (max-width: 1100px) {
    body.ea360-interface .shell,
    body.ea360-interface .shell.sidebar-collapsed { --cirrel-sidebar-width: 82px; }
    body.ea360-interface .shell > aside .brand.brand-logo { display: none !important; }
    body.ea360-interface .shell > aside .sidehead { justify-content: center !important; padding-inline: 0 !important; }
    body.ea360-interface .shell > aside > #nav .ea-nav-heading,
    body.ea360-interface .shell > aside > #nav .nav-label { display: none !important; }
    body.ea360-interface .shell > aside > #nav > button { justify-content: center !important; padding: 0 !important; }
    body.ea360-interface .shell > aside > #nav > button .nav-icon { flex-basis: 22px !important; }
    body.ea360-interface .shell > aside > #nav .nav-count { position: absolute !important; top: 2px !important; right: 3px !important; margin: 0 !important; }
    body.ea360-interface .shell > aside > footer { display: none !important; }
    body.ea360-interface .shell > aside { min-width: 82px !important; max-width: 82px !important; }
    body.ea360-interface .shell > aside > #nav,
    body.ea360-interface .shell > aside > #nav > button { min-width: 0 !important; }
    body.ea360-interface .command-actions .command-ai span { display: none !important; }
    body.ea360-interface .shell > main { padding-inline: 18px !important; }
  }
}

/* Soft glass panels across every CRM page, not only the overview dashboard. */
body.ea360-interface #app :is(
  .panel, .stat, .card, .document-card, .client-card, .department-card,
  .work-queue-panel, .recent-work-panel, .work-metric, .command-card,
  .command-kpi, .attention-panel, .client360-panel, .home-card,
  .client360-grid article, .pipeline-step, .pipeline .lane, .lead-card,
  .project-card, .service-card, .employee-card, .account-card,
  .contract-card, .reminder-stage, .invoice-card, .quotation-card,
  .settings-card, .analytics-card, .report-card, .finance-card
) {
  background: linear-gradient(145deg, var(--cirrel-glass-bg), rgba(12, 19, 34, .54)) !important;
  border: 1px solid var(--cirrel-glass-edge) !important;
  border-radius: 22px !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .16), inset 0 1px var(--cirrel-glass-hi) !important;
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

body.ea360-interface #app :is(.panel, .home-card, .client360-panel, .work-queue-panel, .recent-work-panel) { padding: clamp(16px, 1.8vw, 24px) !important; }
body.ea360-interface #app :is(.tablewrap, .revamp-table-wrap, .home-project-table-wrap, .toolbar, .filter-buttons, .filters) {
  background: rgba(8, 14, 26, .46) !important;
  border: 1px solid rgba(192, 209, 242, .12) !important;
  border-radius: 17px !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
body.ea360-interface #app table th { background: rgba(47, 65, 101, .58) !important; }
body.ea360-interface #app table td { background: transparent !important; }
body.ea360-interface #app :is(input, select, textarea) { background: var(--cirrel-control-bg) !important; border-color: var(--cirrel-glass-edge) !important; }
body.ea360-interface #app :is(button, a.button) { transition: transform .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease !important; }
body.ea360-interface #app :is(.panel, .stat, .card, .document-card, .client-card, .home-card):hover {
  border-color: rgba(154, 188, 251, .28) !important;
  box-shadow: 0 22px 52px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .1) !important;
}

body.ea360-interface[data-theme="light"] {
  --cirrel-text: #1d2a40;
  --cirrel-muted: #62728a;
  --cirrel-glass-edge: rgba(71, 96, 138, .17);
  --cirrel-glass-hi: rgba(255, 255, 255, .66);
  --cirrel-glass-bg: rgba(255, 255, 255, .62);
  --cirrel-control-bg: rgba(247, 250, 255, .66);
  --cirrel-sidebar-bg: linear-gradient(155deg, rgba(239, 246, 255, .82), rgba(255, 255, 255, .72));
  color: #1d2a40 !important;
  background:
    radial-gradient(ellipse at 82% 8%, rgba(240, 178, 77, .16), transparent 28%),
    radial-gradient(ellipse at 96% 64%, rgba(48, 200, 238, .13), transparent 31%),
    radial-gradient(ellipse at 14% 42%, rgba(67, 135, 255, .15), transparent 34%),
    #eaf0fb !important;
}
body.ea360-interface[data-theme="light"]::before { opacity: .72 !important; }
body.ea360-interface[data-theme="light"] .shell > aside,
body.ea360-interface[data-theme="light"] .commandbar {
  color: #1d2a40 !important;
  border-color: rgba(71, 96, 138, .17) !important;
  box-shadow: 0 22px 58px rgba(50, 70, 110, .13), inset 0 1px rgba(255, 255, 255, .72) !important;
}
body.ea360-interface[data-theme="light"] .shell > aside > #nav > button { color: #53647d !important; }
body.ea360-interface[data-theme="light"] .shell > aside > #nav > button .nav-icon { color: #56719d !important; }
body.ea360-interface[data-theme="light"] .shell > aside > #nav > button.active { color: #173b78 !important; background: rgba(68, 126, 222, .13) !important; }
body.ea360-interface[data-theme="light"] .shell > aside > #nav .ea-nav-heading { color: #7888a0 !important; }
body.ea360-interface[data-theme="light"] .commandbar { background: rgba(255, 255, 255, .64) !important; }
body.ea360-interface[data-theme="light"] .command-search { background: rgba(247, 250, 255, .76) !important; }
body.ea360-interface[data-theme="light"] #app :is(.panel, .stat, .card, .document-card, .client-card, .home-card, .client360-panel, .work-queue-panel, .recent-work-panel) {
  background: linear-gradient(145deg, rgba(255, 255, 255, .76), rgba(240, 246, 255, .58)) !important;
  border-color: rgba(83, 109, 154, .17) !important;
  box-shadow: 0 18px 45px rgba(54, 78, 120, .1), inset 0 1px rgba(255, 255, 255, .8) !important;
}
body.ea360-interface[data-theme="light"] #app :is(input, select, textarea) { color: #1d2a40 !important; }

@media (max-width: 720px) {
  body.ea360-interface { --cirrel-glass-bg: rgba(22, 30, 48, .68); }
  body.ea360-interface::before { inset: -3vh -55vw !important; filter: saturate(115%) !important; }
  body.ea360-interface .shell > aside {
    position: sticky !important;
    inset: 0 auto auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    gap: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    padding: calc(9px + env(safe-area-inset-top)) 14px 9px !important;
    background: rgba(12, 18, 31, .7) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--cirrel-glass-edge) !important;
    border-radius: 0 0 20px 20px !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, .15) !important;
    backdrop-filter: blur(26px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(26px) saturate(145%) !important;
  }
  body.ea360-interface .shell > aside .sidehead,
  body.ea360-interface .shell > aside > #nav,
  body.ea360-interface .shell > aside > footer { display: none !important; }
  body.ea360-interface .shell > main > #commandBar {
    position: static !important;
    inset: auto !important;
    grid-column: 1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    padding: 0 !important;
    transform: none !important;
  }
  body.ea360-interface .commandbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
    min-height: 0 !important;
    padding: 8px !important;
    border-radius: 18px !important;
  }
  body.ea360-interface .command-search { width: 100% !important; min-height: 42px !important; height: 42px !important; }
  body.ea360-interface .command-actions { justify-content: flex-start !important; gap: 6px !important; width: 100% !important; overflow-x: auto !important; scrollbar-width: none !important; }
  body.ea360-interface .command-actions::-webkit-scrollbar { display: none !important; }
  body.ea360-interface .command-actions button { flex: 0 0 42px !important; width: 42px !important; min-width: 42px !important; height: 42px !important; min-height: 42px !important; padding: 0 6px !important; }
  body.ea360-interface .command-actions .command-new { flex-basis: 90px !important; width: 90px !important; }
  body.ea360-interface .shell > main { width: 100% !important; margin: 0 !important; padding: 18px 14px calc(82px + env(safe-area-inset-bottom)) !important; }
  body.ea360-interface #mobileNav {
    background: rgba(12, 18, 31, .72) !important;
    border: 1px solid rgba(205, 219, 250, .18) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .34), inset 0 1px rgba(255, 255, 255, .09) !important;
    backdrop-filter: blur(28px) saturate(155%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(155%) !important;
  }
  body.ea360-interface #mobileNav button.active { color: #9bd8ff !important; background: rgba(70, 117, 203, .28) !important; }
  body.ea360-interface[data-theme="light"] .shell > aside { background: rgba(245, 249, 255, .82) !important; }
  body.ea360-interface[data-theme="light"] #mobileNav { background: rgba(247, 250, 255, .82) !important; }
}

@keyframes cirrel-orbit {
  from { transform: translate3d(-1%, 0, 0) scale(1); }
  to { transform: translate3d(1.4%, 1.2%, 0) scale(1.035); }
}

/* Mobile app shell. These rules only apply below the phone/tablet breakpoint;
   desktop navigation and desktop spacing remain unchanged. */
@media (max-width: 720px) {
  body.ea360-interface {
    --cirrel-mobile-bar: rgba(11, 17, 30, .88);
    --cirrel-mobile-border: rgba(198, 215, 249, .17);
    min-height: 100dvh !important;
    padding: 0 0 calc(104px + env(safe-area-inset-bottom)) !important;
    overflow-x: clip !important;
    overscroll-behavior-y: contain;
  }

  body.ea360-interface .shell,
  body.ea360-interface .shell.sidebar-collapsed {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  /* Compact branded app header; the full sidebar remains a desktop-only rail. */
  body.ea360-interface .shell > aside {
    position: sticky !important;
    inset: 0 0 auto !important;
    z-index: 190 !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    padding: calc(7px + env(safe-area-inset-top)) 16px 7px !important;
    background: var(--cirrel-mobile-bar) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--cirrel-mobile-border) !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .2) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
  }

  body.ea360-interface .shell > aside .sidehead {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    border: 0 !important;
  }

  body.ea360-interface .shell > aside .brand.brand-logo {
    display: flex !important;
    flex: 0 1 auto !important;
    width: 148px !important;
    min-width: 0 !important;
    padding: 0 !important;
  }

  body.ea360-interface .shell > aside .brand.brand-logo img {
    display: block !important;
    width: 100% !important;
    max-width: 148px !important;
    max-height: 34px !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  body.ea360-interface .shell > aside .sidebar-toggle,
  body.ea360-interface .shell > aside > #nav,
  body.ea360-interface .shell > aside > footer { display: none !important; }

  body.ea360-interface .shell > main {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: calc(100dvh - 52px) !important;
    margin: 0 !important;
    padding: 0 14px calc(28px + env(safe-area-inset-bottom)) !important;
    overflow: visible !important;
  }

  /* Keep the search and essential utilities in a tidy, reachable app toolbar. */
  body.ea360-interface .shell > main > #commandBar {
    position: sticky !important;
    top: calc(50px + env(safe-area-inset-top)) !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 180 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 -14px 14px !important;
    padding: 8px 14px !important;
    transform: none !important;
    background: rgba(7, 11, 20, .3) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
  }

  body.ea360-interface .commandbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 8px !important;
    border: 1px solid var(--cirrel-mobile-border) !important;
    border-radius: 17px !important;
    background: rgba(20, 28, 45, .82) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2), inset 0 1px rgba(255,255,255,.07) !important;
    backdrop-filter: blur(24px) saturate(145%) !important;
    -webkit-backdrop-filter: blur(24px) saturate(145%) !important;
  }

  body.ea360-interface .command-search {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    border-radius: 13px !important;
  }

  body.ea360-interface .command-search input {
    min-width: 0 !important;
    width: 100% !important;
    font-size: 15px !important;
  }

  body.ea360-interface .command-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 7px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body.ea360-interface #commandBar .command-actions .command-ai,
  body.ea360-interface #commandBar .command-actions .command-new,
  body.ea360-interface #commandBar .command-actions #windows-app-refresh,
  body.ea360-interface #commandBar .command-actions #erp-logout-button,
  body.ea360-interface #commandBar .command-actions .command-logout,
  body.ea360-interface #commandBar .command-actions [aria-label="Log out"] { display: none !important; }

  body.ea360-interface #commandBar .command-actions > button {
    box-sizing: border-box !important;
    display: grid !important;
    place-items: center !important;
    flex: 0 0 42px !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    border-radius: 13px !important;
  }

  body.ea360-interface #commandBar .command-actions .command-icon b {
    top: -4px !important;
    right: -3px !important;
  }

  body.ea360-interface #app {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-wrap: anywhere;
  }

  body.ea360-interface #app :is(.panel, .card, .home-card, .client360-panel, .work-queue-panel, .recent-work-panel, .accounting-performance-panel) {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border-radius: 20px !important;
  }

  body.ea360-interface #app :is(.actions, .toolbar, .filters, .filter-buttons) {
    min-width: 0 !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  body.ea360-interface #app :is(input, select, textarea) {
    box-sizing: border-box !important;
    max-width: 100% !important;
    font-size: 16px !important;
  }

  body.ea360-interface #app :is(.tablewrap, .revamp-table-wrap, .home-project-table-wrap) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overscroll-behavior-x: contain !important;
    -webkit-overflow-scrolling: touch;
  }

  body.ea360-interface #app table { max-width: 100% !important; }

  /* App-style floating tab bar with breathing room around the home indicator. */
  body.ea360-interface #mobileNav {
    position: fixed !important;
    inset: auto auto calc(8px + env(safe-area-inset-bottom)) 50% !important;
    z-index: 500 !important;
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    gap: 3px !important;
    box-sizing: border-box !important;
    width: min(520px, calc(100vw - 24px)) !important;
    min-width: 0 !important;
    min-height: 70px !important;
    padding: 6px 7px !important;
    transform: translateX(-50%) !important;
    border: 1px solid var(--cirrel-mobile-border) !important;
    border-radius: 23px !important;
    background: rgba(11, 17, 30, .91) !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .42), inset 0 1px rgba(255,255,255,.09) !important;
    backdrop-filter: blur(26px) saturate(155%) !important;
    -webkit-backdrop-filter: blur(26px) saturate(155%) !important;
  }

  body.ea360-interface #mobileNav button {
    display: grid !important;
    grid-template-rows: 23px auto !important;
    place-content: center !important;
    justify-items: center !important;
    align-content: center !important;
    gap: 3px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 56px !important;
    min-height: 56px !important;
    padding: 4px 1px !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: transparent !important;
    color: #a8b4ca !important;
    font-size: 9px !important;
    font-weight: 650 !important;
    line-height: 1.1 !important;
    white-space: nowrap !important;
  }

  body.ea360-interface #mobileNav button > span,
  body.ea360-interface #mobileNav .mobile-fab span {
    display: block !important;
    color: #dfc87a !important;
    font-size: 20px !important;
    line-height: 1 !important;
  }

  body.ea360-interface #mobileNav button.active {
    background: rgba(67, 119, 214, .2) !important;
    color: #a7d9ff !important;
    box-shadow: inset 0 0 0 1px rgba(120, 173, 255, .13) !important;
  }

  body.ea360-interface #mobileNav button.active > span { color: #f1d77e !important; }

  body.ea360-interface #mobileNav .mobile-fab {
    position: static !important;
    display: grid !important;
    grid-template-rows: 23px auto !important;
    place-content: center !important;
    justify-items: center !important;
    width: 100% !important;
    height: 56px !important;
    min-height: 56px !important;
    margin: 0 !important;
    transform: none !important;
    border: 0 !important;
    border-radius: 16px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #a8b4ca !important;
    font-size: 0 !important;
  }

  body.ea360-interface #mobileNav .mobile-fab::before {
    content: '+';
    display: grid;
    place-items: center;
    color: #fff !important;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
  }

  body.ea360-interface #mobileNav .mobile-fab::after {
    content: 'Create';
    color: inherit;
    font-size: 9px;
    font-weight: 650;
    line-height: 1.1;
  }

  body.ea360-interface[data-theme="light"] { --cirrel-mobile-bar: rgba(245, 248, 255, .94); --cirrel-mobile-border: rgba(75, 101, 150, .17); }
  body.ea360-interface[data-theme="light"] .commandbar,
  body.ea360-interface[data-theme="light"] #mobileNav { background: rgba(247, 250, 255, .94) !important; }
  body.ea360-interface[data-theme="light"] #mobileNav button { color: #53647d !important; }
  body.ea360-interface[data-theme="light"] #mobileNav button.active { color: #235db2 !important; background: rgba(68, 126, 222, .13) !important; }
}

@media (max-width: 420px) {
  body.ea360-interface #app .home-dashboard { gap: 12px !important; }
  body.ea360-interface #app .home-dashboard-head h1 { font-size: clamp(24px, 7.2vw, 29px) !important; line-height: 1.12 !important; }
  body.ea360-interface #app .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  body.ea360-interface #app .home-kpi { grid-template-columns: 26px minmax(0, 1fr) !important; gap: 5px 7px !important; padding: 10px 8px !important; }
  body.ea360-interface #app .home-kpi-icon { width: 26px !important; height: 26px !important; }
  body.ea360-interface #app .home-kpi-label { font-size: 9px !important; }
  body.ea360-interface #app .home-kpi > b { font-size: 16px !important; }
  body.ea360-interface #app .home-kpi > b.home-money { font-size: 12px !important; }
  body.ea360-interface #app .home-kpi > small { font-size: 9px !important; }
  body.ea360-interface #mobileNav { width: calc(100vw - 16px) !important; gap: 1px !important; }
  body.ea360-interface #mobileNav button { font-size: 8px !important; }
}

/* Mobile client list: replace the wide desktop table with readable, tappable cards. */
@media (max-width: 720px) {
  body.ea360-interface #app .client-toolbar {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.ea360-interface #app .client-toolbar > input,
  body.ea360-interface #app .client-toolbar > select {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 48px !important;
    margin: 0 !important;
  }

  body.ea360-interface #app #clientRows .tablewrap {
    width: 100% !important;
    max-width: 100% !important;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  body.ea360-interface #app #clientRows { min-width: 0 !important; max-width: 100% !important; }

  body.ea360-interface #app #clientRows table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    border: 0 !important;
    border-collapse: separate !important;
    background: transparent !important;
  }

  body.ea360-interface #app #clientRows thead { display: none !important; }

  body.ea360-interface #app #clientRows tbody {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    width: 100% !important;
  }

  body.ea360-interface #app #clientRows tbody tr {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px 12px !important;
    width: 100% !important;
    min-width: 0 !important;
    padding: 14px !important;
    border: 1px solid rgba(160, 183, 225, .15) !important;
    border-radius: 16px !important;
    background: rgba(13, 20, 34, .72) !important;
    box-shadow: inset 0 1px rgba(255,255,255,.035) !important;
  }

  body.ea360-interface #app #clientRows tbody td {
    display: block !important;
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow-wrap: anywhere !important;
    border: 0 !important;
    background: transparent !important;
    color: #d9e1f0 !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
  }

  body.ea360-interface #app #clientRows tbody td:nth-child(1) { grid-column: 1 / -1 !important; }
  body.ea360-interface #app #clientRows tbody td:nth-child(1) b {
    display: block !important;
    color: #f4f6fb !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
  }
  body.ea360-interface #app #clientRows tbody td small {
    display: block !important;
    margin-top: 3px !important;
    color: #9daac0 !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
  body.ea360-interface #app #clientRows tbody td:nth-child(2)::before,
  body.ea360-interface #app #clientRows tbody td:nth-child(3)::before,
  body.ea360-interface #app #clientRows tbody td:nth-child(4)::before {
    display: block !important;
    margin-bottom: 4px !important;
    color: #8494ad !important;
    font-size: 10px !important;
    font-weight: 750 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;
  }
  body.ea360-interface #app #clientRows tbody td:nth-child(2)::before { content: 'Contact'; }
  body.ea360-interface #app #clientRows tbody td:nth-child(3)::before { content: 'Pipeline'; }
  body.ea360-interface #app #clientRows tbody td:nth-child(4)::before { content: 'Lead score'; }
  body.ea360-interface #app #clientRows tbody td:nth-child(3),
  body.ea360-interface #app #clientRows tbody td:nth-child(4) { align-self: center !important; }
  body.ea360-interface #app #clientRows tbody td:nth-child(5) {
    grid-column: 1 / -1 !important;
    padding-top: 9px !important;
    border-top: 1px solid rgba(160, 183, 225, .12) !important;
  }
  body.ea360-interface #app #clientRows tbody td:nth-child(5) .actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 7px !important;
    width: 100% !important;
  }
  body.ea360-interface #app #clientRows tbody td:nth-child(5) .actions > button {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    padding: 8px 10px !important;
    white-space: normal !important;
  }
  body.ea360-interface #app #clientRows tbody td:nth-child(5) .actions > button:first-child { grid-column: 1 !important; grid-row: 1 !important; }
  body.ea360-interface #app #clientRows tbody td:nth-child(5) .actions > button:nth-child(2) { grid-column: 1 / -1 !important; grid-row: 2 !important; }
  body.ea360-interface #app #clientRows tbody td:nth-child(5) .actions > button:nth-child(3) { grid-column: 2 !important; grid-row: 1 !important; }

  /* Leave a full tab-bar-height scroll landing zone and separate the two top bars. */
  body.ea360-interface[data-theme] .shell > aside { margin-bottom: 6px !important; }
  body.ea360-interface[data-theme] .shell > main > #commandBar { margin-top: 4px !important; }
  body.ea360-interface[data-theme] .shell > main { padding-bottom: calc(118px + env(safe-area-inset-bottom)) !important; }
}

/* Correct higher-specificity mobile rules inherited from previous themes. */
@media (max-width: 720px) {
  html:has(body.ea360-interface) { overflow-x: clip !important; }

  body.ea360-interface[data-theme] .shell > aside {
    width: 100% !important;
    padding: calc(4px + env(safe-area-inset-top)) 14px 4px !important;
    border-radius: 0 0 14px 14px !important;
  }

  body.ea360-interface[data-theme] .shell > aside .sidehead {
    justify-content: flex-start !important;
    min-height: 34px !important;
    height: 34px !important;
  }

  body.ea360-interface[data-theme] .shell > aside .brand.brand-logo {
    justify-content: flex-start !important;
    width: 148px !important;
    max-width: 60vw !important;
  }

  body.ea360-interface[data-theme] .shell > main > #commandBar {
    top: calc(42px + env(safe-area-inset-top)) !important;
    margin-bottom: 10px !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }

  html body.ea360-interface[data-theme] .commandbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    width: 100% !important;
    height: auto !important;
    min-height: 54px !important;
    padding: 7px !important;
  }

  html body.ea360-interface[data-theme] .command-search {
    display: flex !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 40px !important;
    min-height: 40px !important;
  }

  html body.ea360-interface[data-theme] .command-search input {
    position: static !important;
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 100% !important;
    padding: 0 6px 0 0 !important;
    opacity: 1 !important;
  }

  html body.ea360-interface[data-theme] #commandBar .command-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 5px !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  html body.ea360-interface[data-theme] #commandBar .command-actions > button {
    display: grid !important;
    flex: 0 0 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
  }

  html body.ea360-interface[data-theme] #commandBar .command-actions > .command-ai,
  html body.ea360-interface[data-theme] #commandBar .command-actions > .command-new,
  html body.ea360-interface[data-theme] #commandBar .command-actions > #windows-app-refresh,
  html body.ea360-interface[data-theme] #commandBar .command-actions > .command-refresh,
  html body.ea360-interface[data-theme] #commandBar .command-actions > .windows-refresh,
  html body.ea360-interface[data-theme] #commandBar .command-actions > #erp-logout-button,
  html body.ea360-interface[data-theme] #commandBar .command-actions > .command-logout,
  html body.ea360-interface[data-theme] #commandBar .command-actions > [aria-label="Log out"],
  html body.ea360-interface[data-theme] #commandBar .command-actions > [title="Refresh CRM"] { display: none !important; }

  html body.ea360-interface[data-theme] .shell > aside .brand.brand-logo { justify-content: flex-start !important; }

  html body.ea360-interface[data-theme] #commandBar .command-actions [data-today-workspace],
  html body.ea360-interface[data-theme] #commandBar .command-actions [title="Today workspace"],
  html body.ea360-interface[data-theme] #commandBar .command-actions .command-refresh,
  html body.ea360-interface[data-theme] #commandBar .command-actions .windows-refresh,
  html body.ea360-interface[data-theme] #commandBar .command-actions [title="Refresh CRM"] { display: none !important; }

  body.ea360-interface[data-theme] #app .home-period-switch {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    gap: 4px !important;
    overflow: hidden !important;
  }

  body.ea360-interface[data-theme] #app .home-period-switch > button {
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 42px !important;
    padding: 8px 3px !important;
    flex: initial !important;
    font-size: 11px !important;
    line-height: 1.1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
  }
}

/* Mobile shell: keep the brand and command bar pinned while the document scrolls. */
@media (max-width: 720px) {
  html:has(body.ea360-interface) {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: clip !important;
    overflow-y: auto !important;
    scroll-padding-top: calc(148px + env(safe-area-inset-top)) !important;
  }

  body.ea360-interface {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    overscroll-behavior-y: auto !important;
  }

  body.ea360-interface .shell,
  body.ea360-interface .shell.sidebar-collapsed {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body.ea360-interface .shell > aside {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    inset: auto 0 auto !important;
    z-index: 190 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.ea360-interface .shell > main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: calc(100dvh - 100px) !important;
    margin: 0 !important;
    overflow: visible !important;
  }

  body.ea360-interface .shell > main > #commandBar {
    position: -webkit-sticky !important;
    position: sticky !important;
    /* The brand strip is 50px tall before the device safe area. Keep the
       toolbar directly below it instead of letting the two sticky layers overlap. */
    top: calc(54px + env(safe-area-inset-top)) !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: 180 !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 4px -14px 10px !important;
    transform: none !important;
    scroll-margin-top: calc(148px + env(safe-area-inset-top)) !important;
  }

  body.ea360-interface #app {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  body.ea360-interface #mobileNav {
    position: fixed !important;
    top: auto !important;
    right: 12px !important;
    bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    left: 12px !important;
    z-index: 200 !important;
    box-sizing: border-box !important;
    width: calc(100% - 24px) !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    overflow: visible !important;
  }

  body.ea360-interface .shell > main {
    padding-bottom: calc(132px + env(safe-area-inset-bottom)) !important;
  }
}
