/* ============================================================
   SHREY CRM — Design System v2
   Light mode · Plus Jakarta Sans + DM Sans · Editorial SaaS
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --white:    #FFFFFF;
  --bg:       #FAF9F7;
  --bg2:      #FFFFFF;
  --bg3:      #F4F2EF;
  --bg4:      #EBE8E3;
  --bg5:      #DDD9D2;

  --border:   #E5E1DA;
  --border2:  #D4CFC7;
  --border3:  #BDB7AE;

  --text:     #1A1208;
  --text2:    #4A3F30;
  --text3:    #8C8070;
  --text4:    #BDB5A8;

  /* Hero — Red Orange (brand primary) */
  --hero:        #FF4D00;
  --hero-h:      #E64400;
  --hero-light:  #FF7040;
  --hero-bg:     #FFF3EE;
  --hero-bg2:    #FFE6D9;
  --hero-border: #FFCDB8;

  /* Accent — Indigo (UI interactive / secondary) */
  --accent:        #3D52D5;
  --accent-h:      #2C3FBF;
  --accent-light:  #5C72E8;
  --accent-bg:     #EEF1FB;
  --accent-border: #C4CCF5;

  --green:     #15803D;
  --green-bg:  #F0FDF4;
  --green-b:   #BBF7D0;
  --green-mid: #22C55E;

  --amber:     #B45309;
  --amber-bg:  #FFFBEB;
  --amber-b:   #FDE68A;

  --red:       #DC2626;
  --red-bg:    #FEF2F2;
  --red-b:     #FECACA;

  --purple:    #6D28D9;
  --purple-bg: #F5F3FF;
  --purple-b:  #DDD6FE;

  --teal:      #0E7490;
  --teal-bg:   #ECFEFF;
  --teal-b:    #A5F3FC;

  --font-head: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-w: 230px;
  --topbar-h:  56px;
  --r:  6px;
  --r2: 10px;
  --r3: 12px;
  --r4: 16px;

  --shadow-xs: 0 1px 2px rgba(13,19,33,.04);
  --shadow-sm: 0 1px 4px rgba(13,19,33,.06), 0 1px 2px rgba(13,19,33,.04);
  --shadow-md: 0 4px 14px rgba(13,19,33,.08), 0 1px 3px rgba(13,19,33,.05);
  --shadow-lg: 0 10px 30px rgba(13,19,33,.10), 0 2px 8px rgba(13,19,33,.06);
  --shadow-xl: 0 24px 60px rgba(13,19,33,.13), 0 4px 16px rgba(13,19,33,.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--hero-border); border-radius: 10px; opacity:.5; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }

/* ── LAYOUT ── */
.app-shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; grid-template-rows: var(--topbar-h) 1fr; height: 100vh; overflow: hidden; }

/* ── TOPBAR ── */
.topbar { grid-column: 1/-1; display: flex; align-items: center; padding: 0 20px 0 0; background: var(--white); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-xs); z-index: 200; gap: 12px; }
.topbar-brand { width: var(--sidebar-w); display: flex; align-items: center; gap: 10px; padding: 0 18px; border-right: 1px solid var(--border); height: 100%; flex-shrink: 0; }
.brand-icon { width: 31px; height: 31px; background: linear-gradient(135deg, var(--hero), var(--hero-light)); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; color: white; box-shadow: 0 2px 8px rgba(255,77,0,.28); flex-shrink: 0; }
.brand-name { font-family: var(--font-head); font-size: 15px; font-weight: 800; letter-spacing: -.025em; color: var(--text); }
.brand-tag { font-size: 9px; color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border); padding: 1px 6px; border-radius: 20px; font-weight: 600; margin-top: 1px; display: block; width: fit-content; }

.topbar-search { flex: 1; max-width: 400px; position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text4); font-size: 14px; pointer-events: none; }
.topbar-search input { width: 100%; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px 7px 34px; color: var(--text); font-family: var(--font-body); font-size: 13px; outline: none; transition: all .15s; }
.topbar-search input:focus { background: var(--white); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67,97,238,.1); }
.topbar-search input::placeholder { color: var(--text4); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-icon-btn { width: 34px; height: 34px; background: transparent; border: 1px solid transparent; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text3); font-size: 16px; transition: all .12s; position: relative; }
.topbar-icon-btn:hover { background: var(--bg3); border-color: var(--border); color: var(--text2); }
.notif-badge { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; background: var(--red); border-radius: 50%; border: 2px solid var(--white); }

