@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Open+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================================================
   Fusova — BACKEND (logged-in tenant workspace) shared stylesheet · rev5
   ----------------------------------------------------------------------------
   Brand tokens RESKINNED to the QESaaS / Site_Rev26 visual system:
   navy #070606 dark surfaces, teal #12D7EC primary accent, Montserrat /
   Open Sans / JetBrains Mono type. Token-level reskin only — all variable
   NAMES are preserved (every rule that references them re-themes automatically).

   REV5 UI CHANGE (vs rev1): SLATE #424E64 moved off the sidebar and onto a new
   page-header band (.page-banner / §2d) — the marketing "hero at the top of the
   content area" pattern. The sidebar returned to navy #070606. Banner contrast
   is white/teal/light-gray text on slate (no dark-on-dark).

   This is the logged-in tenant app shell (sidebar + topbar + main), distinct
   from the marketing site. Every backend page links ONLY this file:
       <link rel="stylesheet" href="./styles.css">

   See _components.md for the exact HTML snippets every page must copy.
   ============================================================================ */

/* ---------------------------------------------------------------------------
   1. BRAND TOKENS  (palette + typography)
   QESaaS / Site_Rev26 palette: navy #070606 dark surfaces, teal #12D7EC accent,
   slate text on light, gray-50/100 light bands, gray-200 hairlines. Variable
   NAMES preserved; only the hex VALUES are remapped (by role).
   --------------------------------------------------------------------------- */
:root {
  /* --- surfaces (QESaaS light content palette) --- */
  --bg:            #F5F5F5;   /* app canvas  (gray-100) */
  --bg-soft:       #FAFAFA;   /* sidebar fill / banded zones (gray-50) */
  --bg-elevated:   #FFFFFF;   /* cards, topbar, modal (white) */
  --bg-paper:      #FAFAFA;   /* inputs, subtle fills (gray-50) */

  /* --- ink --- */
  --text:          #070606;   /* navy */
  --text-muted:    #424E64;   /* slate */
  --text-light:    #7A8499;   /* slate-light */
  --text-invert:   #FFFFFF;   /* white (on dark surfaces) */

  /* --- brand accent (QESaaS teal) --- */
  --accent:        #12D7EC;   /* teal — PRIMARY accent */
  --accent-dark:   #0E96A8;   /* teal-deep — accent hover */
  --accent-soft:   #D4F7FA;   /* teal-light — subtle accent tint */
  --slate:         #424E64;   /* QESaaS slate — mid-dark panel surface (REV5: page-header band) */
  --slate-light:   #7A8499;   /* QESaaS slate-light — muted line/text on slate */

  /* --- secondary brand hues (navy + gold on the QESaaS scale) --- */
  --sage:          #424E64;   /* slate (secondary brand hue) */
  --sage-soft:     #EFF1F5;   /* slate tint */
  --gold:          #CA8A04;   /* gold */
  --gold-soft:     #FBF1D2;   /* gold tint */

  /* --- lines + shadows --- */
  --border:        #E5E5E5;   /* gray-200 hairline */
  --border-strong: #CFCFCF;   /* darker gray-200 */
  --shadow-sm: 0 1px 2px rgba(7, 6, 6, 0.05);
  --shadow-md: 0 4px 14px rgba(7, 6, 6, 0.08);
  --shadow-lg: 0 12px 32px rgba(7, 6, 6, 0.12);
  --shadow-modal: 0 24px 64px rgba(7, 6, 6, 0.32);

  /* --- radii --- */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  /* --- typography (QESaaS / Site_Rev26 web fonts) --- */
  --serif: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; /* headings / strong UI labels */
  --sans:  "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* body / inputs */
  --mono:  "JetBrains Mono", ui-monospace, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; /* eyebrows / code / tags */

  /* --- app shell metrics --- */
  --sidebar-w: 248px;
  --topbar-h:  64px;

  /* --- functional STATUS colors (UI semantics, not marketing) --- */
  --ok:       #059669;   --ok-soft:    #E3F4EC;   /* Connected / Active (green) */
  --idle:     #424E64;   --idle-soft:  #EFF1F5;   /* Not connected (slate) */
  --candidate:#D97706;   --cand-soft:  #FBEFDD;   /* Candidate / not built (amber) */
  --warn:     #D97706;   --warn-soft:  #FBEFDD;   /* needs attention (amber) */

  /* --- READ/WRITE badge families (mirror integrations/base.py rulings) ---
     kept SEMANTICALLY DISTINCT on the QESaaS palette:
     read-only = teal · write-gated = amber · read-mostly = slate --- */
  --ro-fg:    #0E96A8;   --ro-bg:    #D4F7FA;   --ro-bd:  #9FE9F2; /* read-only   (teal)  */
  --wg-fg:    #B45309;   --wg-bg:    #FBEFDD;   --wg-bd:  #F2D6A8; /* write-gated (amber) */
  --rm-fg:    #424E64;   --rm-bg:    #EFF1F5;   --rm-bd:  #D5DAE3; /* read-mostly (slate) */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-dark); text-decoration: none; }   /* teal-deep: legible link on light */
a:hover { color: var(--accent); text-decoration: underline; }

h1, h2 { font-family: var(--serif); font-weight: 800; letter-spacing: -0.01em; margin: 0 0 0.4em; color: var(--text); line-height: 1.18; }
h3, h4 { font-family: var(--sans);  font-weight: 700; margin: 0 0 0.4em; color: var(--text); line-height: 1.25; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }
p  { margin: 0 0 1em; }
strong { font-weight: 700; color: var(--text); }

.muted { color: var(--text-muted); }
.serif { font-family: var(--serif); }
.mono  { font-family: var(--mono); }
.eyebrow {
  font-family: var(--mono);   /* JetBrains Mono — QESaaS eyebrow */
  text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem;
  font-weight: 600; color: var(--accent-dark); margin: 0 0 8px;  /* teal-deep: legible on light */
}

/* ---------------------------------------------------------------------------
   2. APP SHELL  —  fixed left sidebar + top bar + main content
   --------------------------------------------------------------------------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

/* ---- 2a. Sidebar ----
   QESaaS rhythm: the nav chrome is the DARK band — navy surface, white text,
   teal accents. (Marketing-site top-nav analog.) The .auth-rail on signup.html
   shares the same dark treatment for consistency.
   REV5 CHANGE: sidebar returns to NAVY (#070606). Slate (#424E64) moves to the
   page-header band (.page-banner) — the marketing "hero at the top of the
   content area" pattern. See §2d. The nav-link contrast was already tuned for a
   dark band, so navy carries it the same as slate did. */
.sidebar,
.auth-rail {
  background: var(--slate);                 /* mockup: SLATE #424E64 nav chrome (black logo block sits on top) */
  border-right: 1px solid rgba(255, 255, 255, 0.10);
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: var(--topbar-h);                 /* match the topbar height exactly so bottom edges align */
  padding: 0 20px;
  font-family: var(--serif);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--text-invert);               /* white logo wordmark */
  background: var(--text);                 /* mockup: BLACK logo block over the slate sidebar */
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);   /* hairline below the black block */
}
.sidebar-brand:hover { text-decoration: none; color: var(--text-invert); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--accent);               /* teal chip on the navy band */
  color: var(--text);                      /* navy "M" inside teal */
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-weight: 800; font-size: 1.15rem;
}

