/* app/frontend/shared/style.css - shared across both apps.
   --mvs-brand's default here is the same burnt orange seeded into the
   settings table (sql/008_schema_auth_hardening.sql, #CC5500) - each app's
   main.js overrides this CSS variable at runtime from GET /api/settings, so
   changing brand_primary_color via the Settings screen actually takes
   effect without editing this file. This value is only the fallback shown
   before that fetch resolves, or if it ever fails. */
:root {
  --mvs-brand: #CC5500;
  --mvs-brand-dark: #A34400;
  --mvs-text: #1a1a1a;
  --mvs-bg: #f5f5f5;
  --mvs-border: #d0d0d0;
  --mvs-danger: #b3261e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--mvs-text);
  background: var(--mvs-bg);
}

button {
  background: var(--mvs-brand);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.5em 1em;
  cursor: pointer;
  font-size: 0.95em;
}
button:hover { background: var(--mvs-brand-dark); }
button:disabled { background: #999; cursor: not-allowed; }
button.mvs-danger { background: var(--mvs-danger); }

a { color: var(--mvs-brand); }

/* Auth screens (login / change password) */
.mvs-auth-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}
/* Decorative lightning backdrop behind the login screens
   (LightningBackground.js) - a dark field so the yellow/red bolts glow. */
.mvs-lightning-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, #2a2140 0%, #14101f 60%, #0a0810 100%);
}
.mvs-lightning-bg ~ .mvs-auth-screen { position: relative; z-index: 1; }
.mvs-lightning-bg ~ .mvs-auth-screen .mvs-auth-form { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); }
.mvs-auth-form {
  background: #fff;
  border: 1px solid var(--mvs-border);
  border-radius: 8px;
  padding: 32px;
  width: 100%;
  max-width: 360px;
}
.mvs-auth-form h1 { margin-top: 0; font-size: 1.4em; border-bottom: 3px solid var(--mvs-brand); padding-bottom: 8px; }
.mvs-auth-form label { display: block; margin-bottom: 12px; font-size: 0.9em; }
.mvs-auth-form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid var(--mvs-border);
  border-radius: 4px;
}
.mvs-auth-form button { width: 100%; margin-top: 8px; padding: 10px; }
.mvs-hint { display: block; margin-top: 2px; font-size: 0.8em; color: #666; }
.mvs-required { color: var(--mvs-danger); font-weight: 700; margin-left: 3px; }
.mvs-error { color: var(--mvs-danger); font-weight: 600; }
.mvs-notice { background: #fff3e0; border-left: 4px solid var(--mvs-brand); padding: 8px 12px; }

/* Agent screen-pop (ContactPop.js) - deliberately more prominent than
   .mvs-notice above ("flash screen" was the user's own phrase) so a
   connected dialer call's contact data is impossible to miss. */
.mvs-screenpop { background: #e8f5e9; border: 2px solid #2e7d32; border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.mvs-screenpop-header { display: flex; justify-content: space-between; align-items: center; }
.mvs-screenpop-header h2 { margin: 0; font-size: 1.1em; }
.mvs-screenpop-body p { margin: 4px 0; }
.mvs-screenpop-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 4px 16px; margin: 8px 0 0; }
.mvs-screenpop-fields div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed #c8e6c9; padding: 2px 0; }
.mvs-screenpop-fields dt { font-weight: 600; margin: 0; }
.mvs-screenpop-fields dd { margin: 0; text-align: right; }
/* Toast variant (ContactPop.js, screenpop_toast_mode setting) - same
   content, fixed to a corner and capped in width/height instead of
   taking up a full-width banner slot in the dashboard's own layout. */
.mvs-screenpop-toast {
  position: fixed; bottom: 16px; right: 16px; z-index: 1000;
  background: #e8f5e9; border: 2px solid #2e7d32; border-radius: 8px;
  padding: 10px 14px; width: 320px; max-height: 70vh; overflow-y: auto;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.mvs-screenpop-toast .mvs-screenpop-header h2 { font-size: 1em; }

/* Nav */
.mvs-navbar {
  display: flex;
  align-items: center;
  gap: 24px;
  background: #fff;
  border-bottom: 3px solid var(--mvs-brand);
  padding: 0 16px;
  height: 56px;
}
.mvs-navbar-brand { font-weight: 700; color: var(--mvs-brand); }
.mvs-navbar ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex: 1; }
.mvs-navbar a { display: block; padding: 8px 12px; border-radius: 4px; text-decoration: none; color: var(--mvs-text); }
.mvs-navbar a.active, .mvs-navbar a:hover { background: var(--mvs-brand); color: #fff; }
.mvs-navbar-user { font-size: 0.85em; display: flex; align-items: center; gap: 8px; }

/* Admin app shell + left sidebar nav. This REPLACES .mvs-navbar as the
   admin app's own nav surface, but .mvs-navbar above is left completely
   untouched - the agent app (app/frontend/agent/main.js) hand-rolls its
   own top bar directly against those classes, not against NavBar.js, so
   restyling .mvs-navbar itself would have silently broken it too. */
.mvs-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.mvs-shell-content { min-width: 0; }
@media (max-width: 860px) { .mvs-shell { grid-template-columns: 1fr; } }

.mvs-sidebar {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 3px solid var(--mvs-brand);
  min-height: 100vh;
}
.mvs-sidebar-brand { font-weight: 700; color: var(--mvs-brand); padding: 16px; font-size: 1.05em; }
.mvs-sidebar-scroll { flex: 1; overflow-y: auto; }
.mvs-sidebar-list { list-style: none; margin: 0; padding: 0 8px; }
.mvs-sidebar-list > li > a {
  display: block; padding: 8px 12px; margin-bottom: 2px; border-radius: 4px;
  text-decoration: none; color: var(--mvs-text);
}
.mvs-sidebar-list > li > a.active, .mvs-sidebar-list > li > a:hover { background: var(--mvs-brand); color: #fff; }
.mvs-sidebar-group-header {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; color: #666; border: none; padding: 8px 12px; margin-top: 8px;
  font-size: 0.78em; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  cursor: pointer;
}
.mvs-sidebar-group-header:hover { background: #fafafa; color: var(--mvs-text); }
.mvs-sidebar-chevron { font-size: 0.85em; }
.mvs-sidebar-sublist { list-style: none; margin: 0 0 4px; padding: 0; }
.mvs-sidebar-sublist li a {
  display: block; padding: 7px 12px 7px 20px; border-radius: 4px;
  text-decoration: none; color: var(--mvs-text);
}
.mvs-sidebar-sublist li a.active, .mvs-sidebar-sublist li a:hover { background: var(--mvs-brand); color: #fff; }
.mvs-sidebar-user {
  padding: 12px 16px; border-top: 1px solid var(--mvs-border); font-size: 0.85em;
  display: flex; flex-direction: column; gap: 4px;
}
.mvs-sidebar-user-name { font-weight: 600; }
.mvs-sidebar-user button { margin-top: 4px; }

/* Sections / tables */
.mvs-section { padding: 24px; max-width: 1000px; margin: 0 auto; }
/* Wider variant for screens with a genuine multi-column layout
   (AnalyticsSection.js, PLAN.md sec 23 P3) - a modifier, not a change to
   the default, so every existing single-column screen is unaffected. */
.mvs-section-wide { max-width: 1400px; }
.mvs-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.mvs-table { width: 100%; border-collapse: collapse; background: #fff; }
.mvs-table th, .mvs-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--mvs-border); }
.mvs-table th { background: #fafafa; }

/* Actions dropdown (ActionsMenu.js) - real user report, with a
   screenshot: "these action buttons are taking too much space because
   of their orientation" - a table cell with several stacked buttons
   wrapped one per line, since the Actions column has no room for them
   to sit side by side. One fixed-size trigger + an absolutely
   positioned list keeps every row the same height regardless of how
   many actions it has. */
.mvs-actions-menu { position: relative; display: inline-block; }
.mvs-actions-menu-trigger { white-space: nowrap; }
.mvs-actions-menu-list {
  position: absolute; top: 100%; right: 0; z-index: 20; margin-top: 4px;
  display: flex; flex-direction: column; min-width: 160px;
  background: #fff; border: 1px solid var(--mvs-border); border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); padding: 4px; gap: 2px;
}
.mvs-actions-menu-list button {
  background: none; color: var(--mvs-text); text-align: left; border-radius: 4px; white-space: nowrap;
}
.mvs-actions-menu-list button:hover { background: var(--mvs-bg); }
.mvs-actions-menu-list button.mvs-danger { color: var(--mvs-danger); }
.mvs-actions-menu-list button.mvs-danger:hover { background: #fdecea; }
/* The dropdown's own z-index is moot if an ancestor <td>/<tr> doesn't
   actually create a stacking context above a later table row's own
   background - table cells paint in source order, so a later row could
   otherwise visually clip an earlier row's open dropdown. */
.mvs-table td { position: relative; }
/* Real user report: "when a header is highlighted tone down the color so
   the text is still readable" - the browser's own default button
   hover/focus/active treatment (a system highlight color, sometimes with
   poor contrast against this text) was showing through uncontrolled;
   given an explicit, subtle, guaranteed-readable highlight instead
   (light neutral tint, text color pinned to `inherit` in every state). */
.mvs-sort-th { background: none; border: none; padding: 2px 4px; margin: -2px -4px; font: inherit; font-weight: 600; color: inherit; cursor: pointer; white-space: nowrap; border-radius: 3px; }
.mvs-sort-th:hover, .mvs-sort-th:focus, .mvs-sort-th:active { background: rgba(0, 0, 0, 0.08); color: inherit; outline: none; }

/* Two-column, user-repositionable layout (PLAN.md sec 23 P3) - the panel
   assignment (which column each one renders in) is decided in JS from a
   localStorage preference (shared/lib/prefs.js), not by CSS source order,
   so a panel's actual position and its "move" button's intent always
   agree regardless of DOM order. */
.mvs-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.mvs-layout-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 860px) { .mvs-layout { grid-template-columns: 1fr; } }
.mvs-panel-header { display: flex; justify-content: space-between; align-items: center; }
.mvs-panel-header button { font-size: 0.75em; padding: 3px 10px; }

/* Reports module (PLAN.md sec 26) - a narrow fixed-width browser column
   beside the report's own params/results, not the even 1fr/1fr split
   .mvs-layout uses for movable dashboard panels. */
.mvs-report-layout { display: grid; grid-template-columns: 220px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .mvs-report-layout { grid-template-columns: 1fr; } }
.mvs-report-list { list-style: none; margin: 0 0 12px; padding: 0; }
.mvs-report-list li a { display: block; padding: 6px 10px; border-radius: 4px; text-decoration: none; color: inherit; }
.mvs-report-list li a.active { background: var(--mvs-brand); color: #fff; }

/* The Lists/Companies tab strip inside ContactsSection.js (PLAN.md sec 26) */
.mvs-tab-active { background: var(--mvs-brand); color: #fff; }

/* Modal */
.mvs-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.mvs-modal { background: #fff; border-radius: 8px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; }
.mvs-modal-wide { max-width: 680px; }
.mvs-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--mvs-border); }
.mvs-modal-body { padding: 16px; }

/* Dual-list transfer picker (DualListTransfer.js) */
.mvs-dual-list { display: flex; gap: 12px; margin-bottom: 12px; }
.mvs-dual-list-panel { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.mvs-dual-list-search { width: 100%; padding: 6px 8px; margin-bottom: 6px; border: 1px solid var(--mvs-border); border-radius: 4px; }
.mvs-dual-list-box { border: 1px solid var(--mvs-border); border-radius: 4px; height: 220px; overflow-y: auto; }
.mvs-dual-list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--mvs-border); font-size: 0.9em;
}
.mvs-dual-list-row:last-child { border-bottom: none; }
.mvs-dual-list-row:hover { background: #f5f5f5; }
.mvs-dual-list-arrow { color: var(--mvs-brand); font-weight: 700; flex: 0 0 auto; }
.mvs-dual-list-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; font-size: 0.85em; color: #666; }
.mvs-dual-list-extra { display: block; max-width: 160px; margin-bottom: 12px; font-size: 0.9em; }
.mvs-dual-list-extra input { width: 100%; margin-top: 4px; padding: 8px; border: 1px solid var(--mvs-border); border-radius: 4px; }

/* Disposition tree (DispositionsSection.js) - real user ask: "the
   dispositions need to show how a disposition links to another - so b
   is level two to A - there has to be a visual map so the same is
   clear." A plain nested ul/li tree, each level connected by a left
   border rule - a parent/child relationship is visible at a glance, not
   something to infer from indentation dashes. */
.mvs-disp-tree ul { list-style: none; margin: 0; padding-left: 24px; border-left: 2px solid var(--mvs-border); }
.mvs-disp-tree > ul { padding-left: 0; border-left: none; }
.mvs-disp-tree li { margin: 8px 0; }
.mvs-disp-node { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--mvs-border); border-radius: 6px; background: #fff; }
.mvs-disp-node-name { font-weight: 600; }
.mvs-disp-badge-closes, .mvs-disp-badge-callback, .mvs-disp-badge-business { font-size: 0.75em; padding: 1px 8px; border-radius: 10px; white-space: nowrap; }
.mvs-disp-badge-closes { background: #e8f5e9; color: #2e7d32; }
.mvs-disp-badge-callback { background: #fff3e0; color: #e65100; }
.mvs-disp-badge-business { background: #e3f2fd; color: #1565c0; }

/* Form */
.mvs-form label { display: block; margin-bottom: 12px; font-size: 0.9em; }
.mvs-form input, .mvs-form select {
  display: block; width: 100%; margin-top: 4px; padding: 8px;
  border: 1px solid var(--mvs-border); border-radius: 4px;
}
.mvs-form-actions { display: flex; gap: 8px; margin-top: 16px; }
.mvs-checkbox-list { display: flex; flex-direction: column; gap: 4px; }
.mvs-checkbox-list-item { display: flex; align-items: center; gap: 6px; font-weight: normal; }
.mvs-checkbox-list-item input { display: inline; width: auto; margin: 0; }

/* Agent dashboard */
.mvs-dashboard-card { background: #fff; border: 1px solid var(--mvs-border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.mvs-dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.mvs-dashboard-grid .mvs-dashboard-card { margin-bottom: 0; }
.mvs-filter-row { display: flex; gap: 16px; align-items: flex-end; margin-bottom: 12px; flex-wrap: wrap; }
.mvs-filter-row label { display: flex; flex-direction: column; font-size: 0.85em; gap: 4px; }

/* Custom report builder (CustomReportsSection.js) - real user ask: "I
   want to be able to create custom reports on the frontend with the
   possibility to have joins." */
.mvs-builder-group { border: 1px solid var(--mvs-border); border-radius: 6px; padding: 12px; margin-bottom: 12px; }
.mvs-builder-group legend { font-weight: 600; padding: 0 4px; }
.mvs-builder-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.mvs-builder-row select, .mvs-builder-row input { padding: 6px 8px; border: 1px solid var(--mvs-border); border-radius: 4px; }

/* Softphone registration-status badge - referenced by Softphone.js since it
   was first built (sec 22.5) but had no rule at all until sec 23 (P1). A
   colored dot before the text so "registered" vs "disconnected" is visible
   at a glance, not just readable text an agent has to actually parse mid-call. */
.mvs-softphone-status { display: flex; align-items: center; gap: 6px; }
.mvs-softphone-status::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: #999; /* default/unknown - loading, error */
}
.mvs-softphone-status.mvs-status-registered::before,
.mvs-softphone-status.mvs-status-connected::before { background: #2e7d32; }
.mvs-softphone-status.mvs-status-connecting::before { background: #f9a825; }
.mvs-softphone-status.mvs-status-disconnected::before,
.mvs-softphone-status.mvs-status-error::before { background: var(--mvs-danger); }

/* Real-time dashboard status tiles (DashboardSection.js) */
.mvs-status-counts { display: flex; gap: 12px; flex-wrap: wrap; }
.mvs-status-count {
  flex: 1; min-width: 90px; text-align: center; padding: 12px 8px;
  border-radius: 8px; background: var(--mvs-bg); border: 1px solid var(--mvs-border);
}
.mvs-status-count-value { display: block; font-size: 1.6em; font-weight: 700; }
.mvs-status-count-label { display: block; font-size: 0.8em; color: #666; }
.mvs-status-count.mvs-status-available { border-color: #2e7d32; }
.mvs-status-count.mvs-status-available .mvs-status-count-value { color: #2e7d32; }
.mvs-status-count.mvs-status-paused { border-color: #f9a825; }
.mvs-status-count.mvs-status-paused .mvs-status-count-value { color: #b8860b; }
.mvs-status-count.mvs-status-stale { border-color: var(--mvs-danger); }
.mvs-status-count.mvs-status-stale .mvs-status-count-value { color: var(--mvs-danger); }

/* Trunk liveness badge (Trunks screen, src/lib/trunkLiveness.js's 4
   status values) - a small inline pill, not the larger dashboard status
   tiles above, but the same green/red/grey color vocabulary. */
.mvs-status-badge { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 0.8em; font-weight: 600; }
.mvs-status-badge.mvs-status-reachable { background: #e8f5e9; color: #2e7d32; }
.mvs-status-badge.mvs-status-unreachable { background: #fdecea; color: var(--mvs-danger); }
.mvs-status-badge.mvs-status-unknown, .mvs-status-badge.mvs-status-inactive { background: #f0f0f0; color: #666; }

/* Agent Settings' Requirements tab (AgentSettings.js) - same green/red
   vocabulary as the badges above, one row per check. */
.mvs-requirements-list { display: flex; flex-direction: column; gap: 8px; }
.mvs-requirements-item { border-bottom: 1px solid var(--mvs-border); padding: 6px 0; }
.mvs-requirements-row { display: flex; justify-content: space-between; align-items: center; }
.mvs-req-pass { color: #2e7d32; font-weight: 700; }
.mvs-req-fail { color: var(--mvs-danger); font-weight: 700; }
.mvs-req-checking { color: #666; }

/* DTMF pad (Softphone.js, PLAN.md sec 23 P5) - a small fixed 3-column grid,
   not a full-width button row, so 12 digits stay compact next to the rest
   of the in-call controls. */
.mvs-dtmf-pad { display: grid; grid-template-columns: repeat(3, 48px); gap: 6px; margin-top: 8px; }
.mvs-dtmf-pad button { padding: 8px 0; }

/* A stale agent (no heartbeat within the threshold) despite showing as
   available/busy/etc - see app/src/api/handlers/realtime.js's
   STALE_AFTER_SECONDS and its own comment on why this is display-only. */
.mvs-stale-badge {
  display: inline-block; font-size: 0.7em; font-weight: 700; text-transform: uppercase;
  background: var(--mvs-danger); color: #fff; border-radius: 3px; padding: 1px 5px;
}

/* Visual IVR flow designer (IvrFlowDesigner.js) - a hand-rolled canvas,
   no vendored graph library (this codebase has none). Three-column
   layout: a narrow "add node" palette, the canvas itself, and a
   property panel for whichever node is selected. */
.mvs-ivr-layout { display: grid; grid-template-columns: 160px 1fr 280px; gap: 16px; margin-top: 16px; align-items: start; }
@media (max-width: 860px) { .mvs-ivr-layout { grid-template-columns: 1fr; } }
.mvs-ivr-palette { display: flex; flex-direction: column; gap: 6px; }
.mvs-ivr-palette button { font-size: 0.85em; text-align: left; }
.mvs-ivr-canvas {
  position: relative; min-height: 560px; background: #fafafa;
  resize: vertical; /* drag the bottom edge to make the canvas taller */
  border: 1px solid var(--mvs-border); border-radius: 8px; overflow: auto;
  background-image: radial-gradient(#ddd 1px, transparent 1px); background-size: 16px 16px;
}
.mvs-ivr-edges { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mvs-ivr-edge-line { stroke: #999; stroke-width: 2; marker-end: url(#mvs-ivr-arrow); }
.mvs-ivr-edge-label { font-size: 11px; fill: #555; text-anchor: middle; }
.mvs-ivr-node {
  position: absolute; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 6px; border-radius: 8px; border: 2px solid var(--mvs-border); background: #fff;
  cursor: grab; user-select: none; touch-action: none; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.mvs-ivr-node:active { cursor: grabbing; }
.mvs-ivr-node-selected { border-color: var(--mvs-brand); box-shadow: 0 0 0 2px var(--mvs-brand); }
.mvs-ivr-node-type { font-weight: 700; font-size: 0.8em; }
.mvs-ivr-node-desc { font-size: 0.72em; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.mvs-ivr-node-remove {
  position: absolute; top: -8px; right: -8px; width: 18px; height: 18px; padding: 0; line-height: 1;
  border-radius: 50%; background: var(--mvs-danger); font-size: 12px;
}
.mvs-ivr-node-start { border-color: #2e7d32; }
.mvs-ivr-node-hangup { border-color: var(--mvs-danger); }
.mvs-ivr-node-menu { border-color: #1565c0; }
.mvs-ivr-node-playback { border-color: #6a1b9a; }
.mvs-ivr-node-queue, .mvs-ivr-node-extension { border-color: #00838f; }
.mvs-ivr-node-ivr { border-color: #ef6c00; }
.mvs-ivr-node-recording_start, .mvs-ivr-node-recording_stop { border-color: #ad1457; }
.mvs-ivr-node-timer { border-color: #827717; }
.mvs-ivr-node-api_call { border-color: #00695c; }
.mvs-ivr-node-condition { border-color: #4527a0; }
.mvs-ivr-node-set_variable { border-color: #558b2f; }
.mvs-ivr-node-switch { border-color: #c62828; }
/* Full-window designer (IvrFlowDesigner.js "Expand"). */
.mvs-ivr-expanded {
  position: fixed; inset: 0; z-index: 900; max-width: none; margin: 0;
  background: var(--mvs-bg); padding: 16px 20px; overflow: auto;
}
.mvs-ivr-expanded .mvs-ivr-layout { grid-template-columns: 160px 1fr 320px; }
.mvs-ivr-expanded .mvs-ivr-canvas { min-height: calc(100vh - 230px); }
body.mvs-no-scroll { overflow: hidden; }
.mvs-ivr-panel { background: #fff; border: 1px solid var(--mvs-border); border-radius: 8px; padding: 12px; }
.mvs-ivr-panel-body label { display: block; margin-bottom: 10px; }
.mvs-ivr-panel-body select, .mvs-ivr-panel-body input[type="text"], .mvs-ivr-panel-body input[type="number"] { width: 100%; margin-top: 4px; }
.mvs-ivr-panel-body .mvs-form-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mvs-ivr-panel-body .mvs-form-row select { width: auto; flex: 1; margin-top: 0; }

/* API docs page (ApiDocsSection.js) - real user ask: "a page that has
   all the detailed API's that can be used to drive all parts of this
   system from an external system - be very detailed." A left-nav TOC
   + scrolling right content area, the standard API-reference-doc
   layout, over the data in apiDocsData.js. */
.mvs-api-search { width: 280px; padding: 8px; border: 1px solid var(--mvs-border); border-radius: 4px; }
.mvs-api-intro { color: #555; margin-bottom: 12px; }
.mvs-api-layout { display: flex; gap: 24px; align-items: flex-start; }
.mvs-api-toc {
  flex: 0 0 240px; position: sticky; top: 12px; max-height: calc(100vh - 100px); overflow-y: auto;
  background: #fff; border: 1px solid var(--mvs-border); border-radius: 8px; padding: 12px;
}
.mvs-api-toc ul { list-style: none; margin: 0; padding: 0; }
.mvs-api-toc li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.mvs-api-toc a { flex: 1; }
.mvs-api-toc a.active { font-weight: 700; color: var(--mvs-brand); }
.mvs-api-toc-count { font-size: 0.75em; color: #888; background: #f0f0f0; border-radius: 10px; padding: 1px 7px; }
.mvs-api-content { flex: 1; min-width: 0; }
.mvs-api-group { background: #fff; border: 1px solid var(--mvs-border); border-radius: 8px; padding: 16px; margin-bottom: 20px; }
.mvs-api-group h2 { margin-top: 0; }
.mvs-api-route { border-top: 1px solid var(--mvs-border); padding: 12px 0; }
.mvs-api-route:first-of-type { border-top: none; padding-top: 0; }
.mvs-api-route-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.mvs-api-method {
  display: inline-block; min-width: 56px; text-align: center; font-size: 0.75em; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; color: #fff;
}
.mvs-api-method-get { background: #1565c0; }
.mvs-api-method-post { background: #2e7d32; }
.mvs-api-method-put { background: #ef6c00; }
.mvs-api-method-delete { background: var(--mvs-danger); }
.mvs-api-path { font-size: 0.95em; }
.mvs-api-auth { color: #555; margin: 2px 0 6px; }
.mvs-api-block { margin-top: 6px; }
.mvs-api-block pre {
  white-space: pre-wrap; word-break: break-word; background: #f7f7f7; border: 1px solid var(--mvs-border);
  border-radius: 4px; padding: 8px; margin: 4px 0 0; font-size: 0.85em;
}
@media (max-width: 900px) {
  .mvs-api-layout { flex-direction: column; }
  .mvs-api-toc { position: static; flex: none; width: 100%; max-height: none; }
}

/* Settings > System protection (SystemProtectionPanel.js) */
.mvs-sysprot-status { padding: 10px 12px; border-radius: 6px; margin: 8px 0 12px; line-height: 1.6; }
.mvs-sysprot-status.is-ok { background: #e7f6ec; color: #14532d; }
.mvs-sysprot-status.is-paused { background: #fdecea; color: #7f1d1d; }
.mvs-sysprot-status.is-unknown { background: #f1f1f1; color: #444; }
.mvs-sysprot-form { max-width: 560px; }
.mvs-sysprot h3 { margin-top: 18px; }