.user-pill { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1px solid var(--border2); border-radius: 10px; padding: 5px 12px 5px 6px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow-xs); }
.user-pill:hover { border-color: var(--hero-border); box-shadow: 0 0 0 3px rgba(255,77,0,.08); }
.user-avatar { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--hero), var(--purple)); display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 10px; font-weight: 700; color: white; }
.user-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.user-role { font-size: 10px; color: var(--text3); }

/* ── SIDEBAR ── */
.sidebar { background: var(--white); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; padding: 8px 0 0; }
.nav-group-label { font-size: 9.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text4); padding: 13px 16px 4px; font-family: var(--font-head); }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 7px 10px; margin: 1px 7px; border-radius: 8px; cursor: pointer; color: var(--text3); font-size: 13px; font-weight: 500; transition: all .12s; text-decoration: none; position: relative; white-space: nowrap; }
.nav-item:hover { background: var(--bg3); color: var(--text2); }
.nav-item.active { background: var(--hero-bg); color: var(--hero); font-weight: 600; }
.nav-item.active .nav-icon svg, .nav-item.active .nav-icon { color: var(--hero); }
.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; color: var(--text4); transition: color .12s; }
.nav-item:hover .nav-icon { color: var(--text2); }
.nav-label { flex: 1; }
.nav-pill { background: var(--red); color: white; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 20px; min-width: 18px; text-align: center; font-family: var(--font-head); }
.sidebar-divider { height: 1px; background: var(--border); margin: 6px 14px; }

.sidebar-footer { margin-top: auto; padding: 10px; border-top: 1px solid var(--border); }
.agent-widget { background: var(--bg3); border: 1px solid var(--border); border-radius: var(--r2); padding: 10px 12px; }
.agent-widget-title { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); margin-bottom: 8px; font-family: var(--font-head); }
.agent-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.agent-row:last-child { margin-bottom: 0; }
.agent-row-name { font-size: 11px; color: var(--text2); font-weight: 500; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-active { background: var(--hero); animation: blink 2s infinite; }
.dot-idle   { background: var(--bg5); }
.dot-error  { background: var(--red); }
.dot-paused { background: var(--amber); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── MAIN ── */
.main { overflow-y: auto; background: var(--bg); display: flex; flex-direction: column; }
.page-header { display: flex; align-items: flex-start; padding: 24px 26px 0; gap: 14px; flex-shrink: 0; }
.page-title { font-family: var(--font-head); font-size: 20px; font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text3); margin-top: 3px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.page-body { padding: 18px 26px; flex: 1; }

/* ── BUTTONS ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 16px; border-radius: var(--r2); border: 1px solid transparent; font-family: var(--font-body); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; white-space: nowrap; text-decoration: none; line-height: 1; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--hero); color: white; border-color: var(--hero); box-shadow: 0 1px 3px rgba(255,77,0,.3); }
.btn-primary:hover { background: var(--hero-h); border-color: var(--hero-h); box-shadow: 0 3px 10px rgba(255,77,0,.35); }
.btn-secondary { background: var(--white); color: var(--text2); border-color: var(--border2); box-shadow: var(--shadow-xs); }
.btn-secondary:hover { background: var(--bg3); color: var(--text); }
.btn-success { background: var(--green-bg); color: var(--green); border-color: var(--green-b); }
.btn-success:hover { background: #DCFCE7; }
.btn-danger { background: var(--red-bg); color: var(--red); border-color: var(--red-b); }
.btn-danger:hover { background: #FEE2E2; }
.btn-amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-b); }
.btn-amber:hover { background: #FEF3C7; }
.btn-ghost { background: transparent; color: var(--text3); border-color: transparent; }
.btn-ghost:hover { background: var(--bg3); color: var(--text2); border-color: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: var(--r); }
.btn-xs { padding: 3px 9px; font-size: 11px; border-radius: 6px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; }

/* ── STATS ── */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r3); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: all .15s; position: relative; overflow: hidden; }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: var(--stripe, var(--accent)); }
.stat-card.s-blue   { --stripe: var(--hero); }
.stat-card.s-green  { --stripe: var(--green-mid); }
.stat-card.s-amber  { --stripe: var(--amber); }
.stat-card.s-red    { --stripe: var(--red); }
.stat-card.s-purple { --stripe: var(--purple); }
.stat-card.s-teal   { --stripe: var(--teal); }
.stat-icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 10px; }
.si-blue   { background: var(--hero-bg); }
.si-green  { background: var(--green-bg); }
.si-amber  { background: var(--amber-bg); }
.si-red    { background: var(--red-bg); }
.si-purple { background: var(--purple-bg); }
.si-teal   { background: var(--teal-bg); }
.stat-val { font-family: var(--font-head); font-size: 28px; font-weight: 800; letter-spacing: -.04em; line-height: 1; color: var(--text); }
.stat-label { font-size: 11.5px; color: var(--text3); margin-top: 5px; font-weight: 500; }