.nav {
  list-style: none;
  margin: 0;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #C7CCD6;                          /* muted light on navy */
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-link:hover { background: rgba(255,255,255,0.06); color: var(--text-invert); text-decoration: none; }
.nav-link .icon { color: #8A93A3; flex-shrink: 0; }
.nav-link.active {
  background: rgba(18, 215, 236, 0.12);    /* teal wash */
  color: var(--accent);                    /* teal label */
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-link.active .icon { color: var(--accent); }

.sidebar-foot {
  padding: 14px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);     /* hairline on slate */
  font-size: 0.8rem;
  color: #C7CCD6;                    /* muted light on slate (lightened for contrast) */
}
.sidebar-foot a { color: var(--accent); }   /* teal link on navy */
.sidebar-foot a:hover { color: #fff; }

/* ---- 2b. Topbar ---- */
.shell-main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  background: var(--slate);                          /* mockup: SLATE header band */
  border-bottom: 1px solid rgba(255, 255, 255, 0.10); /* light hairline — flows into the slate page-banner below */
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 800; margin: 0; color: var(--accent); }  /* mockup: TEAL page title on slate */
.topbar-spacer { flex: 1; }
.topbar-tenant {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.9rem; color: rgba(255, 255, 255, 0.82);   /* light tenant text on slate */
}
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--text); color: #fff;              /* navy disc + white initials — reads on slate */
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem; flex-shrink: 0;
}

