/* Org360 owner console — additions on top of the app design system (web/css/app.css). Tokens only, so dark mode works. */

/* ---------- shell */
.owner-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 16px 10px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: #fde68a; background: linear-gradient(90deg, rgba(245, 158, 11, 0.22), rgba(236, 72, 153, 0.18)); border: 1px solid rgba(251, 191, 36, 0.28); white-space: nowrap; width: max-content; }
.app.collapsed .owner-badge { margin: 0 auto 10px; padding: 5px; } .app.collapsed .owner-badge span { display: none; }
.owner-topbar-title { font-weight: 650; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.owner-search { position: relative; flex: 1; max-width: 420px; min-width: 0; }
.owner-search .combo-menu { max-height: 360px; }
.owner-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; background: linear-gradient(135deg, #f59e0b, #ec4899); }

/* ---------- organisation mark (logo or initials in the brand colour) */
.org-mark { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; color: #fff; font-weight: 700; letter-spacing: 0;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 10%, transparent); }
.org-mark img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.org-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.org-cell .nm { font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-cell .sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-link { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.ws-link:hover { color: var(--brand); }
.health { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); white-space: nowrap; }
.health .hd { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.health.ok .hd { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.health.warn .hd { background: var(--amber); animation: pulse-amber 1.6s infinite; }
.health.bad .hd { background: var(--red); }
@keyframes pulse-amber { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 22%, transparent); } }
.seats { min-width: 110px; }
.seats .sl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); margin-bottom: 4px; white-space: nowrap; }

/* ---------- wizard */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.wizard-preview { position: sticky; top: calc(var(--topbar-h) + 16px); }
.wizard .stepper { margin-bottom: 18px; }
.wizard-foot { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.slug-field .input-group .input { font-family: var(--mono); font-size: 13px; }
.slug-status { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-height: 20px; }
.slug-status.ok { color: var(--green-text); } .slug-status.bad { color: var(--red-text); } .slug-status.wait { color: var(--muted); }
.logo-drop { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1.5px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); cursor: pointer; }
.logo-drop:hover, .logo-drop.over { border-color: var(--brand); background: var(--brand-50); }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; display: flex; gap: 14px; align-items: flex-start; text-align: left; padding: 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; color: var(--text); font: inherit;
  transition: border-color 0.12s, box-shadow 0.12s, background 0.12s; }
.choice:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.choice.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand-50) 70%, var(--surface)); box-shadow: 0 0 0 3px var(--ring); }
.choice .ct { font-weight: 650; font-size: 14px; } .choice .cd { font-size: 12.5px; color: var(--text-2); margin-top: 3px; line-height: 1.45; }
.choice .tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: flex; align-items: center; justify-content: center; color: transparent; }
.choice.active .tick { background: var(--brand); border-color: var(--brand); color: #fff; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-card .price { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.plan-card .price small { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; font-size: 12.5px; color: var(--text-2); }
.plan-card li { display: flex; gap: 7px; align-items: flex-start; } .plan-card li .icon { color: var(--green-text); margin-top: 2px; flex-shrink: 0; }

.module-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.module-group + .module-group { margin-top: 10px; }
.module-group > .mg-head { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.module-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.module-row:last-child { border-bottom: 0; }
.module-row .mr-main { flex: 1; min-width: 0; } .module-row .mr-title { font-weight: 600; font-size: 13.5px; } .module-row .mr-sub { font-size: 12px; color: var(--muted); }
.modules-2col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modules-2col .module-group + .module-group { margin-top: 0; }

.progress-steps { display: grid; gap: 4px; }
.pstep { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; }
.pstep.running { background: var(--brand-50); } .pstep.failed { background: var(--red-bg); } .pstep.action { background: var(--amber-bg); }
.pstep .pi { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid var(--border-strong); color: var(--muted); background: var(--surface); }
.pstep.done .pi { background: var(--green); border-color: var(--green); color: #fff; }
.pstep.failed .pi { background: var(--red); border-color: var(--red); color: #fff; }
.pstep.running .pi { border-color: var(--brand); color: var(--brand); }
.pstep.action .pi { background: var(--amber); border-color: var(--amber); color: #fff; }
.pstep .pt { font-weight: 600; } .pstep .pd { font-size: 12.5px; color: var(--text-2); margin-top: 1px; overflow-wrap: anywhere; }

/* ---------- code & secrets */
.codeblock { position: relative; background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; border: 1px solid #1e293b; }
.codeblock .copy-btn { position: absolute; top: 8px; right: 8px; }
.codeblock .c-k { color: #93c5fd; } .codeblock .c-s { color: #86efac; } .codeblock .c-m { color: #94a3b8; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; }
.secret-box .sv { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.erp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.erp-tile { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); cursor: pointer; text-align: left; font: inherit; color: var(--text); min-width: 0; }
.erp-tile:hover, .erp-tile.active { border-color: var(--brand-200); background: var(--brand-50); }
.erp-tile .em { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 750; color: #fff; flex-shrink: 0; }
.erp-tile .en { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .erp-tile .es { font-size: 11.5px; color: var(--muted); }

.log-view { background: #0b1020; color: #cbd5e1; font-family: var(--mono); font-size: 12px; line-height: 1.55; padding: 12px 14px; border-radius: 12px; max-height: 520px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #1e293b; }
.log-view .le { color: #fca5a5; } .log-view .lw { color: #fcd34d; } .log-view .lh { color: #93c5fd; }

.kpi-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.kpi-grid > * { flex: 1 1 165px; min-width: 0; }
.hero-org { display: flex; align-items: center; gap: 14px; min-width: 0; }
.owner-tabs { margin-bottom: 18px; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.mini-kpis > div { padding: 14px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mini-kpis > div:nth-child(3n) { border-right: 0; }
.mini-kpis > div:nth-last-child(-n+3) { border-bottom: 0; }
.mini-kpis .mk-v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; } .mini-kpis .mk-l { font-size: 12px; color: var(--muted); }
.danger-zone { border-color: color-mix(in srgb, var(--red) 35%, var(--border)); }

/* ---------- usage analytics (v1.3) */
.usage-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.usage-org { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.usage-org.is-active { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.usage-org .uo-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.usage-org .nm { display: block; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-org .nm:hover { color: var(--brand-text); }
.usage-org .uo-clock { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.usage-org .uo-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.usage-org .uo-v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.usage-org .uo-l { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-org .uo-foot { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto; min-width: 0; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); animation: live-pulse 2s ease-in-out infinite; }
.live-dot.off { background: var(--faint, var(--muted)); box-shadow: none; animation: none; }
@keyframes live-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 6%, transparent); } }
.hour-heat { display: grid; grid-template-columns: 36px repeat(24, minmax(8px, 1fr)); gap: 3px; align-items: center; font-size: 11px; color: var(--muted); }
.hour-heat .hh-cell { height: 22px; border-radius: 4px; background: var(--surface-3); }
.hour-heat .hh-cell.biz { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--amber) 55%, transparent); }
.hour-heat .hh-hour { text-align: left; font-variant-numeric: tabular-nums; }
.hour-heat .hh-day { font-weight: 600; }
.hh-legend { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.hh-legend .hh-swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; background: var(--surface-3); }
.hh-legend .hh-swatch.biz { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--amber) 55%, transparent); }
.hh-legend .hh-biz-key { display: inline-flex; align-items: center; gap: 5px; margin-left: 12px; }
.window-list .wl-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.window-list .wl-item:first-child { padding-top: 0; } .window-list .wl-item:last-child { border-bottom: 0; padding-bottom: 0; }
.window-list .wl-rank { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 700; font-size: 12.5px; background: var(--brand-50); color: var(--brand-text); }
.window-list .wl-orgs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.window-list .wl-orgs .chip { cursor: default; font-size: 11.5px; }
.privacy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.privacy-list li { display: flex; gap: 10px; align-items: flex-start; } .privacy-list li .icon { flex-shrink: 0; margin-top: 2px; color: var(--green-text); }
.privacy-list.never li .icon { color: var(--red-text); }
.table tr.row-warn td { background: color-mix(in srgb, var(--amber-bg) 55%, transparent); }
.doc-view { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.doc-view h2 { font-size: 18px; color: var(--text); margin: 22px 0 8px; } .doc-view h2:first-child { margin-top: 0; }
.doc-view h3 { font-size: 15px; color: var(--text); margin: 18px 0 6px; } .doc-view h4 { font-size: 14px; color: var(--text); margin: 14px 0 4px; }
.doc-view p, .doc-view ul, .doc-view ol, .doc-view .table-wrap { margin: 0 0 10px; } .doc-view ul, .doc-view ol { padding-left: 20px; }
.doc-view code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
.doc-view blockquote { margin: 0 0 10px; padding: 10px 14px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 8px 8px 0; }

/* ---------- auth */
.owner-auth .auth-side { background: radial-gradient(1000px 520px at -10% -10%, #b45309 0%, transparent 55%), radial-gradient(900px 600px at 110% 110%, #7c3aed 0%, transparent 55%), linear-gradient(160deg, #0b1024, #1a1433 60%, #0c1a2e); }
.owner-auth .feature-list .fi .fic { color: #fcd34d; }

/* ---------- responsive */
@media (max-width: 1280px) { .wizard { grid-template-columns: minmax(0, 1fr); } .wizard-preview { position: static; } }
@media (max-width: 900px) {
  .kpi-grid > * { flex-basis: 160px; }
  .choice-grid, .modules-2col { grid-template-columns: 1fr; }
  .mini-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-kpis > div { border-right: 1px solid var(--border) !important; border-bottom: 1px solid var(--border) !important; }
  .mini-kpis > div:nth-child(2n) { border-right: 0 !important; }
  .owner-search { display: none; }
  .hero-org h1 { font-size: 20px; }
  .usage-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
  .hour-heat { grid-template-columns: 30px repeat(24, minmax(6px, 1fr)); gap: 2px; font-size: 10px; }
  .hour-heat .hh-cell { height: 18px; border-radius: 3px; }
  .window-list .wl-item { flex-wrap: wrap; }
}
@media (max-width: 520px) { .kpi-grid { gap: 10px; } .kpi-grid > * { flex-basis: 140px; } .kpi-grid .stat .stat-value { font-size: 21px; } .wizard .step-line { flex-basis: 14px; } .wizard .stepper { gap: 6px; } }
