/* ============================================================
   CRM Dialer — Main Stylesheet
   ============================================================ */

:root {
  --primary:     #6366f1;
  --primary-d:   #4f46e5;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #3b82f6;

  --sidebar-w:   240px;
  --sidebar-bg:  #0f172a;
  --sidebar-txt: #94a3b8;
  --sidebar-act: #6366f1;

  --bg:          #f1f5f9;
  --surface:     #ffffff;
  --border:      #e2e8f0;
  --text:        #1e293b;
  --text-muted:  #64748b;

  --radius:      0.5rem;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg:   0 4px 20px rgba(0,0,0,.12);
  --transition:  .18s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-d); }
img { max-width: 100%; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: .6rem .9rem; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--bg); }
tr:hover td { background: #f8fafc; }

/* ── Typography ── */
h1 { font-size: 1.5rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1.1rem; font-weight: 600; }
small { font-size: .8rem; color: var(--text-muted); }
.icon, .app-icon, .title-icon, .label-icon, .icon-sm {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}
.app-icon { width: 1.35rem; height: 1.35rem; color: var(--success); }
.title-icon { width: 1.45rem; height: 1.45rem; color: var(--primary); vertical-align: -.2rem; }
.label-icon { width: .95rem; height: .95rem; vertical-align: -.15rem; color: var(--text-muted); }
.icon-sm { width: .95rem; height: .95rem; vertical-align: -.15rem; }
.icon-link { color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; }
.icon-link:hover { color: #fff; }
.btn .icon,
.nav-item .icon,
.topbar .icon,
.stat-icon .icon,
.avatar-sm .icon,
.recording-consent-icon .icon,
.call-recording-note .icon {
  width: 1rem;
  height: 1rem;
}
.stat-icon .icon {
  width: 1.25rem;
  height: 1.25rem;
}

/* ── App Shell ── */
.app-shell { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; z-index: 200;
  transition: transform var(--transition);
}
.sidebar-brand {
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand h1 {
  color: #fff; font-size: 1.1rem;
  display: flex; align-items: center; gap: .5rem;
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.nav-section { font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  color: rgba(255,255,255,.3); padding: .75rem 1.25rem .3rem; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: .7rem;
  padding: .6rem 1.25rem; color: var(--sidebar-txt);
  transition: background var(--transition), color var(--transition);
  cursor: pointer; font-size: .88rem; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(99,102,241,.18); color: var(--sidebar-act);
  border-right: 3px solid var(--sidebar-act); }
.nav-item .icon { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.sidebar-footer { padding: 1rem 1.25rem; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-user { display: flex; align-items: center; gap: .7rem; }
.sidebar-user .avatar { width: 34px; height: 34px; border-radius: 50%;
  background: var(--primary); color: #fff; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; overflow: hidden; }
.sidebar-user .avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user .info { flex: 1; overflow: hidden; }
.sidebar-user .info .name { color: #fff; font-size: .85rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .info .role { color: var(--sidebar-txt); font-size: .72rem; }

/* ── Main Content ── */
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* ── Topbar ── */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: .75rem 1.5rem; display: flex; align-items: center; gap: 1rem;
  position: sticky; top: 0; z-index: 100;
}
.topbar-menu-btn { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: .25rem; }
.topbar-title { font-weight: 600; font-size: 1rem; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: .75rem; }
.notif-btn { position: relative; background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: .25rem; display: inline-flex; align-items: center; }
.notif-badge { position: absolute; top: -2px; right: -2px; background: var(--danger);
  color: #fff; font-size: .65rem; font-weight: 700; min-width: 1rem; height: 1rem;
  border-radius: .5rem; display: flex; align-items: center; justify-content: center;
  padding: 0 .25rem; }

/* ── Page Content ── */
.page { padding: 1.5rem; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.35rem; }

/* ── Cards ── */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card-header { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.card-title { font-weight: 600; font-size: .95rem; }
.card-title, .page-header h1 {
  display: flex;
  align-items: center;
  gap: .45rem;
}

/* ── Stat Cards ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.25rem; display: flex; align-items: flex-start; gap: 1rem; }
.stat-icon { width: 44px; height: 44px; border-radius: .5rem; display: flex;
  align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-icon.indigo  { background: rgba(99,102,241,.12); color: var(--primary); }
.stat-icon.green   { background: rgba(34,197,94,.12);  color: var(--success); }
.stat-icon.amber   { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.red     { background: rgba(239,68,68,.12);  color: var(--danger); }
.stat-icon.blue    { background: rgba(59,130,246,.12); color: var(--info); }
.stat-info .value  { font-size: 1.6rem; font-weight: 700; line-height: 1.2; }
.stat-info .label  { font-size: .78rem; color: var(--text-muted); margin-top: .1rem; }
.stat-info .change { font-size: .75rem; margin-top: .25rem; }
.change.up   { color: var(--success); }
.change.down { color: var(--danger); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem;
  border-radius: var(--radius); border: none; cursor: pointer; font-size: .88rem;
  font-weight: 500; transition: all var(--transition); text-decoration: none; white-space: nowrap; }
.btn-sm { padding: .35rem .7rem; font-size: .8rem; }
.btn-lg { padding: .7rem 1.4rem; font-size: 1rem; }
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); color: #fff; }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #16a34a; color: #fff; }
.btn-danger    { background: var(--danger);  color: #fff; }
.btn-danger:hover  { background: #dc2626; color: #fff; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-info      { background: var(--info);    color: #fff; }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); color: var(--text); }
.btn-ghost     { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-call      { background: var(--success); color: #fff; border-radius: 2rem; font-weight: 700; }
.btn-call:hover { background: #16a34a; color: #fff; }
.btn-soft { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.16); }
.btn-soft:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .35rem; }
.form-control { width: 100%; padding: .55rem .85rem; border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .9rem; background: var(--surface);
  transition: border-color var(--transition), box-shadow var(--transition); outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.form-control.is-invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: .78rem; margin-top: .25rem; }
.form-hint  { color: var(--text-muted); font-size: .78rem; margin-top: .25rem; }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%2364748b' d='M4.427 6.427l3.396 3.396a.25.25 0 00.354 0l3.396-3.396A.25.25 0 0011.396 6H4.604a.25.25 0 00-.177.427z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .75rem center; background-size: 1rem; padding-right: 2.25rem; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.form-row   { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 0; }
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }

/* ── Badges ── */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem;
  border-radius: 2rem; font-size: .72rem; font-weight: 600; }
.badge-primary  { background: rgba(99,102,241,.12);  color: var(--primary); }
.badge-success  { background: rgba(34,197,94,.12);   color: #16a34a; }
.badge-warning  { background: rgba(245,158,11,.12);  color: #d97706; }
.badge-danger   { background: rgba(239,68,68,.12);   color: #dc2626; }
.badge-info     { background: rgba(59,130,246,.12);  color: #2563eb; }
.badge-gray     { background: rgba(100,116,139,.12); color: #475569; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table-actions { display: flex; gap: .4rem; }

/* ── Filters Bar ── */
.filters-bar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.filters-bar .form-control { max-width: 200px; }
.search-box { position: relative; flex: 1; max-width: 320px; }
.search-box input { padding-left: 2.25rem; }
.search-box .search-icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* ── Pagination ── */
.pagination { display: flex; gap: .35rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.page-link { padding: .4rem .7rem; border-radius: var(--radius); border: 1px solid var(--border);
  font-size: .85rem; color: var(--text-muted); transition: all var(--transition); }
.page-link:hover { background: var(--bg); color: var(--text); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-info { font-size: .82rem; color: var(--text-muted); }

/* ── Flash Messages ── */
.alert { padding: .85rem 1.1rem; border-radius: var(--radius); margin-bottom: 1rem;
  display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.alert-success { background: rgba(34,197,94,.1);  color: #166534; border-left: 4px solid var(--success); }
.alert-error   { background: rgba(239,68,68,.1);  color: #991b1b; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(245,158,11,.1); color: #92400e; border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(59,130,246,.1); color: #1e40af; border-left: 4px solid var(--info); }

/* ── Dialer Panel ── */
.dialer-panel { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 999; }
.dialer-fab { width: 56px; height: 56px; border-radius: 50%; background: var(--success);
  color: #fff; border: none; cursor: pointer; font-size: 1.5rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center; transition: all .2s; }
.dialer-fab:hover { transform: scale(1.08); background: #16a34a; }
.dialer-card { position: absolute; bottom: 70px; right: 0; width: 300px;
  background: var(--surface); border-radius: 1rem; box-shadow: var(--shadow-lg);
  padding: 1.25rem; display: none; }
.dialer-card.open { display: block; }
.dialer-lead-name { font-weight: 700; font-size: 1.05rem; margin-bottom: .25rem; }
.dialer-phone { font-size: 1.3rem; color: var(--text-muted); font-family: monospace; margin-bottom: 1rem; }
.dialer-timer { font-size: 1.8rem; font-weight: 700; font-family: monospace; text-align: center;
  color: var(--primary); letter-spacing: .08em; padding: .75rem 0; }
.dialer-actions { display: flex; gap: .5rem; justify-content: center; margin-bottom: 1rem; }
.dialer-btn { width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.dialer-btn.call  { background: var(--success); color: #fff; width: 56px; height: 56px; font-size: 1.4rem; }
.dialer-btn.end   { background: var(--danger);  color: #fff; width: 56px; height: 56px; font-size: 1.4rem; }
.dialer-btn.mute  { background: var(--bg); color: var(--text); }
.dialer-btn.note  { background: var(--bg); color: var(--text); }

/* ── Call Log Form ── */
.call-log-card { max-width: 720px; }
.call-session-card {
  background: linear-gradient(135deg,#0f172a,#1e293b);
  color: #fff;
  max-width: 900px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.call-session-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.call-session-name { font-size: 1.3rem; font-weight: 700; }
.call-session-phone { font-size: 1.1rem; opacity: .84; margin-top: .25rem; font-family: monospace; }
.call-session-meta { font-size: .85rem; opacity: .68; margin-top: .15rem; }
.call-session-actions { text-align: center; }
.call-session-hint { font-size: .75rem; opacity: .7; margin-top: .4rem; }
.call-recording-note {
  max-width: 900px;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(245,158,11,.32);
  background: rgba(245,158,11,.1);
  color: #92400e;
  font-size: .84rem;
}
.call-recording-note strong {
  display: block;
  color: #78350f;
  margin-bottom: .15rem;
}
.call-recording-note span {
  display: block;
}
.recording-upload-panel {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 300px);
  gap: 1rem;
  align-items: center;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}
.call-recorder-panel {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,.12);
  text-align: center;
}
.call-recorder-panel .dialer-timer { color: #a5b4fc; }
.recording-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: .78rem;
  margin: .25rem 0 .75rem;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.82);
}
.recording-status.recording {
  color: #fecaca;
  background: rgba(239,68,68,.18);
}
.recording-status.saved {
  color: #bbf7d0;
  background: rgba(34,197,94,.18);
}
.recording-status.error {
  color: #fde68a;
  background: rgba(245,158,11,.18);
}
.recorder-actions {
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.recording-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15,23,42,.68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.recording-consent-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
}
.recording-consent-icon {
  width: 46px;
  height: 46px;
  border-radius: .5rem;
  color: var(--primary);
  background: rgba(99,102,241,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .85rem;
}
.recording-consent-icon .icon { width: 1.35rem; height: 1.35rem; }
.recording-script {
  margin: .85rem 0 1rem;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}
.recording-confirm {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-size: .88rem;
  color: var(--text);
}
.recording-confirm input { width: 1rem; height: 1rem; }
.form-actions.compact { margin-top: 1rem; padding-top: 1rem; }
.disposition-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .5rem; }
.disposition-option { display: none; }
.disposition-label { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem;
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer;
  font-size: .83rem; font-weight: 500; transition: all .15s; }
.disposition-label:hover { border-color: var(--primary); }
.disposition-option:checked + .disposition-label { border-color: var(--primary);
  background: rgba(99,102,241,.08); color: var(--primary); }
.dispo-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* ── Pipeline Board ── */
.pipeline-board { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; }
.pipeline-col { min-width: 220px; flex-shrink: 0; }
.pipeline-col-header { padding: .65rem .9rem; border-radius: var(--radius) var(--radius) 0 0;
  font-size: .82rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; color: #fff; }
.pipeline-col-body { background: var(--bg); border: 1px solid var(--border);
  border-top: none; border-radius: 0 0 var(--radius) var(--radius); padding: .5rem;
  min-height: 200px; display: flex; flex-direction: column; gap: .4rem; }
.pipeline-card { background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .75rem; cursor: pointer;
  transition: transform .15s, box-shadow .15s; font-size: .83rem; }
.pipeline-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.pipeline-card .name { font-weight: 600; margin-bottom: .25rem; }
.pipeline-card .phone { color: var(--text-muted); font-family: monospace; font-size: .78rem; }
.pipeline-card .meta { display: flex; justify-content: space-between; margin-top: .4rem; }

/* ── Auth Layout ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); padding: 1rem; }
.auth-card { background: var(--surface); border-radius: 1rem; box-shadow: var(--shadow-lg);
  padding: 2.5rem; width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-logo h1 { font-size: 1.75rem; color: var(--primary); }
.auth-logo p  { color: var(--text-muted); font-size: .88rem; margin-top: .25rem; }
.auth-card h2 { font-size: 1.25rem; margin-bottom: 1.5rem; text-align: center; }

/* ── Real-time board ── */
.realtime-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.agent-live-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1rem; display: flex; align-items: center; gap: .85rem; position: relative; }
.agent-live-card .status-dot { width: 10px; height: 10px; border-radius: 50%;
  position: absolute; top: .75rem; right: .75rem; }
.status-dot.online   { background: var(--success); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.status-dot.on-call  { background: var(--warning);  box-shadow: 0 0 0 3px rgba(245,158,11,.2); animation: pulse 1.5s infinite; }
.status-dot.offline  { background: #94a3b8; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* ── Audio Player ── */
.audio-player { display: flex; align-items: center; gap: .75rem; background: var(--bg);
  padding: .5rem .85rem; border-radius: 2rem; }
.audio-player audio { flex: 1; height: 36px; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .sidebar {
    width: min(86vw, 310px);
    z-index: 10001;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  body { background: #f8fafc; }
  html { font-size: 14px; }
  .topbar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: .5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    flex-shrink: 0;
  }
  .topbar-menu-btn .icon {
    width: 1.35rem;
    height: 1.35rem;
  }
  .topbar {
    padding: .65rem .85rem;
    gap: .65rem;
  }
  .topbar-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar-actions {
    gap: .4rem;
  }
  .topbar-actions .btn {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 10000; }
  .sidebar-overlay.show { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
  .stat-card { padding: .85rem; gap: .7rem; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-icon .icon { width: 1.05rem; height: 1.05rem; }
  .stat-info .value { font-size: 1.25rem; }
  .page { padding: .85rem; }
  .btn .icon {
    width: .95rem;
    height: .95rem;
  }
  .title-icon {
    width: 1.15rem;
    height: 1.15rem;
  }
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: .75rem;
    margin-bottom: 1rem;
  }
  .page-header h1 { font-size: 1.2rem; }
  .page-header .btn,
  .page-header .d-flex {
    width: 100%;
  }
  .page-header .d-flex {
    flex-wrap: wrap;
  }
  .page-header .d-flex .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
  .card { padding: 1rem; border-radius: .45rem; }
  .card-header { align-items: flex-start; gap: .75rem; }
  .form-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .form-actions .btn,
  .form-actions button {
    width: 100%;
    justify-content: center;
  }
  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-bar .form-control,
  .search-box {
    max-width: none;
    width: 100%;
  }
  .table-wrap {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    margin-left: -1rem;
    margin-right: -1rem;
  }
  th, td {
    padding: .55rem .65rem;
  }
  .dialer-card { right: -1rem; width: 280px; }
  .pipeline-board { flex-direction: column; }
  .pipeline-col { min-width: unset; }
  .call-session-card,
  .call-log-card,
  .call-recording-note {
    max-width: none;
    width: 100%;
  }
  .call-session-card {
    padding: 1rem;
    border-radius: .45rem;
  }
  .call-session-top {
    flex-direction: column;
    align-items: stretch;
  }
  .call-session-name {
    font-size: 1.15rem;
  }
  .call-session-phone {
    font-size: 1.35rem;
    line-height: 1.25;
    word-break: break-word;
  }
  .call-session-actions,
  .call-session-actions .btn {
    width: 100%;
  }
  .call-session-actions .btn {
    justify-content: center;
    min-height: 48px;
  }
  .call-recorder-panel {
    margin-top: 1rem;
  }
  .call-recorder-panel .dialer-timer {
    font-size: 2.2rem;
    padding: .35rem 0;
  }
  .recording-status {
    width: 100%;
    white-space: normal;
    line-height: 1.35;
    padding: .45rem .7rem;
  }
  .recorder-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .5rem;
  }
  .recorder-actions .btn {
    justify-content: center;
    padding-left: .4rem;
    padding-right: .4rem;
  }
  .call-recording-note {
    font-size: .8rem;
  }
  .recording-upload-panel {
    grid-template-columns: 1fr;
    gap: .75rem;
    padding: .85rem;
  }
  .recording-consent-modal {
    align-items: flex-end;
    padding: 0;
  }
  .recording-consent-card {
    max-width: none;
    border-radius: .75rem .75rem 0 0;
    padding: 1.15rem;
  }
  .recording-script {
    font-size: .95rem;
  }
  .disposition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .disposition-label {
    min-height: 44px;
    font-size: .8rem;
  }
  .dash-grid,
  .view-grid,
  .import-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 420px) {
  .stats-grid,
  .disposition-grid {
    grid-template-columns: 1fr;
  }
  .recorder-actions {
    grid-template-columns: 1fr;
  }
}

/* ── Utilities ── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: .82rem; }
.fw-600      { font-weight: 600; }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }  .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.d-flex { display: flex; } .align-center { align-items: center; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover;
  background: var(--primary); color: #fff; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: .82rem; flex-shrink: 0; }
.priority-low    { color: var(--text-muted); }
.priority-medium { color: var(--info); }
.priority-high   { color: var(--warning); }
.priority-urgent { color: var(--danger); font-weight: 700; }