/* ── CARDS ── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r3); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.card-title { font-family: var(--font-head); font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.card-body { padding: 18px; }
.card-footer { padding: 11px 18px; border-top: 1px solid var(--border); background: var(--bg3); display: flex; align-items: center; justify-content: space-between; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th { text-align: left; padding: 9px 14px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); border-bottom: 1px solid var(--border); background: var(--bg3); white-space: nowrap; font-family: var(--font-head); }
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--bg3); }
tbody tr:last-child { border-bottom: none; }
td { padding: 10px 14px; font-size: 13px; color: var(--text2); vertical-align: middle; }
td.td-primary { color: var(--text); font-weight: 600; }
.row-actions { display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
tr:hover .row-actions { opacity: 1; }

/* ── BADGES ── */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px; text-transform: capitalize; white-space: nowrap; font-family: var(--font-head); }
.badge-hot    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-b); }
.badge-warm   { background: var(--amber-bg);  color: var(--amber);  border: 1px solid var(--amber-b); }
.badge-cold   { background: var(--bg3);       color: var(--text3);  border: 1px solid var(--border2); }
.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-b); }
.badge-blue   { background: var(--accent-bg); color: var(--accent); border: 1px solid var(--accent-border); }
.badge-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid var(--purple-b); }
.badge-gray   { background: var(--bg3);       color: var(--text3);  border: 1px solid var(--border); }
.badge-teal   { background: var(--teal-bg);   color: var(--teal);   border: 1px solid var(--teal-b); }
.badge-hero   { background: var(--hero-bg);   color: var(--hero);   border: 1px solid var(--hero-border); }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 6px; font-family: var(--font-head); letter-spacing: -.01em; }
.form-hint { font-size: 11px; color: var(--text3); margin-top: 4px; line-height: 1.5; }
.form-hint-warn { color: var(--amber); }
.form-input, .form-select, .form-textarea { width: 100%; background: var(--white); border: 1px solid var(--border2); border-radius: var(--r2); padding: 8px 12px; color: var(--text); font-family: var(--font-body); font-size: 13px; outline: none; transition: all .15s; line-height: 1.5; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67,97,238,.1); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text4); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237A85A0' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Toggle */
.toggle { position: relative; width: 38px; height: 21px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track { position: absolute; cursor: pointer; inset: 0; background: var(--bg5); border: 1px solid var(--border2); border-radius: 21px; transition: .2s; }
.toggle-track::before { content: ''; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; background: var(--white); border-radius: 50%; box-shadow: var(--shadow-sm); transition: .2s; }
.toggle input:checked + .toggle-track { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(17px); }

/* ── DELAY CONFIGURATOR (the key feature) ── */
.delay-config {
  background: linear-gradient(135deg, var(--hero-bg), #FFF8F5);
  border: 1px solid var(--hero-border);
  border-radius: var(--r3);
  padding: 16px 18px;
}
.delay-config-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.delay-config-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--hero); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.delay-config-title { font-family: var(--font-head); font-size: 12.5px; font-weight: 700; color: var(--hero); }
.delay-config-sub { font-size: 11px; color: var(--text3); margin-top: 1px; }
.delay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.delay-field { display: flex; flex-direction: column; gap: 5px; }
.delay-field-label { font-size: 11px; font-weight: 600; color: var(--text3); font-family: var(--font-head); }
.delay-input-row { display: flex; gap: 6px; align-items: center; }
.delay-input-row .form-input { font-family: var(--font-mono); }
.delay-unit { font-size: 11px; color: var(--text3); background: var(--white); border: 1px solid var(--border2); border-radius: 6px; padding: 8px 9px; white-space: nowrap; font-weight: 500; }
.delay-preview {
  background: var(--white);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.delay-preview-icon { font-size: 18px; }
.delay-preview-text { flex: 1; }
.delay-preview-label { font-size: 11px; color: var(--text3); }
.delay-preview-val { font-size: 13px; font-weight: 600; color: var(--text); font-family: var(--font-head); margin-top: 1px; }
.delay-human-note {
  display: flex; align-items: flex-start; gap: 8px;
  background: var(--green-bg); border: 1px solid var(--green-b);
  border-radius: var(--r); padding: 9px 12px; margin-top: 8px;
}
.delay-human-note .note-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.delay-human-note .note-text { font-size: 11.5px; color: var(--green); line-height: 1.5; }

/* ── MODALS ── */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(13,19,33,.4); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal { background: var(--white); border: 1px solid var(--border2); border-radius: var(--r4); width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-xl); transform: translateY(14px) scale(.99); transition: transform .22s cubic-bezier(.34,1.56,.64,1); }
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 820px; }
.modal-xl { max-width: 1000px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-title { font-family: var(--font-head); font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.modal-close { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: 7px; cursor: pointer; color: var(--text3); font-size: 18px; transition: all .12s; }
.modal-close:hover { background: var(--bg3); color: var(--text); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; background: var(--bg3); border-radius: 0 0 var(--r4) var(--r4); }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 9px 16px; font-size: 13px; font-weight: 500; color: var(--text3); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--text2); }
.tab.active { color: var(--hero); border-bottom-color: var(--hero); font-weight: 600; }

