/* -------------------------------------------------------------------
   Stage 105.1A CLEAN — Customer 360 Professional Layout v1
   Frontend-only professional layout layer for Customer 360 / Edit Customer.
   CSS-first layout transformation only. No routes, API calls, save logic,
   popup behaviour, backend, database, billing, RADIUS, product, package,
   Asset Register, Job Card, Calendar, Android, or protected-module changes.
------------------------------------------------------------------- */

:root{
  --ui2-pro-c360-page: #f4f7fb;
  --ui2-pro-c360-panel: rgba(255,255,255,.985);
  --ui2-pro-c360-panel-2: rgba(248,250,252,.94);
  --ui2-pro-c360-border: rgba(148,163,184,.22);
  --ui2-pro-c360-border-strong: rgba(37,99,235,.22);
  --ui2-pro-c360-text: #0f172a;
  --ui2-pro-c360-muted: #64748b;
  --ui2-pro-c360-soft: #eef6ff;
  --ui2-pro-c360-blue: #2563eb;
  --ui2-pro-c360-cyan: #0891b2;
  --ui2-pro-c360-emerald: #059669;
  --ui2-pro-c360-amber: #d97706;
  --ui2-pro-c360-purple: #7c3aed;
  --ui2-pro-c360-shadow: 0 22px 60px rgba(15,23,42,.10);
  --ui2-pro-c360-shadow-soft: 0 14px 38px rgba(15,23,42,.075);
  --ui2-pro-c360-ring: 0 0 0 4px rgba(37,99,235,.10);
}

html[data-theme="dark"], body.dark, body.theme-dark{
  --ui2-pro-c360-page: #07111f;
  --ui2-pro-c360-panel: rgba(15,23,42,.96);
  --ui2-pro-c360-panel-2: rgba(30,41,59,.84);
  --ui2-pro-c360-border: rgba(148,163,184,.24);
  --ui2-pro-c360-border-strong: rgba(96,165,250,.28);
  --ui2-pro-c360-text: #e5edf8;
  --ui2-pro-c360-muted: #9fb0c5;
  --ui2-pro-c360-soft: rgba(30,58,138,.24);
  --ui2-pro-c360-blue: #60a5fa;
  --ui2-pro-c360-cyan: #22d3ee;
  --ui2-pro-c360-emerald: #34d399;
  --ui2-pro-c360-amber: #fbbf24;
  --ui2-pro-c360-purple: #a78bfa;
  --ui2-pro-c360-shadow: 0 24px 70px rgba(0,0,0,.34);
  --ui2-pro-c360-shadow-soft: 0 16px 44px rgba(0,0,0,.26);
  --ui2-pro-c360-ring: 0 0 0 4px rgba(96,165,250,.12);
}

/* Wider, calmer professional workbench shell. */
.stage822-page{
  max-width: 1980px !important;
  padding: clamp(22px, 2.2vw, 38px) !important;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.10), transparent 28%),
    radial-gradient(circle at top right, rgba(14,165,233,.11), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0) 340px),
    var(--ui2-pro-c360-page) !important;
}

.stage822-page *{
  text-rendering: geometricPrecision !important;
}

/* Top command bar becomes demo-friendly rather than cramped. */
.stage822-page > .stage822-title-row{
  display: grid !important;
  grid-template-columns: minmax(260px,.55fr) minmax(420px,.75fr) auto !important;
  gap: 18px !important;
  align-items: center !important;
  margin-bottom: 18px !important;
  padding: 18px 20px !important;
  border-radius: 28px !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), rgba(248,250,252,.90)) !important;
  border: 1px solid var(--ui2-pro-c360-border) !important;
  box-shadow: var(--ui2-pro-c360-shadow-soft) !important;
}

html[data-theme="dark"] .stage822-page > .stage822-title-row,
body.dark .stage822-page > .stage822-title-row,
body.theme-dark .stage822-page > .stage822-title-row{
  background: linear-gradient(135deg, rgba(15,23,42,.96), rgba(30,41,59,.84)) !important;
}

.stage822-page > .stage822-title-row h1{
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 !important;
  font-size: clamp(27px, 2.05vw, 38px) !important;
  letter-spacing: -.055em !important;
}

