/*
 * Hand-authored, not vendored: re-implements the documented tokens/components from the
 * admin-panel-theme skill (Smarthr/Dreamstechnologies reference) from scratch, so this file
 * carries no commercial-template copyright question (see that skill's "Licensing note").
 * Only the selectors panel/ actually uses are here -- extend as new screens need more.
 */

:root {
  --color-primary: #F26522;
  --color-secondary: #0C4B5E;
  --color-success: #03C95A;
  --color-info: #1B84FF;
  --color-warning: #FFC107;
  --color-danger: #E70D0D;

  --primary-transparent: #FEF1EB;
  --success-transparent: #E8FAF0;
  --warning-transparent: #FFF9E9;
  --danger-transparent: #FAE7E7;
  --info-transparent: #EBF4FF;

  --body-bg: #F8F9FA;
  --body-text: #6B7280;
  --heading-text: #202C4B;
  --border-color: #ededed;
  --white-color: #FFFFFF;

  --sidebar-width: 252px;
  --sidebar-collapsed-width: 72px;
  --header-height: 52px;

  /* Enterprise sizing (one value per role, used everywhere; 2026-10-10 product decision:
     the dense 11-12px mode was too small to read). */
  --fs-base: 13px;          /* body, inputs, buttons, table cells */
  --fs-head: 12.5px;          /* table header, labels */
  --fs-small: 12px;       /* hints, badges, captions -- the floor; nothing readable goes below */
  --control-h: 30px;        /* inputs, selects, buttons: one height */
  --icon-btn: 26px;         /* square icon-only buttons (row actions, toolbar icons) */
  --icon: 14px;             /* icon glyph inside buttons */
  --row-pad-y: .4rem;       /* table row vertical padding (about 32px rows) */
  --fs-table: 11px;         /* table cells and header */
  --cell-pad-x: .75rem;
  --table-head-bg: #F3F4F6;
  --focus-ring: 0 0 0 3px rgba(242, 101, 34, .25);
}

:root[data-theme="dark"] {
  --body-bg: #131313;
  --border-color: #1F2228;
  --white-color: #0D0D0D;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Roboto", sans-serif;
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--body-text);
  background: var(--body-bg);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-text);
  font-family: "Roboto", sans-serif;
  margin-bottom: 0;
}
h1 { font-size: 28px; font-weight: 700; }
h2.main-title { font-size: 24px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
h4.sub-title { font-size: 18px; font-weight: 600; }
h5, .card-title { font-size: 16px; font-weight: 600; }
h6 { font-size: 14px; font-weight: 600; }

a { color: var(--color-primary); text-decoration: none; }
code { color: var(--color-secondary); }

/* =========================================================================
   Layout shell
   ========================================================================= */
.main-wrapper { min-height: 100vh; }

/* Keyboard focus is always visible, in the theme colour (never the browser's blue). */
a:focus-visible, button:focus-visible, .btn:focus-visible, summary:focus-visible,
.form-check-input:focus-visible, [tabindex]:focus-visible {
  outline: none; box-shadow: var(--focus-ring); border-radius: 5px;
}

.header {
  position: fixed; top: 0; left: var(--sidebar-width); right: 0; height: var(--header-height);
  background: var(--white-color); border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem; z-index: 1000; transition: left 0.3s ease;
  gap: 1rem;
}
[data-theme="dark"] .header { background: #0D0D0D; border-color: #1F2228; }
.header-page-title { font-weight: 600; color: var(--heading-text); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Icon-only header buttons: #toggle_btn, mobile hamburger -- 40px square, matches .form-control height */
.btn-menubar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 5px; border: 1px solid var(--border-color);
  background: var(--white-color); color: var(--heading-text); font-size: 18px; cursor: pointer;
  flex-shrink: 0;
}
.btn-menubar:hover { background: var(--primary-transparent); color: var(--color-primary); border-color: var(--primary-transparent); }
.mobile_btn { display: none; }

/* --- Sidebar --- */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
  background: var(--white-color); border-right: 1px solid var(--border-color);
  z-index: 1001; transition: width 0.3s ease, left 0.3s ease;
  display: flex; flex-direction: column;
}
.sidebar-logo { height: var(--header-height); display: flex; align-items: center; padding: 0 1.25rem; flex-shrink: 0; border-bottom: 1px solid var(--border-color); }
.sidebar-logo .brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; color: var(--heading-text); font-size: 18px; white-space: nowrap; overflow: hidden; }
.sidebar-logo .brand i { color: var(--color-primary); font-size: 22px; flex-shrink: 0; }