/* ---- 2d. Page-header band (REV5)  ----------------------------------------
   The marketing "hero at the top of the content area" pattern, ported to the
   backend: a full-width SLATE band directly under the topbar that carries the
   page title (eyebrow + h1 + lede). This is where slate #424E64 now lives
   (rev1 had it on the sidebar). Nav chrome above is navy; the band is slate;
   the working content below it is the light canvas — three legible tiers.

   Usage on every workspace page: a <header class="page-banner"> sits between
   the .topbar and the <main class="main">, wrapping a <div class="page-banner-inner">
   that holds the eyebrow / h1 / lede (and, optionally, a right-aligned status
   chip via .page-banner .row-between).
   ------------------------------------------------------------------------- */
.page-banner {
  background: var(--bg);                     /* off-white #F5F5F5 — blends into the page body (owner request) */
  color: var(--text);                        /* navy text on the light band */
  border-bottom: none;                       /* seamless into the content canvas below */
}
.page-banner-inner {
  max-width: 1080px;
  width: 100%;
  padding: 28px 32px;
}
/* headings + lede render DARK on the off-white band (contrast: navy / slate) */
.page-banner h1 { color: var(--text); margin-bottom: 6px; }              /* navy headline */
.page-banner .eyebrow { color: var(--accent-dark); }     /* teal-deep eyebrow reads on off-white */
.page-banner p { color: var(--text-muted); margin: 0; font-size: 1rem; max-width: 680px; }  /* slate lede */
.page-banner strong { color: var(--text); }              /* navy emphasis on light */
.page-banner a { color: var(--accent-dark); }            /* teal-deep link on light */
.page-banner a:hover { color: var(--accent); }
/* a status chip can ride on the right of the band title row; keep chip styles intact */
.page-banner .row-between { gap: 18px; }

/* ---- 2c. Main content area ---- */
.main {
  padding: 30px 32px 60px;
  max-width: 1080px;
  width: 100%;
}
/* In-band page heads (rev1 pattern) still supported for any page that keeps the
   title in the content column; on rev5 the standing pages move it to .page-banner. */
.page-head { margin-bottom: 24px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p { color: var(--text-muted); margin: 0; font-size: 1rem; max-width: 680px; }

/* generic spacing helpers */
.stack > * + * { margin-top: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.mt-0 { margin-top: 0; }  .mt-1 { margin-top: 10px; } .mt-2 { margin-top: 18px; } .mt-3 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }

/* ---------------------------------------------------------------------------
   3. BUTTONS  —  primary / secondary / ghost  (+ small + danger variants)
   --------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s ease, border-color 0.13s ease, box-shadow 0.13s ease, transform 0.07s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { flex-shrink: 0; }

.btn-primary {
  background: var(--accent); color: var(--text);   /* solid teal, navy text (QESaaS) */
  box-shadow: 0 1px 0 rgba(0,0,0,0.04), 0 4px 12px rgba(18, 215, 236, 0.28);
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }  /* teal-deep, white text */

.btn-secondary {
  background: var(--bg-elevated); color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-paper); border-color: var(--text-muted); color: var(--text); }

.btn-ghost {
  background: transparent; color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }

.btn-danger {
  background: transparent; color: #DC2626; border-color: #F1C4C4;   /* QESaaS red */
}
.btn-danger:hover { background: #FCECEC; color: #B91C1C; }

.btn-sm { padding: 6px 12px; font-size: 0.82rem; border-radius: var(--radius-sm); }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------------------------------------------------------------------------
   4. CARDS
   --------------------------------------------------------------------------- */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { margin: 0; }
.card-title { font-family: var(--serif); font-size: 1.2rem; margin: 0 0 4px; }
.card p { color: var(--text-muted); }
.card p:last-child { margin-bottom: 0; }

/* dashed "coming soon / candidate" card variant */
.card-dashed {
  background: var(--bg-paper);
  border: 1.5px dashed var(--border-strong);
  box-shadow: none;
}

/* metric tile — illustrative numbers only, never presented as real metrics */
.tile { text-align: left; }
.tile .tile-num { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--text); line-height: 1.1; }
.tile .tile-label { color: var(--text-muted); font-size: 0.9rem; }

/* ---------------------------------------------------------------------------
   5. CONNECTOR / SERVICE ROW
   The base44 "Tools" row analog: icon · name+capability · badge · chip · button
   --------------------------------------------------------------------------- */
.conn-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
}
.conn-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.conn-row:last-child { border-bottom: none; }
.conn-row:hover { background: var(--bg-paper); }