.stage822-page > .stage822-title-row h1::before{
  content: "" !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 16px !important;
  background:
    radial-gradient(circle at 32% 28%, rgba(255,255,255,.78), transparent 18%),
    linear-gradient(135deg, #38bdf8, #2563eb 55%, #7c3aed) !important;
  box-shadow: 0 14px 34px rgba(37,99,235,.28) !important;
  flex: 0 0 auto !important;
}

.stage822-page > .stage822-title-row h1::after{
  content: "Professional customer workbench" !important;
  display: block !important;
  font-size: 12px !important;
  font-weight: 850 !important;
  letter-spacing: .01em !important;
  color: var(--ui2-pro-c360-muted) !important;
  margin-left: 4px !important;
  transform: translateY(2px) !important;
}

.stage822-quick-switch{
  justify-content: center !important;
  max-width: none !important;
  min-width: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(148,163,184,.22) !important;
  background: rgba(248,250,252,.74) !important;
}

.stage822-quick-switch-label{
  color: var(--ui2-pro-c360-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  font-size: 10.5px !important;
}

.stage822-page .stage822-switch-wrap .stage833-search-input{
  height: 42px !important;
  font-size: 13.5px !important;
  padding-left: 18px !important;
  padding-right: 42px !important;
  background: var(--ui2-pro-c360-panel) !important;
  border-color: rgba(148,163,184,.30) !important;
}

.stage822-page .stage822-switch-wrap .stage833-search-input:focus{
  border-color: rgba(37,99,235,.50) !important;
  box-shadow: var(--ui2-pro-c360-ring) !important;
}

.stage822-page .stage822-switch-wrap .stage833-results{
  top: 48px !important;
  border-radius: 18px !important;
  box-shadow: 0 24px 62px rgba(15,23,42,.20) !important;
}

.stage822-top-actions{
  gap: 10px !important;
}

/* Customer hero: more like a modern account profile header. */
.stage822-header-card{
  position: relative !important;
  isolation: isolate !important;
  margin-bottom: 22px !important;
  padding: clamp(20px, 1.6vw, 28px) !important;
  border-radius: 32px !important;
  background:
    linear-gradient(135deg, rgba(37,99,235,.12), rgba(14,165,233,.07) 44%, rgba(255,255,255,.96)),
    var(--ui2-pro-c360-panel) !important;
  border: 1px solid var(--ui2-pro-c360-border-strong) !important;
  box-shadow: var(--ui2-pro-c360-shadow) !important;
  overflow: hidden !important;
}

html[data-theme="dark"] .stage822-header-card,
body.dark .stage822-header-card,
body.theme-dark .stage822-header-card{
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.28), transparent 34%),
    linear-gradient(135deg, rgba(15,23,42,.98), rgba(30,41,59,.88)) !important;
}

.stage822-header-card::before{
  content: "" !important;
  position: absolute !important;
  inset: -70px -80px auto auto !important;
  width: 260px !important;
  height: 260px !important;
  border-radius: 999px !important;
  background: radial-gradient(circle, rgba(37,99,235,.20), transparent 62%) !important;
  z-index: -1 !important;
}

.stage822-header-card::after{
  content: "Customer 360" !important;
  position: absolute !important;
  right: 24px !important;
  bottom: 16px !important;
  color: rgba(37,99,235,.075) !important;
  font-size: clamp(48px, 6vw, 104px) !important;
  font-weight: 950 !important;
  letter-spacing: -.08em !important;
  line-height: 1 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

.stage822-header-card .stage822-title-row{
  display: grid !important;
  grid-template-columns: minmax(280px,1fr) auto minmax(420px,auto) !important;
  gap: 18px !important;
  align-items: center !important;
}

.stage822-customer-name{
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  font-size: clamp(24px, 2.1vw, 38px) !important;
  line-height: 1.02 !important;
  letter-spacing: -.06em !important;
  color: var(--ui2-pro-c360-text) !important;
}

.stage822-customer-name::before{
  content: "" !important;
  width: 58px !important;
  height: 58px !important;
  border-radius: 22px !important;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.82), transparent 19%),
    linear-gradient(135deg, #0ea5e9, #2563eb 60%, #4338ca) !important;
  box-shadow: 0 18px 36px rgba(37,99,235,.26) !important;
  flex: 0 0 auto !important;
}

.stage1040x-customer-state-label{
  align-self: center !important;
  min-width: 132px !important;
  min-height: 40px !important;
}

.stage822-header-card .stage822-top-actions{
  justify-content: flex-end !important;
  padding: 10px !important;
  border: 1px solid rgba(148,163,184,.18) !important;
  border-radius: 22px !important;
  background: rgba(255,255,255,.50) !important;
  backdrop-filter: blur(12px) !important;
}

