@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
    --bg:           #0b1120;
    --bg-sidebar:   #0f1629;
    --surface:      #151d2e;
    --surface-2:    #1a2438;
    --line:         rgba(148,163,184,.12);
    --line-strong:  rgba(148,163,184,.22);
    --text:         #e2e8f0;
    --text-sec:     #94a3b8;
    --accent:       #3b82f6;
    --accent-hover: #2563eb;
    --success:      #22c55e;
    --danger:       #ef4444;
    --danger-text:  #fca5a5;
    --warning:      #f59e0b;
    --sidebar-w:    240px;
    --topbar-h:     60px;
    --radius:       12px;
    --radius-lg:    16px;
    --shadow:       0 1px 3px rgba(0,0,0,.3),0 4px 24px rgba(0,0,0,.18);
}

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}

body{
    min-height:100vh;
    background:var(--bg);
    color:var(--text);
    font-family:'Inter','Segoe UI',system-ui,-apple-system,sans-serif;
    font-size:.9rem;
    line-height:1.5;
    overflow-x:hidden;
}

/* ================================================================
   LOADING SCREEN
   ================================================================ */
.screen-loader{
    position:fixed;inset:0;display:grid;place-items:center;gap:1rem;
    color:var(--text-sec);z-index:100;background:var(--bg);
}
.loading-orb{
    width:3rem;height:3rem;border-radius:50%;
    border:3px solid var(--line);border-top-color:var(--accent);
    animation:spin .8s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ================================================================
   APP SHELL (sidebar + main)
   ================================================================ */
.app-shell{
    min-height:100vh;
}

/* ================================================================
   SIDEBAR
   ================================================================ */
.sidebar{
    position:fixed;top:0;left:0;bottom:0;width:var(--sidebar-w);
    background:var(--bg-sidebar);
    border-right:1px solid var(--line);
    display:flex;flex-direction:column;justify-content:space-between;
    z-index:40;overflow-y:auto;
    transition:transform .25s ease;
}
.sidebar-top{padding:1.25rem 1rem .5rem;}
.sidebar-bottom{padding:.5rem 1rem 1.25rem;}

.sidebar-brand{
    display:flex;align-items:center;gap:.6rem;
    margin-bottom:1.5rem;
}
.sidebar-logo-icon{font-size:1.5rem;}
.sidebar-logo-text{
    font-size:1.1rem;font-weight:800;letter-spacing:-.02em;
    color:var(--text);
}

.sidebar-section-label{
    font-size:.68rem;font-weight:700;letter-spacing:.12em;
    text-transform:uppercase;color:var(--text-sec);
    margin-bottom:.5rem;padding-left:.5rem;
}

.sidebar-nav{display:grid;gap:.15rem;}

.nav-item{
    display:flex;align-items:center;gap:.65rem;
    padding:.7rem .75rem;border-radius:var(--radius);
    color:var(--text-sec);text-decoration:none;
    font-size:.88rem;font-weight:500;
    transition:all .15s ease;
}
.nav-item svg{width:20px;height:20px;flex-shrink:0;}
.nav-item:hover{background:rgba(255,255,255,.05);color:var(--text);}
.nav-item.active{
    background:rgba(59,130,246,.12);color:var(--accent);font-weight:600;
}

/* Availability panel */
.sidebar-avail{
    padding:.75rem;border-radius:var(--radius);
    border:1px solid var(--line);background:var(--surface);
    margin-bottom:.75rem;
}
.avail-row{
    display:flex;align-items:center;gap:.5rem;
}
.avail-dot{
    width:10px;height:10px;border-radius:50%;
    background:var(--danger);transition:background .2s;
}
.avail-dot.on{background:var(--success);}
#availLabel{font-weight:600;font-size:.85rem;flex:1;}
.avail-hint{font-size:.75rem;color:var(--text-sec);margin-top:.3rem;}

/* Toggle switch */
.toggle-switch{position:relative;width:42px;height:24px;flex-shrink:0;}
.toggle-switch input{opacity:0;width:0;height:0;}
.toggle-slider{
    position:absolute;inset:0;cursor:pointer;border-radius:24px;
    background:var(--surface-2);border:1px solid var(--line);
    transition:.2s;
}
.toggle-slider::before{
    content:'';position:absolute;left:3px;top:3px;
    width:16px;height:16px;border-radius:50%;
    background:var(--text-sec);transition:.2s;
}
.toggle-switch input:checked+.toggle-slider{
    background:rgba(34,197,94,.2);border-color:rgba(34,197,94,.3);
}
.toggle-switch input:checked+.toggle-slider::before{
    transform:translateX(18px);background:var(--success);
}

/* User card */
.sidebar-user{
    display:flex;align-items:center;gap:.65rem;
    padding:.65rem;border-radius:var(--radius);
    cursor:pointer;transition:background .15s;
}
.sidebar-user:hover{background:rgba(255,255,255,.04);}

.user-avatar{
    width:38px;height:38px;border-radius:50%;
    background:var(--accent);color:#fff;
    display:grid;place-items:center;
    font-weight:700;font-size:.9rem;flex-shrink:0;
}
.user-avatar.sm{width:30px;height:30px;font-size:.75rem;}

.user-info{display:flex;flex-direction:column;}
.user-info strong{font-size:.85rem;line-height:1.2;}
.user-info span{font-size:.75rem;color:var(--text-sec);}
.user-role{
    display:inline-block;margin-top:.15rem;
    font-size:.65rem;font-weight:600;
    color:var(--text-sec);background:var(--surface-2);
    padding:.1rem .45rem;border-radius:4px;width:fit-content;
}

/* ================================================================
   MAIN CONTENT
   ================================================================ */
.main-content{
    margin-left:var(--sidebar-w);
    min-height:100vh;
    display:flex;flex-direction:column;
}

/* Top bar */
.top-bar{
    position:sticky;top:0;z-index:20;
    display:flex;align-items:center;justify-content:space-between;
    height:var(--topbar-h);padding:0 1.5rem;
    background:rgba(11,17,32,.85);
    backdrop-filter:blur(12px);
    border-bottom:1px solid var(--line);
}
.top-bar-left{display:flex;align-items:center;gap:.75rem;}
.top-bar-right{display:flex;align-items:center;gap:.75rem;}

.hamburger{
    display:none;background:none;border:none;
    color:var(--text);font-size:1.3rem;cursor:pointer;
    padding:.4rem;
}

.top-icon-btn{
    background:none;border:1px solid var(--line);
    border-radius:var(--radius);padding:.5rem;
    color:var(--text-sec);cursor:pointer;
    display:grid;place-items:center;
    transition:all .15s;
}
.top-icon-btn:hover{background:rgba(255,255,255,.04);color:var(--text);}

.notif-dot{
    position:absolute;top:6px;right:6px;
    width:8px;height:8px;border-radius:50%;
    background:var(--danger);
}

.top-user-chip{
    display:flex;align-items:center;gap:.5rem;
    padding:.35rem .65rem .35rem .35rem;
    border-radius:999px;border:1px solid var(--line);
    cursor:pointer;transition:background .15s;
}
.top-user-chip:hover{background:rgba(255,255,255,.04);}
.top-user-chip span{font-size:.85rem;font-weight:600;}
.top-role{font-size:.75rem;color:var(--text-sec);font-weight:500 !important;}

/* ================================================================
   PAGES
   ================================================================ */
.page{display:none;padding:1.5rem;flex:1;animation:fadeIn .2s ease;}
.page.active{display:block;}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}

