*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sidebar-w: 216px;
  --topbar-h: 54px;

  /* Page & surfaces */
  --bg:       #f4f3ef;
  --surface:  #ffffff;
  --surface2: #f7f6f2;
  --surface3: #eeede9;
  --border:   #ebebE7;

  /* Text */
  --text:  #1a1a35;
  --text2: #6b7280;
  --text3: #9ca3af;

  /* Brand / accent (navy — buttons, focus rings, active nav) */
  --accent:      #1a1a35;
  --accent2:     #2d2d5e;
  --accent-glow: rgba(26,26,53,0.12);

  /* Semantic */
  --green:      #16a34a;
  --green-dim:  #edfdf5;
  --red:        #dc2626;
  --red-dim:    #fff1f0;
  --yellow:     #ca8a04;
  --yellow-dim: #fefce8;
  --blue-dim:   #f0f0f8;

  --radius:    10px;
  --radius-sm: 7px;
  --shadow:    0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
}

/* ── INPUTS ─────────────────────────────────────────────── */
input[type="text"], input[type="search"], input[type="date"], input[type="time"],
input[type="number"], input[type="email"], input[type="password"], input[type="tel"],
input:not([type]), select, textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, input[type="search"]:focus, input[type="date"]:focus,
input[type="time"]:focus, input[type="number"]:focus, input[type="email"]:focus,
input[type="password"]:focus, input[type="tel"]:focus,
input:not([type]):focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input::placeholder { color: var(--text3); }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: opacity(0.45); cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer;
}

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.brand-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-icon svg { width: 14px; height: 14px; }
.brand-name {
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--text); letter-spacing: -.3px;
}
.brand-tag {
  font-size: 9px; color: var(--text3);
  font-weight: 500; letter-spacing: .3px;
}