/* ── AGENT CONTROL BAR ── */
.agent-control-bar { display: flex; align-items: center; gap: 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r2); padding: 10px 14px; margin-bottom: 12px; box-shadow: var(--shadow-xs); }
.acb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.acb-name { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; font-family: var(--font-head); }
.acb-status-txt { font-size: 11px; color: var(--text3); }
.acb-actions { display: flex; gap: 5px; }

/* ── SETTING ROW ── */
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border); gap: 16px; }
.setting-row:last-child { border-bottom: none; }
.setting-info { flex: 1; }
.setting-label { font-size: 13px; font-weight: 500; color: var(--text); }
.setting-desc { font-size: 12px; color: var(--text3); margin-top: 2px; line-height: 1.5; }
.setting-ctrl { flex-shrink: 0; }

/* ── SECTION LABEL ── */
.section-label { font-family: var(--font-head); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* ── EMPTY / LOADING ── */
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 60px 24px; gap: 10px; }
.empty-icon { font-size: 34px; opacity: .2; }
.empty-title { font-family: var(--font-head); font-size: 15px; font-weight: 700; color: var(--text2); }
.empty-sub { font-size: 13px; text-align: center; max-width: 290px; line-height: 1.6; color: var(--text3); }
.page-loading { display: flex; align-items: center; justify-content: center; height: 180px; gap: 8px; color: var(--text3); font-size: 13px; }
.loading-dots { display: flex; gap: 4px; }
.loading-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hero); animation: ldot 1.4s ease-in-out infinite; }
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes ldot { 0%,80%,100%{transform:scale(.5);opacity:.2} 40%{transform:scale(1);opacity:1} }

/* ── TOAST ── */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { background: var(--white); border: 1px solid var(--border2); border-radius: var(--r2); padding: 11px 15px; display: flex; align-items: center; gap: 10px; font-size: 13px; min-width: 250px; max-width: 380px; box-shadow: var(--shadow-lg); animation: tIn .22s cubic-bezier(.34,1.56,.64,1) forwards; font-family: var(--font-body); }
@keyframes tIn { from{opacity:0;transform:translateX(18px)} to{opacity:1;transform:translateX(0)} }
.toast.t-success { border-left: 3px solid var(--green-mid); }
.toast.t-error   { border-left: 3px solid var(--red); }
.toast.t-info    { border-left: 3px solid var(--hero); }
.toast.t-warn    { border-left: 3px solid var(--amber); }
.toast-icon { font-size: 15px; flex-shrink: 0; }
.toast-text { flex: 1; color: var(--text2); line-height: 1.4; }
.toast-x { color: var(--text4); cursor: pointer; font-size: 14px; padding: 2px; transition: color .1s; }
.toast-x:hover { color: var(--text2); }