.page-header{margin-bottom:1.25rem;}
.page-header h1{font-size:1.5rem;font-weight:800;letter-spacing:-.02em;}
.page-header p,.page-header-row p{color:var(--text-sec);font-size:.88rem;margin-top:.15rem;}

.page-header-row{
    display:flex;align-items:flex-start;justify-content:space-between;
    gap:1rem;margin-bottom:1.25rem;flex-wrap:wrap;
}
.page-header-row h1{font-size:1.5rem;font-weight:800;letter-spacing:-.02em;}

/* ================================================================
   DASHBOARD
   ================================================================ */
.stats-row{
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
    gap:.75rem;margin-bottom:1.25rem;
}
.stat-card{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:1rem 1.15rem;
    box-shadow:var(--shadow);
}
.stat-label{
    display:block;font-size:.7rem;font-weight:700;
    letter-spacing:.1em;text-transform:uppercase;
    color:var(--text-sec);margin-bottom:.5rem;
}
.stat-card strong{font-size:1.5rem;font-weight:800;}
.stat-card .text-danger{color:var(--danger);}

.dash-card{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:1.15rem;
    margin-bottom:1rem;box-shadow:var(--shadow);
}
.dash-card-head{
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:.65rem;gap:1rem;
}
.dash-card-head h2{font-size:1.1rem;font-weight:700;}
.dash-card-body{color:var(--text-sec);font-size:.88rem;}