.sidebar-profile {
  display: flex; align-items: center; gap: .625rem; margin: 1rem .9375rem; padding: .625rem;
  background: var(--body-bg); border-radius: 5px; flex-shrink: 0; overflow: hidden;
}
.sidebar-profile-info { overflow: hidden; }
.sidebar-profile-info h6 { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-profile-info p { font-size: 11px; color: var(--body-text); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-inner { flex: 1; overflow-y: auto; overflow-x: hidden; padding-bottom: 1rem; }

.sidebar-menu, .sidebar-menu ul, .sidebar-menu li { list-style: none; margin: 0; padding: 0; }

.sidebar-menu .menu-title { padding: .75rem .9375rem .25rem; font-size: 10px; font-weight: 600; text-transform: uppercase; color: #9CA3AF; white-space: nowrap; }

/* Top-level item: either a plain link, or a .submenu group toggle.
   Hover/open state is a NEUTRAL gray pill with DARK text -- never orange. Orange is reserved
   for the one specific active leaf link (see below), matching the reference exactly: an
   expanded parent group is not "active colored" just because one of its children is. */
.sidebar-menu > ul > li { margin-bottom: 2px; }
.sidebar-menu > ul > li > a,
.sidebar-menu .submenu > a {
  display: flex; align-items: center; gap: .6rem; padding: 10px 15px; border-radius: 5px;
  margin: 0 .75rem; color: #4B5563; font-weight: 500; font-size: 15px; line-height: 1.3;
  cursor: pointer; white-space: nowrap;
}
.sidebar-menu i { font-size: 18px; width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-menu > ul > li > a:hover,
.sidebar-menu .submenu > a:hover,
.sidebar-menu > ul > li > a.active,
.sidebar-menu .submenu > a.subdrop {
  background: #F3F4F6; color: #1F2937;
}
.sidebar-menu .menu-arrow { margin-left: auto; width: 16px; height: 16px; position: relative; flex-shrink: 0; transition: transform .2s ease; }
.sidebar-menu .menu-arrow::before {
  content: ""; position: absolute; top: 45%; left: 50%; width: 6px; height: 6px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translate(-50%, -50%) rotate(45deg); transition: transform .2s ease;
}
.sidebar-menu .submenu > a.subdrop .menu-arrow::before { transform: translate(-50%, -50%) rotate(-135deg); }

/* Nested <ul>, collapsed by default; .subdrop toggle (JS) or server-rendered open state shows it.
   The ACTUAL active page's link is the only thing that ever turns orange: gray pill (same as a
   plain hover) + a solid left accent bar + orange text -- not a full orange-tinted fill. */
.sidebar-menu .submenu > ul { list-style: none; margin: 0; margin-top: 6px; padding: 0; display: none; position: relative; }
.sidebar-menu .submenu.menu-open > ul { display: block; }
.sidebar-menu .submenu > ul::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 22px; width: 1.5px; background: #E5E7EB;
}
.sidebar-menu .submenu > ul > li { margin-bottom: 1px; }
.sidebar-menu .submenu > ul > li > a {
  display: block; position: relative; padding: 8px 15px 8px 2.5rem; border-radius: 5px; margin: 0 .75rem;
  color: #4B5563; font-size: 14px; font-weight: 500; line-height: 1.3; white-space: nowrap;
}
.sidebar-menu .submenu > ul > li > a:hover {
  background: #F3F4F6; color: #1F2937;
}
/* Positioned at left:10px (the <a>'s own box) so it lands exactly on top of the connector
   line above -- the line sits at left:22px on the <ul>, and this <a> is inset 12px (.75rem
   margin) from that same <ul> edge, so 22-12=10px puts the bar in the identical track. */
.sidebar-menu .submenu > ul > li > a.active::before {
  content: ""; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 3px; border-radius: 2px;
  background: var(--color-primary);
}
.sidebar-menu .submenu > ul > li > a.active {
  background: #F3F4F6; color: var(--color-primary);
}

.page-wrapper {
  margin-left: var(--sidebar-width); padding-top: var(--header-height); min-height: 100vh;
  transition: margin-left 0.3s ease;
  display: flex; flex-direction: column;            /* footer stays at the bottom of short pages */
}
.content { padding: 1rem 1.25rem; flex: 1 0 auto; }
.page-wrapper > .footer { flex-shrink: 0; margin-top: auto; font-size: var(--fs-small); }

/* --- Collapse ("mini-sidebar"): toggled on <body> by #toggle_btn, see sidebar.js --- */
body.mini-sidebar .sidebar { width: var(--sidebar-collapsed-width); }
body.mini-sidebar .sidebar-logo .brand span,
body.mini-sidebar .sidebar-profile,
body.mini-sidebar .sidebar-menu .menu-title,
body.mini-sidebar .sidebar-menu span,
body.mini-sidebar .sidebar-menu .menu-arrow { display: none; }
body.mini-sidebar .sidebar-menu .submenu > ul { display: none !important; }
body.mini-sidebar .page-wrapper { margin-left: var(--sidebar-collapsed-width); }
body.mini-sidebar .header { left: var(--sidebar-collapsed-width); }

/* Hover-to-peek: while collapsed, hovering the rail re-expands it without leaving mini-sidebar */
body.mini-sidebar.expand-menu .sidebar { width: var(--sidebar-width); z-index: 1002; }
body.mini-sidebar.expand-menu .sidebar-logo .brand span,
body.mini-sidebar.expand-menu .sidebar-profile,
body.mini-sidebar.expand-menu .sidebar-menu .menu-title,
body.mini-sidebar.expand-menu .sidebar-menu span,
body.mini-sidebar.expand-menu .sidebar-menu .menu-arrow { display: initial; }
body.mini-sidebar.expand-menu .sidebar-profile { display: flex; }
body.mini-sidebar.expand-menu .sidebar-menu .submenu.menu-open > ul { display: block; }

/* --- Mobile off-canvas (<992px): independent from mini-sidebar, see sidebar.js --- */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1000; }
.sidebar-overlay.opened { display: block; }

@media (max-width: 991.98px) {
  .mobile_btn { display: inline-flex; }
  .sidebar { left: calc(var(--sidebar-width) * -1); width: var(--sidebar-width) !important; }
  body.menu-opened .sidebar { left: 0; }
  .header { left: 0 !important; }
  .page-wrapper { margin-left: 0 !important; }
  body.mini-sidebar .sidebar-logo .brand span,
  body.mini-sidebar .sidebar-profile,
  body.mini-sidebar .sidebar-menu .menu-title,
  body.mini-sidebar .sidebar-menu span,
  body.mini-sidebar .sidebar-menu .menu-arrow { display: initial; }
  body.mini-sidebar .sidebar-profile { display: flex; }
  body.mini-sidebar .sidebar-menu .submenu.menu-open > ul { display: block; }
}

/* =========================================================================
   Card
   ========================================================================= */
.card {
  background: var(--white-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-shadow: 0 1px 1px 0 rgba(0,0,0,.2);
  margin-bottom: 1rem;
  transition: all 0.5s ease;
}
.card-header, .card-body, .card-footer { padding: .75rem 1rem; }
.card > .table-responsive:last-child .table tr:last-child td { border-bottom: none; }
/* background set explicitly: Bootstrap paints .card-header/.card-footer grey (rgba(33,37,41,.03)),
   which made light buttons in a footer sit on grey and lose their edge. */
.card-header { background-color: var(--white-color); border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card-footer { background-color: var(--white-color); border-top: 1px solid var(--border-color); }

/* =========================================================================
   Forms
   ========================================================================= */
.form-label { font-size: var(--fs-head); font-weight: 500; color: var(--heading-text); margin-bottom: .35rem; display: block; }
/* background-color, not the `background` shorthand: the shorthand would wipe the
   chevron Bootstrap paints via background-image on .form-select. */
.form-control, .form-select,
.form-control-sm, .form-select-sm {
  height: var(--control-h); min-height: var(--control-h); width: 100%; border-radius: 5px; padding: .3rem .65rem;
  border: 1px solid #DCDFE4; font-size: var(--fs-base); color: var(--heading-text);
  background-color: var(--white-color); transition: border-color .2s ease, box-shadow .2s ease;
}
.form-control::placeholder { color: #9CA3AF; }
/* select[multiple] and textareas grow with their content */
select.form-select[multiple], select.form-select[size] { height: auto; padding-right: .75rem; background-image: none; }
/* File inputs: same height as every other control, a proper button for the picker */
.form-control[type=file] { padding: 0; line-height: calc(var(--control-h) - 2px); overflow: hidden; }
.form-control[type=file]::file-selector-button {
  height: 100%; margin: 0 .75rem 0 0; padding: 0 1rem; border: 0; border-right: 1px solid #DCDFE4;
  background: var(--body-bg); color: var(--heading-text); font-weight: 500; cursor: pointer;
}
.form-control[type=file]:hover::file-selector-button { background: #eee; }
.form-select { padding-right: 2.25rem; }
textarea.form-control { height: auto; }
/* Bootstrap's own :focus paints a blue ring (rgba(13,110,253,.25)); replace it with the theme's. */
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--color-primary);
  box-shadow: var(--focus-ring);
}
.form-control:disabled, .form-select:disabled { background-color: var(--body-bg); opacity: .7; }
.form-control.is-invalid, .form-select.is-invalid { border-color: var(--color-danger); }
.form-control.is-invalid:focus, .form-select.is-invalid:focus {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(231, 13, 13, .15);
}
.invalid-feedback { display: block; color: var(--color-danger); font-size: var(--fs-small); margin-top: .25rem; }
.form-check { display: flex; align-items: center; gap: .5rem; }
.form-check-input { width: 1.15rem; height: 1.15rem; flex-shrink: 0; float: none; margin: 0; cursor: pointer; }
.form-check-input:checked { background-color: var(--color-primary); border-color: var(--color-primary); }
.form-check-input:focus { border-color: var(--color-primary); box-shadow: var(--focus-ring); }
.form-check { font-size: var(--fs-base); color: var(--heading-text); }
.form-check-label { margin: 0; font-size: var(--fs-base); color: var(--heading-text); cursor: pointer; }

/* -------------------------------------------------------------------------
   Form pattern. Every panel form is built from these, so they all look alike:

   <form>
     <div class="card">                                  one card per section
       <div class="card-header"><h5 class="card-title">Section</h5></div>
       <div class="card-body">
         <div class="form-grid">                         2 columns, 1 on phones
           <div class="form-field">                      label + control + errors + hint
             <label class="form-label" for="f_x">Name <span class="text-danger">*</span></label>
             <input class="form-control ..." id="f_x" ...>
             @error ... <div class="invalid-feedback">
             <div class="form-hint">...</div>
           </div>
           <div class="form-field form-span-full">       full-width field (textarea, JSON, long text)
           <div class="form-field form-field-check">     single checkbox: .form-check inside
           <div class="form-field form-span-full">       checkbox group: span.form-label + .form-options
         </div>
       </div>
     </div>
     <div class="form-actions">                          Back (btn-light) then Save (btn-primary), right-aligned
   </form>
   ------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; align-items: start; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem 1.25rem; align-items: start; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem 1.25rem; align-items: start; }
.form-span-full { grid-column: 1 / -1; }
.form-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.form-field > .form-label { margin-bottom: 0; }
.form-field-check { justify-content: flex-end; }
.form-hint { font-size: var(--fs-small); line-height: 1.45; color: var(--body-text); }
.form-options { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; min-height: 40px; }
.form-options .form-check { margin: 0; }
/* A repeated block inside a card (a time window, a calling rule, a gateway slot). */
.form-slot { border: 1px solid var(--border-color); border-radius: 5px; padding: 1rem 1.25rem; }
.form-slot + .form-slot { margin-top: .75rem; }
.form-slot .form-grid, .form-slot .form-grid-3, .form-slot .form-grid-4 { margin-top: .75rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: .5rem; }
@media (max-width: 991.98px) {
  .form-grid-3, .form-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
}

/* =========================================================================
   Buttons
   Bootstrap's variant classes drive hover / focus / active / disabled through
   --bs-btn-* custom properties. Theme colors are set by redefining those
   variables per variant -- NOT by overriding background on the base class.
   Overriding only the base state lets Bootstrap's own state rules (e.g.
   .btn:focus-visible, :not(.btn-check)+.btn:active) paint stock blue/grey on
   press and keyboard focus.
   ========================================================================= */
/* One button size across the Panel: every .btn (and .btn-sm, kept for old markup) is
   --control-h tall so buttons line up with inputs in toolbars and forms. */
.btn, .btn-sm {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  height: var(--control-h); min-height: var(--control-h); border-radius: 5px; padding: 0 .8rem;
  font-size: var(--fs-base); font-weight: 500; line-height: 1; white-space: nowrap;
  cursor: pointer; transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.btn .ti, .btn-sm .ti { font-size: var(--icon); line-height: 1; }
.btn:focus-visible { box-shadow: var(--focus-ring); }
/* Icon-only buttons (row actions, toolbar search / download / filter): square, always carry
   aria-label + title. Inside table rows they are a little smaller so rows stay even. */
.btn-icon { width: var(--icon-btn); height: var(--icon-btn); min-height: var(--icon-btn); padding: 0; flex-shrink: 0; }
.table .btn-icon { width: 24px; height: 24px; min-height: 24px; }
.table .btn-icon .ti { font-size: 13px; }
.btn-icon .ti { font-size: var(--icon); }
.btn-lg { height: 44px; padding: 0 1.25rem; font-size: 15px; }
td .d-inline + .d-inline, td form.d-inline + form.d-inline, td .btn-icon + form, td form + .btn-icon, td .btn-icon + .btn-icon { margin-left: .25rem; }

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-primary);
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #d9530f;
  --bs-btn-hover-border-color: #d9530f;
  --bs-btn-focus-shadow-rgb: 242, 101, 34;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #c2470c;
  --bs-btn-active-border-color: #c2470c;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--color-primary);
  --bs-btn-disabled-border-color: var(--color-primary);
}

.btn-light {
  --bs-btn-color: var(--heading-text);
  --bs-btn-bg: var(--body-bg);
  --bs-btn-border-color: var(--border-color);
  --bs-btn-hover-color: var(--heading-text);
  --bs-btn-hover-bg: #eee;
  --bs-btn-hover-border-color: var(--border-color);
  --bs-btn-focus-shadow-rgb: 242, 101, 34;
  --bs-btn-active-color: var(--heading-text);
  --bs-btn-active-bg: #e2e2e2;
  --bs-btn-active-border-color: var(--border-color);
  --bs-btn-disabled-color: var(--heading-text);
  --bs-btn-disabled-bg: var(--body-bg);
  --bs-btn-disabled-border-color: var(--border-color);
}
[data-theme="dark"] .btn-light {
  --bs-btn-color: #E5E7EB;
  --bs-btn-bg: #1F2228;
  --bs-btn-border-color: #2A2E36;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #2A2E36;
  --bs-btn-hover-border-color: #343944;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #343944;
  --bs-btn-active-border-color: #3D4350;
  --bs-btn-disabled-color: #E5E7EB;
  --bs-btn-disabled-bg: #1F2228;
  --bs-btn-disabled-border-color: #2A2E36;
}

.btn-outline-primary {
  --bs-btn-color: var(--color-primary);
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--color-primary);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--color-primary);
  --bs-btn-hover-border-color: var(--color-primary);
  --bs-btn-focus-shadow-rgb: 242, 101, 34;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #c2470c;
  --bs-btn-active-border-color: #c2470c;
  --bs-btn-disabled-color: var(--color-primary);
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: var(--color-primary);
}

.btn-success {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-success);
  --bs-btn-border-color: var(--color-success);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #029e48;
  --bs-btn-hover-border-color: #029e48;
  --bs-btn-focus-shadow-rgb: 3, 201, 90;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #028a3e;
  --bs-btn-active-border-color: #028a3e;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--color-success);
  --bs-btn-disabled-border-color: var(--color-success);
}

.btn-danger {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--color-danger);
  --bs-btn-border-color: var(--color-danger);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #b80a0a;
  --bs-btn-hover-border-color: #b80a0a;
  --bs-btn-focus-shadow-rgb: 231, 13, 13;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #9a0909;
  --bs-btn-active-border-color: #9a0909;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--color-danger);
  --bs-btn-disabled-border-color: var(--color-danger);
}

.btn-warning {
  --bs-btn-color: #212529;
  --bs-btn-bg: var(--color-warning);
  --bs-btn-border-color: var(--color-warning);
  --bs-btn-hover-color: #212529;
  --bs-btn-hover-bg: #e0ab00;
  --bs-btn-hover-border-color: #e0ab00;
  --bs-btn-focus-shadow-rgb: 255, 193, 7;
  --bs-btn-active-color: #212529;
  --bs-btn-active-bg: #c79500;
  --bs-btn-active-border-color: #c79500;
  --bs-btn-disabled-color: #212529;
  --bs-btn-disabled-bg: var(--color-warning);
  --bs-btn-disabled-border-color: var(--color-warning);
}

.btn-block { width: 100%; }

/* =========================================================================
   Badges (soft is the dominant theme look)
   ========================================================================= */