/* ── PROGRESS ── */
.progress { height: 4px; background: var(--bg4); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; transition: width .4s; background: linear-gradient(90deg, var(--hero), var(--hero-light)); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ── LOGIN ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 25% 25%, rgba(255,77,0,.07) 0%, transparent 55%), radial-gradient(ellipse at 80% 75%, rgba(109,40,217,.04) 0%, transparent 50%); }
.login-dots { position: absolute; inset: 0; background-image: radial-gradient(circle, var(--border2) 1px, transparent 1px); background-size: 26px 26px; }
.login-card { position: relative; z-index: 1; background: var(--white); border: 1px solid var(--border2); border-radius: 20px; padding: 40px 44px; width: 100%; max-width: 420px; box-shadow: var(--shadow-xl); }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 30px; }
.login-logo-icon { width: 54px; height: 54px; border-radius: 15px; background: linear-gradient(135deg, var(--hero), var(--hero-light)); display: flex; align-items: center; justify-content: center; font-size: 26px; color: white; box-shadow: 0 8px 20px rgba(255,77,0,.3); }
.login-logo-name { font-family: var(--font-head); font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.login-logo-sub { font-size: 12px; color: var(--text3); letter-spacing: .02em; }
.login-error { background: var(--red-bg); border: 1px solid var(--red-b); border-radius: var(--r); padding: 10px 14px; color: var(--red); font-size: 13px; margin-bottom: 14px; display: none; }

/* ── SEQUENCE BUILDER ── */
.seq-step { display: flex; align-items: flex-start; gap: 12px; background: var(--white); border: 1px solid var(--border); border-radius: var(--r2); padding: 12px 14px; margin-bottom: 4px; box-shadow: var(--shadow-xs); transition: border-color .12s; }
.seq-step:hover { border-color: var(--hero-border); }
.seq-step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--hero-bg); border: 1px solid var(--hero-border); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--hero); flex-shrink: 0; font-family: var(--font-head); }
.seq-line { width: 1px; height: 12px; background: var(--border2); margin: 0 11px; }

/* ── CONNECTORS ── */
.connector-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r3); padding: 16px 18px; box-shadow: var(--shadow-xs); transition: all .15s; }
.connector-card:hover { box-shadow: var(--shadow-md); border-color: var(--border2); transform: translateY(-1px); }
.connector-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--bg3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px; }

/* ── POST CARDS ── */
.post-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r3); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow-xs); transition: all .15s; }
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--border2); }
.post-hook { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.5; margin-bottom: 8px; font-family: var(--font-head); }
.post-body { font-size: 13px; color: var(--text2); line-height: 1.7; max-height: 78px; overflow: hidden; }
.post-body.exp { max-height: none; }
.post-tag { font-size: 11px; color: var(--hero); background: var(--hero-bg); border: 1px solid var(--hero-border); padding: 2px 8px; border-radius: 20px; font-weight: 500; }

/* ── UTILS ── */
.flex { display: flex; } .flex-col { display: flex; flex-direction: column; } .items-center { align-items: center; } .items-start { align-items: flex-start; } .justify-between { justify-content: space-between; } .justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; } .flex-wrap { flex-wrap: wrap; }
.gap-1{gap:4px} .gap-2{gap:8px} .gap-3{gap:12px} .gap-4{gap:16px} .gap-5{gap:20px}
.mt-1{margin-top:4px} .mt-2{margin-top:8px} .mt-3{margin-top:12px} .mt-4{margin-top:16px} .mt-5{margin-top:20px}
.mb-1{margin-bottom:4px} .mb-2{margin-bottom:8px} .mb-3{margin-bottom:12px} .mb-4{margin-bottom:16px}
.ml-auto{margin-left:auto} .w-full{width:100%}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
.grid4{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.text-xs{font-size:11px} .text-sm{font-size:12px}
.text-muted{color:var(--text3)} .text-2{color:var(--text2)} .text-accent{color:var(--accent)} .text-green{color:var(--green)} .text-red{color:var(--red)} .text-amber{color:var(--amber)}
.fw-5{font-weight:500} .fw-6{font-weight:600} .fw-7{font-weight:700}
.font-head{font-family:var(--font-head)} .font-mono{font-family:var(--font-mono);font-size:12px}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.divider{height:1px;background:var(--border);margin:14px 0}

@media (max-width:1280px) { .stats-grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:1024px) {
  :root { --sidebar-w: 52px; }
  .nav-label, .nav-group-label, .brand-name, .brand-tag, .agent-widget-title, .agent-row-name { display: none; }
  .topbar-brand { justify-content: center; padding: 0 12px; }
  .nav-item { justify-content: center; padding: 8px; margin: 1px 4px; }
  .nav-icon { width: 20px; height: 20px; }
}

/* ── HERO COLOUR UTILITIES ── */
.hero-text    { color: var(--hero); }
.hero-bg      { background: var(--hero-bg); }
.hero-border  { border-color: var(--hero-border); }
.sep-hero     { height: 2px; background: linear-gradient(90deg, var(--hero), var(--hero-light), transparent); border: none; margin: 16px 0; }
.sep-hero-sm  { height: 1px; background: linear-gradient(90deg, var(--hero-border), transparent); border: none; margin: 10px 0; }
.highlight-hero { background: var(--hero-bg); border-left: 3px solid var(--hero); padding: 10px 14px; border-radius: 0 var(--r) var(--r) 0; }
.dot-hero     { width: 6px; height: 6px; border-radius: 50%; background: var(--hero); display: inline-block; }