.phone-status{
    display:flex;align-items:center;gap:.4rem;
    font-size:.88rem;font-weight:600;
}
.status-dot{
    width:10px;height:10px;border-radius:50%;flex-shrink:0;
}
.status-dot.online{background:var(--success);}
.status-dot.offline{background:var(--danger);}
.status-dot.connecting{background:var(--warning);animation:pulse 1.2s infinite;}
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.4;}}

.phone-status .online~span{color:var(--success);}
.phone-status .offline~span{color:var(--danger);}

.team-count{font-size:.82rem;color:var(--text-sec);font-weight:500;}

.team-list{list-style:none;}
.team-item{
    display:flex;align-items:center;justify-content:space-between;
    padding:.65rem 0;border-bottom:1px solid var(--line);
}
.team-item:last-child{border-bottom:none;}
.team-item-left{display:flex;align-items:center;gap:.5rem;}
.team-dot{
    width:9px;height:9px;border-radius:50%;flex-shrink:0;
}
.team-dot.online{background:var(--success);}
.team-dot.offline{background:var(--text-sec);}
.team-name{font-size:.88rem;font-weight:500;}
.team-you{font-size:.78rem;color:var(--text-sec);font-weight:400;}
.team-status-label{font-size:.82rem;font-weight:600;}
.team-status-label.available{color:var(--success);}
.team-status-label.offline{color:var(--text-sec);}

/* Live Calls */
.live-calls-list{max-height:220px;overflow-y:auto;}
.live-call-item{
    display:flex;align-items:center;gap:.5rem;
    padding:.55rem 0;border-bottom:1px solid var(--line);font-size:.88rem;
}
.live-call-item:last-child{border-bottom:none;}
.live-call-from,.live-call-to{font-weight:500;color:var(--text);}
.live-call-arrow{color:var(--text-sec);font-size:.75rem;}
.live-call-state{
    margin-left:auto;font-size:.78rem;font-weight:600;
    padding:2px 8px;border-radius:8px;background:var(--surface-2);color:var(--accent);
}
.live-call-dur{font-size:.78rem;color:var(--text-sec);min-width:3rem;text-align:right;}

/* ================================================================
   MANUAL DIALER
   ================================================================ */