.badge, .badge-xs, .badge-sm { display: inline-block; padding: .3rem .55rem; border-radius: 4px; font-size: var(--fs-small); font-weight: 500; letter-spacing: .2px; line-height: 1.1; }
.badge-soft-primary { background: var(--primary-transparent); color: var(--color-primary); }
.badge-soft-success { background: var(--success-transparent); color: var(--color-success); }
.badge-soft-warning { background: var(--warning-transparent); color: #a66b00; }
.badge-soft-danger { background: var(--danger-transparent); color: var(--color-danger); }
.badge-soft-info { background: var(--info-transparent); color: var(--color-info); }
.badge-soft-secondary { background: #EDF2F4; color: var(--color-secondary); }

/* =========================================================================
   Alerts
   ========================================================================= */
.alert { border-radius: 5px; padding: .75rem 1rem; font-size: var(--fs-base); border: 1px solid transparent; margin-bottom: 1rem; }
.alert-success { background: var(--success-transparent); color: var(--color-success); border-color: var(--success-transparent); }
.alert-danger { background: var(--danger-transparent); color: var(--color-danger); border-color: var(--danger-transparent); }
.alert-warning { background: var(--warning-transparent); color: #a66b00; border-color: var(--warning-transparent); }
.alert-info { background: var(--info-transparent); color: var(--color-info); border-color: var(--info-transparent); }

/* =========================================================================
   Table
   ========================================================================= */
/* One table style for every list in the Panel: header band, 14px cells, ~48px rows,
   horizontal rules only, hover tint. Long tables scroll inside .table-responsive with the
   header kept in view. */
.table-responsive { overflow-x: auto; }
.table-scroll { max-height: 70vh; overflow: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 0; color: var(--heading-text); }
.table > :not(caption) > * > * { box-shadow: none; background-color: transparent; }
.table th, .table td {
  padding: var(--row-pad-y) var(--cell-pad-x); border-bottom: 1px solid var(--border-color);
  text-align: left; vertical-align: middle; font-size: var(--fs-table); white-space: nowrap;
}
.table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--table-head-bg); color: var(--heading-text);
  font-size: var(--fs-head); font-weight: 600; letter-spacing: .1px;
  padding-top: .85rem; padding-bottom: .85rem; border-bottom: 1px solid #E5E7EB;
}
.table tbody td { color: #374151; }
.table tbody tr:hover > td { background: #FAFAFB; }
.table td code, .table td .font-mono { font-size: 13px; }
.table .text-end, .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.table td.wrap, .table th.wrap { white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
.table td.empty { text-align: center; color: var(--body-text); padding: 2.5rem 1rem; white-space: normal; }
[data-theme="dark"] .table thead th { background: #1A1D22; border-color: #2A2E36; }
[data-theme="dark"] .table tbody td { color: #D1D5DB; }

/* Card header used as the list toolbar: title on the left, filters and actions on the right. */
.table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; width: 100%; }
.table-toolbar .toolbar-actions { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.table-toolbar .form-control, .table-toolbar .form-select { width: auto; min-width: 170px; }
/* Search box: input with a leading magnifier; the whole box is one control. */
.search-box { position: relative; display: inline-flex; align-items: center; min-width: 240px; flex: 0 1 300px; }
.search-box .ti { position: absolute; left: .75rem; font-size: var(--icon); color: #9CA3AF; pointer-events: none; }
.search-box .form-control { padding-left: 2rem; width: 100%; min-width: 0; }
.table-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: .5rem 1rem; border-top: 1px solid var(--border-color); font-size: var(--fs-small); color: var(--body-text); }
.table-footer .pagination { margin: 0; }

/* Diff view in the audit trail */
.diff-list { margin: .4rem 0 0; padding: 0; list-style: none; font-size: 13px; white-space: normal; }
.diff-list li { padding: .15rem 0; }
.diff-old { color: var(--color-danger); text-decoration: line-through; }
.diff-new { color: #047857; }

/* Page section heading inside .content (above cards) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h4 { font-size: 18px; font-weight: 600; }
.page-head p { margin: 0; font-size: var(--fs-base); color: var(--body-text); max-width: 960px; }

/* Modal dialog (<dialog class="app-dialog">): centred over a dimmed page. */
dialog.app-dialog {
  position: fixed; inset: 0; margin: auto; width: min(440px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
  padding: 0; border: 1px solid #E9EDF4; border-radius: 8px; background: var(--white-color);
  box-shadow: 0 20px 60px rgba(17, 24, 39, .25); color: var(--heading-text);
}
dialog.app-dialog::backdrop { background: rgba(17, 24, 39, .45); }
dialog.app-dialog .dialog-head { display: flex; align-items: center; gap: .75rem; padding: 1.1rem 1.25rem .5rem; }
dialog.app-dialog .dialog-head .ti { font-size: 22px; color: var(--color-warning); }
dialog.app-dialog .dialog-head h5 { font-size: 17px; }
dialog.app-dialog .dialog-body { padding: .25rem 1.25rem 1rem; font-size: var(--fs-base); color: #374151; }
dialog.app-dialog .dialog-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--border-color); background: var(--body-bg); border-radius: 0 0 8px 8px; }

/* =========================================================================
   Inline settings-edit panel (the "Edit" row a system-setting row expands into)
   ========================================================================= */
@keyframes settingEditReveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.setting-edit-panel {
  background: var(--primary-transparent);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem;
  animation: settingEditReveal .15s ease-out;
}
.setting-edit-panel-head {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin-bottom: .75rem; font-weight: 600; color: var(--heading-text); font-size: 13.5px;
}
.setting-edit-panel-head i { color: var(--color-primary); font-size: 16px; }
.setting-edit-panel-head code { font-size: 12.5px; }
.setting-edit-panel .form-label { margin-bottom: .25rem; }
.setting-edit-panel .btn { align-self: flex-end; }

/* =========================================================================
   Pagination (real Bootstrap component; only re-branding its color variables
   from stock Bootstrap blue to this theme's orange, structure is untouched)
   ========================================================================= */
.pagination {
  --bs-pagination-color: var(--color-primary);
  --bs-pagination-hover-color: var(--color-primary);
  --bs-pagination-focus-color: var(--color-primary);
  --bs-pagination-active-bg: var(--color-primary);
  --bs-pagination-active-border-color: var(--color-primary);
  --bs-pagination-border-radius: 5px;
}

/* =========================================================================
   Settings-list nav (left card on /settings -- real Bootstrap nav-pills under
   the hood via data-bs-toggle="pill", this only brands its link styling)
   ========================================================================= */
.settings-list a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .625rem .75rem; border-radius: 5px; margin-bottom: 2px;
  color: #4B5563; font-weight: 500; font-size: 13.5px; cursor: pointer;
}
.settings-list a:hover { background: #F3F4F6; color: #1F2937; }
.settings-list a.active { background: var(--primary-transparent); color: var(--color-primary); }

/* =========================================================================
   Dropdown (header toggle_btn menus, profile menu)
   ========================================================================= */
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0; min-width: 220px;
  background: var(--white-color); border: 1px solid var(--border-color); border-radius: 5px;
  box-shadow: 0 4px 10px rgba(0,0,0,.1); z-index: 1050; padding: .5rem 0;
}
.dropdown.open > .dropdown-menu { display: block; }
.dropdown-item {
  display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem;
  color: var(--heading-text); font-size: var(--fs-base); width: 100%; background: none; border: none;
  text-align: left; cursor: pointer;
}
.dropdown-item:hover { background: var(--primary-transparent); color: var(--color-primary); }
.dropdown-divider { height: 1px; background: var(--border-color); margin: .4rem 0; }
.dropdown-header-card { padding: .75rem .9375rem; border-bottom: 1px solid var(--border-color); margin-bottom: .25rem; }
.dropdown-user-name { font-weight: 600; color: var(--heading-text); }

/* =========================================================================
   Avatar
   ========================================================================= */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.625rem; height: 2.625rem; border-radius: 4px; background: var(--color-primary);
  color: #fff; font-weight: 600; font-size: 14px; overflow: hidden;
}
.avatar-sm { width: 1.5rem; height: 1.5rem; font-size: 11px; }
.avatar-md { width: 2rem; height: 2rem; font-size: 12px; }
.avatar-lg { width: 2.813rem; height: 2.813rem; font-size: 15px; }
.avatar-rounded { border-radius: 50%; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* =========================================================================
   Auth (centered-card pattern)
   ========================================================================= */
.auth-wrapper { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--body-bg); padding: 1rem; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { text-align: center; margin-bottom: 1.5rem; font-weight: 700; font-size: 20px; color: var(--heading-text); }

/* =========================================================================
   Utilities
   ========================================================================= */
.text-muted { color: var(--body-text); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: #a66b00; }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }
.text-white { color: #fff; }
.text-center { text-align: center; }
.text-uppercase-wide { text-transform: uppercase; letter-spacing: .5px; }
.font-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.opacity-50 { opacity: .5; }

/* small-text utilities never go below --fs-small (readability floor) */
.fs-10 { font-size: var(--fs-small); }
.fs-11 { font-size: var(--fs-small); }
.fs-12 { font-size: var(--fs-small); }
.fs-13 { font-size: 13px; }
.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.fs-18 { font-size: 1.1rem; }
.fs-20 { font-size: 20px; }

.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-inline { display: inline; }
.d-none { display: none; }
.d-block { display: block; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-self-end { align-self: flex-end; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }

.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-3-eq { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.grid-auto-180 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.grid-auto-260 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .5rem; }
@media (max-width: 767.98px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-2-5 { margin-top: .75rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.ms-3 { margin-left: 1rem; }
.ms-auto { margin-left: auto; }
.me-3 { margin-right: 1rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.p-0 { padding: 0; }

.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.mw-100 { max-width: 100px; }
.mw-120 { max-width: 120px; }
.mw-150 { max-width: 150px; }
.mw-160 { max-width: 160px; }
.mw-200 { max-width: 200px; }
.mw-220 { max-width: 220px; }
.mw-250 { max-width: 250px; }
.mw-280 { max-width: 280px; }
.mw-300 { max-width: 300px; }
.mw-420 { max-width: 420px; }
.mw-500 { max-width: 500px; }
.minw-100 { min-width: 100px; }
.minw-200 { min-width: 200px; }
.minw-250 { min-width: 250px; }
.minw-280 { min-width: 280px; }
.w-60 { width: 60px; }
.w-140 { width: 140px; }

/* Action bar used by the IVR dashboard and call pages. */
.ivr-actionbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: .75rem; }
.ivr-actionbar-meta, .ivr-actionbar-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.ivr-published { font-size: 13px; color: var(--body-text); }
.ivr-problems { position: relative; }
.ivr-problems summary { list-style: none; cursor: pointer; }
.ivr-problems summary::-webkit-details-marker { display: none; }
.ivr-problems ul { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; margin: 0; padding: .6rem .6rem .6rem 1.6rem; width: min(560px, 90vw); max-height: 60vh; overflow: auto; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 5px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.25); }
.ivr-problems li { margin: .2rem 0; font-size: 13px; }

/* IVR flow canvas editor (public/js/ivr-canvas-editor.js). Scoped under .ivrc so its classes cannot leak.
   Layout: step library | canvas | inspector, with one top bar. The library can collapse to icons. */
.ivrc { --lib-w: 236px; --side-w: 0px; display: grid; grid-template-columns: var(--lib-w) minmax(0, 1fr) var(--side-w); grid-template-rows: 40px minmax(0, 1fr); height: calc(100vh - 150px); min-height: 620px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--body-bg); overflow: hidden; transition: grid-template-columns .2s ease; }
.ivrc.lib-collapsed { --lib-w: 42px; }
.ivrc.side-open { --side-w: 360px; }
.ivrc.side-open.side-min { --side-w: 40px; }
.ivrc, .ivrc * { box-sizing: border-box; }
.ivrc button, .ivrc input, .ivrc select, .ivrc textarea { font: inherit; color: inherit; }
.ivrc :focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.ivrc .muted { color: var(--body-text); opacity: .85; }
.ivrc .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.ivrc .sp { flex: 1; min-width: 8px; }
.ivrc [hidden] { display: none !important; }
.ivrc .mobile-only { display: none; }
.ivrc .hide-sm, .ivrc .hide-md { display: revert; }

/* top bar: one 40px row of 12px text and icon buttons */
.ivrc .ivrc-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 12px; background: var(--white-color); border-bottom: 1px solid var(--border-color); min-width: 0; }
.ivrc .ivrc-back { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--border-color); border-radius: 6px; color: var(--heading-text); text-decoration: none; flex: none; }
.ivrc .ivrc-back i { font-size: 14px; }
.ivrc .ivrc-back:hover { border-color: var(--color-primary); color: var(--color-primary); }
.ivrc .ivrc-crumb { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 8px; border-right: 1px solid var(--border-color); white-space: nowrap; }
.ivrc .ivrc-name { font-weight: 600; font-size: 12.5px; color: var(--heading-text); overflow: hidden; text-overflow: ellipsis; max-width: 22vw; }
.ivrc .ivrc-code { font: 600 10.5px ui-monospace, Menlo, monospace; color: var(--body-text); background: var(--body-bg); border: 1px solid var(--border-color); border-radius: 4px; padding: 1px 5px; }
.ivrc .ivrc-pub { font: 600 10.5px ui-monospace, Menlo, monospace; color: var(--body-text); white-space: nowrap; }
.ivrc .badge { white-space: nowrap; }
.ivrc .ivrc-top .badge { font-size: 10.5px; padding: 2px 6px; }
.ivrc .ivrc-div { width: 1px; height: 18px; background: var(--border-color); flex: none; margin: 0 2px; }
.ivrc .ivrc-grp { display: flex; align-items: center; gap: 1px; padding: 1px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--white-color); }
.ivrc .ib { position: relative; width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; border-radius: 5px; cursor: pointer; color: var(--body-text); flex: none; padding: 0; }
.ivrc .ib:hover { background: var(--body-bg); color: var(--heading-text); }
.ivrc .ib:disabled { opacity: .35; cursor: default; background: transparent; }
.ivrc .ib i { font-size: 14px; }
.ivrc .ivrc-grp .ib { width: 24px; height: 24px; }
.ivrc .ib.on { background: var(--primary-transparent); color: var(--color-primary); }
.ivrc .ib.danger:hover { color: var(--color-danger); background: var(--danger-transparent); }
.ivrc .ib-line { border: 1px solid color-mix(in srgb, var(--color-primary) 55%, transparent); color: var(--color-primary); }
.ivrc .ib-line:hover { background: var(--primary-transparent); color: var(--color-primary); }
.ivrc .ib-pri { background: var(--color-primary); color: #fff; }
.ivrc .ib-pri:hover { background: color-mix(in srgb, var(--color-primary) 85%, #000); color: #fff; }
.ivrc .ib-cnt { position: absolute; top: -3px; right: -4px; min-width: 14px; height: 14px; padding: 0 3px; border-radius: 7px; font: 700 9px/14px ui-monospace, Menlo, monospace; text-align: center; background: var(--color-danger); color: #fff; }
.ivrc .ib-cnt.w { background: var(--color-warning); color: #3a2a00; }
.ivrc .zl { font: 500 11px ui-monospace, Menlo, monospace; min-width: 38px; text-align: center; color: var(--body-text); border: 0; background: transparent; cursor: pointer; height: 24px; padding: 0; }
.ivrc .btn i { font-size: 13px; }
.ivrc #btnIssues.has-errors { color: var(--color-danger); }
.ivrc #btnIssues.is-clean { color: var(--color-success); }
.ivrc .cnt { display: inline-block; min-width: 15px; padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 600; line-height: 15px; text-align: center; background: var(--color-danger); color: #fff; margin-left: 2px; }
.ivrc .cnt.w { background: var(--color-warning); color: #3a2a00; }

/* step library: starts as an icon rail; the expand button or Ctrl/⌘ K opens it */
.ivrc .ivrc-lib { grid-column: 1; background: var(--white-color); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.ivrc .lib-h { padding: 8px 8px 6px; }
.ivrc .lib-title { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ivrc .lib-title h2 { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--heading-text); flex: 1; white-space: nowrap; }
.ivrc .lib-count { font-size: 10.5px; color: var(--body-text); background: var(--body-bg); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.ivrc .search { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--white-color); font-size: 12px; }
.ivrc .search:focus-within { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--primary-transparent); }
.ivrc .search i { color: var(--body-text); font-size: 13px; }
.ivrc .search input { border: 0; background: transparent; outline: 0; flex: 1; min-width: 0; }
.ivrc .search kbd { font: 500 10px ui-monospace, Menlo, monospace; color: var(--body-text); background: transparent; border: 1px solid var(--border-color); border-radius: 4px; padding: 0 4px; }
.ivrc .lib-b { overflow: auto; flex: 1; padding: 0 8px 8px; min-height: 0; }
.ivrc .lcat { margin-bottom: 2px; }
.ivrc .lcat-h { width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 2px; font-weight: 600; font-size: 11.5px; color: var(--heading-text); text-align: start; cursor: pointer; }
.ivrc .lcat-h > span:nth-child(2) { flex: 1; }
.ivrc .lcat-h .ti-chevron-down { font-size: 12px; color: var(--body-text); transition: transform .15s; }
.ivrc .lcat.is-closed .lcat-h .ti-chevron-down { transform: rotate(-90deg); }
.ivrc .lcount { font-size: 10.5px; font-weight: 500; color: var(--body-text); }
.ivrc .lcat.is-closed .lcat-b { display: none; }
.ivrc .wi { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin-bottom: 4px; border: 1px solid var(--border-color); border-radius: 7px; background: var(--white-color); cursor: grab; user-select: none; -webkit-user-select: none; }
.ivrc .wi:hover { border-color: color-mix(in srgb, var(--cc) 55%, transparent); box-shadow: 0 2px 8px -4px color-mix(in srgb, var(--cc) 60%, transparent); }
.ivrc .wi:active { cursor: grabbing; }
.ivrc .wi-ic { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex: none; color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.ivrc .wi-ic i { font-size: 14px; }
.ivrc .wi-t { min-width: 0; flex: 1; }
.ivrc .wi-t b { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12px; color: var(--heading-text); }
.ivrc .wi-t b .badge { font-size: 9.5px; padding: 1px 4px; }
.ivrc .wi-t small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--body-text); font-size: 11px; line-height: 1.3; font-weight: 400; }
.ivrc .wi-grip { color: var(--body-text); opacity: .5; font-size: 13px; }
.ivrc .lib-f { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-top: 1px solid var(--border-color); font-size: 11px; color: var(--body-text); }
.ivrc .lib-f i { font-size: 13px; }
.ivrc.lib-collapsed .lib-title h2, .ivrc.lib-collapsed .lib-count, .ivrc.lib-collapsed .search, .ivrc.lib-collapsed .wi-t, .ivrc.lib-collapsed .wi-grip, .ivrc.lib-collapsed .lcat-h > span, .ivrc.lib-collapsed .lib-f { display: none; }
.ivrc.lib-collapsed .lib-h { padding: 6px 0 4px; }
.ivrc.lib-collapsed .lib-title { justify-content: center; margin: 0; }
.ivrc.lib-collapsed .lib-b { padding: 0 4px 6px; scrollbar-width: none; }
.ivrc.lib-collapsed .lcat-h { justify-content: center; padding: 0; height: 9px; cursor: default; pointer-events: none; }
.ivrc.lib-collapsed .lcat-h .ti-chevron-down { display: none; }
.ivrc.lib-collapsed .lcat + .lcat .lcat-h { border-top: 1px solid var(--border-color); margin-top: 4px; height: 6px; }
.ivrc.lib-collapsed .lcat.is-closed .lcat-b { display: block; }
.ivrc.lib-collapsed .wi { justify-content: center; padding: 2px 0; margin-bottom: 2px; border-color: transparent; background: transparent; box-shadow: none; }
.ivrc.lib-collapsed .wi:hover { background: var(--body-bg); }

/* canvas */
.ivrc .ivrc-stage { grid-column: 2; position: relative; overflow: hidden; background-color: var(--body-bg); background-image: radial-gradient(circle, color-mix(in srgb, var(--body-text) 20%, transparent) 1px, transparent 1.2px); touch-action: none; min-width: 0; }
.ivrc .ivrc-stage.panning { cursor: grabbing; }
.ivrc .world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.ivrc #edges { position: absolute; overflow: visible; pointer-events: none; }
.ivrc #nodes { position: absolute; left: 0; top: 0; }
.ivrc .lane { position: absolute; border: 1px dashed var(--color-danger); border-radius: 10px; background: color-mix(in srgb, var(--danger-transparent) 55%, transparent); pointer-events: none; }
.ivrc .lane-h { position: absolute; left: 14px; top: 10px; font-size: 12.5px; font-weight: 600; color: var(--color-danger); }

.ivrc .node { position: absolute; width: 300px; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 2px 8px -2px rgba(0,0,0,.10); user-select: none; -webkit-user-select: none; cursor: pointer; --cc: var(--color-primary); transition: box-shadow .15s, border-color .15s, opacity .2s; }
.ivrc .node:hover { border-color: color-mix(in srgb, var(--cc) 50%, var(--border-color)); }
.ivrc .node.sel { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--primary-transparent), 0 6px 18px -6px rgba(0,0,0,.18); }
.ivrc .node.drop { border-color: var(--color-success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-success) 25%, transparent); }
.ivrc .node.dim { opacity: .38; }
.ivrc .node.live { border-color: var(--color-success); animation: ivrc-live 1.3s ease-in-out infinite; }
.ivrc .node.entry { border-color: var(--color-primary); border-width: 1.5px; }
@keyframes ivrc-live { 0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-success) 30%, transparent); } 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--color-success) 8%, transparent); } }
.ivrc .nin { position: absolute; top: -6px; left: 50%; width: 11px; height: 11px; margin-left: -5px; border-radius: 50%; background: var(--white-color); border: 2px solid var(--color-primary); }
.ivrc .nb { position: absolute; top: -6px; right: -6px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--white-color); }
.ivrc .nb.e { background: var(--color-danger); }
.ivrc .nb.w { background: var(--color-warning); }
.ivrc .nh { display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px; }
.ivrc .nt { min-width: 0; flex: 1; }
.ivrc .nt b { display: block; font-weight: 600; font-size: 15px; color: var(--heading-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivrc .nt b.untitled { color: var(--color-danger); }
.ivrc .nt small { display: block; font-size: 12px; color: var(--body-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivrc .ntag { font: 700 10px/18px ui-monospace, Menlo, monospace; letter-spacing: .04em; padding: 0 7px; border-radius: 5px; color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); flex: none; }
.ivrc .ni { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.ivrc .ni i { font-size: 16px; }
.ivrc .nop { width: 22px; height: 22px; display: grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--border-color); border-radius: 5px; background: var(--white-color); color: var(--body-text); cursor: pointer; }
.ivrc .nop i { font-size: 13px; }
.ivrc .nop:hover, .ivrc .node.sel .nop { color: var(--color-primary); border-color: color-mix(in srgb, var(--color-primary) 50%, transparent); }
.ivrc .nbody { padding: 0 12px 10px; }
.ivrc .speech { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; background: color-mix(in srgb, var(--color-purple) 9%, transparent); min-width: 0; }
.ivrc .speech .sp-ic { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--color-purple); color: #fff; }
.ivrc .speech .sp-ic i { font-size: 15px; }
.ivrc .speech > div { min-width: 0; flex: 1; }
.ivrc .speech small { display: block; font-size: 11px; color: var(--body-text); }
.ivrc .speech .mono { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--heading-text); }
.ivrc .speech.empty { background: var(--danger-transparent); }
.ivrc .speech.empty .sp-ic { background: var(--color-danger); }
.ivrc .ns { padding: 8px 10px; border-radius: 9px; background: var(--body-bg); color: var(--body-text); font-size: 12.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.ivrc .ns.empty { color: var(--color-danger); background: var(--danger-transparent); }
.ivrc .xlist { margin-top: 10px; }
.ivrc .xh { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--body-text); margin: 0 2px 4px; }
.ivrc .xrow { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 6px; margin-top: 6px; border: 1px solid var(--border-color); border-radius: 9px; background: var(--white-color); min-width: 0; }
.ivrc .xrow:first-of-type { margin-top: 0; }
.ivrc .kchip { min-width: 26px; height: 24px; padding: 0 7px; border-radius: 6px; display: grid; place-items: center; font: 600 12px ui-monospace, Menlo, monospace; color: var(--color-primary); background: var(--primary-transparent); flex: none; }
.ivrc .xrow.key .kchip { color: var(--heading-text); background: var(--body-bg); }
.ivrc .kchip.err { color: var(--color-danger); background: var(--danger-transparent); }
.ivrc .xlabel { flex: 1; min-width: 0; font-size: 13px; color: var(--heading-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ivrc .xlabel.open { color: var(--color-danger); font-style: italic; }
.ivrc .port { width: 12px; height: 12px; flex: none; border-radius: 50%; padding: 0; font-size: 0; border: 2px solid var(--color-success); background: var(--white-color); cursor: crosshair; box-sizing: border-box; }
.ivrc .port.open { border: 2px dashed var(--color-danger); background: var(--white-color); }
.ivrc .port:hover { background: var(--color-success); }
.ivrc .port.open:hover { background: var(--color-danger); }
.ivrc .np { display: flex; flex-wrap: wrap; gap: 5px; }
.ivrc .np.end { font-size: 12px; color: var(--body-text); padding: 2px 2px 0; }
.ivrc .nf { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--border-color); font-size: 12px; color: var(--body-text); min-height: 34px; }
.ivrc .nf .tmo { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ivrc .nf .tmo i { font-size: 13px; }
.ivrc .tb { font: 600 10px/16px ui-monospace, Menlo, monospace; min-width: 18px; height: 16px; padding: 0 3px; text-align: center; border-radius: 3px; background: var(--body-bg); color: var(--body-text); border: 1px solid var(--border-color); opacity: .5; }
.ivrc .tb.on { opacity: 1; background: var(--secondary-transparent); color: var(--color-secondary); border-color: transparent; }
.ivrc .tb.mask.on { background: var(--danger-transparent); color: var(--color-danger); }
.ivrc .badges { display: flex; gap: 3px; }
.ivrc .e { fill: none; stroke-width: 1.7; stroke: var(--body-text); stroke-opacity: .5; }
.ivrc .e.back { stroke-dasharray: 5 5; }
.ivrc .e.sel { stroke: var(--color-primary); stroke-opacity: 1; stroke-width: 2.6; }
.ivrc .e.trav { stroke: var(--color-success); stroke-opacity: 1; stroke-width: 2.8; stroke-dasharray: 7 6; animation: ivrc-flow .7s linear infinite; }
@keyframes ivrc-flow { to { stroke-dashoffset: -13; } }
.ivrc .hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.ivrc #tmp { fill: none; stroke: var(--color-primary); stroke-width: 2; stroke-dasharray: 5 4; }
.ivrc .fl { position: absolute; display: flex; align-items: center; gap: 4px; padding: 4px 7px; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.08); font-size: 11px; color: var(--body-text); }
.ivrc .hint { left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; }
.ivrc .legend { left: 14px; bottom: 14px; flex-direction: column; align-items: flex-start; gap: 4px; }
.ivrc .legend span { display: flex; align-items: center; gap: 6px; }
.ivrc .lg-sw { width: 22px; height: 0; border-top: 2px solid var(--body-text); opacity: .6; }
.ivrc .lg-sw.d { border-top-style: dashed; border-color: var(--color-danger); }
.ivrc .lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--color-danger); display: inline-block; }
.ivrc .mini { position: absolute; right: 10px; bottom: 10px; width: 160px; height: 100px; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); cursor: pointer; touch-action: none; }

/* right side: shut until a step's settings icon, Issues, Test call or the panel button opens it.
   Collapsed (.side-min) it is a rail of tab icons; each tab icon opens it again. */
.ivrc .ivrc-side { grid-column: 3; background: var(--white-color); border-left: 1px solid var(--border-color); display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; }
.ivrc:not(.side-open) .ivrc-side { display: none; }
.ivrc .side-h { display: flex; align-items: center; gap: 4px; padding: 0 6px 0 8px; border-bottom: 1px solid var(--border-color); min-height: 36px; }
.ivrc .tabs { display: flex; gap: 0; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ivrc .tab { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; padding: 9px 7px 8px; cursor: pointer; color: var(--body-text); font-weight: 500; font-size: 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ivrc .tab i { font-size: 14px; }
.ivrc .tab > span { display: none; }
.ivrc .tab.on > span { display: inline; }
.ivrc .tab:hover { color: var(--heading-text); }
.ivrc .tab.on { color: var(--color-primary); border-bottom-color: var(--color-primary); }
.ivrc .tab b:empty { display: none; }
.ivrc .side-acts { display: flex; gap: 1px; flex: none; }
.ivrc .side-acts .ib { width: 24px; height: 24px; }
.ivrc.side-min .side-h { flex-direction: column-reverse; align-items: center; padding: 6px 0; border-bottom: 0; gap: 6px; }
.ivrc.side-min .tabs { flex-direction: column; flex: none; overflow: visible; }
.ivrc.side-min .tab { padding: 6px; border-bottom: 0; border-right: 2px solid transparent; margin: 0; justify-content: center; position: relative; }
.ivrc.side-min .tab.on { border-right-color: var(--color-primary); }
.ivrc.side-min .tab.on > span { display: none; }
.ivrc.side-min .tab .cnt { position: absolute; top: 0; right: 0; margin: 0; }
.ivrc.side-min .side-acts { flex-direction: column; }
.ivrc.side-min #btnSideMin i { transform: scaleX(-1); }
.ivrc.side-min .pane, .ivrc.side-min .ivrc-foot { display: none !important; }
.ivrc .pane { overflow: auto; flex: 1; padding: 12px 14px 18px; min-height: 0; }
.ivrc .ivrc-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-color); background: var(--white-color); }
.ivrc .ivrc-foot .btn { min-width: 90px; justify-content: center; }

/* inspector header and sub-tabs */
.ivrc .ins-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.ivrc .ins-big { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, transparent); }
.ivrc .ins-big i { font-size: 17px; }
.ivrc .ins-t { flex: 1; min-width: 0; }
.ivrc .ins-title { width: 100%; height: 32px; border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 8px; font-weight: 600; font-size: 13px; color: var(--heading-text); background: var(--white-color); outline: 0; }
.ivrc .ins-title:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--primary-transparent); }
.ivrc .ins-sub { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; font-size: 11.5px; color: var(--body-text); }
.ivrc .tag { font: 700 10px/16px ui-monospace, Menlo, monospace; padding: 0 6px; border-radius: 4px; color: var(--color-primary); background: var(--primary-transparent); }
.ivrc .ins-acts { display: flex; gap: 1px; flex: none; }
.ivrc .ins-acts .ib { width: 24px; height: 24px; }