.conn-logo {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-dark);   /* teal-deep — legible icon stroke on near-white */
}
.conn-body { flex: 1; min-width: 0; }
.conn-name { font-weight: 700; font-size: 0.98rem; color: var(--text); display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.conn-cap  { color: var(--text-muted); font-size: 0.88rem; margin-top: 2px; }
.conn-meta { display: flex; align-items: center; gap: 9px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* required-connector mini icon strip for service cards */
.req-icons { display: inline-flex; align-items: center; gap: 6px; }
.req-icons .req-ico {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--bg-soft); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   6. STATUS CHIPS  —  Connected / Not connected / Active / Candidate …
   --------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.4;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.chip-ok        { background: var(--ok-soft);   color: var(--ok);        border-color: #B8E2CC; }  /* Connected / Active (green) */
.chip-idle      { background: var(--idle-soft); color: var(--idle);      border-color: var(--border); } /* Not connected (slate) */
.chip-candidate { background: var(--cand-soft); color: var(--candidate); border-color: #F2D6A8; }  /* Candidate / not built (amber) */
.chip-warn      { background: var(--warn-soft); color: var(--warn);      border-color: #F2D6A8; }  /* Needs attention (amber) */
.chip-info      { background: var(--ro-bg);     color: var(--ro-fg);     border-color: var(--ro-bd); } /* neutral/info */

/* ---------------------------------------------------------------------------
   7. READ / WRITE BADGES  —  rendered honestly from integrations/base.py
   read-only · write-gated · read-mostly  (distinct color families)
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  border: 1px solid transparent;
  font-family: var(--mono);
}
.badge-readonly   { background: var(--ro-bg); color: var(--ro-fg); border-color: var(--ro-bd); }  /* read-only   */
.badge-writegated { background: var(--wg-bg); color: var(--wg-fg); border-color: var(--wg-bd); }  /* write-gated */
.badge-readmostly { background: var(--rm-bg); color: var(--rm-fg); border-color: var(--rm-bd); }  /* read-mostly */

/* ---------------------------------------------------------------------------
   8. TABS
   --------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.tab {
  padding: 9px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  font-family: inherit;
  text-decoration: none;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-dark); border-bottom-color: var(--accent); }

/* pill-style tabs (used for catalog categories) */
.tabs-pill { border-bottom: none; gap: 8px; flex-wrap: wrap; }
.tabs-pill .tab {
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 6px 15px; margin-bottom: 0; background: var(--bg-elevated);
}
.tabs-pill .tab.active { background: var(--accent); color: var(--text); border-color: var(--accent); }  /* teal pill, navy text */

/* ---------------------------------------------------------------------------
   9. TABLES
   --------------------------------------------------------------------------- */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elevated);
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
table.tbl thead th {
  text-align: left;
  padding: 12px 18px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border);
}
table.tbl tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: var(--bg-paper); }
table.tbl td .sub { color: var(--text-muted); font-size: 0.82rem; }

/* Inputs inside a .tbl cell (e.g. the Business hours editor) get the SAME field
   styling as the rest of the form — the .field input rules above are .field-scoped,
   so table-cell inputs would otherwise render as unstyled browser defaults. */
table.tbl td input[type=text],
table.tbl td select {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.13s ease, box-shadow 0.13s ease, background 0.13s ease;
}
table.tbl td input[type=text]:focus,
table.tbl td select:focus {
  outline: none;
  border-color: var(--accent-dark);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(18, 215, 236, 0.22);
}

/* ---------------------------------------------------------------------------
   10. MODAL  —  connector-setup (scope disclosure)  +  toggle switch
   --------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 6, 6, 0.55);   /* navy scrim */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 100;
}
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px 16px;
}
.modal-head .conn-logo { width: 48px; height: 48px; }
.modal-title { font-family: var(--serif); font-size: 1.3rem; margin: 0; }
.modal-subtitle { color: var(--text-muted); font-size: 0.88rem; margin: 2px 0 0; }
.modal-body { padding: 4px 24px 8px; }
.modal-body p { color: var(--text-muted); font-size: 0.92rem; }

