/* ==========================================================================
   Drawn AI — dashboards.css
   The live HTML/CSS dashboard "UI kit" used in the hero collages.
   Everything inside a .dash-stage is sized in em so the whole collage scales
   fluidly with its container (container query units drive the root em).
   ========================================================================== */

.dash-stage {
  position: relative;
  container-type: inline-size;
  /* every panel's typography derives from this */
  font-size: clamp(8.5px, 1.62cqw, 12.5px);
  aspect-ratio: 1.32;
  isolation: isolate;
}
.dash-stage::before {
  content: "";
  position: absolute;
  inset: -6% -4%;
  background: radial-gradient(58% 54% at 52% 45%, rgba(46, 86, 240, .34), transparent 70%);
  filter: blur(26px);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Panel shell ---------- */
.panel {
  position: relative;
  border-radius: 0.9em;
  border: 1px solid rgba(120, 155, 255, .18);
  background: linear-gradient(158deg, #07173A 0%, #030C22 100%);
  box-shadow: 0 2.2em 4.5em -2em rgba(0, 0, 0, .92), inset 0 1px 0 rgba(255, 255, 255, .07);
  color: #DCE3F5;
  overflow: hidden;
  line-height: 1.35;
}
.panel::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(142deg, rgba(255, 255, 255, .06), transparent 44%);
  pointer-events: none;
  z-index: 2;
}
.panel-float { position: absolute; }
.panel-glow { box-shadow: 0 2.2em 4.5em -2em rgba(0,0,0,.92), 0 0 0 1px rgba(74,108,250,.35), 0 0 3.5em -.6em rgba(46,86,240,.55); }

.panel-bar {
  display: flex; align-items: center; gap: .7em;
  padding: .85em 1em;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(255, 255, 255, .025);
  position: relative; z-index: 1;
}
.panel-bar > svg { width: 1.15em; height: 1.15em; color: #7E9BFF; flex: none; }
.panel-bar .title {
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700; font-size: .96em; color: #EAF0FF; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.panel-bar .spacer { margin-left: auto; }
.panel-bar .dots { display: flex; gap: .35em; margin-left: auto; }
.panel-bar .dots i { width: .5em; height: .5em; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.panel-bar .x { margin-left: auto; color: #5F6C88; font-size: .9em; }

.panel-body { padding: 1em; display: grid; gap: .8em; position: relative; z-index: 1; }
.panel-body.tight { gap: .55em; }

/* ---------- Text atoms ---------- */
.p-label { font-size: .8em; line-height: 1.25; letter-spacing: .07em; text-transform: uppercase; color: #8C9AB7; font-weight: 600; }
.p-cap   { font-size: .88em; color: #9AA6C2; }
.p-value { font-family: var(--font-display); font-weight: 800; font-size: 1.55em; color: #fff; letter-spacing: -.025em; line-height: 1.1; }
.p-value-sm { font-size: 1.2em; }
.p-value-lg { font-size: 2.15em; }
.p-delta { font-size: .82em; font-weight: 700; color: #4ADE80; display: inline-flex; align-items: center; gap: .25em; }
.p-delta.down { color: #F87171; }
.p-delta svg { width: .85em; height: .85em; }
.p-sub { font-size: .85em; color: #8C9AB7; }
.p-strong { color: #fff; font-weight: 600; }

/* ---------- Stat tiles ---------- */
.p-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6em; }
.p-stats.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.p-stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.p-stat {
  padding: .7em .8em;
  border-radius: .55em;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .06);
}
.p-stat .p-value { font-size: 1.3em; }
.p-stat .p-label { font-size: .74em; letter-spacing: .04em; }

/* ---------- Tabs ---------- */
.p-tabs { display: flex; gap: .3em; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.p-tabs span { padding: .5em .8em; font-size: .88em; color: #8C9AB7; border-bottom: 2px solid transparent; white-space: nowrap; }
.p-tabs span.on { color: #fff; border-bottom-color: #4A6CFA; font-weight: 600; }

/* ---------- List rows ---------- */
.p-row {
  display: flex; align-items: center; gap: .6em;
  padding: .5em .65em;
  border-radius: .5em;
  background: rgba(255, 255, 255, .03);
  font-size: .9em;
}
.p-row.plain { background: none; padding: .3em 0; }
.p-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-row .ico { width: 1.5em; height: 1.5em; border-radius: .35em; background: rgba(74, 108, 250, .2); display: grid; place-items: center; flex: none; }
.p-row .ico svg { width: .85em; height: .85em; color: #7E9BFF; }
.p-row .ico.green { background: rgba(34, 197, 94, .18); } .p-row .ico.green svg { color: #4ADE80; }
.p-row .ico.amber { background: rgba(245, 158, 11, .18); } .p-row .ico.amber svg { color: #FBBF24; }
.p-row .ico.red   { background: rgba(239, 68, 68, .18); }  .p-row .ico.red svg { color: #F87171; }
.p-row .meta { color: #8C9AB7; font-size: .85em; white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { font-size: .78em; font-weight: 700; padding: .18em .6em; border-radius: 99px; white-space: nowrap; }
.badge-green { background: rgba(34, 197, 94, .16); color: #4ADE80; }
.badge-amber { background: rgba(245, 158, 11, .16); color: #FBBF24; }
.badge-red   { background: rgba(239, 68, 68, .16); color: #F87171; }
.badge-blue  { background: rgba(74, 108, 250, .2); color: #93A9FF; }
.badge-grey  { background: rgba(255, 255, 255, .08); color: #97A3BC; }

/* ---------- Progress ---------- */
.p-progress-row {
  display: grid; grid-template-columns: 6.5em 1fr 2.4em; gap: .6em; align-items: center;
  font-size: .88em; color: #9AA6C2;
}
.p-progress-row .pct { text-align: right; color: #fff; font-weight: 600; }
.track { height: .42em; border-radius: .3em; background: rgba(255, 255, 255, .09); overflow: hidden; }
.track .fill {
  display: block; height: 100%; border-radius: .3em;
  background: linear-gradient(90deg, #2E56F0, #7E9BFF);
  width: var(--w, 50%);
}
.track .fill.green { background: linear-gradient(90deg, #16A34A, #4ADE80); }
.track .fill.amber { background: linear-gradient(90deg, #D97706, #FBBF24); }

/* ---------- Charts ---------- */
.p-chart { width: 100%; height: auto; display: block; }
.p-chart .line { fill: none; stroke: #7E9BFF; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.p-chart .line.green { stroke: #4ADE80; }
.p-chart .grid-l { stroke: rgba(255, 255, 255, .06); stroke-width: 1; vector-effect: non-scaling-stroke; }
.p-chart .dot-l { fill: #fff; }

.p-bars { display: flex; align-items: flex-end; gap: .22em; height: 5.2em; }
.p-bars i {
  flex: 1; border-radius: .18em .18em 0 0;
  background: linear-gradient(180deg, #7E9BFF, #2E56F0);
  height: var(--h, 40%); min-height: 2px;
}
.p-bars.violet i:nth-child(3n) { background: linear-gradient(180deg, #A78BFA, #6D28D9); }
.p-bars.tall { height: 7em; }

.p-donut { position: relative; width: 7em; height: 7em; flex: none; }
.p-donut svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.p-donut .bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 9; }
.p-donut .val { fill: none; stroke: #4A6CFA; stroke-width: 9; stroke-linecap: round; }
.p-donut .val.violet { stroke: #8B5CF6; }
.p-donut .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.p-donut .mid b { font-family: var(--font-display); font-size: 1.3em; color: #fff; font-weight: 800; letter-spacing: -.02em; }
.p-donut .mid span { font-size: .72em; color: #8C9AB7; }
.p-donut-sm { width: 5em; height: 5em; }

.p-gauge { width: 100%; height: auto; }
.p-gauge .arc-bg { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 8; stroke-linecap: round; }
.p-gauge .arc-v  { fill: none; stroke-width: 8; stroke-linecap: round; }
.p-gauge .needle { stroke: #fff; stroke-width: 2; stroke-linecap: round; }

.p-chips { display: flex; gap: .22em; }
.p-chips i { height: 1.3em; flex: 1; border-radius: .25em; }

.p-funnel { display: grid; gap: .3em; justify-items: center; }
.p-funnel i {
  height: 1em; border-radius: .2em;
  background: linear-gradient(90deg, #2E56F0, #7E9BFF);
  width: var(--w, 100%);
}

/* ---------- Table ---------- */
.p-table { width: 100%; border-collapse: collapse; font-size: .88em; }
.p-table td { padding: .42em 0; border-bottom: 1px solid rgba(255, 255, 255, .05); color: #B6C1DA; }
.p-table td:last-child { text-align: right; color: #fff; font-weight: 600; }
.p-table tr:last-child td { border-bottom: 0; }

.p-avatar {
  width: 1.6em; height: 1.6em; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #4A6CFA, #8B5CF6);
  display: grid; place-items: center;
  font-size: .78em; font-weight: 700; color: #fff;
}

/* ---------- Map / field ops ---------- */
.p-map {
  position: relative; height: 7.5em; border-radius: .5em;
  background: radial-gradient(circle at 32% 42%, rgba(74, 108, 250, .18), transparent 55%), linear-gradient(180deg, #061431, #030B1F);
  border: 1px solid rgba(255, 255, 255, .06);
  overflow: hidden;
}
.p-map::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 1.6em 1.6em;
}
.p-map .pin {
  position: absolute; width: .7em; height: .7em; border-radius: 50%;
  background: #7E9BFF; z-index: 1; box-shadow: 0 0 0 .3em rgba(74, 108, 250, .22);
}
.p-map .pin.alt { background: #A78BFA; box-shadow: 0 0 0 .3em rgba(139, 92, 246, .22); }
.p-map .pin.pulse { animation: dai-pulse 2.6s var(--ease-in-out) infinite; }
@keyframes dai-pulse {
  0%, 100% { box-shadow: 0 0 0 .3em rgba(74, 108, 250, .22); }
  50%      { box-shadow: 0 0 0 .85em rgba(74, 108, 250, .04); }
}

/* ---------- Thumbnails ---------- */
.p-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .3em; }
.p-thumbs i {
  aspect-ratio: 4/3; border-radius: .3em;
  background: linear-gradient(140deg, #16305F, #0A1936);
  border: 1px solid rgba(255, 255, 255, .07);
}
.p-thumbs i:nth-child(2) { background: linear-gradient(140deg, #1D3A63, #0C1E3E); }
.p-thumbs i:nth-child(3) { background: linear-gradient(140deg, #123055, #081831); }

/* ---------- Phone frame ---------- */
.phone {
  border-radius: 1.8em;
  border: 1px solid rgba(120, 155, 255, .24);
  background: linear-gradient(160deg, #0A1938 0%, #02081A 100%);
  padding: .55em .45em;
  box-shadow: 0 2.4em 5em -2em rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .08);
  position: relative;
  overflow: hidden;
}
.phone-inner { border-radius: 1.4em; overflow: hidden; background: #030B1F; }
.phone .status {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5em .9em .35em; font-size: .7em; color: #8C9AB7;
}
.phone .status .bars { display: flex; gap: .2em; align-items: flex-end; }
.phone .status .bars i { width: .2em; background: #8C9AB7; border-radius: 1px; }
.phone .phone-body { padding: .2em .7em .9em; display: grid; gap: .55em; }

/* ---------- Checklist rows ---------- */
.p-check { display: flex; align-items: center; gap: .55em; font-size: .88em; color: #B6C1DA; }
.p-check .box {
  width: 1.15em; height: 1.15em; border-radius: .3em; flex: none;
  border: 1px solid rgba(255,255,255,.18); display: grid; place-items: center;
}
.p-check .box.on { background: #22C55E; border-color: #22C55E; }
.p-check .box svg { width: .75em; height: .75em; color: #fff; }

/* ---------- Node flow (automation panels) ---------- */
.p-flow { display: grid; gap: .5em; }
.p-flow .node {
  display: flex; align-items: center; gap: .6em;
  padding: .5em .7em; border-radius: .5em;
  background: rgba(255, 255, 255, .04);
  border: 1px solid rgba(255, 255, 255, .07);
  font-size: .88em;
}
.p-flow .node .ico { width: 1.5em; height: 1.5em; border-radius: .35em; display: grid; place-items: center; background: rgba(74,108,250,.2); flex: none; }
.p-flow .node .ico svg { width: .85em; height: .85em; color: #7E9BFF; }
.p-flow .node.done .ico { background: rgba(34,197,94,.2); } .p-flow .node.done .ico svg { color: #4ADE80; }
.p-flow .connector { height: .8em; width: 1px; background: rgba(255,255,255,.16); margin-left: 1.4em; }

/* ---------- Search field mock ---------- */
.p-search {
  min-width: 0;
  display: flex; align-items: center; gap: .5em;
  padding: .55em .75em; border-radius: .5em;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  font-size: .88em; color: #8C9AB7;
}
.p-search svg { width: .95em; height: .95em; color: #7E9BFF; }

/* ---------- Static (non-floating) dashboard used in light sections ---------- */
.dash-inline { container-type: inline-size; font-size: clamp(7px, 5.6cqw, 12px); }
.dash-inline .panel { border-radius: .8em; }


/* ==========================================================================
   Overflow containment
   Flex and grid children default to min-width:auto, so a long label pushes
   past the panel edge and gets sliced by the panel's overflow:hidden. These
   rules let the content shrink instead of overflowing.
   ========================================================================== */
.panel, .panel * , .phone, .phone * { min-width: 0; }
.panel-body, .phone-body { min-width: 0; }
.p-row, .p-check, .p-flow .node, .p-progress-row, .p-search { min-width: 0; }
.p-row > span, .p-check > span, .p-flow .node > span { min-width: 0; }
.p-strong, .p-cap, .p-sub, .p-label { min-width: 0; }
.p-row .grow, .panel-bar .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-stat { min-width: 0; overflow: hidden; }
 /* stat tiles are narrow — shrink the label rather than breaking words apart */
.p-stat .p-label { white-space: normal; font-size: .66em; letter-spacing: .03em; line-height: 1.2; }
.p-table td { overflow-wrap: anywhere; }
.badge { flex: none; }