.ivrc .subtabs { display: flex; gap: 0; border-bottom: 1px solid var(--border-color); margin: 0; }
.ivrc .subtab { border: 0; background: transparent; padding: 8px 8px 9px; cursor: pointer; color: var(--body-text); font-weight: 500; font-size: 12px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ivrc .subtab:hover { color: var(--heading-text); }
.ivrc .subtab.on { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }
.ivrc .subpane { padding-top: 14px; }

/* forms */
.ivrc .ph { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.ivrc .ph h3 { margin: 0; font-size: 15px; font-weight: 600; color: var(--heading-text); }
.ivrc .ph p { margin: 2px 0 0; font-size: 12.5px; color: var(--body-text); }
.ivrc .f { margin-bottom: 11px; }
.ivrc .f > label { display: block; font-weight: 500; color: var(--heading-text); margin-bottom: 4px; font-size: 12px; }
.ivrc .req { color: var(--color-danger); }
.ivrc .help { color: var(--body-text); font-size: 11.5px; margin-top: 4px; line-height: 1.4; }
.ivrc .help.warn { color: #a66b00; }
.ivrc .in { width: 100%; height: 30px; border: 1px solid var(--border-color); background: var(--white-color); border-radius: 6px; padding: 4px 8px; outline: 0; font-size: 12.5px; }
.ivrc .in:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--primary-transparent); }
.ivrc textarea.in { height: auto; min-height: 66px; resize: vertical; line-height: 1.4; }
.ivrc .in.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.ivrc select.in { padding-right: 28px; }
/* Prompt per language (17 §2): each language plays a recording or text to speak. */
.ivrc .pp-lang { border: 1px solid var(--border-color); border-radius: 9px; padding: 9px 10px; margin-bottom: 8px; background: var(--white-color); }
.ivrc .pp-lang.done { border-color: color-mix(in srgb, var(--color-success) 35%, var(--border-color)); }
.ivrc .pp-lang.busy { opacity: .6; pointer-events: none; }
.ivrc .pp-lh { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; min-width: 0; }
.ivrc .pp-lh b { font-size: 12.5px; color: var(--heading-text); }
.ivrc .pp-lh .sp { flex: 1; }
.ivrc .pp-lh .badge { font-size: 10.5px; }
.ivrc .pp-lh .ib { width: 24px; height: 24px; }
.ivrc .pp-seg { display: inline-flex; border: 1px solid var(--border-color); border-radius: 7px; overflow: hidden; margin-bottom: 8px; }
.ivrc .pp-seg button { border: 0; background: transparent; padding: 4px 10px; font-size: 12px; color: var(--body-text); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ivrc .pp-seg button + button { border-left: 1px solid var(--border-color); }
.ivrc .pp-seg button.on { background: var(--primary-transparent); color: var(--color-primary); font-weight: 600; }
.ivrc .pp-seg button:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.ivrc .pp-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--body-text); margin: 4px 0 6px; min-width: 0; }
.ivrc .pp-meta .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.ivrc .pp-meta .bad { color: var(--color-danger); font-weight: 600; }
.ivrc .pp-row { display: flex; gap: 6px; align-items: center; }
.ivrc .pp-row .in { flex: 1; min-width: 0; height: 32px; }
.ivrc .pp-row .btn { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.ivrc .pp-audio audio { width: 100%; height: 34px; }
.ivrc .pp-up { margin: 0; cursor: pointer; }
.ivrc .pp-drop { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px dashed var(--border-color); border-radius: 8px; cursor: pointer; margin: 0; }
.ivrc .pp-drop:hover, .ivrc .pp-drop:focus-within { border-color: var(--color-primary); background: var(--primary-transparent); }
.ivrc .pp-drop > i { font-size: 20px; color: var(--color-primary); }
.ivrc .pp-drop b { display: block; font-size: 12.5px; color: var(--heading-text); }
.ivrc .pp-drop small { display: block; font-size: 11.5px; color: var(--body-text); }
.ivrc .in:disabled { background: var(--body-bg); color: var(--body-text); }
.ivrc .sec { margin: 18px 0 10px; font-size: 11.5px; font-weight: 700; color: var(--body-text); text-transform: uppercase; letter-spacing: .05em; display: flex; align-items: center; gap: 10px; }
.ivrc .sec::after { content: ""; flex: 1; height: 1px; background: var(--border-color); }
.ivrc .sec .muted { text-transform: none; letter-spacing: 0; font-weight: 400; }
.ivrc .keypad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ivrc .key { height: 40px; border-radius: 9px; border: 1px solid var(--border-color); background: var(--white-color); font: 600 15px ui-monospace, Menlo, monospace; color: var(--heading-text); cursor: pointer; }
.ivrc .key:hover { border-color: var(--body-text); }
.ivrc .key.on { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.ivrc .keypad.sim { max-width: 240px; grid-template-columns: repeat(3, 1fr); }
.ivrc .keypad.sim .key { height: 44px; font-size: 17px; }
.ivrc .keypad.off .key { opacity: .4; cursor: default; }
.ivrc .exit { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border-color); }
.ivrc .exit:last-child { border-bottom: 0; }
.ivrc .exit .port { width: auto; height: 24px; flex: none; min-width: 44px; padding: 0 8px; border-radius: 6px; font: 600 12px ui-monospace, Menlo, monospace; color: var(--color-success); border: 1px solid color-mix(in srgb, var(--color-success) 45%, transparent); background: color-mix(in srgb, var(--color-success) 8%, transparent); text-align: center; line-height: 22px; white-space: nowrap; cursor: default; }
.ivrc .exit .port.open { color: var(--color-danger); border: 1px dashed var(--color-danger); background: transparent; }
.ivrc .exit .port.key { color: var(--heading-text); border-color: var(--border-color); background: var(--body-bg); }
.ivrc .exit .port.err { color: var(--color-danger); }
.ivrc .exit select { flex: 1; min-width: 0; height: 30px; }
.ivrc .sw-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border-color); }
.ivrc .sw-row:last-child { border-bottom: 0; }
.ivrc .sw-row b { font-weight: 500; font-size: 13px; color: var(--heading-text); }
.ivrc .sw-row small { display: block; font-size: 12px; color: var(--body-text); line-height: 1.35; }
.ivrc .switch { position: relative; width: 36px; height: 20px; flex: none; }
.ivrc .switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ivrc .switch span { position: absolute; inset: 0; border-radius: 20px; background: color-mix(in srgb, var(--body-text) 35%, transparent); transition: background .15s; cursor: pointer; }
.ivrc .switch span::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.ivrc .switch input:checked + span { background: var(--color-primary); }
.ivrc .switch input:checked + span::after { transform: translateX(16px); }
.ivrc .switch input:disabled + span { opacity: .45; cursor: default; }
.ivrc .alert { border: 1px solid color-mix(in srgb, var(--color-danger) 40%, transparent); background: var(--danger-transparent); border-radius: 8px; padding: 9px 12px; margin-bottom: 12px; font-size: 12.5px; color: var(--heading-text); }
.ivrc .alert.w { border-color: color-mix(in srgb, var(--color-warning) 50%, transparent); background: var(--warning-transparent); }
.ivrc .alert p { margin: 2px 0; }
.ivrc .acts { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.ivrc .kv { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border-color); font-size: 13px; min-width: 0; }
.ivrc .kv > span:first-child { color: var(--body-text); min-width: 0; }
.ivrc .kv > span.v { color: var(--heading-text); text-align: right; min-width: 0; overflow-wrap: anywhere; }
.ivrc .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ivrc .stats div { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px; background: var(--white-color); }
.ivrc .stats b { display: block; font-size: 20px; font-weight: 600; color: var(--heading-text); font-variant-numeric: tabular-nums; }
.ivrc .stats span { font-size: 12px; color: var(--body-text); }
.ivrc .stats .bad b { color: var(--color-danger); }
.ivrc .stats .mid b { color: #a66b00; }
.ivrc .stats .good b { color: var(--color-success); }
.ivrc .iss { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--border-color); border-radius: 8px; margin-bottom: 8px; cursor: pointer; align-items: flex-start; background: var(--white-color); }
.ivrc .iss:hover { border-color: color-mix(in srgb, var(--body-text) 45%, transparent); }
.ivrc .iss b { font-weight: 600; font-size: 13px; color: var(--heading-text); }
.ivrc .iss p { margin: 2px 0 0; color: var(--body-text); font-size: 12.5px; }
.ivrc .lv { font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 4px; flex: none; margin-top: 1px; }
.ivrc .lv.error { background: var(--danger-transparent); color: var(--color-danger); }
.ivrc .lv.warn { background: var(--warning-transparent); color: #a66b00; }
.ivrc .log { border: 1px solid var(--border-color); border-radius: 8px; background: var(--body-bg); height: 260px; overflow: auto; padding: 8px 10px; font-size: 12.5px; }
.ivrc .lg { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--border-color); align-items: flex-start; }
.ivrc .lg:last-child { border-bottom: 0; }
.ivrc .lg .w { font: 600 10.5px/18px ui-monospace, Menlo, monospace; width: 58px; flex: none; color: var(--body-text); }
.ivrc .lg .m { min-width: 0; flex: 1; color: var(--heading-text); }
.ivrc .lg .trc { font-size: 11px; color: var(--body-text); white-space: nowrap; text-align: right; max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
.ivrc .lg.ivr .w { color: var(--color-purple); }
.ivrc .lg.caller .w { color: var(--color-info); }
.ivrc .lg.route .w, .ivrc .lg.ok .w { color: var(--color-success); }
.ivrc .lg.warn .w, .ivrc .lg.end .w { color: var(--color-danger); }
.ivrc .choices { display: flex; flex-wrap: wrap; gap: 6px; }
.ivrc .buf { font: 600 13px ui-monospace, Menlo, monospace; color: var(--color-primary); letter-spacing: .08em; }
.ivrc .empty-state { text-align: center; padding: 30px 10px; color: var(--body-text); }
.ivrc .empty-state i { font-size: 34px; color: var(--color-success); }
.ivrc .empty-state h3 { margin: 8px 0 4px; color: var(--heading-text); }
.ivrc .toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; background: var(--heading-text); color: var(--white-color); padding: 9px 16px; border-radius: 8px; font-weight: 500; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); transition: all .2s; z-index: 60; max-width: 90vw; }
.ivrc .toast.on { opacity: 1; transform: translate(-50%, 0); }
.ivrc .toast.err { background: var(--color-danger); color: #fff; }
.ivrc .toast.ok { background: var(--color-success); color: #fff; }

@media (max-width: 1280px) { .ivrc.side-open:not(.side-min) { --side-w: 330px; } .ivrc .hide-md { display: none !important; } }
@media (max-width: 1100px) { .ivrc:not(.lib-collapsed) { --lib-w: 212px; } .ivrc .ivrc-pub { display: none; } }
@media (max-width: 880px) {
  .ivrc { grid-template-columns: minmax(0, 1fr); height: calc(100vh - 170px); }
  .ivrc .ivrc-stage { grid-column: 1; }
  .ivrc .ivrc-lib, .ivrc .ivrc-side { position: fixed; top: 52px; bottom: 0; z-index: 30; width: min(340px, 90vw); box-shadow: 0 18px 50px -14px rgba(0,0,0,.35); transition: transform .22s ease; background: var(--white-color); }
  .ivrc .ivrc-lib { left: 0; transform: translateX(-105%); }
  .ivrc .ivrc-side { right: 0; transform: translateX(105%); }
  .ivrc.show-lib .ivrc-lib, .ivrc.show-side .ivrc-side { transform: none; }
  .ivrc .hide-sm { display: none !important; }
  .ivrc .mobile-only { display: grid; }
  .ivrc .mini, .ivrc .hint, .ivrc .legend { display: none; }
  .ivrc .ivrc-name { max-width: 40vw; }
  .ivrc #btnSideMin { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ivrc * { animation: none !important; transition: none !important; } }

/* IVR reports and simulator */
.ivr-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.ivr-filter-app { min-width: 260px; max-width: 100%; }
.ivr-filter input[type=date] { width: 170px; }
.ivr-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ivr-kpi { background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 14px 16px; }
.ivr-kpi .num { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ivr-kpi .lbl { font-size: 13px; color: var(--body-text); margin-top: 4px; }
.ivr-sim-form { display: grid; gap: 14px; }
.ivr-sim-form .form-actions { justify-content: flex-start; }
.mt-4 { margin-top: 1.5rem; }

/* Collapsible help card (<details class="card settings-help"><summary class="card-header">). */
details.card > summary { cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "\ea5f"; font-family: "tabler-icons"; margin-left: auto; font-size: var(--icon); transition: transform .2s ease; }
details.card[open] > summary::after { transform: rotate(180deg); }
details.card:not([open]) > summary { border-bottom: 0; }
.settings-help h6 { font-size: 14px; }
.settings-help p { font-size: var(--fs-base); line-height: 1.55; color: #4B5563; }
.settings-chain { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: var(--fs-small); }
.settings-chain .ti { color: #9CA3AF; }
.btn-icon.disabled { opacity: .45; }

/* ---- List-screen alignment, applied to every table (2026-10-10) ----
   A toolbar inside a card header takes the free width, so a sibling "New …" button stays on the
   same line at the right instead of wrapping underneath. */
.card-header > .table-toolbar, .card-header > form.table-toolbar { flex: 1 1 0; width: auto; min-width: 0; }
.card-header > .table-toolbar + .btn, .card-header > form + .btn, .card-header > form + a.btn { margin-left: auto; }
.card-header > .card-title + .table-toolbar { flex: 0 1 auto; }
/* The row-action column: last column holding buttons is right-aligned, never wraps, and its
   header reads "Actions" even where the markup left it blank. */
.table td:last-child:has(> .btn, > a.btn, > form, > .d-inline), .table td.actions { text-align: right; white-space: nowrap; width: 1%; }
.table td:last-child > form { display: inline-block; }
.table td:last-child > form + form, .table td:last-child > .btn + form, .table td:last-child > form + .btn, .table td:last-child > a + a { margin-left: .25rem; }
.table thead th:last-child:empty { text-align: right; }
.table thead th:last-child:empty::after { content: "Actions"; }
.table thead th.text-end, .table td.text-end { text-align: right; }
/* Code / identifier cells read as data, not links. */
.table td code { color: #374151; background: #F3F4F6; padding: .15rem .4rem; border-radius: 4px; }
[data-theme="dark"] .table td code { color: #D1D5DB; background: #23272F; }
/* Card header hint text sits under the toolbar at full width. */
.card-header > .fs-11, .card-header > .fs-12, .card-header > .text-muted:not(.btn) { flex-basis: 100%; font-size: var(--fs-small); }

/* Table header band: taller, darker text (product request 2026-10-10). */
.table thead th { padding-top: .5rem; padding-bottom: .5rem; color: #111827; font-size: var(--fs-table); }
.table tbody td { color: #1F2937; }
.table td code { font-size: 11px; padding: .05rem .3rem; }
.table .badge { font-size: 10.5px; padding: .2rem .45rem; }

/* Smaller buttons (2026-10-10): tighter padding, 12px label. */
.btn, .btn-sm { padding: 0 .65rem; font-size: 12px; gap: .35rem; }
.btn-icon { padding: 0; }
.table td .fs-12, .table td .text-muted.fs-12, .table td .form-hint { font-size: 10.5px; }

/* Compact pagination: numbers and Previous/Next as small 24px buttons, 11px text. */
.pagination { gap: .2rem; margin: 0; flex-wrap: wrap; }
.pagination .page-link {
  min-width: 24px; height: 24px; padding: 0 .45rem; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; border-radius: 4px !important; margin: 0;
}
.pagination .page-item:not(:first-child) .page-link { margin-left: 0; }
nav[role="navigation"] p, nav[role="navigation"] .small, .table-footer nav .small { font-size: 11px; margin: 0; }

/* Wallboard designer and formula builder */
.wb-pages .list-group-item { cursor: pointer; font-size: var(--fs-base); }
.wb-pages .active-page { background: var(--primary-transparent, #FEF1EB); border-left: 3px solid var(--color-primary); }
.wb-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 44px; gap: 6px; min-height: 100px; padding: 8px; background: #F3F4F6; border-radius: 6px;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(100%/12 - 1px), #E5E7EB calc(100%/12 - 1px) calc(100%/12)); }
.wb-cell { background: #1E293B; color: #F1F5F9; border-radius: 5px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 11px; padding: 4px; overflow: hidden; }
.formula-line { display: flex; flex-wrap: wrap; gap: 4px; min-height: 38px; padding: 6px; border: 1px dashed #D1D5DB; border-radius: 6px; font-size: 12px; color: var(--body-text); align-items: center; }
.formula-tok { padding: 2px 8px; border-radius: 4px; background: #F3F4F6; color: #111827; }
.formula-tok.formula-counter { background: #EBF4FF; color: #1B4F9C; }
.formula-tok.formula-op, .formula-tok.formula-p { background: #FEF1EB; color: #B4410F; font-weight: 600; }
.formula-tok.formula-fn { background: #F7EEF9; color: #7B2E8E; }

/* The hidden attribute always wins over component display rules (cards, flex rows). */
[hidden] { display: none !important; }

/* ---- CRM template builder (palette | canvas | properties) ---- */
.crm-topbar .card-body { padding: .6rem 1rem; }
.crm-topbar-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.crm-title { flex: 1 1 320px; min-width: 0; }
.crm-name { font-size: 15px; font-weight: 600; border-color: transparent; padding-left: .4rem; }
.crm-name:hover, .crm-name:focus { border-color: #DCDFE4; }
.crm-title .form-hint { padding-left: .4rem; display: flex; gap: .5rem; align-items: center; }
.crm-top-opts, .crm-top-actions { display: flex; align-items: center; gap: .5rem; }
.crm-top-opts .form-select { width: auto; }
.crm-builder { display: grid; grid-template-columns: 250px minmax(0, 1fr) 300px; gap: 1rem; align-items: start; }
.crm-palette, .crm-props { position: sticky; top: 64px; max-height: calc(100vh - 80px); overflow: auto; margin-bottom: 0; }
.crm-pal-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #6B7280; margin-bottom: .4rem; display: flex; justify-content: space-between; }
.crm-pal-title span { text-transform: none; letter-spacing: 0; font-weight: 400; color: #9CA3AF; }
.crm-pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.crm-pal-grid .crm-pal-item { padding: .4rem .4rem; gap: .3rem; }
.crm-pal-list { display: flex; flex-direction: column; gap: .3rem; }
.crm-pal-item { display: flex; align-items: center; gap: .4rem; padding: .4rem .5rem; border: 1px solid #E5E7EB; border-radius: 6px; background: #fff; font-size: 12px; color: #1F2937; cursor: grab; text-align: left; min-width: 0; }
.crm-pal-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-pal-item .ti { font-size: 15px; color: var(--color-primary); flex-shrink: 0; }
.crm-pal-item:hover { border-color: var(--color-primary); background: #FEF7F3; }
.crm-pal-item:active { cursor: grabbing; }
.crm-canvas { min-height: 60vh; background: #EEF0F3; border-radius: 8px; padding: 1rem; }
.crm-canvas .crm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; align-items: start; }
.crm-tabs { display: flex; gap: .25rem; margin-bottom: .5rem; }
.crm-tab { border: 0; background: transparent; padding: .35rem .8rem; border-radius: 6px 6px 0 0; font-size: 12px; color: #6B7280; }
.crm-tab.on { background: #fff; color: var(--heading-text); font-weight: 600; }
.crm-sec { background: #fff; border: 1px solid #E5E7EB; border-radius: 8px; margin-bottom: .75rem; cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease; }
.crm-sec:hover { border-color: #CBD5E1; }
.crm-sec.on { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(242, 101, 34, .15); }
.crm-sec.off { opacity: .6; }
.crm-sec-head { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-bottom: 1px solid #F1F2F4; font-size: 13px; }
.crm-sec-tools { margin-left: auto; display: none; gap: .2rem; }
.crm-sec:hover .crm-sec-tools, .crm-sec.on .crm-sec-tools { display: inline-flex; }
.crm-grip { cursor: grab; color: #9CA3AF; font-size: 16px; display: inline-flex; }
.crm-sec-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; padding: .7rem; min-height: 54px; }
.crm-sec-body.crm-type-search { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.crm-sec-body.crm-type-table { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.crm-field { border: 1px dashed transparent; border-radius: 6px; padding: .3rem .4rem; cursor: grab; }
.crm-field:hover { border-color: #CBD5E1; background: #FAFBFC; }
.crm-field.on { border: 1px solid var(--color-primary); background: #FEF7F3; }
.crm-field.wide { grid-column: 1 / -1; }
.crm-f-label { font-size: 11px; font-weight: 600; color: #374151; margin-bottom: .2rem; display: flex; align-items: center; gap: .25rem; }
.crm-bound { color: #1B84FF; font-size: 12px; }
.crm-f-input { height: 26px; border: 1px solid #DCDFE4; border-radius: 4px; background: #fff; font-size: 11px; color: #9CA3AF; padding: 0 .4rem; display: flex; align-items: center; overflow: hidden; white-space: nowrap; }
.crm-f-input.ro { background: #F3F4F6; color: #374151; }
.crm-f-input.t-textarea { height: 44px; align-items: flex-start; padding-top: .25rem; }
.crm-f-input.t-checkbox { width: 26px; justify-content: center; }
.crm-chip { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid #DCDFE4; background: #fff; border-radius: 16px; padding: .2rem .6rem; font-size: 12px; }
.crm-chip.on { border-color: var(--color-primary); background: #FEF7F3; }
.crm-fake { pointer-events: none; height: 26px; min-height: 26px; font-size: 11px; }
.crm-empty { grid-column: 1 / -1; color: #9CA3AF; font-size: 12px; text-align: center; padding: .6rem; border: 1px dashed #DCDFE4; border-radius: 6px; width: 100%; }
.crm-start { display: flex; gap: .8rem; align-items: center; justify-content: center; padding: 3rem 1rem; border: 2px dashed #CBD5E1; border-radius: 8px; color: var(--heading-text); background: #fff; }
.crm-start .ti { font-size: 32px; color: var(--color-primary); }
.crm-drop-end { display: none; text-align: center; padding: .8rem; border: 2px dashed var(--color-primary); border-radius: 8px; color: var(--color-primary); font-size: 12px; }
body.crm-dragging-section .crm-drop-end { display: block; }
body.crm-dragging-field .crm-sec-body { outline: 2px dashed rgba(242, 101, 34, .35); outline-offset: -4px; }
.crm-drop-line { height: 3px; background: var(--color-primary); border-radius: 2px; margin: -2px 0 6px; grid-column: 1 / -1; }
.crm-sec-body .crm-drop-line { margin: 0; }
.crm-props .form-field { margin-bottom: .6rem; }
@media (max-width: 1199.98px) { .crm-builder { grid-template-columns: 200px minmax(0, 1fr); } .crm-props { grid-column: 1 / -1; position: static; max-height: none; } }
@media (max-width: 767.98px) { .crm-builder { grid-template-columns: 1fr; } .crm-palette { position: static; max-height: none; } }

/* ---------------------------------------------------------------- Routing: week heat-map, branch rows (S-NUM-03, S-NUM-08) */
.week-map { display: grid; grid-template-columns: 38px repeat(96, minmax(0, 1fr)); gap: 1px; font-size: 11px; }
.week-map .wm-day { color: var(--heading-text); font-weight: 600; display: flex; align-items: center; }
.week-map .wm-hour { grid-column: span 4; color: #9CA3AF; font-size: 10px; }
.week-map .wm-cell { height: 18px; border-radius: 2px; background: #E5E7EB; }
.week-map .wm-cell.wm-none { background: repeating-linear-gradient(45deg, #FAE7E7, #FAE7E7 3px, #F5B5B5 3px, #F5B5B5 5px); }
.wm-c0 { background: #1B84FF !important; } .wm-c1 { background: #03C95A !important; } .wm-c2 { background: #F26522 !important; }
.wm-c3 { background: #AB47BC !important; } .wm-c4 { background: #0C4B5E !important; } .wm-c5 { background: #FFC107 !important; }
.wm-c6 { background: #FD3995 !important; } .wm-c7 { background: #6B7280 !important; }
.wm-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .6rem; font-size: 12px; }
.wm-legend span.wm-sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-right: .3rem; background: #E5E7EB; }
.wm-legend span.wm-sw.wm-none { background: repeating-linear-gradient(45deg, #FAE7E7, #FAE7E7 3px, #F5B5B5 3px, #F5B5B5 5px); }
.wm-now { outline: 2px solid var(--heading-text); outline-offset: -1px; }
.branch-table td { vertical-align: top; }
.branch-table .form-select, .branch-table .form-control { min-width: 120px; }
.branch-table .branch-ord { width: 34px; font-weight: 600; color: var(--heading-text); padding-top: .55rem; }
.verdict { border-left: 3px solid var(--color-primary); padding: .6rem .8rem; background: var(--primary-transparent, #FEF1EB); border-radius: 4px; }
.verdict.verdict-none { border-left-color: #E70D0D; background: #FAE7E7; }
.verdict h5 { margin-bottom: .2rem; }
.kv-list { display: grid; grid-template-columns: max-content 1fr; gap: .3rem 1rem; margin: 0; }
.kv-list dt { font-weight: 500; color: var(--heading-text); }
.kv-list dd { margin: 0; }
[data-theme="dark"] .week-map .wm-cell { background: #2A2E36; }
[data-theme="dark"] .verdict { background: #2A1D16; }
[data-theme="dark"] .verdict.verdict-none { background: #2A1414; }

/* ======================================================================================================
   Shared feedback: toasts, help cards (2026-10-12)
   ====================================================================================================== */
.toast-stack { position: fixed; top: calc(var(--header-height) + 12px); right: 16px; z-index: 1080; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.app-toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 8px; background: var(--white-color); border: 1px solid var(--border-color); border-left: 4px solid var(--color-success); box-shadow: 0 10px 28px -10px rgba(17,24,39,.35); color: var(--heading-text); font-size: var(--fs-base); transform: translateX(24px); opacity: 0; transition: all .25s ease; }
.app-toast.on { transform: none; opacity: 1; }
.app-toast > .ti { font-size: 18px; margin-top: 1px; }
.app-toast-body { flex: 1; line-height: 1.45; }
.app-toast-close { border: 0; background: none; color: var(--body-text); padding: 0 2px; cursor: pointer; }
.app-toast-success { border-left-color: var(--color-success); } .app-toast-success > .ti { color: var(--color-success); }
.app-toast-warning { border-left-color: var(--color-warning); } .app-toast-warning > .ti { color: #c99400; }
.app-toast-danger { border-left-color: var(--color-danger); } .app-toast-danger > .ti { color: var(--color-danger); }
.app-toast-info { border-left-color: var(--color-info); } .app-toast-info > .ti { color: var(--color-info); }

.help-tip { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; padding: 0; margin-left: 4px; border: 0; border-radius: 50%; background: transparent; color: #9CA3AF; cursor: help; vertical-align: middle; }
.help-tip:hover, .help-tip:focus-visible { color: var(--color-primary); background: var(--primary-transparent); }
.help-tip .ti { font-size: 15px; }
.help-pop { position: absolute; z-index: 1090; width: 340px; max-width: calc(100vw - 16px); background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; box-shadow: 0 16px 40px -12px rgba(17,24,39,.35); padding: 12px 14px; font-size: var(--fs-base); color: #374151; }
.help-pop h6 { font-size: 14px; color: var(--heading-text); margin: 0 0 6px; display: flex; gap: 6px; align-items: center; }
.help-pop h6 .ti { color: var(--color-primary); }
.help-pop dl { margin: 0; display: grid; grid-template-columns: 52px 1fr; gap: 4px 8px; }
.help-pop dt { font-weight: 600; color: var(--heading-text); font-size: var(--fs-small); text-transform: uppercase; letter-spacing: .3px; padding-top: 1px; }
.help-pop dd { margin: 0; line-height: 1.45; }

/* Explanation band at the top of a page or section */
.explain { display: flex; gap: 12px; padding: 12px 14px; border-radius: 8px; background: var(--info-transparent); color: #1f3b63; margin-bottom: 1rem; }
.explain > .ti { font-size: 22px; color: var(--color-info); }
.explain h6 { margin: 0 0 4px; color: var(--heading-text); font-size: 14px; }
.explain p { margin: 0 0 4px; }
.explain ul { margin: 4px 0 0; padding-left: 18px; }
.explain details summary { cursor: pointer; color: var(--color-info); font-weight: 500; }

/* ======================================================================================================
   Skill pages: header, icon tabs, stepper, flow lanes, tier board, rule builder, simulator
   ====================================================================================================== */
.skill-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
.skill-head .skill-avatar { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary-transparent); color: var(--color-primary); font-size: 22px; }
.skill-head h4 { margin: 0; font-size: 18px; }
.skill-head .meta { color: var(--body-text); font-size: var(--fs-small); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.skill-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.skill-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border-color); margin-bottom: 16px; overflow-x: auto; scrollbar-width: thin; }
.skill-tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; color: var(--body-text); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 6px 6px 0 0; text-decoration: none; transition: background .2s, color .2s; }
.skill-tabs a .ti { font-size: 17px; }
.skill-tabs a:hover { color: var(--heading-text); background: var(--body-bg); }
.skill-tabs a.active { color: var(--color-primary); border-bottom-color: var(--color-primary); background: var(--primary-transparent); }
.skill-tabs a.disabled { opacity: .45; pointer-events: none; }
.skill-tabs .count { font-size: 11px; background: var(--body-bg); color: var(--body-text); border-radius: 10px; padding: 0 6px; line-height: 17px; }
.skill-tabs a.active .count { background: #fff; color: var(--color-primary); }
.skill-tabs .count.bad { background: var(--danger-transparent); color: var(--color-danger); }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 1rem; }
.stat-strip .stat { background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.stat-strip .stat .ti { font-size: 20px; width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--body-bg); color: var(--color-secondary); }
.stat-strip .stat b { display: block; font-size: 16px; color: var(--heading-text); }
.stat-strip .stat span { font-size: var(--fs-small); }

.check-list { list-style: none; margin: 0; padding: 0; }
.check-list li { display: flex; gap: 10px; padding: 9px 14px; border-top: 1px solid var(--border-color); align-items: flex-start; }
.check-list li:first-child { border-top: 0; }
.check-list .ti { font-size: 18px; margin-top: 1px; }
.check-list .ok .ti { color: var(--color-success); } .check-list .bad .ti { color: var(--color-danger); } .check-list .warn .ti { color: #c99400; }
.check-list small { display: block; color: var(--body-text); }

/* Stepper */
.stepper { display: flex; gap: 0; margin-bottom: 16px; overflow-x: auto; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 6px; }
.stepper button { flex: 1 1 0; min-width: 120px; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 10px; border-radius: 6px; color: var(--body-text); text-align: left; cursor: pointer; position: relative; }
.stepper button .num { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--body-bg); border: 1px solid var(--border-color); font-size: 12px; font-weight: 600; flex: none; }
.stepper button .lbl { font-weight: 500; font-size: 12.5px; line-height: 1.2; }
.stepper button.active { background: var(--primary-transparent); color: var(--color-primary); }
.stepper button.active .num { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.stepper button.done .num { background: var(--success-transparent); color: var(--color-success); border-color: transparent; }
.stepper button.has-error .num { background: var(--danger-transparent); color: var(--color-danger); border-color: var(--color-danger); }
.step-pane[hidden] { display: none !important; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; position: sticky; bottom: 0; background: linear-gradient(to top, var(--body-bg) 70%, transparent); z-index: 5; }
.step-nav .dirty { font-size: var(--fs-small); color: #a66b00; }
.form-field[data-show-if][hidden] { display: none; }
.field-label-row { display: flex; align-items: center; }
.review-list { list-style: none; padding: 0; margin: 0; }
.review-list li { padding: 6px 0; border-top: 1px dashed var(--border-color); display: flex; gap: 8px; }
.review-list li:first-child { border-top: 0; }
.review-list .old { color: var(--color-danger); text-decoration: line-through; }
.review-list .new { color: var(--color-success); font-weight: 500; }

/* Prompt flow lanes */
.flow-lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; align-items: start; }
.flow-lane { background: var(--white-color); border: 1px solid var(--border-color); border-radius: 10px; overflow: hidden; }
.flow-lane > header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border-color); background: var(--body-bg); }
.flow-lane > header .ti { font-size: 18px; color: var(--color-secondary); }
.flow-lane > header h6 { margin: 0; font-size: 13.5px; }
.flow-lane > header small { display: block; color: var(--body-text); font-size: 11.5px; }
.flow-lane .lane-body { padding: 10px; display: flex; flex-direction: column; gap: 0; }
.flow-step { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--border-color); border-radius: 8px; background: var(--white-color); cursor: pointer; transition: border-color .2s, box-shadow .2s; position: relative; }
.flow-step:hover { border-color: var(--color-primary); box-shadow: 0 4px 14px -8px rgba(242,101,34,.5); }
.flow-step .ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: none; background: var(--primary-transparent); color: var(--color-primary); }
.flow-step .ico.jump { background: var(--info-transparent); color: var(--color-info); }
.flow-step .ico.end { background: var(--danger-transparent); color: var(--color-danger); }
.flow-step .ico.offer { background: var(--success-transparent); color: #059646; }
.flow-step .txt { flex: 1; min-width: 0; }
.flow-step .txt b { display: block; color: var(--heading-text); font-size: 12.5px; }
.flow-step .txt span { display: block; font-size: 12px; color: var(--body-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-step .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.flow-step .tags .badge { font-size: 10.5px; }
.flow-step .tools { display: flex; flex-direction: column; gap: 2px; opacity: 0; transition: opacity .2s; }
.flow-step:hover .tools, .flow-step:focus-within .tools { opacity: 1; }
.flow-step .tools button { border: 0; background: var(--body-bg); width: 22px; height: 22px; border-radius: 5px; color: var(--body-text); padding: 0; }
.flow-step .tools button:hover { color: var(--color-primary); }
.flow-step.issue { border-color: #f5c26b; background: #fffaf0; }
.flow-link { width: 2px; height: 14px; background: var(--border-color); margin: 0 auto; }
.flow-add { display: flex; justify-content: center; margin: 4px 0 0; }
.flow-add button { border: 1px dashed var(--border-color); background: none; border-radius: 20px; padding: 4px 12px; color: var(--body-text); font-size: 12px; }
.flow-add button:hover { border-color: var(--color-primary); color: var(--color-primary); }
.lane-empty { text-align: center; color: var(--body-text); font-size: 12px; padding: 14px 6px; }
.lint-list { list-style: none; margin: 0; padding: 0; }
.lint-list li { padding: 7px 14px; border-top: 1px solid var(--border-color); display: flex; gap: 8px; }
.lint-list li:first-child { border-top: 0; }
.lint-list .ti { color: #c99400; font-size: 16px; }
.lint-list .err .ti { color: var(--color-danger); }
.timeline-preview { display: flex; flex-wrap: nowrap; gap: 0; align-items: stretch; font-size: 12px; border-radius: 6px; overflow: hidden; }
.timeline-preview .seg { padding: 6px 8px; border-right: 1px solid #fff; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timeline-preview .seg.welcome { background: #0C4B5E; } .timeline-preview .seg.queue { background: #F26522; } .timeline-preview .seg.hold { background: #6B7280; } .timeline-preview .seg.timeout { background: #E70D0D; } .timeline-preview .seg.ring { background: #9CA3AF; }

/* Tier board (members) */
.member-layout { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .member-layout { grid-template-columns: 1fr; } }
.pool { background: var(--white-color); border: 1px solid var(--border-color); border-radius: 10px; position: sticky; top: calc(var(--header-height) + 12px); }
.pool header { padding: 10px 12px; border-bottom: 1px solid var(--border-color); }
.pool .pool-list { max-height: 520px; overflow-y: auto; }
.pool .pool-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-top: 1px solid var(--border-color); cursor: grab; }
.pool .pool-item:hover { background: var(--body-bg); }
.pool footer { padding: 10px 12px; border-top: 1px solid var(--border-color); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tier-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.tier-col { background: var(--body-bg); border: 1px solid var(--border-color); border-radius: 10px; min-height: 120px; display: flex; flex-direction: column; }
.tier-col > header { padding: 8px 10px; display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--border-color); }
.tier-col > header h6 { margin: 0; font-size: 13px; }
.tier-col > header .badge { margin-left: auto; }
.tier-col.parked { background: repeating-linear-gradient(45deg, var(--body-bg), var(--body-bg) 8px, #f1f2f4 8px, #f1f2f4 16px); }
.tier-col .drop { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tier-col.drag-over { border-color: var(--color-primary); box-shadow: inset 0 0 0 2px var(--primary-transparent); }
.member-card { background: var(--white-color); border: 1px solid var(--border-color); border-radius: 8px; padding: 7px 9px; display: flex; gap: 8px; align-items: center; cursor: grab; transition: box-shadow .2s, opacity .2s; }
.member-card.dragging { opacity: .4; }
.member-card.changed { border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--primary-transparent); }
.member-card.removed { opacity: .45; text-decoration: line-through; }
.member-card.suspended .who { color: var(--body-text); }
.member-card .initials, .pool-item .initials { width: 30px; height: 30px; border-radius: 50%; background: var(--secondary-transparent, #EDF2F4); color: var(--color-secondary); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 600; flex: none; }
.member-card .who { flex: 1; min-width: 0; }
.member-card .who b { display: block; font-size: 12.5px; color: var(--heading-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-card .who small { color: var(--body-text); font-size: 11.5px; }
.stars { display: inline-flex; gap: 0; }
.stars button { border: 0; background: none; padding: 0 1px; color: #D1D5DB; font-size: 15px; line-height: 1; cursor: pointer; }
.stars button.on { color: #F5A524; }
.member-card .mtools { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.member-card .mtools button { border: 0; background: none; color: var(--body-text); padding: 0 2px; font-size: 14px; }
.member-card .mtools button:hover { color: var(--color-primary); }
.member-card input[type=checkbox] { flex: none; }
.save-bar { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-top: 12px; background: var(--heading-text); color: #fff; border-radius: 10px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.5); }
.save-bar[hidden] { display: none; }
.save-bar .btn-light { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }

/* Rule builder (overflow) */
.rule-card { display: flex; gap: 10px; align-items: flex-start; background: var(--white-color); border: 1px solid var(--border-color); border-radius: 10px; padding: 12px; margin-bottom: 8px; }
.rule-card .ord { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-transparent); color: var(--color-primary); display: flex; align-items: center; justify-content: center; font-weight: 600; flex: none; }
.rule-card .sentence { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rule-card .sentence .kw { color: var(--heading-text); font-weight: 600; }
.rule-card .sentence .form-select, .rule-card .sentence .form-control { width: auto; min-width: 120px; }
.rule-card .sentence .form-control.num { width: 90px; min-width: 0; }
.rule-card .rtools { display: flex; gap: 4px; }
.rule-card .plain { flex-basis: 100%; font-size: 12px; color: var(--body-text); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chain .node { padding: 4px 10px; border-radius: 16px; background: var(--body-bg); border: 1px solid var(--border-color); font-size: 12px; }
.chain .node.self { background: var(--primary-transparent); border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; }
.chain .ti { color: var(--body-text); }

/* Simulator */
.sim-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .sim-grid { grid-template-columns: 1fr; } }
.range-field { margin-bottom: 14px; }
.range-field .top { display: flex; justify-content: space-between; align-items: center; }
.range-field output { font-weight: 600; color: var(--heading-text); }
.range-field input[type=range] { width: 100%; accent-color: var(--color-primary); }
.gauge { height: 10px; border-radius: 6px; background: #E9EDF4; overflow: hidden; position: relative; }
.gauge > i { position: absolute; inset: 0 auto 0 0; background: var(--color-success); border-radius: 6px; transition: width .3s; }
.gauge.bad > i { background: var(--color-danger); } .gauge.mid > i { background: var(--color-warning); }
.gauge .target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--heading-text); }
.metric-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.metric-tiles .tile { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; background: var(--white-color); }
.metric-tiles .tile b { font-size: 20px; color: var(--heading-text); display: block; }
.metric-tiles .tile span { font-size: 12px; }
.curve-table td.hit { background: var(--success-transparent); font-weight: 600; }
.action-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-color); border-radius: 18px; background: var(--white-color); color: var(--heading-text); font-size: 12.5px; cursor: pointer; margin: 0; transition: all .15s; }
.action-chip:hover { border-color: var(--color-primary); }
.action-chip.selected { background: var(--primary-transparent); border-color: var(--color-primary); color: var(--color-primary); font-weight: 600; box-shadow: 0 0 0 2px var(--primary-transparent); }
.action-chip:has(input:focus-visible) { box-shadow: var(--focus-ring); }
[data-keypad] .btn-primary { color: #fff; }
.rule-card [data-threshold-wrap]:not([hidden]) { display: inline-flex; align-items: center; gap: 6px; }
.help-pop ul { margin: 0; padding-left: 16px; }
.help-pop li { margin: 3px 0; line-height: 1.45; }
.page-help { display: flex; align-items: center; gap: 4px; font-weight: 500; color: var(--heading-text); margin-bottom: 8px; }
.rec-list { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.rec-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--border-color); }
.rec-row:first-child { border-top: 0; }
.rec-row.fallback { background: var(--body-bg); }
.rec-row .lang b { display: block; font-size: 12.5px; color: var(--heading-text); }
.rec-row .lang small { color: var(--body-text); font-size: 11.5px; }
.rec-row audio { width: 100%; height: 30px; }
.rec-row .none { color: var(--body-text); font-size: 12px; }
.rec-row .acts { display: flex; gap: 4px; }
.rec-row .acts label { margin: 0; }
.rec-row.busy { opacity: .55; pointer-events: none; }