html[data-theme="dark"] .stage822-header-card .stage822-top-actions,
body.dark .stage822-header-card .stage822-top-actions,
body.theme-dark .stage822-header-card .stage822-top-actions{
  background: rgba(15,23,42,.46) !important;
}

.stage822-vip{
  display: inline-flex !important;
  margin-top: 16px !important;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, #fde68a, #f59e0b) !important;
  color: #422006 !important;
  box-shadow: 0 14px 34px rgba(217,119,6,.22) !important;
}

/* Real layout transformation: convert the old 3 narrow columns into a 12-column workbench. */
.stage822-grid{
  display: grid !important;
  grid-template-columns: repeat(12, minmax(0,1fr)) !important;
  gap: 18px !important;
  align-items: start !important;
}

.stage822-grid > div{
  display: contents !important;
  min-width: 0 !important;
}

.stage822-grid .stage822-card{
  margin-bottom: 0 !important;
  border-radius: 28px !important;
  border-color: var(--ui2-pro-c360-border) !important;
  background: var(--ui2-pro-c360-panel) !important;
  box-shadow: var(--ui2-pro-c360-shadow-soft) !important;
}

.stage822-grid .stage822-card:hover{
  transform: translateY(-2px) !important;
  border-color: var(--ui2-pro-c360-border-strong) !important;
  box-shadow: var(--ui2-pro-c360-shadow) !important;
}

/* Left original column cards. */
.stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(1){ grid-column: 1 / span 4 !important; order: 10 !important; }
.stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(2){ grid-column: 1 / span 4 !important; order: 30 !important; }
.stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(3){ grid-column: 1 / span 4 !important; order: 40 !important; }
.stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(4){ grid-column: 1 / span 4 !important; order: 21 !important; }
.stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(5){ grid-column: 1 / span 4 !important; order: 50 !important; }

/* Centre original column cards. */
.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(1){ grid-column: 5 / span 5 !important; order: 11 !important; }
.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(2){ grid-column: 5 / span 5 !important; order: 20 !important; }
.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(3){ grid-column: 5 / span 5 !important; order: 31 !important; }
.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(4){ grid-column: 5 / span 5 !important; order: 41 !important; }
.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(5){ grid-column: 5 / span 5 !important; order: 51 !important; }