/* the disclosure block (scopes / Limited-Use text) */
.scope-box {
  background: var(--bg-paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin: 14px 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.scope-box code {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  background: var(--bg-soft);
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-all;
}

/* read-only TOGGLE row inside the modal */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  margin: 14px 0;
}
.toggle-row .toggle-copy { flex: 1; }
.toggle-row .toggle-copy strong { display: block; font-size: 0.92rem; }
.toggle-row .toggle-copy span { color: var(--text-muted); font-size: 0.82rem; }

/* the switch itself */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  transition: background 0.18s ease;
}
.switch .slider::before {
  content: ""; position: absolute;
  height: 18px; width: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.55; cursor: not-allowed; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

/* ---------------------------------------------------------------------------
   11. FORM FIELDS
   --------------------------------------------------------------------------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=password],
.field input[type=number],
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-paper);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  transition: border-color 0.13s ease, box-shadow 0.13s ease, background 0.13s ease;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-dark);                 /* teal-deep focus ring */
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(18, 215, 236, 0.22);    /* teal glow */
}
.field-help { font-size: 0.82rem; color: var(--text-muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* inline check/radio options */
.opt-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 9px;
  font-size: 0.92rem; color: var(--text); cursor: pointer;
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.opt:hover { background: var(--bg-paper); }

/* requirements checklist (service detail) */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px dashed var(--border);
  font-size: 0.93rem;
}
.check-list li:last-child { border-bottom: none; }
.check-list .ck { color: var(--ok); flex-shrink: 0; }
.check-list .ck-empty { color: var(--text-light); flex-shrink: 0; }
.check-list .req-tag { margin-left: auto; font-size: 0.78rem; color: var(--text-muted); }

/* ---------------------------------------------------------------------------
   12. INLINE-SVG ICON SIZING
   Pages paste raw <svg class="icon ..."> — these classes set the box only.
   --------------------------------------------------------------------------- */
.icon      { width: 18px; height: 18px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon-sm   { width: 15px; height: 15px; }
.icon-lg   { width: 22px; height: 22px; }
.icon-xl   { width: 26px; height: 26px; }
/* stroke icons should inherit the surrounding text color */
.icon[stroke], .icon path[stroke] { stroke: currentColor; }

/* ---------------------------------------------------------------------------
   13. TRUST / NOTE callouts (used to surface owner-approval + read-only facts)
   --------------------------------------------------------------------------- */
.note {
  font-size: 0.9rem;
  color: var(--text);
  padding: 14px 16px;
  background: var(--accent-soft);          /* teal-light tint — QESaaS accent callout */
  border-left: 3px solid var(--accent-dark);
  border-radius: var(--radius-sm);
  margin: 16px 0;
}
.note strong { color: var(--text); }
.note-paper {
  background: var(--bg-paper);
  border-left-color: var(--border-strong);
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------------
   14. SETUP WIZARD  —  shared stepped flow (connector-setup.html A2P + onboarding.html)
   One step visible at a time, a Back/Next footer, and a progress rail.
   COLOR SEMANTICS (per owner request 2026-06-09):
     · upcoming step   = gray
     · current step    = teal  (--accent)   "in progress"
     · COMPLETED step  = GREEN (--ok)        "done"  ← green check
     · completed panel = GREEN success card
   --------------------------------------------------------------------------- */

/* progress rail — one <li> per step in the current path */
.step-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; padding: 0; list-style: none; }
.step-strip li {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
  padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--bg-elevated);
}
.step-strip li .num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 800; font-family: var(--mono);
  background: var(--bg-soft); color: var(--text-muted); border: 1px solid var(--border);
}
/* CURRENT step = teal accent (in progress) */
.step-strip li.is-current { color: var(--text); border-color: var(--accent-dark); background: var(--accent-soft); }
.step-strip li.is-current .num { background: var(--accent); color: var(--text); border-color: var(--accent); }
/* COMPLETED step = GREEN (done) — the green completed-step check */
.step-strip li.is-done { color: var(--ok); border-color: #B8E2CC; background: var(--ok-soft); }
.step-strip li.is-done .num { background: var(--ok); color: #fff; border-color: var(--ok); }

/* one step pane fades in as it becomes current */
.wiz-step { animation: wizfade 0.18s ease; }
@keyframes wizfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* wizard footer — Back left, Next / Submit right */
.wiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }

/* COMPLETED-WIZARD success card — green-accented (the "completed wizard, green" state) */
.wiz-complete { border: 1.5px solid #B8E2CC; background: var(--ok-soft); }
.wiz-complete .card-title { color: var(--ok); }
.wiz-complete .complete-mark {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--ok); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}

/* visually-hidden status word for the progress rail (screen-reader only) */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------------------------------------------------------------------------
   15. RESPONSIVE  (review-ready, not pixel-perfect)
   --------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar-brand { border-bottom: none; border-right: 1px solid rgba(255, 255, 255, 0.12); }
  .nav { flex-direction: row; padding: 8px; }
  .nav-link.active { box-shadow: inset 0 -3px 0 var(--accent); }
  .sidebar-foot { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .main { padding: 22px 18px 48px; }
  .page-banner-inner { padding: 22px 18px; }   /* REV5: match .main side padding on mobile */
}
