/* AmiCRM - Orange & White Theme */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  /* ── Brand: Orange ── */
  --primary:#F47B20;--primary-dark:#d4640c;--primary-light:#FEF0E6;
  --primary-mid:#FB923C;
  --indigo:#F47B20;--indigo-dark:#d4640c;

  /* ── Status colours ── */
  --success:#16a34a;--success-light:#dcfce7;
  --warning:#d97706;--warning-light:#fef3c7;
  --danger:#dc2626;--danger-light:#fee2e2;--danger-text:#b91c1c;
  --info:#0369a1;--info-light:#e0f2fe;

  /* ── Sidebar: deep warm charcoal ── */
  --nav-bg:#1C1917;
  --nav-text:rgba(255,255,255,.75);
  --nav-text-muted:rgba(255,255,255,.40);
  --nav-active-bg:rgba(244,123,32,.18);
  --nav-active-text:#FB923C;
  --nav-hover-bg:rgba(255,255,255,.06);
  --nav-border:rgba(255,255,255,.07);

  /* ── Content area: clean white ── */
  --text:#18181B;--text-muted:#71717A;--text-subtle:#A1A1AA;
  --bg:#F8F7F5;--bg-card:#FFFFFF;--bg-secondary:#FAFAF9;
  --border:rgba(0,0,0,.07);--border-strong:rgba(0,0,0,.13);

  /* ── Topbar: white with orange accent ── */
  --topbar-bg:#FFFFFF;
  --topbar-border:rgba(0,0,0,.07);

  /* ── Shape & shadow ── */
  --radius:8px;--radius-lg:12px;--radius-xl:16px;
  --shadow:0 1px 3px rgba(0,0,0,.07),0 4px 16px rgba(0,0,0,.05);
  --shadow-md:0 4px 20px rgba(244,123,32,.12),0 1px 4px rgba(0,0,0,.06);
  --font:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
}
html,body{height:100%;font-family:var(--font);background:var(--bg);color:var(--text);font-size:13px;line-height:1.5}
#app{height:100vh;overflow:hidden}
.screen{display:none;height:100%}.screen.active{display:flex;flex-direction:column}
/* LOGIN */
.login-wrap{flex:1;display:flex;align-items:center;justify-content:center;padding:20px;background:var(--bg)}
.login-card{background:var(--bg-card);border:0.5px solid var(--border);border-radius:var(--radius-xl);padding:38px 34px;width:100%;max-width:420px;box-shadow:var(--shadow)}
.login-brand{display:flex;align-items:center;gap:11px;margin-bottom:30px}
.login-brand-icon{width:38px;height:38px;background:var(--primary);border-radius:10px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:18px}
.login-brand-name{font-size:19px;font-weight:600;letter-spacing:-.3px}
.login-title{font-size:22px;font-weight:600;margin-bottom:5px}
.login-sub{font-size:13px;color:var(--text-muted);margin-bottom:24px}
.form-group{margin-bottom:15px}
.form-label{display:block;font-size:12px;font-weight:500;color:var(--text-muted);margin-bottom:5px}
.form-input{width:100%;height:42px;padding:0 13px;border:0.5px solid var(--border-strong);border-radius:var(--radius);font-size:14px;background:var(--bg-card);color:var(--text);outline:none;transition:border .15s;font-family:inherit}
.form-input:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(244,123,32,.12)}
.btn-login{width:100%;height:44px;background:var(--primary);color:#fff;border:none;border-radius:var(--radius);font-size:14px;font-weight:600;cursor:pointer;transition:background .15s;font-family:inherit;margin-top:6px}
.btn-login:hover{background:var(--primary-dark)}.btn-login:disabled{opacity:.65;cursor:not-allowed}
.alert{border-radius:var(--radius);padding:10px 13px;font-size:13px;margin-bottom:12px}
.alert-error{background:var(--danger-light);color:#7a1d0e;border:0.5px solid #f0a090}
.demo-accounts{margin-top:22px;border-top:0.5px solid var(--border);padding-top:18px}
.demo-label{font-size:11px;font-weight:600;color:var(--text-subtle);text-transform:uppercase;letter-spacing:.08em;margin-bottom:10px}
.demo-card{display:flex;align-items:center;gap:11px;padding:9px 12px;border:0.5px solid var(--border);border-radius:var(--radius-lg);cursor:pointer;margin-bottom:7px;transition:all .15s}
.demo-card:hover{border-color:var(--primary);background:var(--primary-light)}
.demo-av{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;flex-shrink:0}
.demo-info{flex:1}.demo-name{font-size:13px;font-weight:500}.demo-email{font-size:11px;color:var(--text-subtle)}
.role-pill{font-size:11px;padding:2px 9px;border-radius:99px;font-weight:500}
/* ── SIDEBAR ──────────────────────────────────── */
.sidebar{width:232px;background:var(--nav-bg);border-right:none;display:flex;flex-direction:column;flex-shrink:0;box-shadow:4px 0 24px rgba(0,0,0,.15)}
.sb-brand{padding:18px 16px 16px;display:flex;align-items:center;gap:10px;border-bottom:1px solid var(--nav-border)}
.sb-brand-icon{width:32px;height:32px;background:var(--primary);border-radius:9px;display:flex;align-items:center;justify-content:center;color:#fff;font-size:15px;box-shadow:0 2px 8px rgba(244,123,32,.45)}
.sb-brand-name{font-size:15px;font-weight:700;color:#fff;letter-spacing:-.2px}
.sb-user{padding:12px 14px;border-bottom:1px solid var(--nav-border);display:flex;align-items:center;gap:10px}
.sb-avatar{width:34px;height:34px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex-shrink:0;box-shadow:0 0 0 2px rgba(244,123,32,.4)}
.sb-name{font-size:13px;font-weight:600;color:#fff}
.sb-role{font-size:10px;border-radius:99px;padding:2px 8px;font-weight:600;display:inline-block;margin-top:2px;background:rgba(244,123,32,.2);color:#FB923C;border:1px solid rgba(244,123,32,.3)}
.sb-nav{flex:1;overflow-y:auto;padding:8px 8px}
.sb-section{font-size:9.5px;font-weight:700;color:var(--nav-text-muted);text-transform:uppercase;letter-spacing:.1em;padding:10px 8px 4px}
.sb-item{display:flex;align-items:center;gap:9px;padding:8px 10px;border-radius:var(--radius);cursor:pointer;font-size:13px;color:var(--nav-text);transition:all .15s;margin-bottom:1px;white-space:nowrap}
.sb-item i{font-size:15px;flex-shrink:0;opacity:.8}
.sb-item:hover:not(.locked){background:var(--nav-hover-bg);color:#fff}
.sb-item:hover:not(.locked) i{opacity:1}
.sb-item.active{background:var(--nav-active-bg);color:var(--nav-active-text);font-weight:600}
.sb-item.active i{color:var(--primary);opacity:1}
.sb-item.active::before{content:'';position:absolute;left:0;top:50%;transform:translateY(-50%);width:3px;height:70%;background:var(--primary);border-radius:0 3px 3px 0}
.sb-item{position:relative}
.sb-item.locked{opacity:.3;cursor:not-allowed}
.sb-item.muted{color:var(--nav-text-muted)}
.sb-item.editor-item i{color:#FB923C;opacity:1}
.sb-badge{margin-left:auto;font-size:10px;padding:2px 7px;border-radius:99px;font-weight:700;background:var(--primary);color:#fff;box-shadow:0 2px 6px rgba(244,123,32,.4)}
.sb-badge.warn{background:var(--warning)}
.sb-footer{padding:6px 8px 12px;border-top:1px solid var(--nav-border)}
/* ── APP LAYOUT ──────────────────────────────── */
.app-layout{display:flex;height:100%;overflow:hidden}
/* ── MAIN ──────────────────────────────────── */
.main-wrap{flex:1;display:flex;flex-direction:column;overflow:hidden;min-width:0}
.topbar{height:56px;background:var(--topbar-bg);border-bottom:1px solid var(--topbar-border);display:flex;align-items:center;padding:0 24px;gap:12px;flex-shrink:0;box-shadow:0 1px 0 rgba(0,0,0,.06)}
.topbar-title{font-size:17px;font-weight:700;flex:1;letter-spacing:-.3px;color:var(--text)}
.topbar-actions{display:flex;align-items:center;gap:8px}
.search-box{display:flex;align-items:center;gap:8px;background:var(--bg);border:1px solid var(--border-strong);border-radius:10px;padding:8px 13px;width:220px;transition:all .15s}
.search-box:focus-within{border-color:var(--primary);box-shadow:0 0 0 3px rgba(244,123,32,.12);background:#fff}
.search-box i{font-size:14px;color:var(--text-subtle)}
.search-box input{border:none;background:transparent;outline:none;font-size:13px;color:var(--text);width:100%;font-family:inherit}
.content-area{flex:1;overflow-y:auto;padding:24px;background:var(--bg)}
.page{display:none}.page.active{display:block}
/* ── BUTTONS ──────────────────────────────────── */
.btn{display:inline-flex;align-items:center;gap:6px;padding:7px 14px;border-radius:var(--radius);font-size:13px;font-weight:500;cursor:pointer;border:1px solid var(--border-strong);background:var(--bg-card);color:var(--text);transition:all .15s;white-space:nowrap;font-family:inherit}
.btn:hover{background:var(--bg);border-color:rgba(0,0,0,.2)}
.btn-primary{background:var(--primary);color:#fff;border-color:var(--primary);box-shadow:0 2px 8px rgba(244,123,32,.3)}
.btn-primary:hover{background:var(--primary-dark);box-shadow:0 4px 12px rgba(244,123,32,.4)}
.btn-ghost{color:var(--text-muted);border-color:transparent;background:transparent}
.btn-ghost:hover{background:var(--bg);border-color:var(--border-strong);color:var(--text)}
.btn-danger{color:var(--danger-text);border-color:#fca5a5;background:#fff}
.btn-danger:hover{background:var(--danger-light)}
.btn-sm{padding:5px 10px;font-size:12px}
.btn-edit-layout{background:var(--primary-light);color:var(--primary);border-color:rgba(244,123,32,.3);margin-left:auto}
/* CARDS */
.card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:18px;margin-bottom:14px;box-shadow:var(--shadow)}
.card:last-child{margin-bottom:0}
.card-header{font-size:13px;font-weight:600;margin-bottom:13px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.record-count{font-size:12px;color:var(--text-subtle);font-weight:400}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}
.metrics-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.metric-card{background:var(--bg-card);border:1px solid var(--border);border-radius:var(--radius-lg);padding:16px;box-shadow:var(--shadow);transition:box-shadow .15s}.metric-card:hover{box-shadow:var(--shadow-md)}
.metric-label{font-size:12px;color:var(--text-muted);display:flex;align-items:center;gap:5px;margin-bottom:7px}
.metric-value{font-size:26px;font-weight:700;line-height:1}
.metric-sub{font-size:11px;color:var(--text-subtle);margin-top:4px}
/* TABLE */
.table-wrap{overflow-x:auto}
.data-table{width:100%;border-collapse:collapse;font-size:13px}
.data-table th{text-align:left;padding:10px 14px;font-size:10.5px;font-weight:700;color:var(--text-muted);border-bottom:1px solid var(--border);text-transform:uppercase;letter-spacing:.06em;white-space:nowrap;background:var(--bg-secondary)}
.data-table td{padding:10px 14px;border-bottom:1px solid var(--border);vertical-align:middle}
.data-table tr:last-child td{border-bottom:none}
.data-table tbody tr:hover td{background:var(--primary-light)}
/* TAGS */
.tag{display:inline-flex;align-items:center;font-size:11px;padding:2px 9px;border-radius:99px;font-weight:500;white-space:nowrap}
.tag-purple{background:#EEEDFE;color:#534AB7}.tag-blue{background:#E6F1FB;color:#185FA5}
.tag-teal{background:#E1F5EE;color:#0F6E56}.tag-amber{background:#FAEEDA;color:#854F0B}
.tag-green{background:#EAF3DE;color:#3B6D11}.tag-red{background:#FCEBEB;color:#A32D2D}
.tag-gray{background:#F1EFE8;color:#5F5E5A}
.avatar{width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:11px;font-weight:600}
/* ACCESS DENIED */
.access-denied{text-align:center;padding:80px 20px}
.access-denied i{font-size:52px;color:var(--text-subtle);margin-bottom:16px;display:block}
.access-denied h3{font-size:18px;font-weight:600;margin-bottom:8px}
.access-denied p{font-size:14px;color:var(--text-muted)}
/* MODAL */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:500;align-items:center;justify-content:center;padding:20px}
.modal-overlay.open{display:flex}
.modal-box{background:var(--bg-card);border-radius:var(--radius-xl);padding:28px;width:520px;max-width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 20px 60px rgba(0,0,0,.2),0 4px 16px rgba(0,0,0,.1)}
.modal-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px}
.modal-header h3{font-size:17px;font-weight:600}
.modal-close{background:none;border:none;cursor:pointer;color:var(--text-muted);font-size:18px;display:flex;align-items:center}
.modal-close:hover{color:var(--text)}
.modal-footer{display:flex;justify-content:flex-end;gap:9px;margin-top:20px;padding-top:16px;border-top:0.5px solid var(--border)}
/* DYNAMIC FORM */
.dyn-section-title{font-size:13px;font-weight:600;color:#374151;padding-bottom:9px;border-bottom:0.5px solid var(--border);margin-bottom:13px;margin-top:8px}
.dyn-section-title:first-child{margin-top:0}
.dyn-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:12px}
.dyn-row.full{grid-template-columns:1fr}
.dyn-field{display:flex;flex-direction:column}
.dyn-field label{font-size:12px;font-weight:500;color:var(--text-muted);margin-bottom:5px}
.req-star{color:#e24b4a;margin-left:2px}
.dyn-field input,.dyn-field select,.dyn-field textarea{padding:8px 11px;border:0.5px solid var(--border-strong);border-radius:var(--radius);font-size:13px;background:var(--bg-card);color:var(--text);outline:none;font-family:inherit;transition:border .15s;height:38px}
.dyn-field textarea{height:80px;resize:vertical}
.dyn-field input:focus,.dyn-field select:focus,.dyn-field textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(244,123,32,.12)}
.dyn-field.is-required input,.dyn-field.is-required select{border-left:2.5px solid #e24b4a;border-radius:0 var(--radius) var(--radius) 0}
/* EDITOR */
.editor-wrap{display:flex;flex-direction:column;height:100vh;overflow:hidden}
.ed-nav{height:48px;background:var(--nav-bg);display:flex;align-items:center;padding:0 14px;gap:9px;flex-shrink:0}
.ed-back-btn{background:none;border:none;cursor:pointer;color:#9ca3af;font-size:16px;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--radius);transition:all .15s}
.ed-back-btn:hover{background:rgba(255,255,255,.1);color:#fff}
.ed-mod-label{display:flex;align-items:center;gap:6px;color:#fff;font-size:13px;font-weight:500}
.ed-version{display:flex;align-items:center;gap:5px;background:rgba(255,255,255,.1);border:0.5px solid rgba(255,255,255,.15);border-radius:var(--radius);padding:4px 10px;cursor:pointer;color:#fff;font-size:12px}
.ed-nav-actions{margin-left:auto;display:flex;gap:7px}
.btn-ed{padding:5px 13px;border-radius:var(--radius);font-size:12px;font-weight:500;cursor:pointer;border:none;font-family:inherit;transition:all .15s}
.preview-btn{background:transparent;color:#9ca3af;border:0.5px solid rgba(255,255,255,.15)!important;border-style:solid!important;display:inline-flex;align-items:center;gap:4px}
.preview-btn:hover{background:rgba(255,255,255,.08)}
.cancel-btn{background:transparent;color:#9ca3af;border:0.5px solid rgba(255,255,255,.15)!important}
.cancel-btn:hover{background:rgba(255,255,255,.08)}
.saveclose-btn{background:var(--indigo);color:#fff}
.saveclose-btn:hover{background:var(--indigo-dark)}
.save-btn{background:#22c55e;color:#fff}
.save-btn:hover{background:#16a34a}
.ed-module-bar{height:44px;background:var(--bg-card);border-bottom:0.5px solid var(--border);display:flex;align-items:center;padding:0 14px;gap:3px;flex-shrink:0}
.ed-mod-tab{display:flex;align-items:center;gap:7px;padding:7px 13px;border-radius:var(--radius);cursor:pointer;font-size:13px;color:var(--text-muted);transition:all .15s;user-select:none}
.ed-mod-tab:hover{background:var(--bg);color:var(--text)}
.ed-mod-tab.active{background:var(--primary-light);color:var(--primary);font-weight:500}
.ed-mod-tab i{font-size:15px}
.ed-mod-count{font-size:10px;background:var(--bg);border-radius:99px;padding:1px 6px;color:var(--text-subtle)}
.ed-mod-tab.active .ed-mod-count{background:rgba(83,74,183,.12);color:var(--primary)}
.ed-body{display:flex;flex:1;overflow:hidden}
.ed-palette{width:213px;background:var(--bg-card);border-right:0.5px solid var(--border);display:flex;flex-direction:column;overflow:hidden;flex-shrink:0}
.ed-palette-section{padding:9px 11px 7px;font-size:11px;font-weight:500;color:var(--text-muted);display:flex;align-items:center;justify-content:space-between;border-bottom:0.5px solid var(--border);cursor:pointer;user-select:none}
.ed-palette-section:hover{background:var(--bg-secondary)}
.palette-grid{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:8px 8px 7px;border-bottom:0.5px solid var(--border);overflow-y:auto;max-height:260px}
.palette-pill{display:flex;align-items:center;gap:5px;padding:5px 7px;border:0.5px solid var(--border);border-radius:7px;cursor:grab;font-size:11px;color:var(--text-muted);background:var(--bg-card);transition:all .15s;user-select:none}
.palette-pill:hover{border-color:var(--indigo);color:var(--indigo);background:#EEEDFE}
.palette-pill.dragging{opacity:.35}
.palette-pill i{font-size:13px;flex-shrink:0}
.palette-comps{padding:8px 8px 7px;border-bottom:0.5px solid var(--border)}
.comp-pill{display:flex;align-items:center;gap:7px;padding:7px 9px;border:0.5px solid var(--border);border-radius:7px;cursor:grab;font-size:12px;margin-bottom:5px;color:var(--text-muted);background:var(--bg-card)}
.comp-pill:last-child{margin-bottom:0}
.comp-pill:hover{border-color:var(--indigo);color:var(--indigo)}
.ed-unused-bar{margin:7px 8px 4px;padding:7px 10px;border:0.5px solid var(--border);border-radius:7px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:12px;color:var(--text-muted)}
.ed-unused-bar:hover{border-color:var(--indigo)}
.unused-badge{background:var(--indigo);color:#fff;border-radius:99px;padding:1px 7px;font-size:10px;font-weight:500}
.ed-cfl{padding:5px 9px 8px;font-size:11px;color:var(--indigo)}
.ed-main{flex:1;display:flex;flex-direction:column;overflow:hidden}
.ed-view-tabs{height:40px;background:var(--bg-card);border-bottom:0.5px solid var(--border);display:flex;align-items:flex-end;padding:0 18px;flex-shrink:0}
.ed-vtab{padding:8px 15px;font-size:13px;cursor:pointer;color:var(--text-muted);border-bottom:2px solid transparent;margin-bottom:-0.5px;transition:all .15s;user-select:none}
.ed-vtab.active{color:var(--indigo);border-bottom-color:var(--indigo);font-weight:500}
.ed-vtab:hover:not(.active){color:var(--text)}
.ed-canvas-wrap{flex:1;overflow-y:auto;padding:18px 24px;background:var(--bg)}
.ed-canvas{background:var(--bg-card);border-radius:var(--radius-lg);border:0.5px solid var(--border);padding:18px;min-height:520px}
.ed-img-row{display:flex;align-items:center;gap:11px;margin-bottom:18px}
.ed-img-placeholder{width:50px;height:50px;border-radius:50%;background:var(--bg-secondary);border:0.5px solid var(--border-strong);display:flex;align-items:center;justify-content:center;color:var(--text-subtle);font-size:20px;position:relative;flex-shrink:0}
.ed-img-dots{position:absolute;top:-5px;left:-2px;font-size:10px;color:var(--text-subtle);background:var(--bg-card);padding:1px 5px;border-radius:5px;border:0.5px solid var(--border)}
.ed-toggle{width:34px;height:19px;border-radius:99px;cursor:pointer;position:relative;transition:background .2s;flex-shrink:0;margin-left:8px}
.ed-toggle.on{background:#22c55e}.ed-toggle.off{background:#d1d5db}
.ed-toggle-thumb{width:13px;height:13px;background:#fff;border-radius:50%;position:absolute;top:3px;transition:left .2s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.ed-toggle.on .ed-toggle-thumb{left:18px}.ed-toggle.off .ed-toggle-thumb{left:3px}
.ed-section-block{margin-bottom:16px}
.ed-section-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;padding-bottom:8px;border-bottom:0.5px solid var(--border)}
.ed-section-title{font-size:14px;font-weight:500}
.ed-section-actions{display:flex;gap:4px}
.ed-sec-btn{background:none;border:none;cursor:pointer;color:var(--text-subtle);font-size:14px;padding:3px 5px;border-radius:6px;transition:all .15s}
.ed-sec-btn:hover{color:var(--indigo);background:#EEEDFE}
.ed-sec-btn.del:hover{color:var(--danger-text);background:var(--danger-light)}
.ed-field-row{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:8px}
.ed-field-row.full{grid-template-columns:1fr}
.ed-field{border:0.5px solid var(--border);border-radius:var(--radius);padding:9px 12px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;background:var(--bg-card);transition:all .15s;position:relative;user-select:none;min-height:40px}
.ed-field:hover{border-color:var(--indigo);background:#EEEDFE08}
.ed-field.is-required{border-left:2.5px solid #e24b4a;border-radius:0 var(--radius) var(--radius) 0}
.ed-field.drop-target{border:2px dashed var(--indigo);background:#EEEDFE18}
.ed-field.empty{border:1.5px dashed var(--border-strong);background:var(--bg-secondary);justify-content:center;color:var(--text-subtle)}
.ed-field.empty:hover{border-color:var(--indigo);color:var(--indigo);background:#EEEDFE18}
.ed-field-label{display:flex;align-items:center;gap:7px;font-size:13px;min-width:0}
.ed-field-label i{font-size:14px;color:var(--text-subtle);flex-shrink:0}
.ed-field-unique{font-size:10px;color:var(--text-subtle);margin-left:3px}
.ed-field-menu{font-size:15px;color:var(--text-subtle);cursor:pointer;opacity:0;transition:opacity .15s;padding:2px 5px;border-radius:4px;flex-shrink:0}
.ed-field:hover .ed-field-menu{opacity:1}
.ed-field-menu:hover{background:var(--bg-secondary)}
.ed-add-section-btn{width:100%;padding:9px;border:1.5px dashed var(--border-strong);border-radius:var(--radius);background:transparent;color:var(--text-subtle);font-size:12px;font-weight:500;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;transition:all .15s;font-family:inherit}
.ed-add-section-btn:hover{border-color:var(--indigo);color:var(--indigo);background:#EEEDFE18}
/* CTX */
.ctx-menu{position:fixed;background:var(--bg-card);border:0.5px solid var(--border-strong);border-radius:10px;padding:5px;min-width:168px;z-index:600;box-shadow:var(--shadow);display:none}
.ctx-item{display:flex;align-items:center;gap:9px;padding:7px 11px;border-radius:6px;cursor:pointer;font-size:12px;color:var(--text)}
.ctx-item i{font-size:14px;color:var(--text-muted)}
.ctx-item:hover{background:var(--bg-secondary)}
.ctx-item:hover i{color:var(--indigo)}
.ctx-danger{color:var(--danger-text)}.ctx-danger i{color:var(--danger-text)!important}
.ctx-danger:hover{background:var(--danger-light)!important}
.ctx-divider{height:0.5px;background:var(--border);margin:4px 0}
/* TOAST */
.toast-container{position:fixed;bottom:18px;right:18px;display:flex;flex-direction:column;gap:8px;z-index:999;pointer-events:none}
.toast{background:var(--bg-card);border:0.5px solid var(--border-strong);border-radius:10px;padding:10px 15px;display:flex;align-items:center;gap:9px;font-size:13px;min-width:240px;pointer-events:auto;box-shadow:var(--shadow);animation:toastIn .22s ease}
.toast.success{border-left:3px solid #22c55e}
.toast.error{border-left:3px solid var(--danger)}
.toast.info{border-left:3px solid var(--primary)}
@keyframes toastIn{from{transform:translateY(18px);opacity:0}to{transform:none;opacity:1}}
::-webkit-scrollbar{width:5px;height:5px}
::-webkit-scrollbar-thumb{background:rgba(0,0,0,.15);border-radius:99px}

/* ── FILTER BAR ─────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 0 14px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 140px;
}
.filter-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.filter-label i { font-size: 13px; }
.filter-select,
.filter-input {
  height: 34px;
  padding: 0 10px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 12px;
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  font-family: var(--font);
  cursor: pointer;
  transition: border .15s;
}
.filter-select:focus,
.filter-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(83,74,183,.08); }
.filter-input { cursor: text; min-width: 140px; }
.filter-clear-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 0.5px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  transition: all .15s;
  font-family: var(--font);
  align-self: flex-end;
  height: 34px;
}
.filter-clear-btn:hover { background: var(--danger-light); color: var(--danger-text); border-color: #f0a090; }
.filter-active-badge {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 99px;
  padding: 2px 10px;
  align-self: flex-end;
  margin-bottom: 1px;
}
/* Sortable column headers */
.data-table th { transition: background .15s; }
.data-table th:hover { background: var(--bg-secondary); }

/* ══════════════════════════════════════
   DETAIL PANEL + ACTIVITIES
══════════════════════════════════════ */
.detail-panel-overlay {
  display: none; position: fixed; inset: 0; z-index: 600;
}
.detail-panel-overlay.open { display: flex; justify-content: flex-end; }
.detail-panel-bg {
  position: absolute; inset: 0; background: rgba(0,0,0,.35);
}
.detail-panel {
  position: relative; width: 620px; max-width: 96vw;
  background: var(--bg-card); display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
  box-shadow: -6px 0 30px rgba(0,0,0,.12);
  animation: slideInRight .25s ease;
}
@keyframes slideInRight { from { transform: translateX(60px); opacity: 0; } to { transform: none; opacity: 1; } }

/* PANEL HEADER */
.dp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 16px; border-bottom: 0.5px solid var(--border);
  flex-shrink: 0; gap: 12px;
}
.dp-header-info { display: flex; align-items: center; gap: 13px; min-width: 0; }
.dp-avatar {
  width: 44px; height: 44px; border-radius: 50%; background: var(--primary-light);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.dp-title { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dp-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dp-close-btn {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  background: var(--bg-secondary); cursor: pointer; display: flex; align-items: center;
  justify-content: center; color: var(--text-muted); font-size: 16px; transition: all .15s;
}
.dp-close-btn:hover { background: var(--danger-light); color: var(--danger-text); }

/* INFO SECTION */
.dp-info-section {
  padding: 14px 20px; border-bottom: 0.5px solid var(--border); flex-shrink: 0;
}
.dp-section-label {
  font-size: 10px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px;
}
.dp-info-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.di-item {}
.di-label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.di-value { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ACTIVITIES */
.dp-activities {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.act-tabs {
  display: flex; align-items: center; gap: 0;
  border-bottom: 0.5px solid var(--border); padding: 0 20px; flex-shrink: 0;
  background: var(--bg-secondary);
}
.act-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 13px; cursor: pointer;
  color: var(--text-muted); border: none; background: transparent;
  border-bottom: 2px solid transparent; margin-bottom: -0.5px;
  transition: all .15s; font-family: var(--font); white-space: nowrap;
}
.act-tab i { font-size: 14px; }
.act-tab:hover { color: var(--text); }
.act-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }
.act-tab-count {
  background: var(--primary-light); color: var(--primary);
  border-radius: 99px; font-size: 10px; padding: 1px 6px; font-weight: 600;
  min-width: 16px; text-align: center;
}
.act-panel-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
}

/* ADD BOX */
.act-add-box {
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px; margin-bottom: 16px;
}
.act-textarea {
  width: 100%; padding: 9px 12px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius); font-size: 13px; background: var(--bg-card);
  color: var(--text); outline: none; font-family: var(--font); resize: vertical;
  transition: border .15s;
}
.act-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(83,74,183,.08); }
.act-input {
  width: 100%; height: 36px; padding: 0 11px; border: 0.5px solid var(--border-strong);
  border-radius: var(--radius); font-size: 13px; background: var(--bg-card);
  color: var(--text); outline: none; font-family: var(--font); transition: border .15s;
}
.act-input:focus { border-color: var(--primary); }
.act-field-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-bottom: 5px; }

/* ACTIVITY CARDS */
.act-list { display: flex; flex-direction: column; gap: 10px; }
.act-card {
  background: var(--bg-card); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 13px 14px;
  transition: border-color .15s;
}
.act-card:hover { border-color: var(--border-strong); }
.act-card.act-card-done { opacity: .7; }
.act-card-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.act-card-meta { display: flex; align-items: center; gap: 10px; }
.act-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.act-icon-box {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.act-card-author { font-size: 13px; font-weight: 500; }
.act-card-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.act-card-body { font-size: 13px; color: var(--text); margin-top: 10px; line-height: 1.6; }
.act-card-footer { font-size: 11px; color: var(--text-subtle); margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--border); }
.act-del-btn {
  background: none; border: none; cursor: pointer; color: var(--text-subtle);
  padding: 3px 5px; border-radius: 5px; font-size: 14px; transition: all .15s; flex-shrink: 0;
}
.act-del-btn:hover { color: var(--danger-text); background: var(--danger-light); }
.act-check { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); flex-shrink: 0; }
.act-badge {
  font-size: 11px; padding: 2px 9px; border-radius: 99px; font-weight: 500; white-space: nowrap;
}
.act-badge-sel {
  font-size: 11px; border: none; background: transparent; cursor: pointer;
  color: inherit; font-family: var(--font); outline: none; padding: 0;
}
.act-empty {
  text-align: center; padding: 36px 20px;
  color: var(--text-subtle); font-size: 13px;
}
.act-empty i { font-size: 36px; display: block; margin-bottom: 10px; color: var(--text-subtle); }

/* TIMELINE */
.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item {
  display: flex; gap: 14px; padding-bottom: 20px; position: relative;
}
.tl-item::before {
  content: ''; position: absolute; left: 15px; top: 32px; bottom: 0;
  width: 1.5px; background: var(--border); z-index: 0;
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; z-index: 1; margin-top: 2px;
}
.tl-content { flex: 1; min-width: 0; }
.tl-type { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 3px; }
.tl-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; word-break: break-word; }
.tl-meta { font-size: 11px; color: var(--text-muted); }

/* View button in table */
.btn-view {
  background: #f0f0ff; color: var(--primary);
  border-color: #d0cdf5;
}
.btn-view:hover { background: var(--primary-light); }

/* ═══════════════════════════════════════
   USER MANAGEMENT
═══════════════════════════════════════ */
.um-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.um-title { font-size: 18px; font-weight: 600; }
.um-sub   { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.um-table-wrap { overflow-x: auto; }

/* PERMISSION SECTION IN MODAL */
.perm-section {
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-top: 4px;
}
.perm-section-title {
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 14px; color: var(--text);
}
.perm-role-hint { font-size: 11px; color: var(--text-muted); font-weight: 400; margin-left: auto; }

.perm-matrix-wrap { overflow-x: auto; }
.perm-matrix-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.perm-matrix-table th {
  text-align: center; padding: 8px 10px;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  border-bottom: 0.5px solid var(--border);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg-card);
}
.perm-matrix-table th.perm-mod-col { text-align: left; width: 150px; }
.perm-matrix-table td {
  padding: 9px 10px; border-bottom: 0.5px solid var(--border);
  text-align: center; vertical-align: middle;
}
.perm-matrix-table tr:last-child td { border-bottom: none; }
.perm-matrix-table tbody tr:hover td { background: var(--bg-card); }
.perm-mod-col { text-align: left !important; }
.perm-act-col { width: 72px; }

/* Custom checkbox */
.perm-check-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; width: 24px; height: 24px;
}
.perm-check-wrap input[type=checkbox] { display: none; }
.perm-chk-box {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-card); transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.perm-check-wrap input:checked ~ .perm-chk-box {
  background: var(--primary); border-color: var(--primary);
}
.perm-check-wrap input:checked ~ .perm-chk-box::after {
  content: ''; width: 5px; height: 9px;
  border: 2px solid #fff; border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px,-1px);
  display: block;
}
.perm-check-wrap:hover .perm-chk-box { border-color: var(--primary); }

.perm-row td { transition: background .12s; }

/* ── SEARCH ENHANCEMENTS ─────────────────────── */
.search-box {
  position: relative;
  transition: width .2s;
}
.search-box input:focus {
  outline: none;
}
.search-box:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(244,123,32,.12);
  width: 260px;
}
.search-box input::placeholder {
  color: var(--text-subtle);
  font-size: 12px;
}

/* Search results highlight */
mark {
  background: #FAEEDA;
  color: #854F0B;
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 500;
}

/* No results state */
.search-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-subtle);
}
.search-empty i {
  font-size: 44px;
  display: block;
  margin-bottom: 14px;
  color: var(--text-subtle);
}
.search-empty h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

/* Keyboard shortcut hint */
.search-shortcut {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-subtle);
  background: var(--bg-secondary);
  border: 0.5px solid var(--border);
  border-radius: 5px;
  padding: 2px 6px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ── CHART EMPTY STATE ───────────────────────── */
.chart-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-subtle); gap: 8px; font-size: 13px;
  background: var(--bg-card); border-radius: var(--radius-lg);
}
.chart-empty i { font-size: 36px; }

/* ── SPIN ANIMATION ─────────────────────────── */
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }


/* ═══════════════════════════════════════
   DATA IMPORT WIZARD
═══════════════════════════════════════ */
.imp-wrap { display:flex; flex-direction:column; gap:0; min-height:400px; }

/* Step indicator */
.imp-steps {
  display:flex; align-items:center;
  margin-bottom:20px; padding-bottom:16px;
  border-bottom:0.5px solid var(--border);
}
.imp-step {
  display:flex; align-items:center; gap:7px;
  font-size:12px; color:var(--text-subtle);
  white-space:nowrap;
}
.imp-step.active { color:var(--primary); font-weight:600; }
.imp-step.done   { color:var(--success); }
.imp-step-num {
  width:24px; height:24px; border-radius:50%;
  background:var(--bg); border:1.5px solid currentColor;
  display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; flex-shrink:0;
}
.imp-step.active .imp-step-num { background:var(--primary); color:#fff; border-color:var(--primary); }
.imp-step.done   .imp-step-num { background:var(--success); color:#fff; border-color:var(--success); }
.imp-step-line { flex:1; height:1.5px; background:var(--border); margin:0 10px; }
.imp-step-lbl { font-size:12px; }

/* Module grid */
.imp-mod-grid {
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:16px;
}
.imp-mod-card {
  display:flex; flex-direction:column; align-items:center; gap:7px;
  padding:12px 8px; border:0.5px solid var(--border); border-radius:var(--radius-lg);
  cursor:pointer; font-size:12px; font-weight:500; color:var(--text-muted);
  transition:all .15s; text-align:center; user-select:none;
}
.imp-mod-card i { font-size:22px; }
.imp-mod-card:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-light); }
.imp-mod-card.active { border-color:var(--primary); background:var(--primary-light); color:var(--primary); }

/* Dropzone */
.imp-dropzone {
  border:2px dashed var(--border-strong); border-radius:var(--radius-lg);
  padding:30px 20px; text-align:center; transition:all .15s;
  background:var(--bg-secondary); cursor:pointer; margin-bottom:10px;
}
.imp-dropzone:hover, .imp-dropzone.over {
  border-color:var(--primary); background:var(--primary-light);
}

/* File info bar */
.imp-file-info {
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; background:var(--bg-secondary);
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  margin-bottom:10px;
}

/* Source grid */
.imp-sources { margin-top:14px; }
.imp-source-grid {
  display:grid; grid-template-columns:repeat(3,1fr); gap:6px;
}
.imp-source {
  display:flex; align-items:center; gap:7px; padding:8px 10px;
  background:var(--bg-secondary); border:0.5px solid var(--border);
  border-radius:var(--radius); font-size:12px; color:var(--text-muted);
}
.imp-source i { font-size:15px; flex-shrink:0; }

/* Section label */
.imp-section-label {
  font-size:12px; font-weight:600; color:var(--text-muted);
  display:flex; align-items:center; gap:6px; margin-bottom:10px;
}

/* Footer */
.imp-footer {
  display:flex; align-items:center; gap:10px;
  margin-top:16px; padding-top:14px;
  border-top:0.5px solid var(--border);
}
.imp-footer .btn-primary { margin-left:auto; }

/* Map summary */
.imp-map-summary {
  display:flex; align-items:center; gap:8px;
  padding:9px 13px; background:var(--bg-secondary);
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  font-size:13px; flex-wrap:wrap;
}

/* Map table */
.imp-map-wrap {
  overflow-y:auto; max-height:260px;
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  margin-bottom:0;
}
.imp-map-table { width:100%; border-collapse:collapse; font-size:13px; }
.imp-map-table th {
  text-align:left; padding:8px 12px; font-size:10px; font-weight:600;
  color:var(--text-muted); border-bottom:0.5px solid var(--border);
  text-transform:uppercase; letter-spacing:.05em;
  background:var(--bg-secondary); position:sticky; top:0; z-index:1;
}
.imp-map-table td { padding:7px 12px; border-bottom:0.5px solid var(--border); }
.imp-map-table tr:last-child td { border-bottom:none; }
.imp-map-table .imp-mapped-row td { background:#EEEDFE18; }
.imp-sel {
  width:100%; height:33px; padding:0 10px;
  border:0.5px solid var(--border-strong); border-radius:var(--radius);
  font-size:12px; background:var(--bg-card); color:var(--text);
  outline:none; font-family:var(--font); cursor:pointer; transition:border .15s;
}
.imp-sel:focus { border-color:var(--primary); }

/* Result */
.imp-result {
  text-align:center; padding:24px 20px;
  border-radius:var(--radius-lg); margin-bottom:16px;
}
.imp-result i { font-size:52px; display:block; margin-bottom:12px; }
.imp-result-ok  { background:#E1F5EE; border:0.5px solid #a0dfc0; }
.imp-result-ok  i { color:#1D9E75; }
.imp-result-err { background:var(--danger-light); border:0.5px solid #f0a090; }
.imp-result-err i { color:var(--danger); }
.imp-result-title { font-size:18px; font-weight:700; margin-bottom:6px; }
.imp-result-sub   { font-size:13px; color:var(--text-muted); }

/* Stats row */
.imp-stats {
  display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:12px;
}
.imp-stat {
  text-align:center; padding:14px;
  background:var(--bg-secondary); border:0.5px solid var(--border);
  border-radius:var(--radius-lg);
}
.imp-stat-n { font-size:28px; font-weight:700; line-height:1; }
.imp-stat-l { font-size:11px; color:var(--text-muted); margin-top:4px; }

/* Make modal wider for import */
.modal-overlay.open .modal-box { width: 620px; }

/* Hide the default modal footer when import wizard is active */
.imp-wrap ~ .modal-footer,
#modal-body .imp-wrap + .modal-footer { display:none !important; }

/* ═══════════════════════════════════════
   ADMIN TABS
═══════════════════════════════════════ */
.admin-tabs {
  display: flex; gap: 4px;
  margin-bottom: 18px;
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 0;
}
.admin-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: transparent;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -0.5px; transition: all .15s; font-family: var(--font);
}
.admin-tab i { font-size: 15px; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }


/* ═══════════════════════════════════════════════
   PICKLIST MANAGER
═══════════════════════════════════════════════ */

/* Grid of picklist cards */
.pl-group-lbl {
  font-size: 11px; font-weight: 600; color: var(--text-subtle);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 10px;
}
.pl-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px; margin-bottom: 6px;
}
.pl-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 15px;
  transition: border-color .15s;
}
.pl-card:hover { border-color: var(--border-strong); }
.pl-card-head {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 4px;
}
.pl-card-name { font-size: 14px; font-weight: 600; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.pl-chip {
  font-size: 11px; padding: 2px 9px; border-radius: 99px;
  background: var(--bg-secondary); color: var(--text-muted);
  border: 0.5px solid var(--border);
}
.pl-chip-more {
  font-size: 11px; padding: 2px 9px; border-radius: 99px;
  background: var(--primary-light); color: var(--primary); font-weight: 500;
}

/* Editor — option rows */
.pl-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: var(--radius);
  border: 1.5px solid transparent; margin-bottom: 3px;
  transition: background .1s; cursor: grab;
  background: var(--bg-card);
}
.pl-row:hover { background: var(--bg-secondary); }
.pl-row.pl-over { border-color: var(--primary); background: var(--primary-light); }

/* The text input inside each row */
.pl-opt-in {
  flex: 1; height: 36px; padding: 0 11px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font);
  transition: border .15s;
}
.pl-opt-in:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(83,74,183,.08); }

/* Delete button per row */
.pl-del-btn {
  width: 30px; height: 30px; border-radius: var(--radius); border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-subtle); transition: all .15s; flex-shrink: 0;
}
.pl-del-btn:hover { background: var(--danger-light); color: var(--danger-text); }

/* Admin tabs */
.admin-tabs {
  display: flex; gap: 4px; margin-bottom: 18px;
  border-bottom: 0.5px solid var(--border);
}
.admin-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 9px 16px; font-size: 13px; font-weight: 500;
  cursor: pointer; border: none; background: transparent;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -0.5px; transition: all .15s; font-family: var(--font);
}
.admin-tab i { font-size: 15px; }
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ═══════════════════════════════════════════════
   PICKLIST SIDE PANEL (from Layout Editor)
═══════════════════════════════════════════════ */
#pl-side-panel {
  position: fixed; inset: 0; z-index: 800;
  display: flex; justify-content: flex-end;
}
.pl-sp-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.3);
}
.pl-sp-box {
  position: relative; width: 420px; max-width: 96vw;
  background: var(--bg-card); display: flex; flex-direction: column;
  height: 100vh; box-shadow: -6px 0 30px rgba(0,0,0,.15);
  animation: slideInRight .22s ease;
}
.pl-sp-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px 20px 14px; border-bottom: 0.5px solid var(--border);
  gap: 10px; flex-shrink: 0;
}
.pl-sp-title {
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; color: var(--text);
}
.pl-sp-title i { color: #BA7517; font-size: 17px; }
.pl-sp-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.pl-sp-close {
  width: 32px; height: 32px; border: none; border-radius: 8px;
  background: var(--bg-secondary); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 16px; flex-shrink: 0;
  transition: all .15s;
}
.pl-sp-close:hover { background: var(--danger-light); color: var(--danger-text); }

.pl-sp-body {
  flex: 1; overflow-y: auto; padding: 16px 20px;
  display: flex; flex-direction: column; gap: 14px;
}

/* Options list */
.pl-sp-list {
  border: 0.5px solid var(--border); border-radius: var(--radius-lg);
  min-height: 60px; padding: 6px;
  background: var(--bg-secondary);
}
.pl-sp-empty {
  text-align: center; padding: 24px;
  color: var(--text-subtle); font-size: 13px;
}
.pl-sp-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 7px; border-radius: var(--radius);
  border: 1.5px solid transparent; margin-bottom: 3px;
  background: var(--bg-card); transition: all .1s; cursor: grab;
}
.pl-sp-row:hover { background: var(--bg-card); box-shadow: 0 1px 4px rgba(0,0,0,.07); }
.pl-sp-row.plsp-over { border-color: var(--primary); background: var(--primary-light); }
.pl-sp-opt {
  flex: 1; height: 34px; padding: 0 10px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font); transition: border .15s;
}
.pl-sp-opt:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(83,74,183,.08); }

/* Add single */
.pl-sp-add {
  display: flex; gap: 8px;
}
.pl-sp-input {
  flex: 1; height: 38px; padding: 0 12px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font); transition: border .15s;
}
.pl-sp-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(83,74,183,.08); }

/* Bulk add */
.pl-sp-bulk-wrap {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; background: var(--bg-secondary);
  border: 0.5px solid var(--border); border-radius: var(--radius-lg);
}
.pl-sp-bulk-label {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  display: flex; align-items: center; gap: 6px;
}
.pl-sp-bulk {
  width: 100%; padding: 8px 11px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font); resize: vertical;
  transition: border .15s;
}
.pl-sp-bulk:focus { border-color: var(--primary); }

/* Footer */
.pl-sp-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-top: 0.5px solid var(--border);
  flex-shrink: 0; flex-wrap: wrap;
}
.pl-sp-count {
  font-size: 12px; color: var(--text-muted);
  background: var(--bg-secondary); border: 0.5px solid var(--border);
  border-radius: 99px; padding: 2px 10px;
}

/* Picklist ctx item visibility controlled by JS */
#ctx-picklist-item { display: none; } /* hidden until showCtxMenu runs */

/* ═══════════════════════════════════════════════
   LEAD CONVERSION MODAL
═══════════════════════════════════════════════ */
.conv-wrap { display:flex; flex-direction:column; }

/* Lead summary bar */
.conv-lead-summary {
  display:flex; align-items:center; gap:13px;
  padding:14px 16px; background:var(--bg-secondary);
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  margin-bottom:18px;
}
.conv-lead-avatar {
  width:44px; height:44px; border-radius:50%;
  background:var(--primary-light); color:var(--primary);
  display:flex; align-items:center; justify-content:center;
  font-size:16px; font-weight:700; flex-shrink:0;
}
.conv-lead-info { flex:1; min-width:0; }
.conv-lead-name { font-size:15px; font-weight:600; margin-bottom:4px; }
.conv-lead-meta { display:flex; flex-wrap:wrap; gap:10px; font-size:12px; color:var(--text-muted); }
.conv-lead-meta span { display:flex; align-items:center; gap:4px; }
.conv-lead-status { text-align:center; flex-shrink:0; }

/* Steps */
.conv-steps { display:flex; flex-direction:column; gap:0; }
.conv-arrow { text-align:center; padding:4px 0; color:var(--text-subtle); font-size:16px; }

.conv-step {
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; transition:border-color .15s;
}
.conv-step:hover { border-color:var(--border-strong); }
.conv-step.conv-step-disabled { opacity:.55; }

.conv-step-header {
  display:flex; align-items:center; gap:10px;
  padding:12px 14px; cursor:pointer;
  background:var(--bg-card); user-select:none;
}
.conv-step-header:hover { background:var(--bg-secondary); }

.conv-step-check input[type=checkbox] {
  width:17px; height:17px; accent-color:var(--primary); cursor:pointer; flex-shrink:0;
}
.conv-step-icon {
  width:36px; height:36px; border-radius:9px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:17px;
}
.conv-step-title { flex:1; }
.conv-chevron { color:var(--text-subtle); transition:transform .2s; flex-shrink:0; }

.conv-step-body {
  padding:14px 14px 16px;
  border-top:0.5px solid var(--border);
  background:var(--bg-secondary);
}

/* Form grid inside step */
.conv-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.conv-field { display:flex; flex-direction:column; gap:5px; }
.conv-field label { font-size:11px; font-weight:500; color:var(--text-muted); }
.conv-field input,
.conv-field select {
  height:36px; padding:0 11px;
  border:0.5px solid var(--border-strong); border-radius:var(--radius);
  font-size:13px; background:var(--bg-card); color:var(--text);
  outline:none; font-family:var(--font); transition:border .15s;
}
.conv-field input:focus,
.conv-field select:focus { border-color:var(--primary); box-shadow:0 0 0 2px rgba(83,74,183,.08); }

/* Existing warning */
.conv-existing-warn {
  display:flex; align-items:center; flex-wrap:wrap; gap:6px;
  padding:9px 12px; background:var(--warning-light);
  border:0.5px solid #e8c87a; border-radius:var(--radius);
  font-size:12px; color:#854F0B; margin-bottom:12px;
}
.conv-existing-warn i { font-size:14px; flex-shrink:0; }

/* Footer */
.conv-footer {
  display:flex; justify-content:flex-end; gap:9px;
  margin-top:18px; padding-top:14px;
  border-top:0.5px solid var(--border);
}

/* Success results */
.conv-results { display:flex; flex-direction:column; gap:10px; }
.conv-result-card {
  display:flex; align-items:center; gap:12px;
  padding:12px 14px; background:var(--bg-secondary);
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  transition:border-color .15s;
}
.conv-result-card:hover { border-color:var(--border-strong); }
.conv-result-icon {
  width:38px; height:38px; border-radius:9px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center; font-size:18px;
}
.conv-result-info { flex:1; }
.conv-result-type { font-size:11px; color:var(--text-muted); font-weight:500; text-transform:uppercase; letter-spacing:.06em; }
.conv-result-name { font-size:14px; font-weight:600; margin-top:2px; }

/* Wider modal for conversion */
.modal-overlay.open .modal-box { max-width: 640px; }

/* Pick List badge in editor field */
.ed-field-pl-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 99px;
  background: #FAEEDA; color: #854F0B;
  border: 0.5px solid #e8c87a; margin-left: 4px;
  font-weight: 500; flex-shrink: 0;
}

/* ── PROBABILITY BAR ─────────────────────────── */
.prob-bar-wrap {
  width: 80px; height: 8px; background: var(--bg-secondary);
  border-radius: 99px; overflow: hidden; flex-shrink: 0;
  border: 0.5px solid var(--border);
}
.prob-bar-fill {
  height: 100%; border-radius: 99px;
  background: #BA7517;
  transition: width .3s ease, background .3s ease;
}
.prob-pct {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  min-width: 36px; text-align: right; flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   ORDER PDF FORM
═══════════════════════════════════════════════ */
.pdf-form-wrap { display:flex; flex-direction:column; }

/* Tabs */
.pdf-tabs {
  display:flex; gap:2px; margin-bottom:16px;
  border-bottom:0.5px solid var(--border); padding-bottom:0;
}
.pdf-tab {
  display:flex; align-items:center; gap:6px;
  padding:8px 13px; font-size:12px; font-weight:500;
  cursor:pointer; border:none; background:transparent;
  color:var(--text-muted); border-bottom:2px solid transparent;
  margin-bottom:-0.5px; transition:all .15s; font-family:var(--font);
}
.pdf-tab i { font-size:14px; }
.pdf-tab:hover { color:var(--text); }
.pdf-tab.active { color:var(--primary); border-bottom-color:var(--primary); }

.pdf-tab-body { display:none; }
.pdf-tab-body.active { display:block; }

.pdf-section-label {
  font-size:11px; font-weight:600; color:var(--text-subtle);
  text-transform:uppercase; letter-spacing:.07em; margin-bottom:10px;
}
.pdf-grid {
  display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:4px;
}
.pdf-field { display:flex; flex-direction:column; gap:4px; }
.pdf-field.full { grid-column:span 2; }
.pdf-field label { font-size:11px; font-weight:500; color:var(--text-muted); }
.pdf-field input, .pdf-field textarea {
  height:36px; padding:0 11px;
  border:0.5px solid var(--border-strong); border-radius:var(--radius);
  font-size:13px; background:var(--bg-card); color:var(--text);
  outline:none; font-family:var(--font); transition:border .15s;
}
.pdf-field input:focus, .pdf-field textarea:focus {
  border-color:var(--primary); box-shadow:0 0 0 2px rgba(83,74,183,.08);
}
.pdf-field textarea { height:auto; padding:8px 11px; }

/* Line item rows */
.pdf-item-row {
  display:flex; align-items:center; gap:8px;
  padding:8px 10px; background:var(--bg-card);
  border:0.5px solid var(--border); border-radius:var(--radius-lg);
  margin-bottom:7px; transition:border-color .15s;
}
.pdf-item-row:hover { border-color:var(--border-strong); }
.pdf-item-grip { color:var(--text-subtle); cursor:grab; flex-shrink:0; }
.pdf-item-in {
  width:100%; height:34px; padding:0 9px;
  border:0.5px solid var(--border-strong); border-radius:var(--radius);
  font-size:12px; background:var(--bg-card); color:var(--text);
  outline:none; font-family:var(--font); transition:border .15s;
}
.pdf-item-in:focus { border-color:var(--primary); }
.pdf-item-total {
  font-size:12px; font-weight:600; color:var(--primary);
  min-width:70px; text-align:right; flex-shrink:0;
}

/* Totals preview */
.pdf-total-table {
  margin-top:14px; border:0.5px solid var(--border);
  border-radius:var(--radius-lg); overflow:hidden; max-width:300px;
}
.pdf-total-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:7px 14px; font-size:13px; border-bottom:0.5px solid var(--border);
}
.pdf-total-row:last-child { border-bottom:none; }
.pdf-total-row.grand {
  background:var(--primary); color:#fff; font-weight:700; font-size:14px;
}
.pdf-total-row.grand span { color:#fff; }

/* Footer */
.pdf-form-footer {
  display:flex; justify-content:flex-end; gap:9px;
  margin-top:16px; padding-top:14px;
  border-top:0.5px solid var(--border);
}

/* Wider modal for PDF form */
.modal-overlay.open .modal-box { width:660px; }

/* ═══════════════════════════════════════════════
   MULTI-TENANT LOGIN
═══════════════════════════════════════════════ */
.ws-header {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; margin-bottom: 4px;
  border-bottom: 0.5px solid var(--border);
}
.ws-back-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 0.5px solid var(--border-strong); background: var(--bg-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--text-muted); transition: all .15s;
}
.ws-back-btn:hover { background: var(--bg); color: var(--text); }
.ws-badge {
  display: flex; align-items: center; gap: 7px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 99px; padding: 5px 13px; font-size: 13px; font-weight: 500;
  border: 0.5px solid rgba(244,123,32,.18);
}

/* ═══════════════════════════════════════════════
   SUPER ADMIN DASHBOARD
═══════════════════════════════════════════════ */
.sa-layout {
  display: flex; height: 100%; overflow: hidden;
}
.sa-sidebar {
  width: 220px; background: #0F172A; display: flex;
  flex-direction: column; flex-shrink: 0;
}
.sa-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px; border-bottom: 0.5px solid rgba(255,255,255,.08);
}
.sa-brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: #534AB7; display: flex; align-items: center;
  justify-content: center; font-size: 17px; color: #fff; flex-shrink: 0;
}
.sa-brand-name { font-size: 15px; font-weight: 600; color: #fff; }
.sa-brand-sub  { font-size: 10px; color: #6366f1; font-weight: 500; letter-spacing: .06em; margin-top: 1px; }
.sa-nav { flex: 1; padding: 8px 6px; overflow-y: auto; }
.sa-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: #9ca3af; transition: all .15s; margin-bottom: 2px;
}
.sa-item i { font-size: 16px; flex-shrink: 0; }
.sa-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.sa-item.active { background: rgba(83,74,183,.25); color: #7B72E9; font-weight: 500; }
.sa-item.muted { color: #6b7280; }
.sa-footer { padding: 6px 6px 10px; border-top: 0.5px solid rgba(255,255,255,.06); }

.sa-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.sa-topbar {
  height: 52px; background: #fff; border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; padding: 0 22px; gap: 12px; flex-shrink: 0;
}
.sa-title { font-size: 16px; font-weight: 600; flex: 1; }
.sa-user  { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.sa-content { flex: 1; overflow-y: auto; padding: 20px; }
.sa-page { display: none; }
.sa-page.active { display: block; }

.sa-metrics {
  display: grid; grid-template-columns: repeat(7,1fr); gap: 10px; margin-bottom: 16px;
}
.sa-metric {
  background: var(--bg-card); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 12px; text-align: center;
}
.sa-metric-val { font-size: 24px; font-weight: 700; }
.sa-metric-lbl { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Tenant badge in CRM sidebar */
.sb-tenant-badge {
  margin: 6px 8px 2px;
  padding: 6px 10px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--primary); font-weight: 500;
  border: 0.5px solid rgba(244,123,32,.18);
}
.sb-tenant-plan {
  margin-left: auto; font-size: 10px; padding: 1px 7px;
  background: rgba(83,74,183,.12); border-radius: 99px;
  color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
}

/* ═══════════════════════════════════════════════
   VONAGE PHONE INTEGRATION
═══════════════════════════════════════════════ */

/* ── FAB button ─────────────────────────────── */
#vonage-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 600;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(83,74,183,.45);
  transition: transform .15s, box-shadow .15s;
}
#vonage-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(83,74,183,.55); }

/* ── Dialer panel ────────────────────────────── */
#vonage-dialer {
  position: fixed; bottom: 90px; right: 28px; z-index: 700;
  width: 320px; background: var(--bg-card);
  border: 0.5px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 580px;
}

.vd-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--primary);
  cursor: grab; user-select: none; flex-shrink: 0;
}
.vd-brand { font-size: 13px; font-weight: 600; color: #fff; flex: 1; display: flex; align-items: center; gap: 6px; }
.vd-brand i { font-size: 15px; }
.vd-close { width: 24px; height: 24px; border: none; background: rgba(255,255,255,.2); color: #fff; border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; line-height: 1; flex-shrink: 0; }
.vd-close:hover { background: rgba(255,255,255,.35); }

.vd-tab-btn { border: none; background: rgba(255,255,255,.18); color: #fff; border-radius: 6px; padding: 3px 9px; font-size: 11px; font-weight: 500; cursor: pointer; font-family: var(--font); transition: all .15s; }
.vd-tab-btn.active { background: rgba(255,255,255,.45); }
.vd-tab-btn:hover  { background: rgba(255,255,255,.3); }

.vd-tab { display: none; overflow-y: auto; flex: 1; }
.vd-tab.active { display: flex; flex-direction: column; }

/* ── Dial tab ──────────────────────────────── */
#vd-dial { padding: 14px; gap: 10px; }
.vd-input {
  width: 100%; height: 36px; padding: 0 11px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  font-size: 13px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font); transition: border .15s; box-sizing: border-box;
}
.vd-input:focus { border-color: var(--primary); }
textarea.vd-input { height: auto; padding: 8px 11px; }

.vd-numpad { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top:4px; }
.vd-key {
  height: 42px; border: 0.5px solid var(--border); border-radius: 10px;
  background: var(--bg-secondary); font-size: 17px; font-weight: 500;
  cursor: pointer; transition: all .12s; font-family: var(--font); color: var(--text);
}
.vd-key:hover  { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.vd-key:active { transform: scale(.94); }

.vd-actions { display: flex; gap: 8px; margin-top: 8px; }
.vd-call-btn {
  flex: 1; height: 42px; border: none; border-radius: 10px;
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 7px; font-family: var(--font); transition: all .15s;
}
.vd-call-btn:hover { background: #4339a0; }
.vd-call-btn i { font-size: 17px; }

.vd-warn { font-size: 11px; color: #BA7517; background: #FAEEDA; border-radius: 7px; padding: 7px 10px; display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.vd-warn a { color: var(--primary); cursor: pointer; font-weight: 600; }

/* ── Active call ────────────────────────────── */
.vd-active-call {
  background: linear-gradient(135deg,#1a1a2e,#0F172A);
  border-radius: 12px; padding: 16px; display: flex; align-items: center;
  gap: 12px; margin-bottom: 10px;
}
.vd-call-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.vd-call-info { flex: 1; min-width: 0; }
.vd-call-name { font-size: 14px; font-weight: 600; color: #fff; }
.vd-call-num  { font-size: 12px; color: #9ca3af; margin-top: 1px; }
.vd-call-timer { font-size: 22px; font-weight: 700; color: #1D9E75; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.vd-call-status { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #9ca3af; }
.vd-pulse { width: 8px; height: 8px; border-radius: 50%; background: #1D9E75; animation: pulse 1.2s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(1.3)} }

.vd-call-controls { display: flex; flex-direction: column; gap: 6px; }
.vd-hangup-btn { height: 34px; padding: 0 12px; border: none; border-radius: 8px; background: #EF4444; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 5px; font-family: var(--font); }
.vd-hangup-btn:hover { background: #DC2626; }
.vd-missed-btn { height: 34px; padding: 0 12px; border: 0.5px solid #4B5563; border-radius: 8px; background: transparent; color: #9ca3af; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px; font-family: var(--font); }
.vd-missed-btn:hover { background: rgba(255,255,255,.06); }

/* ── Log tab ─────────────────────────────────── */
#vd-log { padding: 6px; }
.vd-log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer; transition: background .12s;
}
.vd-log-row:hover { background: var(--bg-secondary); }
.vd-log-icon { font-size: 20px; flex-shrink: 0; }
.vd-log-info { flex: 1; min-width: 0; }
.vd-log-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vd-log-meta { font-size: 11px; color: #9ca3af; margin-top: 1px; }

/* ── Manual + Settings tabs ─────────────────── */
#vd-manual   { padding: 14px; gap: 8px; }
#vd-settings { overflow-y: auto; }
.vd-settings-scroll { padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.vd-settings-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; }
.vd-manual-form { display: flex; flex-direction: column; gap: 9px; }
.vd-field { display: flex; flex-direction: column; gap: 4px; }
.vd-field label { font-size: 11px; font-weight: 500; color: var(--text-muted); }

.vd-webhook-box { background: var(--bg-secondary); border: 0.5px solid var(--border); border-radius: 9px; padding: 10px 12px; }
.vd-webhook-url { font-size: 10px; color: var(--primary); font-family: 'Courier New', monospace; word-break: break-all; cursor: pointer; padding: 4px 7px; background: var(--primary-light); border-radius: 5px; }
.vd-webhook-url:hover { opacity: .8; }

/* ── Empty/loading states ─────────────────── */
.vd-loading { display: flex; align-items: center; justify-content: center; padding: 30px; color: var(--text-subtle); font-size: 22px; }
.vd-loading i { animation: spin 1s linear infinite; }
.vd-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 30px 20px; color: var(--text-subtle); font-size: 13px; }
.vd-empty i { font-size: 28px; }

/* ── Call button on table rows ─────────────── */
.btn-call {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; height: 28px; border-radius: 7px;
  background: #FEF0E6; color: var(--primary); border: 1px solid rgba(244,123,32,.3);
  font-size: 11px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all .15s; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(244,123,32,.1);
}
.btn-call:hover { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(244,123,32,.35); }
.btn-call i { font-size: 12px; }

/* ── Call log in detail panel ────────────── */
.call-log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 0.5px solid var(--border);
}
.call-log-item:last-child { border-bottom: none; }
.call-log-avatar { font-size: 20px; flex-shrink: 0; }
.call-log-info { flex: 1; min-width: 0; }

/* ═══════════════════════════════════════════════
   XLITE PHONE INTEGRATION
═══════════════════════════════════════════════ */

/* XLite FAB — single phone button */
#xlite-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 600;
  width: 52px; height: 52px; border-radius: 50%;
  background: #0F6E56; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(15,110,86,.45);
  transition: transform .15s, box-shadow .15s;
}
#xlite-fab:hover { transform: scale(1.08); box-shadow: 0 6px 22px rgba(15,110,86,.55); }

/* Panel */
#xlite-panel {
  position: fixed; bottom: 90px; right: 28px; z-index: 700;
  width: 310px; background: var(--bg-card);
  border: 0.5px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 560px;
}
.xlite-header {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px; background: #0F6E56; cursor: grab; user-select: none;
}
.xlite-brand { display:flex; align-items:center; gap:6px; flex:1; font-size:13px; font-weight:600; color:#fff; }
.xlite-brand i { font-size:15px; }
.xlite-ws-badge { font-size:10px; margin-left:4px; }
.xlite-close { width:24px; height:24px; border:none; background:rgba(255,255,255,.2); color:#fff; border-radius:50%; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; }
.xlite-close:hover { background:rgba(255,255,255,.35); }
.xlite-tab-btn { border:none; background:rgba(255,255,255,.18); color:#fff; border-radius:6px; padding:3px 8px; font-size:11px; font-weight:500; cursor:pointer; font-family:var(--font); transition:all .15s; }
.xlite-tab-btn.active { background:rgba(255,255,255,.45); }
.xlite-tab-btn:hover  { background:rgba(255,255,255,.3); }

/* Active call bar */
#xlite-active-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #0d1a0d;
  border-bottom: 0.5px solid rgba(15,110,86,.4);
}
.xlite-active-icon { font-size: 22px; flex-shrink: 0; }
.xlite-timer { font-size: 18px; font-weight: 700; color: #1D9E75; margin-top: 2px; font-variant-numeric: tabular-nums; }
.xlite-end-btn  { height:30px; padding:0 10px; border:none; border-radius:7px; background:#EF4444; color:#fff; font-size:11px; font-weight:600; cursor:pointer; font-family:var(--font); }
.xlite-miss-btn { height:30px; padding:0 10px; border:0.5px solid #4B5563; border-radius:7px; background:transparent; color:#9ca3af; font-size:11px; cursor:pointer; font-family:var(--font); }

/* Tabs */
.xlite-tab { display:none; overflow-y:auto; flex:1; }
.xlite-tab.active { display:flex; flex-direction:column; }

/* Form */
.xlite-form { padding:12px; display:flex; flex-direction:column; gap:8px; }
.xlite-field { display:flex; flex-direction:column; gap:4px; }
.xlite-field label { font-size:10px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
.xlite-input {
  width:100%; height:34px; padding:0 10px;
  border:0.5px solid var(--border-strong); border-radius:var(--radius);
  font-size:12px; background:var(--bg-card); color:var(--text);
  outline:none; font-family:var(--font); box-sizing:border-box; transition:border .15s;
}
.xlite-input:focus { border-color:#0F6E56; }
textarea.xlite-input { height:auto; padding:7px 10px; }
.xlite-save-btn {
  height:38px; border:none; border-radius:9px;
  background:#0F6E56; color:#fff; font-size:13px; font-weight:600;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  gap:6px; font-family:var(--font); transition:all .15s; margin-top:4px;
}
.xlite-save-btn:hover { background:#0a5440; }

/* Log */
#xlt-tab-log { padding:4px; }
.xlite-log-row {
  display:flex; align-items:center; gap:9px;
  padding:8px 10px; border-radius:8px; cursor:pointer; transition:background .12s;
}
.xlite-log-row:hover { background:var(--bg-secondary); }
.xlite-log-icon { font-size:18px; flex-shrink:0; }
.xlite-log-info { flex:1; min-width:0; }
.xlite-log-name { font-size:12px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.xlite-log-meta { font-size:10px; color:#9ca3af; }

/* Settings */
#xlt-tab-settings { overflow-y:auto; }
.xlite-webhook-box { background:var(--bg-secondary); border:0.5px solid var(--border); border-radius:9px; padding:10px 12px; margin-top:4px; }
.xlite-webhook-url { font-size:10px; color:#0F6E56; font-family:'Courier New',monospace; word-break:break-all; cursor:pointer; padding:5px 8px; background:#E1F5EE; border-radius:5px; margin-top:3px; }
.xlite-webhook-url:hover { opacity:.8; }
.xlite-howto { background:var(--primary-light); border:0.5px solid rgba(244,123,32,.18); border-radius:9px; padding:10px 12px; margin-top:4px; }

/* Loading / empty */
.xlite-loading { display:flex; align-items:center; justify-content:center; padding:28px; color:var(--text-subtle); font-size:20px; }
.xlite-loading i { animation:spin 1s linear infinite; }
.xlite-empty { display:flex; flex-direction:column; align-items:center; gap:6px; padding:24px 16px; color:var(--text-subtle); font-size:12px; text-align:center; }
.xlite-empty i { font-size:26px; }

/* Incoming call notification */
#xlite-call-notif {
  position: fixed; bottom: 28px; left: 28px; z-index: 900;
  background: #0F172A; border: 1px solid #1D9E75;
  border-radius: 16px; padding: 14px 16px;
  display: flex; align-items: flex-start; gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
  min-width: 270px; max-width: 320px;
  animation: slideInLeft .3s ease;
}
@keyframes slideInLeft { from { transform:translateX(-120%); opacity:0; } to { transform:none; opacity:1; } }
.xlite-notif-icon { font-size: 32px; flex-shrink: 0; }
.xlite-notif-info { flex: 1; min-width: 0; }
.xlite-notif-label { font-size: 10px; font-weight: 600; color: #1D9E75; text-transform: uppercase; letter-spacing: .06em; }
.xlite-notif-name  { font-size: 15px; font-weight: 700; color: #fff; margin: 2px 0; }
.xlite-notif-num   { font-size: 12px; color: #9ca3af; }
.xlite-notif-view  { margin-top: 8px; height: 28px; padding: 0 10px; border: 0.5px solid #1D9E75; border-radius: 7px; background: rgba(29,158,117,.15); color: #1D9E75; font-size: 11px; font-weight: 600; cursor: pointer; font-family: var(--font); display: inline-flex; align-items: center; gap: 5px; }
.xlite-notif-view:hover { background: rgba(29,158,117,.3); }
.xlite-notif-nomatch { font-size: 11px; color: #6b7280; margin-top: 6px; }
.xlite-notif-close { width: 24px; height: 24px; border: none; background: rgba(255,255,255,.1); color: #9ca3af; border-radius: 50%; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.xlite-notif-close:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── XLite Dial Tab ─────────────────────────── */
.xlite-numpad {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; margin: 4px 0;
}
.xlite-key {
  height: 40px; border: 0.5px solid var(--border); border-radius: 9px;
  background: var(--bg-secondary); font-size: 16px; font-weight: 500;
  cursor: pointer; transition: all .12s; font-family: var(--font); color: var(--text);
}
.xlite-key:hover  { background: #E1F5EE; border-color: #0F6E56; color: #0F6E56; }
.xlite-key:active { transform: scale(.94); }

.xlite-call-btn {
  height: 42px; border: none; border-radius: 10px;
  background: #0F6E56; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 7px; font-family: var(--font); transition: all .15s; margin-top: 2px;
}
.xlite-call-btn:hover { background: #0a5440; }
.xlite-call-btn i { font-size: 17px; }

.xlite-dial-hint {
  font-size: 11px; color: var(--text-subtle);
  display: flex; align-items: center; gap: 5px;
  justify-content: center; margin-top: 4px;
}

.xlite-warn {
  font-size: 11px; color: #BA7517; background: #FAEEDA;
  border-radius: 7px; padding: 7px 10px;
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
}

/* ── XLite FAB shows even when not configured ─ */
#xlite-fab { display: flex !important; }

/* ═══════════════════════════════════════════════
   VONAGE PHONE PANEL
═══════════════════════════════════════════════ */
#vonage-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 600;
  width: 52px; height: 52px; border-radius: 50%;
  background: #E4135A; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 4px 18px rgba(228,19,90,.45);
  transition: transform .15s, box-shadow .15s;
}
#vonage-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(228,19,90,.55); }

#vonage-panel {
  position: fixed; bottom: 90px; right: 28px; z-index: 700;
  width: 320px; background: var(--bg-card);
  border: 0.5px solid var(--border); border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.22);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 580px;
}

.von-header {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 12px; background: #E4135A; cursor: grab; user-select: none; flex-shrink: 0;
}
.von-brand { display:flex; align-items:center; gap:6px; flex:1; font-size:13px; font-weight:600; color:#fff; }
.von-brand i { font-size:15px; }
.von-status-badge { font-size:10px; padding:2px 7px; border-radius:99px; font-weight:600; }
.von-status-badge.online  { background:rgba(255,255,255,.2); color:#fff; }
.von-status-badge.offline { background:rgba(0,0,0,.3); color:#ffb3b3; }
.von-close { width:24px; height:24px; border:none; background:rgba(255,255,255,.2); color:#fff; border-radius:50%; cursor:pointer; font-size:16px; display:flex; align-items:center; justify-content:center; }
.von-close:hover { background:rgba(255,255,255,.35); }
.von-tab-btn { border:none; background:rgba(255,255,255,.18); color:#fff; border-radius:6px; padding:3px 8px; font-size:11px; font-weight:500; cursor:pointer; font-family:var(--font); transition:all .15s; }
.von-tab-btn.active { background:rgba(255,255,255,.45); }

/* Active call bar */
#von-active-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: #1a0007;
  border-bottom: 0.5px solid rgba(228,19,90,.35); flex-shrink: 0;
}
.von-call-avatar { width:40px; height:40px; border-radius:50%; background:#E4135A; color:#fff; font-size:14px; font-weight:700; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.von-timer { font-size:20px; font-weight:700; color:#E4135A; margin:2px 0; font-variant-numeric:tabular-nums; }
.von-pulse-row { display:flex; align-items:center; gap:5px; font-size:11px; color:#9ca3af; }
.von-pulse { width:7px; height:7px; border-radius:50%; background:#E4135A; animation:pulse 1.1s ease infinite; flex-shrink:0; }
.von-end-btn  { height:30px; padding:0 10px; border:none; border-radius:7px; background:#EF4444; color:#fff; font-size:11px; font-weight:600; cursor:pointer; font-family:var(--font); display:flex; align-items:center; gap:4px; }
.von-miss-btn { height:30px; padding:0 10px; border:0.5px solid #4B5563; border-radius:7px; background:transparent; color:#9ca3af; font-size:11px; cursor:pointer; font-family:var(--font); display:flex; align-items:center; gap:4px; }

/* Tab content */
.von-tab { display:none; overflow-y:auto; flex:1; }
.von-tab.active { display:flex; flex-direction:column; }

.von-form { padding:12px; display:flex; flex-direction:column; gap:9px; }
.von-field { display:flex; flex-direction:column; gap:4px; }
.von-field label { font-size:10px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; }
.von-input {
  width:100%; height:34px; padding:0 10px;
  border:0.5px solid var(--border-strong); border-radius:var(--radius);
  font-size:12px; background:var(--bg-card); color:var(--text);
  outline:none; font-family:var(--font); box-sizing:border-box; transition:border .15s;
}
.von-input:focus { border-color:#E4135A; }
textarea.von-input { height:auto; padding:7px 10px; }

.von-numpad { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; }
.von-key { height:38px; border:0.5px solid var(--border); border-radius:9px; background:var(--bg-secondary); font-size:16px; font-weight:500; cursor:pointer; font-family:var(--font); color:var(--text); transition:all .1s; }
.von-key:hover  { background:#FEE7EF; border-color:#E4135A; color:#E4135A; }
.von-key:active { transform:scale(.93); }

.von-call-btn {
  height:42px; border:none; border-radius:10px;
  background:#E4135A; color:#fff; font-size:13px; font-weight:600;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  gap:7px; font-family:var(--font); transition:all .15s;
}
.von-call-btn:hover { background:#b50f48; }
.von-call-btn:disabled { background:#9ca3af; cursor:not-allowed; }
.von-call-btn i { font-size:16px; }

.von-warn { font-size:11px; color:#BA7517; background:#FAEEDA; border-radius:7px; padding:7px 10px; display:flex; align-items:center; gap:6px; }
.von-info { font-size:11px; color:#185FA5; background:#E6F1FB; border-radius:7px; padding:7px 10px; display:flex; align-items:center; gap:6px; }

/* Log tab */
#vt-tab-log { padding:4px; }
.von-log-row { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:8px; cursor:pointer; transition:background .12s; }
.von-log-row:hover { background:var(--bg-secondary); }
.von-log-icon { font-size:18px; flex-shrink:0; }
.von-log-info { flex:1; min-width:0; }
.von-log-name { font-size:12px; font-weight:500; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.von-log-meta { font-size:10px; color:#9ca3af; }

/* Settings */
.von-webhook-box { background:var(--bg-secondary); border:0.5px solid var(--border); border-radius:9px; padding:10px 12px; }
.von-webhook-url { font-size:10px; color:#E4135A; font-family:'Courier New',monospace; word-break:break-all; cursor:pointer; padding:4px 7px; background:#FEE7EF; border-radius:5px; margin-top:3px; }
.von-webhook-url:hover { opacity:.8; }
.von-howto { background:var(--primary-light); border:0.5px solid rgba(244,123,32,.18); border-radius:9px; padding:10px 12px; }

.von-loading { display:flex; align-items:center; justify-content:center; padding:28px; color:var(--text-subtle); font-size:20px; }
.von-loading i { animation:spin 1s linear infinite; }
.von-empty { display:flex; flex-direction:column; align-items:center; gap:6px; padding:24px; color:var(--text-subtle); font-size:12px; text-align:center; }
.von-empty i { font-size:26px; }

/* ═══════════════════════════════════════════════
   ZOIPER DIALER
═══════════════════════════════════════════════ */

/* ── FAB ──────────────────────────────────────── */
#zoiper-fab {
  position: fixed; bottom: 28px; right: 28px; z-index: 600;
  width: 56px; height: 56px; border-radius: 50%;
  background: #F47B20; color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  cursor: pointer; gap: 1px;
  box-shadow: 0 4px 20px rgba(244,123,32,.5);
  transition: transform .15s, box-shadow .15s;
  overflow: hidden;
}
#zoiper-fab:hover  { transform: scale(1.1); box-shadow: 0 6px 28px rgba(244,123,32,.6); }
#zoiper-fab:active { transform: scale(.95); }
#zoiper-fab i { font-size: 22px; }
.zoiper-fab-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid rgba(244,123,32,.35);
  animation: zoiper-ring 2s ease-in-out infinite;
}
@keyframes zoiper-ring {
  0%,100% { transform:scale(1); opacity:.6; }
  50%      { transform:scale(1.15); opacity:0; }
}

/* ── Panel ─────────────────────────────────────── */
#zoiper-panel {
  position: fixed; bottom: 96px; right: 28px; z-index: 700;
  width: 330px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 12px 48px rgba(0,0,0,.22), 0 2px 8px rgba(244,123,32,.12);
  overflow: hidden; display: flex; flex-direction: column;
  max-height: 620px;
}

/* ── Header ─────────────────────────────────────── */
.zp-header {
  background: linear-gradient(135deg, #F47B20 0%, #e05f00 100%);
  flex-shrink: 0;
}
.zp-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 8px; cursor: grab;
}
.zp-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff; flex-shrink: 0;
}
.zp-title    { font-size: 14px; font-weight: 700; color: #fff; }
.zp-subtitle { font-size: 10px; color: rgba(255,255,255,.75); }
.zp-status-pill {
  margin-left: auto; display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.2); color: #fff;
  border-radius: 99px; padding: 3px 9px; font-size: 11px; font-weight: 600;
}
.zp-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }

.zp-tabs-row {
  display: flex; align-items: center; gap: 3px;
  padding: 0 10px 10px;
}
.zp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 30px; border: none;
  background: rgba(255,255,255,.15); color: rgba(255,255,255,.8);
  border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 500;
  font-family: var(--font); transition: all .15s;
}
.zp-tab:hover  { background: rgba(255,255,255,.25); color: #fff; }
.zp-tab.active { background: rgba(255,255,255,.35); color: #fff; }
.zp-tab i { font-size: 13px; }
.zp-close-btn {
  width: 30px; height: 30px; border: none;
  background: rgba(0,0,0,.2); color: rgba(255,255,255,.8);
  border-radius: 8px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.zp-close-btn:hover { background: rgba(0,0,0,.35); color: #fff; }

/* ── Active call bar ─────────────────────────────── */
#zp-active-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: #1a0800;
  border-bottom: 0.5px solid rgba(244,123,32,.3);
  flex-shrink: 0;
}
.zp-av-lg {
  width: 44px; height: 44px; border-radius: 50%;
  background: #F47B20; color: #fff; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zp-active-name   { font-size: 13px; font-weight: 600; color: #fff; }
.zp-active-num    { font-size: 11px; color: #9ca3af; margin-top: 1px; }
.zp-active-timer  { font-size: 22px; font-weight: 700; color: #F47B20; margin: 3px 0 2px; font-variant-numeric: tabular-nums; }
.zp-active-status { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #9ca3af; }
.zp-pulse { width: 7px; height: 7px; border-radius: 50%; background: #F47B20; animation: pulse 1.1s ease infinite; flex-shrink: 0; }
.zp-active-actions { display: flex; flex-direction: column; gap: 5px; flex-shrink: 0; }
.zp-end-btn  {
  height: 32px; padding: 0 10px; border: none; border-radius: 8px;
  background: #EF4444; color: #fff; font-size: 11px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; gap: 4px;
}
.zp-miss-btn {
  height: 32px; padding: 0 10px; border: 0.5px solid #374151;
  border-radius: 8px; background: transparent; color: #9ca3af;
  font-size: 11px; cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; gap: 4px;
}

/* ── Tab bodies ─────────────────────────────────── */
.zp-tab-body { display: none; overflow-y: auto; flex: 1; }
.zp-tab-body.active { display: flex; flex-direction: column; }

/* ── Dial tab ─────────────────────────────────── */
.zp-display-wrap {
  padding: 14px 14px 6px;
  border-bottom: 0.5px solid var(--border);
}
.zp-display-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.zp-number-display {
  flex: 1; min-height: 42px; padding: 0 12px;
  background: var(--bg-secondary); border-radius: 10px;
  display: flex; align-items: center; cursor: text;
  border: 0.5px solid var(--border); font-variant-numeric: tabular-nums;
}
.zp-del-btn {
  width: 42px; height: 42px; border: 0.5px solid var(--border);
  border-radius: 10px; background: var(--bg-secondary);
  color: var(--text-muted); cursor: pointer; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: all .12s;
}
.zp-del-btn:hover { background: #FCEEE4; color: #F47B20; border-color: #F47B20; }

.zp-contact-card {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; background: #E1F5EE; border-radius: 9px;
  border: 0.5px solid #a0dfc0; margin-bottom: 4px;
}
.zp-contact-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: #0F6E56; color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zp-contact-name  { font-size: 13px; font-weight: 600; color: #0F6E56; }
.zp-contact-badge { font-size: 10px; color: #1D9E75; margin-top: 1px; }

/* ── Numpad ──────────────────────────────────── */
.zp-numpad {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 8px; padding: 10px 14px;
}
.zp-key {
  height: 52px; border: 0.5px solid var(--border);
  border-radius: 12px; background: var(--bg-card);
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px;
  transition: all .1s; font-family: var(--font);
}
.zp-key:hover  { background: #FCEEE4; border-color: #F47B20; }
.zp-key:active { transform: scale(.93); background: #FCEEE4; }
.zp-key-main { font-size: 20px; font-weight: 500; color: var(--text); line-height: 1; }
.zp-key-sub  { font-size: 7.5px; color: var(--text-subtle); letter-spacing: .5px; }

/* ── Call button row ──────────────────────────── */
.zp-call-row {
  display: flex; align-items: center; justify-content: center;
  gap: 20px; padding: 8px 14px 14px;
}
.zp-clear-btn {
  width: 42px; height: 42px; border: 0.5px solid var(--border);
  border-radius: 50%; background: var(--bg-secondary);
  color: var(--text-muted); cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; transition: all .12s;
}
.zp-clear-btn:hover { background: #FCEEE4; color: #F47B20; border-color: #F47B20; }

.zp-call-btn {
  width: 66px; height: 66px; border: none; border-radius: 50%;
  background: #F47B20; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(244,123,32,.45);
  transition: all .15s;
}
.zp-call-btn:hover  { background: #e05f00; transform: scale(1.06); }
.zp-call-btn:active { transform: scale(.94); }
.zp-call-ringing    { animation: zp-ring .5s ease-in-out 3; }
@keyframes zp-ring  { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12)} }
.zp-call-icon { font-size: 26px; color: #fff; }

.zp-info-bar {
  margin: 0 14px 8px; padding: 7px 10px;
  background: #FCEEE4; border-radius: 8px; border: 0.5px solid #F9C79E;
  font-size: 11px; color: #854F0B;
  display: flex; align-items: center; gap: 6px;
}
.zp-info-bar i { font-size: 13px; flex-shrink: 0; }

.zp-softphones { padding: 0 14px 12px; }
.zp-sp-label   { font-size: 10px; color: var(--text-subtle); margin-bottom: 5px; }
.zp-sp-list    { display: flex; flex-wrap: wrap; gap: 5px; }
.zp-sp-tag {
  font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 99px; border: 0.5px solid;
}

/* ── Log tab ─────────────────────────────────── */
#zt-tab-log { padding: 6px 0; }
.zp-log-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer; transition: background .1s;
  border-bottom: 0.5px solid var(--border);
}
.zp-log-item:last-child { border-bottom: none; }
.zp-log-item:hover { background: var(--bg-secondary); }
.zp-log-icon { font-size: 20px; flex-shrink: 0; }
.zp-log-info { flex: 1; min-width: 0; }
.zp-log-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zp-log-meta { font-size: 11px; color: var(--text-subtle); }
.zp-log-right { text-align: right; flex-shrink: 0; }
.zp-log-status { font-size: 10px; font-weight: 600; display: block; }
.zp-log-noted  { font-size: 9px; color: #1D9E75; display: block; margin-top: 2px; }

/* ── Add + Settings tabs ──────────────────────── */
.zp-form {
  padding: 14px; display: flex; flex-direction: column; gap: 10px;
}
.zp-frow { display: flex; flex-direction: column; gap: 4px; }
.zp-frow label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.zp-frow input, .zp-frow select, .zp-frow textarea {
  height: 34px; padding: 0 10px;
  border: 0.5px solid var(--border-strong); border-radius: var(--radius);
  font-size: 12px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font); width: 100%; box-sizing: border-box;
}
.zp-frow input:focus, .zp-frow select:focus, .zp-frow textarea:focus { border-color: #F47B20; }
.zp-frow textarea { height: auto; padding: 8px 10px; }
.zp-hint { font-size: 10px; color: var(--text-subtle); margin-top: 2px; }

.zp-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text); gap: 10px;
}
.zp-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.zp-switch input { opacity: 0; width: 0; height: 0; }
.zp-slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 22px; cursor: pointer; transition: .25s; }
.zp-slider::before { content:''; position:absolute; width:16px; height:16px; left:3px; bottom:3px; background:#fff; border-radius:50%; transition:.25s; }
input:checked + .zp-slider { background: #F47B20; }
input:checked + .zp-slider::before { transform: translateX(16px); }

.zp-save-btn {
  height: 38px; border: none; border-radius: 10px;
  background: #F47B20; color: #fff; font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  gap: 7px; font-family: var(--font); transition: background .15s;
}
.zp-save-btn:hover { background: #e05f00; }

/* Settings specifics */
.zp-settings-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: #FCEEE4;
  border-radius: 10px; border: 0.5px solid #F9C79E; margin-bottom: 4px;
}
.zp-settings-logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: #F47B20; display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
}

.zp-setup-box {
  background: var(--bg-secondary); border-radius: 10px;
  border: 0.5px solid var(--border); padding: 12px;
}
.zp-setup-title { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.zp-setup-list  { display: flex; flex-direction: column; gap: 7px; }
.zp-setup-step  { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-muted); }
.zp-step-num    {
  width: 20px; height: 20px; border-radius: 50%;
  background: #F47B20; color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.zp-link { color: #F47B20; font-weight: 600; text-decoration: none; }
.zp-link:hover { text-decoration: underline; }

.zp-providers-box { background: var(--bg-secondary); border-radius: 10px; border: 0.5px solid var(--border); padding: 12px; }
.zp-providers { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.zp-provider {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; background: var(--bg-card); border-radius: 8px;
  border: 0.5px solid var(--border); text-decoration: none; transition: border-color .12s;
}
.zp-provider:hover { border-color: #F47B20; }
.zp-provider-name  { font-size: 12px; font-weight: 600; color: var(--text); }
.zp-provider-price { font-size: 10px; color: var(--text-subtle); }

/* Post-call form */
.zp-post-call { padding: 12px 14px; }
.zp-post-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; margin-bottom: 8px;
}
.zp-post-dur { margin-left: auto; font-size: 11px; color: var(--text-subtle); }
.zp-post-textarea {
  width: 100%; height: 56px; padding: 7px 10px; resize: none;
  border: 0.5px solid var(--border-strong); border-radius: 8px;
  font-size: 12px; background: var(--bg-card); color: var(--text);
  outline: none; font-family: var(--font); box-sizing: border-box; margin-bottom: 8px;
}
.zp-post-textarea:focus { border-color: #F47B20; }
.zp-post-row { display: flex; gap: 6px; }
.zp-post-select {
  height: 34px; padding: 0 8px; border: 0.5px solid var(--border-strong);
  border-radius: 8px; background: var(--bg-card); color: var(--text);
  font-size: 12px; outline: none; font-family: var(--font);
}
.zp-skip-btn {
  height: 34px; padding: 0 12px; border: 0.5px solid var(--border);
  border-radius: 8px; background: var(--bg-secondary); color: var(--text-muted);
  font-size: 12px; cursor: pointer; font-family: var(--font); white-space: nowrap;
}

/* Loading / empty */
.zp-loading { display: flex; align-items: center; justify-content: center; padding: 32px; color: var(--text-subtle); font-size: 20px; }
.zp-loading i { animation: spin 1s linear infinite; }
.zp-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 14px; color: var(--text-subtle); font-size: 13px; text-align: center; }
.zp-empty i { font-size: 32px; }
.zp-empty-sub { font-size: 11px; color: var(--text-subtle); }

/* Vonage + XLite FABs hidden — Zoiper is primary phone */
#vonage-fab, #xlite-fab { display: none !important; }

/* ═══════════════════════════════════════════════
   AMICRM ORANGE & WHITE THEME — GLOBAL OVERRIDES
═══════════════════════════════════════════════ */

/* ── Page title bar ─────────────────────────── */
.topbar {
  background: #fff;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  color: #18181B;
}

/* ── Record filter bar ──────────────────────── */
.filter-bar {
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}

/* ── Table container ────────────────────────── */
.table-wrap {
  background: #fff;
  border: 1px solid rgba(0,0,0,.07);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.table-header {
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(0,0,0,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-header-title {
  font-size: 14px;
  font-weight: 600;
  color: #18181B;
}

/* ── Data table refinements ─────────────────── */
.data-table th {
  background: #FAFAF9 !important;
  color: #71717A !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .07em !important;
  padding: 11px 16px !important;
  border-bottom: 1px solid rgba(0,0,0,.07) !important;
}
.data-table td {
  padding: 11px 16px !important;
  border-bottom: 1px solid rgba(0,0,0,.05) !important;
  font-size: 13px;
  color: #27272A;
}
.data-table tr:last-child td { border-bottom: none !important; }
.data-table tbody tr { transition: background .1s; }
.data-table tbody tr:hover td {
  background: #FEF0E6 !important;
}

/* ── Add / action buttons in topbar ─────────── */
.btn[onclick*="openAddModal"],
.btn[onclick*="openModal"],
button.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(244,123,32,.28) !important;
}

/* ── Record count badge ─────────────────────── */
.records-count {
  font-size: 13px;
  color: #71717A;
  font-weight: 400;
}

/* ── Metric cards – orange accent on hover ── */
.metric-card {
  border-radius: 14px !important;
  transition: transform .15s, box-shadow .15s !important;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(244,123,32,.14) !important;
}
.metric-value { color: var(--primary) !important; }

/* ── Status pills – warm palette ─────────────── */
.status-pill, .stage-pill {
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Convert button ─────────────────────────── */
.btn-convert {
  background: #FEF0E6 !important;
  color: var(--primary) !important;
  border-color: rgba(244,123,32,.3) !important;
}
.btn-convert:hover {
  background: var(--primary) !important;
  color: #fff !important;
}

/* ── Modal header ───────────────────────────── */
.modal-header {
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #18181B;
}

/* ── Form fields inside modals ──────────────── */
.dyn-field label {
  font-size: 11px;
  font-weight: 600;
  color: #71717A;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 5px;
  display: block;
}
.dyn-field input:focus,
.dyn-field select:focus,
.dyn-field textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(244,123,32,.12) !important;
}

/* ── Login page ─────────────────────────────── */
.login-wrap {
  background: linear-gradient(135deg, #FEF0E6 0%, #fff8f4 50%, #fff 100%);
}
.login-card {
  border-radius: 18px !important;
  box-shadow: 0 8px 40px rgba(244,123,32,.12), 0 2px 8px rgba(0,0,0,.06) !important;
  border: 1px solid rgba(244,123,32,.15) !important;
}
.login-brand-icon {
  background: var(--primary) !important;
  box-shadow: 0 4px 14px rgba(244,123,32,.4) !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 12px !important;
  font-size: 20px !important;
}
.login-brand-name { font-weight: 700 !important; font-size: 20px !important; }
.btn-login {
  background: var(--primary) !important;
  box-shadow: 0 4px 14px rgba(244,123,32,.35) !important;
  border-radius: 10px !important;
  height: 46px !important;
  font-size: 15px !important;
}
.btn-login:hover {
  background: var(--primary-dark) !important;
  box-shadow: 0 6px 20px rgba(244,123,32,.45) !important;
}
.form-input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(244,123,32,.12) !important;
}
.demo-card:hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
}

/* ── Sidebar scrollbar ──────────────────────── */
.sb-nav::-webkit-scrollbar { width: 3px; }
.sb-nav::-webkit-scrollbar-track { background: transparent; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Active nav item orange left bar ────────── */
.sb-item.active {
  background: rgba(244,123,32,.16) !important;
  color: #FB923C !important;
}
.sb-item.active i { color: #FB923C !important; }

/* ── Zoiper FAB – keep orange brand ─────────── */
#zoiper-fab {
  background: var(--primary) !important;
  box-shadow: 0 4px 20px rgba(244,123,32,.5) !important;
}

/* ── Section headings inside pages ──────────── */
.section-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 10px;
}

/* ── Empty state ────────────────────────────── */
.act-empty i { color: rgba(244,123,32,.35) !important; }

/* ── Content scrollbar ───────────────────────── */
.content-area::-webkit-scrollbar { width: 5px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: rgba(244,123,32,.25); border-radius: 3px; }
.content-area::-webkit-scrollbar-thumb:hover { background: rgba(244,123,32,.45); }

/* ═══════════════════════════════════════════════
   ACTION BUTTONS + CLICKABLE ROWS
═══════════════════════════════════════════════ */

/* Clickable row */
.crm-row { transition: background .1s; }
.crm-row:hover td { background: #FEF0E6 !important; }
.crm-row:hover .actions-cell { opacity: 1; }
.actions-cell { opacity: .7; transition: opacity .15s; }
.crm-row:hover .actions-cell { opacity: 1; }

/* Base action button */
.act-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 9px; border-radius: 7px;
  font-size: 11px; font-weight: 600; cursor: pointer;
  border: 1px solid; font-family: var(--font);
  transition: all .15s; white-space: nowrap;
}
.act-btn i { font-size: 12px; }

/* Edit — subtle grey */
.act-btn-edit {
  background: #F4F4F5; color: #52525B;
  border-color: #D4D4D8;
}
.act-btn-edit:hover { background: #18181B; color: #fff; border-color: #18181B; }

/* Convert — orange */
.act-btn-convert {
  background: #FEF0E6; color: #F47B20;
  border-color: rgba(244,123,32,.35);
}
.act-btn-convert:hover { background: #F47B20; color: #fff; border-color: #F47B20;
  box-shadow: 0 2px 8px rgba(244,123,32,.35); }

/* SO — blue */
.act-btn-so {
  background: #EFF6FF; color: #2563EB;
  border-color: #BFDBFE;
}
.act-btn-so:hover { background: #2563EB; color: #fff; border-color: #2563EB; }

/* PO — green */
.act-btn-po {
  background: #F0FDF4; color: #16A34A;
  border-color: #BBF7D0;
}
.act-btn-po:hover { background: #16A34A; color: #fff; border-color: #16A34A; }

/* PDF — amber */
.act-btn-pdf {
  background: #FFFBEB; color: #D97706;
  border-color: #FDE68A;
}
.act-btn-pdf:hover { background: #D97706; color: #fff; border-color: #D97706; }

/* Delete — red */
.act-btn-del {
  background: #FFF1F2; color: #E11D48;
  border-color: #FECDD3;
}
.act-btn-del:hover { background: #E11D48; color: #fff; border-color: #E11D48; }

/* Converted badge */
.act-badge { display: inline-flex; align-items: center; gap: 4px;
  height: 24px; padding: 0 9px; border-radius: 99px;
  font-size: 11px; font-weight: 600; }
.act-badge-done { background: #F0FDF4; color: #16A34A; border: 1px solid #BBF7D0; }
.act-badge i { font-size: 11px; }