.mic-perm-banner{
    display:flex;align-items:center;gap:.75rem;
    background:rgba(245,158,11,.1);border:1px solid rgba(245,158,11,.4);
    border-radius:var(--radius-lg);padding:.85rem 1.15rem;
    margin-bottom:1rem;font-size:.9rem;color:#fbbf24;
}
.mic-perm-banner.granted{
    background:rgba(34,197,94,.08);border-color:rgba(34,197,94,.35);
    color:var(--success);
}
.mic-perm-banner .mic-icon{font-size:1.2rem;}
.btn-mic{
    margin-left:auto;
    background:var(--accent);color:#fff;border:none;
    padding:.45rem 1rem;border-radius:var(--radius);
    font-size:.82rem;font-weight:600;cursor:pointer;
    transition:background .15s;white-space:nowrap;
}
.btn-mic:hover{background:var(--accent-hover,#2563eb);}

.dialer-filters{
    display:grid;grid-template-columns:1fr auto 1fr;gap:.75rem;
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:1rem;
    margin-bottom:1.25rem;box-shadow:var(--shadow);
}
.filter-group{display:flex;flex-direction:column;gap:.3rem;}
.filter-group label{
    font-size:.72rem;font-weight:700;letter-spacing:.08em;
    text-transform:uppercase;color:var(--text-sec);
}
.filter-group select,
.filter-group input[type="text"]{
    padding:.55rem .7rem;border-radius:var(--radius);
    border:1px solid var(--line);background:var(--surface-2);
    color:var(--text);font-size:.88rem;font-family:inherit;
    transition:border-color .15s;
}
.filter-group select:focus,
.filter-group input:focus{
    outline:none;border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(59,130,246,.15);
}
.filter-group.compact{min-width:160px;}

.leads-section{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:1.15rem;
    box-shadow:var(--shadow);
}
.leads-section h2{font-size:1.15rem;font-weight:700;margin-bottom:.75rem;}

.leads-list{display:grid;gap:.65rem;}

.lead-card{
    background:var(--surface-2);border:1px solid var(--line);
    border-radius:var(--radius);padding:1rem;
    display:flex;align-items:flex-start;justify-content:space-between;
    gap:1rem;transition:border-color .15s;
}
.lead-card:hover{border-color:var(--line-strong);}

.lead-info h3{font-size:1rem;font-weight:700;display:flex;align-items:center;gap:.5rem;}
.lead-info p{font-size:.84rem;color:var(--text-sec);margin-top:.15rem;}
.lead-info .lead-detail{font-size:.84rem;color:var(--text-sec);}
.lead-info .lead-detail strong{color:var(--text);font-weight:600;}

.lead-actions{
    display:flex;align-items:center;gap:.5rem;flex-shrink:0;
}

.status-badge{
    display:inline-flex;padding:.2rem .55rem;border-radius:999px;
    font-size:.72rem;font-weight:700;text-transform:lowercase;
}
.status-badge.new{color:#93c5fd;background:rgba(59,130,246,.15);}
.status-badge.contacted{color:#a5b4fc;background:rgba(99,102,241,.15);}
.status-badge.interested{color:#86efac;background:rgba(34,197,94,.15);}
.status-badge.not_interested,.status-badge.not-interested{color:var(--danger-text);background:rgba(239,68,68,.12);}
.status-badge.no_answer,.status-badge.no-answer{color:#fdba74;background:rgba(245,158,11,.12);}
.status-badge.callback{color:#67e8f9;background:rgba(6,182,212,.12);}
.status-badge.converted{color:#86efac;background:rgba(34,197,94,.2);}
.status-badge.called{color:var(--text-sec);background:var(--surface);}
.status-badge.completed{color:#86efac;background:rgba(34,197,94,.15);}

.call-count-chip{
    display:inline-flex;align-items:center;justify-content:center;
    min-width:28px;height:28px;border-radius:50%;
    background:var(--surface);border:1px solid var(--line);
    font-size:.78rem;font-weight:700;color:var(--text-sec);
}

/* ================================================================
   CALL HISTORY
   ================================================================ */
.history-toolbar{
    display:flex;align-items:center;gap:.75rem;
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:.75rem 1rem;
    margin-bottom:1rem;box-shadow:var(--shadow);
}
.search-box{flex:1;max-width:500px;}
.search-box input{
    width:100%;padding:.55rem .75rem;border-radius:var(--radius);
    border:1px solid var(--line);background:var(--surface-2);
    color:var(--text);font-size:.88rem;font-family:inherit;
}
.search-box input:focus{
    outline:none;border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(59,130,246,.15);
}

.history-table-wrap{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);overflow:hidden;
    box-shadow:var(--shadow);
}
.history-table{
    width:100%;border-collapse:collapse;
}
.history-table thead{border-bottom:1px solid var(--line);}
.history-table th{
    padding:.7rem 1rem;text-align:left;
    font-size:.75rem;font-weight:700;letter-spacing:.08em;
    text-transform:uppercase;color:var(--text-sec);
    background:var(--surface-2);
}
.history-table td{
    padding:.75rem 1rem;font-size:.88rem;
    border-bottom:1px solid var(--line);vertical-align:middle;
}
.history-table tr:last-child td{border-bottom:none;}
.history-table tr:hover td{background:rgba(255,255,255,.02);}

.call-status-chip{
    display:inline-flex;align-items:center;gap:.3rem;
    padding:.2rem .55rem;border-radius:999px;
    font-size:.78rem;font-weight:600;
}
.call-status-chip.completed{color:#86efac;background:rgba(34,197,94,.12);}
.call-status-chip.failed{color:var(--danger-text);background:rgba(239,68,68,.12);}
.call-status-chip.no_answer{color:#fdba74;background:rgba(245,158,11,.12);}
.call-status-chip.initiated,.call-status-chip.ringing{color:#93c5fd;background:rgba(59,130,246,.12);}

.lead-cell-name{font-weight:600;font-size:.88rem;}
.lead-cell-phone{font-size:.78rem;color:var(--text-sec);}
.duration-cell{font-family:'SF Mono','Cascadia Code',monospace;font-size:.85rem;color:var(--text-sec);}
.date-cell{font-size:.82rem;color:var(--text-sec);}

.pagination{
    display:flex;align-items:center;justify-content:center;
    gap:.4rem;padding:.75rem;
}
.pagination button{
    padding:.35rem .65rem;border-radius:var(--radius);
    border:1px solid var(--line);background:var(--surface);
    color:var(--text-sec);font-size:.82rem;cursor:pointer;
    transition:.15s;
}
.pagination button:hover{background:var(--surface-2);color:var(--text);}
.pagination button.active{background:var(--accent);color:#fff;border-color:var(--accent);}

/* ================================================================
   VIEW RESULTS
   ================================================================ */
.results-summary{display:flex;gap:.5rem;flex-wrap:wrap;}
.result-badge{
    display:inline-flex;align-items:center;gap:.3rem;
    padding:.45rem .8rem;border-radius:999px;
    font-size:.85rem;font-weight:700;
}
.result-badge.interested{color:#86efac;background:rgba(34,197,94,.12);border:1px solid rgba(34,197,94,.2);}
.result-badge.followup{color:var(--danger-text);background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.18);}

.results-filters{
    display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:.75rem 1rem;
    margin-bottom:1rem;box-shadow:var(--shadow);
}
.filter-tabs{display:flex;gap:.3rem;flex:1;flex-wrap:wrap;}
.tab{
    display:inline-flex;align-items:center;gap:.35rem;
    padding:.45rem .75rem;border-radius:999px;
    border:1px solid var(--line);background:transparent;
    color:var(--text-sec);font-size:.82rem;font-weight:600;
    cursor:pointer;transition:.15s;font-family:inherit;
}
.tab:hover{background:rgba(255,255,255,.04);color:var(--text);}
.tab.active{background:var(--accent);color:#fff;border-color:var(--accent);}
.tab span{
    display:inline-flex;align-items:center;justify-content:center;
    min-width:20px;height:20px;border-radius:10px;
    background:rgba(255,255,255,.15);font-size:.72rem;
}

.results-section{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:1.15rem;
    box-shadow:var(--shadow);
}
.results-section h2{font-size:1.1rem;font-weight:700;margin-bottom:.75rem;}
.results-list{display:grid;gap:.65rem;}

.result-card{
    background:var(--surface-2);border:1px solid var(--line);
    border-radius:var(--radius);padding:1rem;
    transition:border-color .15s;
}
.result-card:hover{border-color:var(--line-strong);}
.result-card h3{font-size:1rem;font-weight:700;margin-bottom:.3rem;}
.result-card p{font-size:.84rem;color:var(--text-sec);}

.empty-state{
    color:var(--text-sec);font-size:.88rem;
    padding:2rem 1rem;text-align:center;
}
.empty-state-big{
    display:flex;flex-direction:column;align-items:center;
    gap:.6rem;padding:3rem 1rem;color:var(--text-sec);
    text-align:center;
}
.empty-state-big svg{opacity:.4;}
.empty-state-big strong{font-size:1.1rem;color:var(--text);}
.empty-state-big p{font-size:.88rem;}

/* ================================================================
   BUTTONS  (shared)
   ================================================================ */
.btn{
    display:inline-flex;align-items:center;gap:.4rem;
    padding:.55rem .85rem;border-radius:var(--radius);
    border:1px solid var(--line);background:transparent;
    color:var(--text);font-size:.85rem;font-weight:600;
    cursor:pointer;font-family:inherit;transition:.15s;
    white-space:nowrap;
}
.btn:hover{background:rgba(255,255,255,.04);}
.btn-sm{padding:.4rem .65rem;font-size:.8rem;}
.btn-primary{background:var(--accent);color:#fff;border-color:var(--accent);}
.btn-primary:hover{background:var(--accent-hover);}
.btn-secondary{background:var(--surface-2);border-color:var(--line);}
.btn-danger{background:rgba(239,68,68,.12);color:var(--danger-text);border-color:rgba(239,68,68,.2);}
.btn-danger:hover{background:rgba(239,68,68,.2);}
.btn-call{background:var(--success);color:#052e16;border-color:var(--success);font-weight:700;}
.btn-call:hover{background:#16a34a;}
.btn-outline{border:1px solid var(--line);background:transparent;color:var(--text-sec);}
.btn-outline:hover{background:rgba(255,255,255,.04);color:var(--text);}
.btn:disabled{opacity:.5;cursor:not-allowed;}

/* ================================================================
   ACTIVE CALL BAR (fixed bottom)
   ================================================================ */
.call-toast{
    position:fixed;top:1.5rem;right:1.5rem;z-index:100;
    padding:.85rem 1.25rem;border-radius:var(--radius-lg);
    font-size:.9rem;font-weight:600;
    transform:translateX(120%);opacity:0;
    transition:transform .3s ease,opacity .3s ease;
    box-shadow:0 8px 24px rgba(0,0,0,.35);
    max-width:380px;
}
.call-toast.show{transform:translateX(0);opacity:1;}
.call-toast.error{background:#dc2626;color:#fff;}
.call-toast.info{background:var(--surface);border:1px solid var(--line);color:var(--text);}
.call-toast.success{background:var(--success);color:#fff;}

.active-call-bar{
    position:fixed;bottom:0;left:var(--sidebar-w);right:0;
    z-index:50;display:flex;align-items:center;justify-content:space-between;
    padding:.65rem 1.5rem;gap:1rem;
    background:rgba(34,197,94,.12);
    border-top:1px solid rgba(34,197,94,.25);
    backdrop-filter:blur(14px);
}
.call-bar-info{display:flex;align-items:center;gap:.75rem;}
.call-bar-status{font-weight:600;font-size:.88rem;}
.call-bar-target{font-weight:800;font-size:.95rem;}
.call-bar-timer{
    font-family:'SF Mono','Cascadia Code',monospace;
    color:var(--success);font-weight:600;font-size:.9rem;
}
.call-bar-actions{display:flex;gap:.5rem;}

/* ================================================================
   INCOMING CALL OVERLAY
   ================================================================ */
.incoming-overlay{
    position:fixed;inset:0;z-index:60;
    display:flex;align-items:center;justify-content:center;
    background:rgba(0,0,0,.6);backdrop-filter:blur(8px);
}
.incoming-card{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);padding:2rem;
    text-align:center;display:flex;flex-direction:column;
    align-items:center;gap:.75rem;box-shadow:var(--shadow);
    min-width:280px;
}
.incoming-card strong{
    font-size:.82rem;text-transform:uppercase;
    letter-spacing:.12em;color:var(--warning);
}
.incoming-num{font-size:1.5rem;font-weight:800;}
.incoming-pulse{
    width:60px;height:60px;border-radius:50%;
    background:rgba(245,158,11,.15);
    animation:incomingPulse 1.2s ease infinite;
}
@keyframes incomingPulse{0%,100%{transform:scale(1);opacity:1;}50%{transform:scale(1.15);opacity:.6;}}
.incoming-actions{display:flex;gap:.5rem;margin-top:.5rem;}

/* ================================================================
   MODAL
   ================================================================ */
.modal-overlay{
    position:fixed;inset:0;z-index:55;
    display:flex;align-items:center;justify-content:center;
    padding:1rem;background:rgba(0,0,0,.55);backdrop-filter:blur(10px);
}
.modal-box{
    background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-lg);
    width:min(100%,28rem);max-height:90vh;overflow-y:auto;
    padding:1.5rem;box-shadow:var(--shadow);
}
.modal-head{
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:1rem;
}
.modal-head h3{font-size:1.25rem;font-weight:800;}
.modal-x{
    background:none;border:none;color:var(--text-sec);
    font-size:1.75rem;cursor:pointer;line-height:1;
}
.modal-x:hover{color:var(--text);}
.modal-note{color:var(--text-sec);font-size:.82rem;margin-bottom:.75rem;}
.modal-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin-top:1rem;}

.form-group{display:flex;flex-direction:column;gap:.3rem;margin-bottom:.75rem;}
.form-group label{
    font-size:.72rem;font-weight:700;letter-spacing:.08em;
    text-transform:uppercase;color:var(--text-sec);
}
.form-group input{
    padding:.6rem .75rem;border-radius:var(--radius);
    border:1px solid var(--line);background:var(--surface-2);
    color:var(--text);font-size:.88rem;font-family:inherit;
}
.form-group input:focus{
    outline:none;border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(59,130,246,.15);
}
.form-group input:disabled{opacity:.5;}

.divider{border:none;border-top:1px solid var(--line);margin:.75rem 0;}

.error-msg,.success-msg{
    padding:.65rem .85rem;border-radius:var(--radius);
    font-size:.84rem;margin-bottom:.75rem;
}
.error-msg{color:var(--danger-text);background:rgba(239,68,68,.1);border:1px solid rgba(239,68,68,.18);}
.success-msg{color:#86efac;background:rgba(34,197,94,.1);border:1px solid rgba(34,197,94,.18);}

.hidden{display:none!important;}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media(max-width:900px){
    .sidebar{transform:translateX(-100%);}
    .sidebar.open{transform:translateX(0);}
    .hamburger{display:block;}
    .main-content{margin-left:0;}
    .active-call-bar{left:0;}
    .dialer-filters{grid-template-columns:1fr;}
    .stats-row{grid-template-columns:repeat(2,1fr);}
}

@media(max-width:600px){
    .page{padding:1rem;}
    .stats-row{grid-template-columns:1fr;}
    .history-table th:nth-child(4),
    .history-table td:nth-child(4){display:none;}
    .page-header-row{flex-direction:column;}
}
