/* ============================================================================
   edge-admin — CoreM8 design system (direction A "Mission-Control"), verbatim
   from /home/ash/marketingm8/static/css/app.css so the two stay in step. Any
   edge-admin-only rules live in the ADDITIONS block at the very bottom.

   Inter is SELF-HOSTED here rather than pulled from Google Fonts: this tool is
   an admin surface for a security company's edge, and it should not make
   third-party requests (it also keeps the CSP to 'self').
   ============================================================================ */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ============================================================================
   MarketingM8 — design system
   A bespoke dark-first agency OS. Layered surfaces, hairline borders, a single
   electric-violet accent, restrained motion. Not a bootstrap dashboard.
   ============================================================================ */

:root {
  /* surfaces (dark default) */
  --bg:        #08080c;
  --bg-grad:   radial-gradient(1200px 700px at 78% -8%, rgba(124,108,255,.10), transparent 60%),
               radial-gradient(900px 600px at 5% 0%, rgba(34,211,238,.05), transparent 55%);
  --surface:   #101018;
  --surface-2: #16161f;
  --elevated:  #1b1b26;
  --hover:     rgba(255,255,255,.035);
  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.11);

  /* text */
  --text:      #f3f3f7;
  --text-2:    #a6a6b8;
  --text-3:    #6c6c80;

  /* brand + semantic */
  --accent:    #7c6cff;
  --accent-2:  #9d6cff;
  --accent-soft: rgba(124,108,255,.14);
  --accent-line: rgba(124,108,255,.40);
  --grad:      linear-gradient(135deg, #7c6cff, #b06cff 60%, #ff6cab);
  --pos:       #34d399;
  --pos-soft:  rgba(52,211,153,.13);
  --warn:      #fbbf24;
  --warn-soft: rgba(251,191,36,.13);
  --neg:       #fb7185;
  --neg-soft:  rgba(251,113,133,.13);
  --info:      #38bdf8;
  --info-soft: rgba(56,189,248,.13);

  --radius:    16px;
  --radius-sm: 11px;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 32px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  --sidebar:   250px;
  --ease:      cubic-bezier(.22,.61,.36,1);
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono:      "SF Mono", "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
}

[data-theme="light"] {
  --bg:        #f6f6f9;
  --bg-grad:   radial-gradient(1100px 600px at 80% -10%, rgba(124,108,255,.10), transparent 60%);
  --surface:   #ffffff;
  --surface-2: #fbfbfd;
  --elevated:  #ffffff;
  --hover:     rgba(10,10,30,.035);
  --line:      rgba(12,12,40,.09);
  --line-2:    rgba(12,12,40,.14);
  --text:      #15151f;
  --text-2:    #51515f;
  --text-3:    #8a8a99;
  --accent-soft: rgba(124,108,255,.12);
  --shadow:    0 1px 2px rgba(20,20,50,.06), 0 14px 34px -16px rgba(30,30,70,.22);
  --shadow-lg: 0 24px 60px -22px rgba(30,30,70,.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); background-clip: content-box; }

/* ── Layout shell ─────────────────────────────────────────────────────────── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  position: fixed; inset: 0 auto 0 0; z-index: 40;
  background: linear-gradient(180deg, var(--surface), var(--bg));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  padding: 18px 14px;
  transition: transform .32s var(--ease);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 18px; }
.brand .mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: var(--grad); display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 15px;
  box-shadow: 0 4px 16px -4px rgba(124,108,255,.7), inset 0 1px 0 rgba(255,255,255,.25);
}
.brand b { font-weight: 700; font-size: 15.5px; letter-spacing: -.02em; }
.brand .m8 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand small { display: block; color: var(--text-3); font-size: 10.5px; font-weight: 500; letter-spacing: .02em; }

.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.nav-section { padding: 16px 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-3); }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 500; font-size: 13.5px;
  position: relative; transition: background .16s, color .16s;
}
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { color: var(--text); background: var(--accent-soft); }
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px;
  background: var(--grad); border-radius: 0 3px 3px 0;
}
.nav-item .badge-mini { margin-left: auto; font-size: 10.5px; background: var(--elevated);
  color: var(--text-2); padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line); }

.side-foot { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  transition: background .16s; cursor: pointer; }
.user-chip:hover, .user-chip.active { background: var(--hover); }
.user-chip.active .meta b { color: var(--text); }
.user-chip .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.user-chip .av { width: 30px; height: 30px; }
.user-chip .meta { line-height: 1.25; min-width: 0; }
.user-chip .meta b { font-size: 12.5px; font-weight: 600; display: block; }
.user-chip .meta span { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.user-chip a.out { margin-left: auto; color: var(--text-3); display: grid; place-items: center; }
.user-chip a.out:hover { color: var(--neg); }

/* main */
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 28px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 17px; font-weight: 650; letter-spacing: -.02em; }
.topbar .sub { color: var(--text-3); font-size: 12.5px; font-weight: 500; }
.hamburger { display: none; }