/* Right original column cards. */
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(1){ grid-column: 10 / span 3 !important; order: 12 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(2){ grid-column: 10 / span 3 !important; order: 22 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(3){ grid-column: 10 / span 3 !important; order: 32 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(4){ grid-column: 10 / span 3 !important; order: 42 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(5){ grid-column: 10 / span 3 !important; order: 52 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(6){ grid-column: 10 / span 3 !important; order: 60 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(7){ grid-column: 10 / span 3 !important; order: 61 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(8){ grid-column: 10 / span 3 !important; order: 62 !important; }
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(9){ grid-column: 10 / span 3 !important; order: 63 !important; }

/* Stronger hero cards in the professional workbench. */
.stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(1),
.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(1),
.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(1){
  min-height: 292px !important;
}

.stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(1){
  border-color: rgba(37,99,235,.28) !important;
  background:
    radial-gradient(circle at top right, rgba(37,99,235,.10), transparent 32%),
    var(--ui2-pro-c360-panel) !important;
}

.stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(1){
  background:
    radial-gradient(circle at top right, rgba(14,165,233,.11), transparent 36%),
    var(--ui2-pro-c360-panel) !important;
}

.stage822-card-head{
  min-height: 62px !important;
  padding: 16px 18px !important;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.82)) !important;
}

html[data-theme="dark"] .stage822-card-head,
body.dark .stage822-card-head,
body.theme-dark .stage822-card-head{
  background: linear-gradient(180deg, rgba(30,41,59,.92), rgba(15,23,42,.70)) !important;
}

.stage822-card-head h2{
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  font-size: 15.5px !important;
  letter-spacing: -.018em !important;
}

.stage822-card-head h2::before{
  content: "" !important;
  width: 10px !important;
  height: 28px !important;
  border-radius: 999px !important;
  background: linear-gradient(180deg, var(--ui2-pro-c360-blue), var(--ui2-pro-c360-cyan)) !important;
  box-shadow: 0 8px 18px rgba(37,99,235,.22) !important;
}

.stage822-grid > div:nth-child(1) .stage822-card .stage822-card-head h2::before{
  background: linear-gradient(180deg, var(--ui2-pro-c360-emerald), var(--ui2-pro-c360-cyan)) !important;
}

.stage822-grid > div:nth-child(2) .stage822-card .stage822-card-head h2::before{
  background: linear-gradient(180deg, var(--ui2-pro-c360-blue), var(--ui2-pro-c360-purple)) !important;
}

.stage822-grid > div:nth-child(3) .stage822-card .stage822-card-head h2::before{
  background: linear-gradient(180deg, var(--ui2-pro-c360-amber), var(--ui2-pro-c360-blue)) !important;
}

.stage822-card-body{
  padding: 17px 18px !important;
}

.stage822-info-table th,
.stage822-info-table td{
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.stage822-info-table th{
  font-size: 11.5px !important;
  text-transform: uppercase !important;
  letter-spacing: .055em !important;
}

.stage822-info-table td{
  font-size: 13px !important;
  font-weight: 720 !important;
}

.stage822-session-row{
  grid-template-columns: minmax(0,1fr) auto !important;
  padding: 13px 0 !important;
  gap: 14px !important;
}

.stage822-session-row strong{
  font-size: 13.5px !important;
  color: var(--ui2-pro-c360-text) !important;
}

.stage822-row-actions{
  gap: 7px !important;
}

.stage822-empty,
.stage822-map-placeholder,
.stage822-chart-placeholder{
  border-radius: 20px !important;
  min-height: 92px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background:
    linear-gradient(135deg, rgba(248,250,252,.94), rgba(239,246,255,.74)) !important;
}

html[data-theme="dark"] .stage822-empty,
html[data-theme="dark"] .stage822-map-placeholder,
html[data-theme="dark"] .stage822-chart-placeholder,
body.dark .stage822-empty,
body.dark .stage822-map-placeholder,
body.dark .stage822-chart-placeholder,
body.theme-dark .stage822-empty,
body.theme-dark .stage822-map-placeholder,
body.theme-dark .stage822-chart-placeholder{
  background: linear-gradient(135deg, rgba(30,41,59,.72), rgba(15,23,42,.82)) !important;
}

.stage822-chart-placeholder{
  min-height: 168px !important;
}

.stage822-map-placeholder{
  min-height: 160px !important;
}

.stage822-btn,
.stage822-icon{
  min-height: 36px !important;
  border-radius: 999px !important;
  padding: 9px 14px !important;
}

.stage822-icon{
  min-width: 38px !important;
}

.stage822-usage,
.stage822-pill{
  padding: 5px 9px !important;
  font-size: 11px !important;
}

/* Responsive conversion: keep the professional arrangement but avoid crowding. */
@media(max-width:1540px){
  .stage822-page > .stage822-title-row{
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }
  .stage822-page > .stage822-title-row h1::after{
    display: none !important;
  }
  .stage822-header-card .stage822-title-row{
    grid-template-columns: 1fr !important;
    align-items: stretch !important;
  }
  .stage822-header-card .stage822-top-actions{
    justify-content: flex-start !important;
  }
  .stage822-grid{
    grid-template-columns: repeat(8, minmax(0,1fr)) !important;
  }
  .stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(n),
  .stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(n){
    grid-column: span 3 !important;
  }
  .stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(n){
    grid-column: span 5 !important;
  }
}

@media(max-width:1180px){
  .stage822-page{
    padding: 16px !important;
  }
  .stage822-grid{
    grid-template-columns: 1fr !important;
  }
  .stage822-grid > div:nth-child(1) .stage822-card:nth-of-type(n),
  .stage822-grid > div:nth-child(2) .stage822-card:nth-of-type(n),
  .stage822-grid > div:nth-child(3) .stage822-card:nth-of-type(n){
    grid-column: 1 / -1 !important;
  }
  .stage822-header-card::after{
    display: none !important;
  }
}

@media(max-width:760px){
  .stage822-page > .stage822-title-row,
  .stage822-header-card,
  .stage822-grid .stage822-card{
    border-radius: 22px !important;
  }
  .stage822-customer-name{
    font-size: 22px !important;
  }
  .stage822-customer-name::before{
    width: 46px !important;
    height: 46px !important;
    border-radius: 18px !important;
  }
  .stage822-session-row{
    grid-template-columns: 1fr !important;
  }
  .stage822-row-actions{
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
  .stage822-card-body{
    padding: 14px !important;
  }
}