.nav-section { padding: 12px 10px 2px; }
.nav-label {
  font-size: 9.5px; font-weight: 600; color: var(--text3);
  letter-spacing: .6px; text-transform: uppercase;
  padding: 0 8px; margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  color: var(--text2);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 450;
  transition: all .12s;
  cursor: pointer;
  margin-bottom: 1px;
}
.nav-item i {
  font-size: 15px;
  color: var(--text3);
  flex-shrink: 0;
  transition: color .12s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item:hover i { color: var(--text2); }
.nav-item.active {
  background: var(--surface2);
  color: var(--text);
  font-weight: 600;
}
.nav-item.active i { color: var(--text); }

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--border);
}
.fs-badge {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 12px;
  font-size: 11.5px; color: var(--text2);
}
.pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text3); flex-shrink: 0;
}
.pulse.on  { background: var(--green); box-shadow: 0 0 0 3px var(--green-dim); animation: blink 2s infinite; }
.pulse.off { background: var(--red); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── AI AGENT SIDEBAR NAV ────────────────────────────────── */
.aia-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  color: #6b7280;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
  transition: background .12s, color .12s;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.aia-nav-item i { font-size: 14px; color: #9ca3af; flex-shrink: 0; transition: color .12s; }
.aia-nav-item:hover { background: #f7f6f2; color: #1a1a35; }
.aia-nav-item:hover i { color: #1a1a35; }
.aia-nav-item.aia-nav-active { background: #f0f0f8; color: #1a1a35; font-weight: 500; }
.aia-nav-item.aia-nav-active i { color: #1a1a35; }
.aia-nav-badge {
  margin-left: auto;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 10px;
  background: #f0f0f8;
  color: #6b7280;
  font-weight: 500;
  flex-shrink: 0;
}

/* ── TOPBAR ──────────────────────────────────────────────── */
.main-wrap {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  position: sticky; top: 0; z-index: 40;
}
.page-title {
  font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700;
  color: var(--text); letter-spacing: -.3px;
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-stat {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 12px;
}
.ts-num  { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ts-label{ font-size: 9px; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; font-weight: 600; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

/* ── PAGES ───────────────────────────────────────────────── */
.page-container { padding: 20px 22px; flex: 1; }
.page { display: none; }
.page.active { display: block; }

/* ── KPI ROW ─────────────────────────────────────────────── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.kpi-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: none;
}
/* remove old colored top bar */
.kpi-card::before { display: none; }

.kpi-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px; font-size: 14px;
}
.kpi-num  { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; letter-spacing: -.5px; }
.kpi-label{ font-size: 11px; color: var(--text3); margin-top: 5px; font-weight: 500; }
.kpi-sub  { font-size: 10px; color: var(--text3); margin-top: 4px; }

/* ── STAT PILL STRIP ─────────────────────────────────────── */
.stat-pill-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stat-pill {
  flex: 1 1 150px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: var(--shadow);
  border: none;
}
.stat-pill-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.stat-pill-num  { font-size: 17px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-pill-label{ font-size: 10.5px; color: var(--text3); font-weight: 500; white-space: nowrap; }

/* ── CHART CARD ──────────────────────────────────────────── */
.chart-card-body { padding: 16px; }
.chart-legend { display: flex; gap: 16px; margin-top: 10px; font-size: 11px; color: var(--text3); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

/* ── PANELS ──────────────────────────────────────────────── */
.panel {
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.panel-title { font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: -.1px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.filter-row { display: flex; align-items: center; gap: 8px; }
.filter-row select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 5px 9px; border-radius: var(--radius-sm); font-size: 11.5px;
}

/* ── DATA TABLE ──────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  text-align: left; padding: 9px 16px;
  font-size: 10.5px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.data-table tbody td {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
  font-size: 12.5px;
}
.data-table tbody tr:nth-child(even) td { background: transparent; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--surface2); }
.data-table tbody tr.empty td { color: var(--text3); text-align: center; padding: 36px; }
.mono { font-family: 'Courier New', monospace; font-size: 11.5px; color: var(--text2); }

/* ── EMPTY STATE ─────────────────────────────────────────── */
.empty-state {
  display: flex; align-items: center; justify-content: center;
  padding: 36px; color: var(--text3); font-size: 12px;
}

/* ── BADGES ──────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 20px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .1px;
}
.badge-green  { background: var(--green-dim);  color: var(--green); }
.badge-red    { background: var(--red-dim);    color: var(--red); }
.badge-blue   { background: var(--blue-dim);   color: var(--accent2); }
.badge-yellow { background: var(--yellow-dim); color: var(--yellow); }
.badge-gray   { background: var(--surface3);   color: var(--text2); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); padding: 7px 14px;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 500; cursor: pointer;
  transition: background .12s, color .12s; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn:hover { background: var(--surface3); color: var(--text); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent); color: #fff;
  border: none; padding: 7px 16px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn-primary:hover { opacity: .85; }

.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border); padding: 7px 14px;
  border-radius: var(--radius-sm); font-size: 12.5px; cursor: pointer;
  transition: background .12s, color .12s;
}
.btn-ghost:hover { background: var(--surface2); color: var(--text); }

.btn-danger {
  background: var(--red-dim); color: var(--red);
  border: 1px solid transparent; padding: 5px 11px;
  border-radius: var(--radius-sm); font-size: 11.5px; cursor: pointer; font-weight: 600;
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-del {
  background: var(--red-dim); color: var(--red);
  border: 1px solid transparent; padding: 5px 11px;
  border-radius: var(--radius-sm); font-size: 11.5px; cursor: pointer; font-weight: 600;
}
.btn-del:hover { background: var(--red); color: #fff; }

.btn-edit {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); padding: 5px 11px;
  border-radius: var(--radius-sm); font-size: 11.5px; cursor: pointer; font-weight: 600;
}
.btn-edit:hover { background: var(--surface3); color: var(--text); }

.btn-refresh {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); padding: 5px 11px;
  border-radius: var(--radius-sm); font-size: 11.5px; cursor: pointer;
}
.btn-refresh:hover { background: var(--surface3); color: var(--text); }

.btn-sec {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); padding: 7px 14px;
  border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, color .12s;
  white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
}
.btn-sec:hover { background: var(--surface3); color: var(--text); }

.btn-xs {
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border); padding: 4px 10px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  transition: background .12s, color .12s;
}
.btn-xs:hover { background: var(--surface3); color: var(--text); }

.btn-sm {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 10px; font-size: 11px; cursor: pointer; color: var(--text2); margin-left: 8px;
}
.btn-sm:hover { background: var(--surface3); color: var(--text); }

.action-btns { display: flex; gap: 6px; }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(26,26,53,.2); z-index: 200;
  align-items: center; justify-content: center;
  backdrop-filter: blur(3px);
}
#confirmBg { z-index: 9999; }
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 500px; max-width: 95vw;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 8px 40px rgba(0,0,0,.12);
  animation: pop .16s ease;
}
.confirm-modal { width: 360px; }
@keyframes pop { from{transform:scale(.96);opacity:0} to{transform:scale(1);opacity:1} }
.modal-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 600; color: var(--text);
}
.modal-x {
  background: none; border: none; color: var(--text3);
  font-size: 15px; cursor: pointer; padding: 4px;
  border-radius: 5px;
}
.modal-x:hover { color: var(--text); background: var(--surface2); }
.modal-bd { padding: 18px; overflow-y: auto; flex: 1; }
.modal-bd p { color: var(--text2); font-size: 13px; }
.modal-ft {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border);
}

/* ── FORM ────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 10.5px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .4px;
}
.field input, .field select, .field textarea {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 11px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-family: inherit; transition: border-color .15s;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.field input::placeholder { color: var(--text3); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 0;
}
.toggle-label { font-size: 13px; color: var(--text); }
.toggle-sub   { font-size: 11px; color: var(--text3); }
.toggle { position: relative; display: inline-block; width: 36px; height: 20px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; background: var(--surface3);
  border-radius: 20px; cursor: pointer; transition: .2s;
}
.slider::before {
  content: ''; position: absolute;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; left: 3px; top: 3px; transition: .2s;
}
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider::before { transform: translateX(16px); }

/* ── IVR BUILDER ─────────────────────────────────────────── */
.ivr-builder { display: flex; flex-direction: column; gap: 8px; }
.ivr-row { display: grid; grid-template-columns: 56px 1fr 1fr 32px; gap: 8px; align-items: center; }
.ivr-row input, .ivr-row select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 7px 10px; border-radius: var(--radius-sm); font-size: 12px;
}
.btn-rm-row  { background: none; border: none; color: var(--text3); font-size: 18px; cursor: pointer; text-align: center; }
.btn-rm-row:hover { color: var(--red); }
.btn-add-row {
  width: 100%; background: var(--surface2); border: 1px dashed var(--border);
  color: var(--text3); padding: 8px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 12px; margin-top: 4px;
}
.btn-add-row:hover { border-color: var(--accent); color: var(--accent); }
.ivr-header { display: grid; grid-template-columns: 56px 1fr 1fr 32px; gap: 8px; margin-bottom: 2px; }
.ivr-header span { font-size: 10px; color: var(--text3); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

/* ── LIVE CHANNEL ROWS ───────────────────────────────────── */
.channel-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.channel-row:last-child { border-bottom: none; }
.ch-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--green-dim); display: flex; align-items: center; justify-content: center; color: var(--green); font-size: 14px; flex-shrink: 0; }
.ch-info { flex: 1; }
.ch-main { font-size: 13px; font-weight: 500; }
.ch-sub  { font-size: 11px; color: var(--text3); }
.ch-dur  { font-size: 13px; font-weight: 600; color: var(--text2); }

/* ── RECENT ACTIVITY ─────────────────────────────────────── */
.activity-row { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--border); }
.activity-row:last-child { border-bottom: none; }
.act-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.act-info { flex: 1; }
.act-main { font-size: 13px; }
.act-sub  { font-size: 11px; color: var(--text3); }
.act-time { font-size: 11px; color: var(--text3); white-space: nowrap; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  padding: 11px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none; z-index: 999;
  transition: opacity .2s, transform .2s;
  transform: translateY(8px);
  background: var(--text); color: #fff;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok  { background: var(--green); }
.toast.err { background: var(--red); }

/* ── TENANT SWITCHER ─────────────────────────────────────── */
.ts-wrap { position: relative; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.ts-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 8px 10px; border-radius: 7px;
  font-size: 12px; font-weight: 500; cursor: pointer;
}
.ts-btn:hover { border-color: var(--accent); }
.ts-dropdown {
  display: none; position: absolute; top: calc(100% - 4px); left: 10px; right: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow-md); z-index: 200; max-height: 240px; overflow-y: auto;
}
.ts-dropdown.open { display: block; }
.ts-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12px; cursor: pointer; color: var(--text2); border-bottom: 1px solid var(--border); }
.ts-item:last-child { border-bottom: none; }
.ts-item:hover { background: var(--surface2); color: var(--text); }
.ts-item.active { color: var(--accent); background: var(--blue-dim); }

/* ── USER MENU ───────────────────────────────────────────── */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 10px 5px 5px; cursor: pointer; color: var(--text);
  transition: background .12s;
}
.user-btn:hover { background: var(--surface2); }
.user-info { text-align: left; }
.user-name  { font-size: 12px; font-weight: 600; line-height: 1.2; }
.user-email { font-size: 10px; color: var(--text3); }
.user-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 9px; min-width: 140px; box-shadow: var(--shadow-md); z-index: 200;
}
.user-dropdown.open { display: block; }
.ud-item {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px; background: none; border: none;
  color: var(--text2); font-size: 13px; cursor: pointer;
}
.ud-item:hover { background: var(--surface2); color: var(--red); }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 10px; }

/* ── SOFTPHONE PANEL ─────────────────────────────────────── */
.softphone-panel {
  display: none; position: fixed; bottom: 24px; right: 24px;
  width: 280px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md); z-index: 9000; overflow: hidden;
}
.softphone-panel.visible { display: block; }
.sp-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--surface2); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600;
}
.sp-panel-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.sp-panel-close:hover { background: var(--surface3); color: var(--text); }
.sp-status-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--text2); }
.sp-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--text3); }
.sp-dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.sp-dot.calling,.sp-dot.ringing { background: var(--yellow); animation: sp-blink .6s infinite; }
.sp-dot.incall { background: var(--accent); }
@keyframes sp-blink { 0%,100%{opacity:1} 50%{opacity:.2} }
.sp-caller-info { text-align: center; margin-bottom: 10px; }
.sp-caller-name { font-size: 15px; font-weight: 600; }
.sp-caller-num  { font-size: 12px; color: var(--text3); margin-top: 2px; }
.sp-timer { font-size: 13px; color: var(--text2); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sp-input-row { display: flex; gap: 6px; margin-bottom: 8px; }
.sp-input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; color: var(--text); font-size: 14px; }
.sp-input:focus { outline: none; border-color: var(--accent); }
.sp-clear { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; color: var(--text2); cursor: pointer; font-size: 13px; }
.sp-clear:hover { background: var(--surface3); }
.sp-dialpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.sp-key { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 6px; font-size: 16px; font-weight: 600; color: var(--text); cursor: pointer; transition: background .1s; }
.sp-key:hover { background: var(--surface3); }
.sp-key:active { background: var(--accent); color: #fff; }
.sp-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.sp-btn { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text); transition: background .15s; }
.sp-btn:hover { background: var(--surface3); }
.sp-btn-call   { background: var(--green); color: #fff; border-color: var(--green); }
.sp-btn-call:hover { filter: brightness(1.1); }
.sp-btn-hangup { background: var(--red); color: #fff; border-color: var(--red); }
.sp-btn-hangup:hover { filter: brightness(1.1); }
.sp-btn-answer { background: var(--green); color: #fff; border-color: var(--green); }

/* ── BUSINESS HOURS ──────────────────────────────────────── */
.bh-day-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.bh-day-row:last-child { border-bottom: none; }
.bh-day-label { width: 60px; font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ── GRID ────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── INFO ROW ────────────────────────────────────────────── */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row span:first-child { color: var(--text2); }

/* ── REPORT TABS ─────────────────────────────────────────── */
.rpt-tab-bar {
  display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: visible;
  gap: 2px; padding-bottom: 0; scrollbar-width: none; min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.rpt-tab-bar::-webkit-scrollbar { display: none; }
.rpt-tab {
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap; border: none; border-radius: 8px 8px 0 0;
  padding: 7px 12px 10px; font-size: 12px; font-weight: 500;
  cursor: pointer; color: var(--text2);
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px; position: relative;
  transition: color .15s, background .15s;
  flex-shrink: 0;
}
.rpt-tab .rpt-icon { font-size: 13px; line-height: 1; }
.rpt-tab:hover { background: var(--surface2); color: var(--text); }
.rpt-tab.active { background: var(--surface2); color: var(--text); font-weight: 600; border-bottom-color: var(--accent); box-shadow: none; }
.rpt-tab-divider { width: 1px; background: var(--border); margin: 6px 2px; flex-shrink: 0; }