.cmd-trigger {
  margin-left: auto; display: flex; align-items: center; gap: 9px;
  padding: 7px 12px; min-width: 230px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; color: var(--text-3); font-size: 13px; cursor: text;
  transition: border-color .16s, background .16s;
}
.cmd-trigger:hover { border-color: var(--line-2); }
.cmd-trigger kbd { margin-left: auto; font-family: var(--font); font-size: 11px; font-weight: 600;
  background: var(--elevated); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer;
  transition: all .16s; position: relative; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 99px;
  background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.bell-badge { position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--grad); color: #fff; font-size: 10px; font-weight: 700;
  line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }

.content { padding: 26px 28px 60px; width: 100%; }

/* ── Reusable bits ────────────────────────────────────────────────────────── */
.av { border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 12px;
  color: #fff; flex: none; letter-spacing: .01em; }
.av.v { background: linear-gradient(135deg,#7c6cff,#b06cff); }
.av.c { background: linear-gradient(135deg,#22d3ee,#3b82f6); }
.av.e { background: linear-gradient(135deg,#34d399,#10b981); }
.av.a { background: linear-gradient(135deg,#fbbf24,#f97316); }
.av.r { background: linear-gradient(135deg,#fb7185,#ec4899); }
.av.b { background: linear-gradient(135deg,#818cf8,#6366f1); }
.av.pink { background: linear-gradient(135deg,#fbcfe8,#f9a8d4); color: #9d2e63; } /* pastel pink — Leah */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; font-weight: 600; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  transition: all .16s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--elevated); border-color: var(--text-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--grad); border: none; color: #fff;
  box-shadow: 0 6px 18px -6px rgba(124,108,255,.7), inset 0 1px 0 rgba(255,255,255,.2); }
.btn.primary:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 9px; }
.btn.block { width: 100%; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; border: 1px solid transparent; white-space: nowrap; }
.badge .d { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.badge.pos { color: var(--pos); background: var(--pos-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.neg { color: var(--neg); background: var(--neg-soft); }
.badge.info { color: var(--info); background: var(--info-soft); }
.badge.muted { color: var(--text-2); background: var(--hover); border-color: var(--line); }
.badge.accent { color: var(--accent-2); background: var(--accent-soft); }

.chip { font-size: 11px; padding: 2px 8px; border-radius: 7px; background: var(--hover);
  border: 1px solid var(--line); color: var(--text-2); font-weight: 500; }
.chip--saas { background: rgba(34,211,238,.12); border-color: rgba(34,211,238,.35);
  color: #22d3ee; font-weight: 650; letter-spacing: .03em; }
.chip--site { background: rgba(124,108,255,.10); border-color: rgba(124,108,255,.30);
  color: #a99dff; font-weight: 650; letter-spacing: .03em; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); }
.card.pad { padding: 20px; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.card-h h3 { font-size: 14.5px; font-weight: 650; letter-spacing: -.01em; }
.card-h .sub { font-size: 12px; color: var(--text-3); }
.card-h .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.section-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); margin: 0 0 12px; }

/* grid helpers */
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(5, 1fr); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3,1fr); }
.dash-main { grid-template-columns: 1.6fr 1fr; align-items: start; }

/* KPI card */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px 46px; position: relative; overflow: hidden; box-shadow: var(--shadow);
  transition: border-color .2s, transform .2s; }
.kpi:hover { border-color: var(--line-2); transform: translateY(-2px); }
.kpi .top { display: flex; align-items: center; gap: 9px; color: var(--text-3); font-size: 12.5px; font-weight: 550; }
.kpi .top .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2); }
.kpi .top .ic svg { width: 16px; height: 16px; }
.kpi .val { font-size: 27px; font-weight: 720; letter-spacing: -.03em; margin: 11px 0 3px; line-height: 1; }
.kpi .meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 650; font-size: 11.5px; }
.delta.up { color: var(--pos); } .delta.down { color: var(--neg); }
.delta svg { width: 13px; height: 13px; }
.kpi .spark { position: absolute; right: 0; bottom: 0; left: 0; height: 38px; width: 100%; opacity: .85; display: block; }

/* app launcher tiles */
.launch-group-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); margin: 4px 2px 10px; }
.launch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.launch-grid:last-child { margin-bottom: 0; }
.app-tile { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 13px;
  border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--text);
  position: relative; transition: border-color .16s, transform .16s, background .16s; }
.app-tile:hover { border-color: var(--line-2); transform: translateY(-2px); background: var(--elevated); }
/* Stretched main link — covers the whole tile. The Demo pill (below) sits above it
   via z-index so it stays independently clickable. This replaces a nested <a>, which
   was invalid HTML (browser split each tile into 3 grid items → scattered layout). */
.app-tile-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.app-tile-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.app-tile-ic svg { width: 19px; height: 19px; }
.app-tile-body { display: flex; flex-direction: column; min-width: 0; }
.app-tile-body b { font-size: 14px; font-weight: 600; line-height: 1.2; }
.app-tile-body .sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; }
.app-tile-arrow { margin-left: auto; color: var(--text-3); opacity: 0; transition: opacity .16s; flex: none; }
.app-tile-arrow svg { width: 15px; height: 15px; }
.app-tile:hover .app-tile-arrow { opacity: .7; }
.app-tile-demo { position: relative; z-index: 2; margin-left: auto; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text-2, var(--text-3)); text-decoration: none; flex: none;
  transition: background .14s, color .14s; }
.app-tile-demo:hover { background: var(--grad); color: #fff; border-color: transparent; }
.app-tile:has(.app-tile-demo) .app-tile-arrow { display: none; }

/* lists / rows */
.row-list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid var(--line); }
.row:first-child { border-top: none; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 550; font-size: 13.5px; }
.row .s { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.click { border-radius: 10px; cursor: pointer; padding-left: 8px; padding-right: 8px; transition: background .14s; }
.row.click:hover { background: var(--hover); }

/* activity feed */
.feed-item { display: flex; gap: 12px; padding: 12px 2px; position: relative; }
.feed-item .ic { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.feed-item .ic svg { width: 15px; height: 15px; }
.feed-item .ic.deploy { color: var(--accent-2); } .feed-item .ic.invoice { color: var(--pos); }
.feed-item .ic.email { color: var(--info); } .feed-item .ic.meeting { color: var(--warn); }
.feed-item:not(:last-child)::before { content:""; position:absolute; left:14px; top:42px; bottom:-12px; width:1px; background: var(--line); }
.feed-item .ft { font-size: 13px; font-weight: 550; }
.feed-item .fd { font-size: 12px; color: var(--text-3); }
.feed-item time { font-size: 11px; color: var(--text-3); margin-left: auto; white-space: nowrap; }

/* checkbox tasks */
.task { display: flex; align-items: center; gap: 11px; padding: 9px 2px; border-top: 1px solid var(--line); }
.task:first-child { border-top: none; }
.tick { width: 19px; height: 19px; border-radius: 7px; border: 1.6px solid var(--line-2); flex: none;
  cursor: pointer; display: grid; place-items: center; transition: all .15s; }
.tick:hover { border-color: var(--accent); }
.tick.done { background: var(--grad); border-color: transparent; }
.tick svg { width: 12px; height: 12px; color: #fff; opacity: 0; transition: opacity .15s; }
.tick.done svg { opacity: 1; }
.task.is-done .tt { text-decoration: line-through; color: var(--text-3); }
.task .tt { flex: 1; font-size: 13px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* per-person to-do board: narrow columns, so let rows wrap —
   tick + title on the first line, controls drop underneath */
.task-board .task { flex-wrap: wrap; row-gap: 6px; }
.task-board .task .tt { flex: 1 1 calc(100% - 32px); }
.task-board .task .t-client, .task-board .task .t-assign { max-width: 42%; }
.task-board .task .sub { white-space: normal !important; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); padding: 0 14px 11px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .14s; }
.tbl tbody tr:hover { background: var(--hover); }
.tbl .name-cell { display: flex; align-items: center; gap: 11px; }

/* meter */
.meter { height: 6px; border-radius: 99px; background: var(--hover); overflow: hidden; min-width: 54px; }
.meter > i { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.meter.pos > i { background: var(--pos); } .meter.warn > i { background: var(--warn); } .meter.neg > i { background: var(--neg); }
.score-cell { display: flex; align-items: center; gap: 9px; }
.score-cell b { font-size: 12.5px; min-width: 26px; }

/* ── Charts (hand-rolled SVG) ─────────────────────────────────────────────── */
.chart { width: 100%; display: block; overflow: visible; }
.chart .area { fill: url(#areaGrad); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .bar { fill: var(--accent-soft); rx: 4; transition: fill .15s; }
.chart .bar:hover { fill: var(--accent); }
.chart .dot { fill: var(--accent); stroke: var(--bg); stroke-width: 2.5; opacity: 0; transition: opacity .15s; }
.chart-tip { position: absolute; pointer-events: none; background: var(--elevated); border: 1px solid var(--line-2);
  border-radius: 9px; padding: 7px 10px; font-size: 12px; box-shadow: var(--shadow-lg); opacity: 0;
  transform: translate(-50%,-8px); transition: opacity .12s; z-index: 5; white-space: nowrap; }
.chart-tip b { font-weight: 700; }

/* donut legend */
.legend { display: flex; flex-direction: column; gap: 9px; }
.legend .li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; }
.legend .sw { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .li b { margin-left: auto; font-weight: 650; }
.legend .li span { color: var(--text-3); }

/* ── CRM kanban ───────────────────────────────────────────────────────────── */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(258px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: stretch; }
/* stretch (not start) so short columns are full-height drop targets — with start,
   cards dragged from the bottom of a tall column had nowhere to drop. */
.col { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
  display: flex; flex-direction: column; min-height: 120px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 13px 14px 10px; }
.col-h .dot { width: 8px; height: 8px; border-radius: 99px; }
.col-h b { font-size: 13px; font-weight: 600; }
.col-h .ct { color: var(--text-3); font-size: 12px; }
.col-h .tot { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.col-body { display: flex; flex-direction: column; gap: 9px; padding: 4px 10px 12px; flex: 1; min-height: 40px; }
.col-body.drag-over { background: var(--accent-soft); border-radius: 12px; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; cursor: grab; position: relative; transition: border-color .15s, transform .15s, box-shadow .15s; }
/* tap-to-move handle — drag is desktop-only (HTML5 DnD), so show this on touch devices */
.card-move { position: absolute; top: 7px; right: 7px; width: 26px; height: 26px; border: none;
  background: var(--hover); color: var(--text-2); border-radius: 7px; cursor: pointer;
  display: none; place-items: center; z-index: 2; }
.card-move svg { width: 16px; height: 16px; }
.card-move:hover { background: var(--elevated); color: var(--text); }
@media (hover: none), (max-width: 760px) { .board .card-move { display: grid; } }
.move-menu { position: absolute; z-index: 95; background: var(--elevated); border: 1px solid var(--line-2);
  border-radius: 11px; box-shadow: var(--shadow-lg); padding: 5px; min-width: 168px; }
.move-menu .mm-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-3); padding: 7px 10px 4px; }
.mm-item { display: block; width: 100%; text-align: left; padding: 10px; border: none; background: none;
  color: var(--text); font-size: 13.5px; border-radius: 8px; cursor: pointer; }
.mm-item:hover, .mm-item:active { background: var(--accent-soft); color: var(--accent-2); }
.lead-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.lead-card.dragging { opacity: .5; cursor: grabbing; }
.lead-card .lc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.lead-card .lc-top .av { width: 30px; height: 30px; }
.lead-card .lc-top b { font-size: 13px; font-weight: 600; line-height: 1.2; }
.lead-card .lc-top span { font-size: 11.5px; color: var(--text-3); display: block; }
.lead-card .lc-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.lead-card .lc-foot { display: flex; align-items: center; justify-content: space-between; }
.lead-card .lc-foot .val { font-weight: 700; font-size: 13px; }
.lead-card .lc-foot .val small { color: var(--text-3); font-weight: 500; }

/* ── Forms ────────────────────────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, textarea.input, select.input,
.inp, textarea.inp, select.inp {
  width: 100%; padding: 10px 13px; background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 10px; color: var(--text);
  font-size: 13.5px; transition: border-color .15s, box-shadow .15s; outline: none; }
.input:focus, textarea.input:focus, select.input:focus,
.inp:focus, textarea.inp:focus, select.inp:focus {
  border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
.input::placeholder, .inp::placeholder { color: var(--text-3); }
textarea.input, textarea.inp { resize: vertical; min-height: 90px; line-height: 1.55; }
/* Review-email dialog textarea — force readable colours by id, so it stays legible
   even if an older cached app.js emits it without the .inp class (it was rendering
   near-invisible: theme-text colour on the UA-default white textarea background). */
#revBody { background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 13px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { padding: 7px 13px; border-radius: 8px; border: none; background: transparent; color: var(--text-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer; transition: all .14s; }
.seg button:hover { color: var(--text); }
.seg button svg { width: 16px; height: 16px; vertical-align: -3px; flex: none; }
.seg button.on { background: var(--elevated); color: var(--text); box-shadow: var(--shadow); }
.seg button.on.grad { background: var(--grad); color: #fff; box-shadow: 0 4px 14px -5px rgba(124,108,255,.7); }

/* ── Command palette + modal ──────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4,4,9,.62);
  backdrop-filter: blur(5px); display: none; opacity: 0; transition: opacity .18s; }
.overlay.show { display: block; opacity: 1; }
.palette { position: fixed; z-index: 91; left: 50%; top: 86px; transform: translateX(-50%) translateY(-8px) scale(.98);
  width: min(620px, 92vw); background: var(--elevated); border: 1px solid var(--line-2);
  border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; display: none; opacity: 0;
  transition: opacity .18s var(--ease), transform .18s var(--ease); }
.palette.show { display: block; opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.palette .pin { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette .pin svg { width: 19px; height: 19px; color: var(--text-3); }
.palette .pin input { flex: 1; background: none; border: none; outline: none; font-size: 16px; }
.palette .results { max-height: 380px; overflow-y: auto; padding: 8px; }
.palette .pgroup { font-size: 10.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); padding: 10px 12px 5px; }
.presult { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer; }
.presult .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--text-2); flex: none; }
.presult .ic svg { width: 15px; height: 15px; }
.presult b { font-size: 13.5px; font-weight: 550; }
.presult span { font-size: 11.5px; color: var(--text-3); display: block; }
.presult kbd { margin-left: auto; font-size: 11px; color: var(--text-3); }
.presult.sel, .presult:hover { background: var(--accent-soft); }
.palette .empty { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }

.modal { position: fixed; z-index: 91; left: 50%; top: 50%; transform: translate(-50%,-46%) scale(.97);
  width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; background: var(--elevated);
  border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-lg);
  display: none; opacity: 0; transition: opacity .18s, transform .2s var(--ease); }
.modal.show { display: block; opacity: 1; transform: translate(-50%,-50%) scale(1); }
.modal .mh { display: flex; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal .mh h3 { font-size: 15.5px; font-weight: 650; }
.modal .mh .x { margin-left: auto; cursor: pointer; color: var(--text-3); width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 8px; }
.modal .mh .x:hover { background: var(--hover); color: var(--text); }
.modal .mb { padding: 20px; }
.modal .mf { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 95; display: flex; flex-direction: column; gap: 10px; }
.toast { display: flex; align-items: center; gap: 11px; padding: 12px 16px; background: var(--elevated);
  border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500;
  animation: toastIn .3s var(--ease); max-width: 360px; }
.toast .ic { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.toast.ok .ic { background: var(--pos-soft); color: var(--pos); }
.toast.err .ic { background: var(--neg-soft); color: var(--neg); }
.toast .ic svg { width: 14px; height: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } }

/* ── Skeleton / loading ───────────────────────────────────────────────────── */
.skel { background: linear-gradient(100deg, var(--surface-2) 30%, var(--hover) 50%, var(--surface-2) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-2); border-top-color: var(--accent);
  border-radius: 99px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Page transition / entrance ───────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(10px); animation: revealUp .5s var(--ease) forwards; }
@keyframes revealUp { to { opacity: 1; transform: none; } }
.content > * { animation: revealUp .45s var(--ease) both; }
.stagger > * { animation: revealUp .45s var(--ease) both; }
.stagger > *:nth-child(2) { animation-delay: .04s; }
.stagger > *:nth-child(3) { animation-delay: .08s; }
.stagger > *:nth-child(4) { animation-delay: .12s; }

/* ── AI Studio ────────────────────────────────────────────────────────────── */
.studio { display: grid; grid-template-columns: 360px 1fr; gap: 18px; align-items: start; }
.gen-out { min-height: 420px; }
.out-block { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px; margin-bottom: 12px;
  background: var(--surface-2); position: relative; }
.out-block h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
  margin-bottom: 9px; font-weight: 600; }
.out-block p { font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; }
.out-block .copy { position: absolute; top: 12px; right: 12px; cursor: pointer; color: var(--text-3); opacity: 0; transition: opacity .15s; }
.out-block:hover .copy { opacity: 1; }
.out-block .copy:hover { color: var(--text); }
.hook-pill { display: block; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 8px; font-size: 13.5px; background: var(--surface); transition: border-color .15s; }
.hook-pill:hover { border-color: var(--accent-line); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-cloud .chip { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.storyboard-scene { display: grid; grid-template-columns: 64px 1fr; gap: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.storyboard-scene .tt { font-family: var(--mono); font-size: 11.5px; color: var(--accent-2); font-weight: 600; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-3); }
.empty-state .big { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; background: var(--accent-soft);
  display: grid; place-items: center; color: var(--accent-2); }
.empty-state .big svg { width: 26px; height: 26px; }
.empty-state h3 { color: var(--text); font-size: 16px; margin-bottom: 6px; }

/* ── Module placeholder / hero ────────────────────────────────────────────── */
.mod-hero { text-align: center; padding: 56px 24px 40px; position: relative; overflow: hidden; }
.mod-hero .glow { position: absolute; inset: 0; background: radial-gradient(420px 220px at 50% 0%, var(--accent-soft), transparent 70%); }
.mod-hero .ic { width: 70px; height: 70px; margin: 0 auto 20px; border-radius: 20px; background: var(--grad);
  display: grid; place-items: center; box-shadow: 0 14px 40px -10px rgba(124,108,255,.6); position: relative; }
.mod-hero .ic svg { width: 33px; height: 33px; color: #fff; }
.mod-hero h2 { font-size: 26px; font-weight: 720; letter-spacing: -.03em; margin-bottom: 8px; position: relative; }
.mod-hero p { color: var(--text-2); font-size: 15px; max-width: 520px; margin: 0 auto 8px; position: relative; }
.feat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.feat { display: flex; align-items: flex-start; gap: 11px; padding: 15px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.feat .tick-ic { width: 22px; height: 22px; border-radius: 7px; background: var(--pos-soft); color: var(--pos);
  display: grid; place-items: center; flex: none; }
.feat .tick-ic svg { width: 13px; height: 13px; }
.feat span { font-size: 13px; font-weight: 500; line-height: 1.45; }
.soon-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-2); font-size: 12px; font-weight: 650; margin-bottom: 22px; }

/* ── Login ────────────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-wrap .orb { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .5; }
.login-wrap .orb.a { width: 460px; height: 460px; background: #7c6cff; top: -160px; right: -120px; }
.login-wrap .orb.b { width: 380px; height: 380px; background: #ff6cab; bottom: -160px; left: -100px; opacity: .35; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line-2);
  border-radius: 22px; padding: 36px 32px; box-shadow: var(--shadow-lg); position: relative; z-index: 2; }
.login-card .brand { justify-content: center; padding-bottom: 6px; }
.login-card h2 { text-align: center; font-size: 21px; font-weight: 700; letter-spacing: -.02em; margin: 14px 0 4px; }
.login-card .lead { text-align: center; color: var(--text-3); font-size: 13.5px; margin-bottom: 26px; }
.login-card .hint { text-align: center; font-size: 11.5px; color: var(--text-3); margin-top: 18px; }
.err-banner { background: var(--neg-soft); color: var(--neg); border: 1px solid rgba(251,113,133,.3);
  border-radius: 10px; padding: 10px 13px; font-size: 12.5px; font-weight: 500; margin-bottom: 16px; }

.note-banner { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: 12px;
  background: var(--warn-soft); border: 1px solid rgba(251,191,36,.28); color: var(--warn); font-size: 12.5px;
  font-weight: 500; margin-bottom: 18px; }
.note-banner svg { width: 17px; height: 17px; flex: none; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2,1fr); }
  .dash-main, .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .studio { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: repeat(2,1fr); }
  .launch-grid { grid-template-columns: repeat(2,1fr); }
  /* inline grids (beat media queries) — collapse 2-col detail layouts + dense KPI rows */
  [style*="grid-template-columns:1.5fr 1fr"],
  [style*="grid-template-columns:1.5fr"] { grid-template-columns: 1fr !important; }
  [style*="repeat(4,1fr)"] { grid-template-columns: repeat(2,1fr) !important; }
}
@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  body { overflow-x: hidden; }
  /* let grid/flex children shrink so wide content (tables) doesn't push the page sideways */
  .grid > *, .dash-main > *, .cols-2 > *, .cols-3 > *, .main { min-width: 0; }
  .launch-grid { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); width: 250px; flex-basis: 250px; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; min-width: 0; }
  .hamburger { display: grid; }
  .topbar { padding: 11px 14px; gap: 10px; }
  .topbar h1 { font-size: 15.5px; }
  .topbar .sub { font-size: 11.5px; }
  .cmd-trigger { min-width: 0; width: 38px; padding: 7px; justify-content: center; margin-left: auto; }
  .cmd-trigger span, .cmd-trigger kbd { display: none; }
  .content { padding: 16px 14px 56px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feat-grid { grid-template-columns: 1fr; }
  /* inline KPI rows (3- or 4-col) → 2 across on phones */
  [style*="repeat(4,1fr)"], [style*="repeat(3,1fr)"] { grid-template-columns: 1fr 1fr !important; }
  .kpi { padding: 14px 14px 40px; } .kpi .val { font-size: 22px; }
  /* kanban: one column ~full width, swipe sideways */
  .board { grid-auto-columns: minmax(82vw, 1fr); gap: 10px; }
  /* tables: tighter + scroll inside their card */
  .card { overflow-x: auto; }
  .tbl th, .tbl td { padding: 9px 8px; font-size: 12.5px; }
  /* overlays full-width */
  .modal { width: 96vw; } .palette { width: 94vw; top: 60px; }
  .seg { width: 100%; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 39; }
}
@media (prefers-reduced-motion: reduce) {
  *, .content > *, .stagger > *, .reveal { animation: none !important; transition: none !important; }
  /* animations are how .reveal fades in from opacity:0 — with motion disabled we must
     force the end-state visible, or the content stays invisible forever. */
  .reveal, .content > *, .stagger > * { opacity: 1 !important; transform: none !important; }
}
/* ICONFIX-START */
/* Admin icons are <svg viewBox="0 0 24 24"> with no width/height/stroke and
   app.css had no svg rules, so they hit the 300x150 SVG default and rendered
   as giant blobs. Size them as line-icons inheriting colour. :not([width])
   leaves the explicit brand logo (width="28") alone. */
svg[viewBox="0 0 24 24"]:not([width]){width:20px;height:20px;flex:0 0 auto;fill:none;stroke:currentColor}
.kpi-icon svg,.quick-ic svg,.action-ic svg,.setting-ic svg{width:22px;height:22px}
.topbar-btn svg,.cal-ic svg,.step-ic svg{width:18px;height:18px}
.btn svg,.pill svg,.tag svg,.stat-chip svg,.seg svg,.toggle svg,.sidebar-link svg,.composer-tool svg{width:18px;height:18px}
.fab svg{width:24px;height:24px}
.empty-ic svg{width:32px;height:32px}
.empty-ic2 svg{width:28px;height:28px}
/* ICONFIX-END */


/* ============================================================================
   ADDITIONS — edge-admin only. Uses CoreM8 tokens exclusively so a future
   shared-package extraction only has to take everything above this line.
   ============================================================================ */

/* CoreM8 declares .hamburger{display:none} BEFORE .icon-btn{display:grid}, so the
   icon rule wins and the menu button also shows on desktop. Re-assert it here
   (later in the cascade) and only reveal it once the sidebar collapses. */
.hamburger { display: none; }
@media (max-width: 760px) { .topbar .hamburger { display: grid; } }

/* brand mark holds a glyph rather than the "M8" wordmark */
.brand .mark svg { width: 18px; height: 18px; color: #fff; stroke-width: 2; }

/* flash messages — CoreM8 ships .err-banner/.note-banner; generalise to all four
   states so flashed categories map straight onto them */
.flash-stack { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.banner { display: flex; align-items: flex-start; gap: 11px; padding: 12px 15px;
  border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  border: 1px solid transparent; overflow-wrap: anywhere; }
.banner svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.banner.success { background: var(--pos-soft); color: var(--pos); border-color: rgba(52,211,153,.3); }
.banner.warning { background: var(--warn-soft); color: var(--warn); border-color: rgba(251,191,36,.3); }
.banner.danger  { background: var(--neg-soft); color: var(--neg); border-color: rgba(251,113,133,.3); }
.banner.info    { background: var(--info-soft); color: var(--info); border-color: rgba(56,189,248,.3); }
.banner code { background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 5px;
  font-family: var(--mono); font-size: 12px; }

/* an inline explanatory note inside a card (not a state — guidance) */
.hint-box { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 12px 14px; color: var(--text-2);
  font-size: 12.5px; line-height: 1.6; margin-bottom: 16px; }
.hint-box b { color: var(--text); font-weight: 600; }
.hint-box code, .hint code { font-family: var(--mono); font-size: 12px; color: var(--text);
  background: var(--hover); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.hint-box ol { margin: 6px 0 0 18px; } .hint-box ol li { margin-bottom: 5px; }

/* field help text under an input */
.help { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.field-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* mono identifiers in tables */
.mono { font-family: var(--mono); font-size: 12.5px; }
.tbl td .mono { color: var(--text-2); }
.tbl .num { font-variant-numeric: tabular-nums; }
.tag { display: inline-block; font-family: var(--mono); font-size: 11.5px; padding: 2px 7px;
  border-radius: 6px; background: var(--hover); border: 1px solid var(--line);
  color: var(--text-2); overflow-wrap: anywhere; }

/* command/diff output blocks */
pre.out { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 13px 15px; overflow-x: auto; font-family: var(--mono); font-size: 12px;
  line-height: 1.55; max-height: 46vh; white-space: pre; color: var(--text-2); }
/* every diff line is its own block span, so no literal newlines are emitted —
   mixing display:block spans with newlines double-spaces the whole diff */
pre.out.diff span { display: block; padding: 0 4px; margin: 0 -4px; }
pre.out.diff .a { color: var(--pos); background: var(--pos-soft); }
pre.out.diff .d { color: var(--neg); background: var(--neg-soft); }
pre.out.diff .h { color: var(--info); }
pre.out.diff .c { color: var(--text-3); }

/* raw config editor */
textarea.editor { width: 100%; min-height: 62vh; padding: 15px 17px; background: var(--bg);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6; white-space: pre;
  overflow-wrap: normal; overflow-x: auto; resize: vertical; outline: none;
  transition: border-color .15s, box-shadow .15s; tab-size: 4; }
textarea.editor:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.editor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.editor-bar .state { font-size: 12.5px; color: var(--text-3); }
.editor-bar .state.ok { color: var(--pos); } .editor-bar .state.bad { color: var(--neg); }

/* per-row action buttons: keep them compact so the actions column never widens
   the routing table past its card */
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-actions form { margin: 0; }
.row-actions .host-hint { display: none; }
@media (max-width: 900px) {
  /* stacked rows have room for the hostname, and it removes the ambiguity of
     several identical trash buttons in one card */
  .row-actions { justify-content: flex-start; }
  .row-actions .host-hint { display: inline; }
}

/* backend rows (Domains page) — a list rather than a table, because each row
   carries an inline edit form that a table cell handles badly on phones */
.be-row { border-top: 1px solid var(--line); padding: 13px 0; }
.be-row:first-of-type { border-top: none; }
.be-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.be-head .be-actions { margin-left: auto; display: flex; gap: 7px; flex-wrap: wrap; }
/* align-items:flex-start, or the address tag stretches to the full row width */
.be-meta { margin-top: 7px; display: flex; flex-direction: column; gap: 3px;
  align-items: flex-start; }
.be-meta .tag { margin-right: 4px; }
.be-edit { margin-top: 10px; }
.be-edit > summary { cursor: pointer; font-size: 12.5px; font-weight: 600;
  color: var(--accent-2); list-style: none; display: inline-flex; align-items: center; gap: 7px; }
.be-edit > summary::-webkit-details-marker { display: none; }
/* CSS-drawn caret: the Inter subset shipped here is latin-only, so ▸/▾ would
   fall back to a tofu box. */
.be-edit > summary::before { content: ""; width: 0; height: 0; flex: none;
  border-left: 5px solid currentColor; border-top: 4px solid transparent;
  border-bottom: 4px solid transparent; transition: transform .15s var(--ease); }
.be-edit[open] > summary::before { transform: rotate(90deg); }
.be-edit > form { margin-top: 12px; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--surface-2); }
@media (max-width: 620px) {
  .be-head .be-actions { margin-left: 0; width: 100%; }
}

/* stat strip on the overview — CoreM8 .kpi without the sparkline footprint */
.kpi.compact { padding: 16px 17px 17px; }
.kpi.compact .val { font-size: 24px; margin: 10px 0 3px; }

/* login: keep CoreM8's card, add the divider + Microsoft button */
.or-line { display: flex; align-items: center; gap: 10px; margin: 18px 0;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; }
.or-line:before, .or-line:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn.ms { background: var(--surface-2); border-color: var(--line-2); gap: 10px; }
.btn.ms:hover { background: var(--elevated); }
.btn.ms svg { width: 16px; height: 16px; }

/* A table card must never widen the page: it scrolls inside itself. CoreM8 does
   this only on phones; here it applies at every width as a backstop, because the
   sidebar is still 250px at tablet sizes and leaves the content column narrow. */
.card:has(.tbl) { overflow-x: auto; }

/* responsive tables: stack into labelled rows rather than side-scrolling.
   Each <td> carries data-label; see templates. Breakpoint is deliberately ABOVE
   CoreM8's 760px sidebar collapse — between the two, the sidebar still takes
   250px and a 6-column table has nowhere to go. */
@media (max-width: 900px) {
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { border: 1px solid var(--line); border-radius: var(--radius-sm);
    padding: 4px 12px 10px; margin-bottom: 10px; background: var(--surface-2); }
  .tbl.stack tr:hover { background: var(--surface-2); }
  .tbl.stack td { border: none; padding: 7px 0; display: flex; gap: 12px;
    align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
  /* cell content must be allowed to shrink and wrap, or a long identifier or a
     second element pushes the whole page sideways */
  .tbl.stack td > * { min-width: 0; overflow-wrap: anywhere; }
  .tbl.stack td:before { content: attr(data-label); flex: none; color: var(--text-3);
    font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
    padding-top: 2px; }
  .tbl.stack td > * { text-align: right; }
  .tbl.stack td.stack-full { display: block; }
  .tbl.stack td.stack-full:before { display: block; margin-bottom: 5px; }
  .tbl.stack td.stack-full > * { text-align: left; }
  /* CoreM8 sets .card{overflow-x:auto} on phones for tables; stacked tables must
     not also scroll, or long values still push the card sideways */
  .card:has(.tbl.stack) { overflow-x: visible; }
  .field-row { grid-template-columns: 1fr; }
  textarea.editor { min-height: 52vh; font-size: 12px; }
}
