/* =====================
   ROOT & RESET
===================== */
:root{
  --bg1:#0b1220;
  --bg2:#020617;
  --glass:rgba(255,255,255,.06);
  --stroke:rgba(255,255,255,.08);
  --text:#e5e7eb;
  --muted:rgba(229,231,235,.55);
  --teal1:#34d399;
  --teal2:#22d3ee;
  --green:#22c55e;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 600px at 55% 45%, #203a66 0%, transparent 55%),
    radial-gradient(900px 600px at 35% 55%, #12284b 0%, transparent 55%),
    radial-gradient(circle at 30% 20%, #1e293b 0%, var(--bg2) 55%),
    linear-gradient(180deg,var(--bg1),var(--bg2));
}

/* =====================
   LAYOUT
===================== */
.layout{
  display:grid;
  grid-template-columns:280px 1fr;
  min-height:100vh;
}

/* =====================
   SIDEBAR
===================== */
.sidebar{
  background:#f8fafc;
  color:#0f172a;
  padding:18px 16px;
  border-right:1px solid #e5e7eb;
}

.brand{padding:10px}
.logo{font-weight:900;letter-spacing:.25em;font-size:26px}
.brand-sub{font-size:12px;opacity:.6}

.nav-group{margin:18px 0}
.nav-title{
  font-size:11px;
  letter-spacing:.14em;
  opacity:.5;
  margin:8px 10px;
}

.nav-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  margin:4px 6px;
  border-radius:12px;
  text-decoration:none;
  color:#0f172a;
  cursor:pointer;
}

.nav-item:hover{background:#eef2f7}
.nav-item.active{
  background:#0f172a;
  color:white;
  box-shadow:0 8px 20px rgba(15,23,42,.3);
}

.nav-ic{
  width:28px;height:28px;
  display:grid;place-items:center;
  border-radius:10px;
  background:#e5e7eb;
}

.sidebar-bottom{margin-top:auto}
.profile{
  display:flex;
  gap:10px;
  align-items:center;
  background:#eef2f7;
  padding:10px;
  border-radius:14px;
  margin:10px 6px;
}

.avatar{
  width:36px;height:36px;
  display:grid;place-items:center;
  border-radius:12px;
  background:#cbd5f5;
  font-weight:700;
}

.logout{
  width:calc(100% - 12px);
  margin:8px 6px;
  padding:12px;
  border:0;
  border-radius:12px;
  background:#ef4444;
  color:white;
  font-weight:700;
  cursor:pointer;
}

/* =====================
   MAIN GRID
===================== */
.main{
  display:grid;
  grid-template-columns:1fr 420px;
  gap:24px;
  padding:24px;
}

/* =====================
   PROSPECT CARD
===================== */
.prospect-card{
  /*max-width:640px;*/
  background:var(--glass);
  border:1px solid var(--stroke);
  border-radius:22px;
  padding:22px;
}

.prospect-row{
  display:flex;
  justify-content:space-between;
  padding:10px 0;
  border-bottom:1px solid var(--stroke);
}

.tag{
  background:#22c55e33;
  color:var(--green);
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
}

.prospect-notes-input{
  width:100%;
  min-height:120px;
  margin-top:14px;
  padding:14px;
  border-radius:16px;
  background:var(--glass);
  border:1px solid var(--stroke);
  color:var(--text);
  resize:none;
}

.prospect-notes-input:focus{
  outline:none;
  border-color:var(--teal2);
  box-shadow:0 0 0 2px rgba(34,211,238,.2);
}

/* =====================
   SOFTPHONE CONTAINER
===================== */
.softphone{
  position:sticky;
  top:24px;
  display:flex;
  align-items:stretch;
}


.glass{
  width:100%;
  max-height:calc(100vh - 48px);
  height:100%;

  display:flex;
  flex-direction:column;

  background:var(--glass);
  border:1px solid var(--stroke);
  border-radius:28px;
  padding:20px;
  backdrop-filter:blur(20px);
}


/* =====================
   TABS
===================== */
.tabs{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-bottom:16px;
}

.tab{
  display:flex;              /* ✅ REQUIRED */
  align-items:center;        /* ✅ vertical centering */
  gap:8px;

  padding:10px 14px;
  border-radius:12px;
  border:0;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
}

/* SVG FIX */
.tab svg{
  display:block;             /* removes baseline shift */
  width:16px;
  height:16px;
}


.tab.active{
  background:linear-gradient(135deg,var(--teal1),var(--teal2));
  color:#041b10;
  font-weight:700;
}

/* =====================
   CARD / PANELS
===================== */
.card{
  flex:1;
  overflow:hidden;
  display:flex;
  flex-direction:column;
}

.panel{
  display:none;
  flex:1;
  overflow-y:auto;
}

.panel.active{display:block}

/* =====================
   DIALPAD
===================== */
.dial-input{
  margin-top:14px;
  width:100%;
  padding:16px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:var(--glass);
  color:var(--text);
}

.dialpad{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
  margin:16px 0;
}

.key{
  padding:16px;
  border-radius:18px;
  background:var(--glass);
  border:1px solid var(--stroke);
  cursor:pointer;
  font-size:18px;
  color: var(--color-white);
}

.key:hover{background:rgba(255,255,255,.1)}

.cta{
  width:100%;
  padding:14px;
  border-radius:18px;
  border:0;
  background:linear-gradient(135deg,#22c55e,#16a34a);
  font-weight:800;
  cursor:pointer;
}

/* =====================
   SETTINGS COMMON
===================== */
.panel-header{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.back{
  background:none;
  border:0;
  font-size:18px;
  cursor:pointer;
  color:var(--teal2);
}

.settings-page{animation:fade .2s}
.hidden{display:none}

/* =====================
   SETTINGS LIST
===================== */
.setting{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px;
  border-radius:16px;
  border:1px solid var(--stroke);
  background:var(--glass);
  cursor:pointer;
  margin-bottom:12px;
}

/* =====================
   SETTINGS ROWS
===================== */
.setting-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 0;
  border-bottom:1px solid var(--stroke);
}

.setting-row small{color:var(--muted)}

/* =====================
   TOGGLE SWITCH
===================== */
.switch{
  position:relative;
  width:42px;height:24px;
}

.switch input{display:none}

.slider{
  position:absolute;
  inset:0;
  background:#e5e7eb;
  border-radius:999px;
  cursor:pointer;
}

.slider:before{
  content:'';
  position:absolute;
  width:18px;height:18px;
  background:white;
  border-radius:50%;
  top:3px;left:3px;
  transition:.2s;
}

.switch input:checked + .slider{
  background:#22c55e;
}

.switch input:checked + .slider:before{
  transform:translateX(18px);
}

/* =====================
   RANGE SLIDER
===================== */
input[type=range]{
  width:100%;
  margin:8px 0;
}

/* =====================
   CALLER ID LIST
===================== */
.caller-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.caller-item{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:var(--glass);
  cursor:pointer;
}

.caller-item input{accent-color:#22c55e}

/* =====================
   ANIMATIONS
===================== */
@keyframes fade{
  from{opacity:0}
  to{opacity:1}
}

/* =====================
   RESPONSIVE
===================== */
@media(max-width:1100px){
  .layout{grid-template-columns:1fr}
  .sidebar{display:none}
  .main{grid-template-columns:1fr}
  .softphone{position:relative;height:auto}
}

/* =====================
   STATUS
===================== */
.status{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:13px;
  margin-bottom:18px;
}

.dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
  box-shadow:0 0 8px rgba(34,197,94,.6);
}

.dot.offline{
  background:#ef4444;
  box-shadow:0 0 8px rgba(239,68,68,.6);
}

.status-text{
  color:rgba(229,231,235,.75);
}

/* =====================
   FIELD / LABEL
===================== */
.field{
  margin-bottom:18px; /* SPACE before Enter number */
}

.field-label{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:11px;
  letter-spacing:.14em;
  color:rgba(229,231,235,.55);
  margin-bottom:12px;
  text-transform:uppercase;
}

.field-label::after{
  content:"";
  flex:1;
  height:1px;
  background:rgba(255,255,255,.08);
}

/* =============================
   CALLER ID CUSTOM DROPDOWN
============================= */

.caller-select{
  position:relative;
}

/* SELECTED */
.caller-selected{
  width:100%;
  height:56px;
  border-radius:16px;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 16px;
  color:var(--text);
  cursor:pointer;
  transition:.15s ease;
}

.caller-selected:hover{
  background:rgba(255,255,255,.07);
  border-color:rgba(34,211,238,.45);
}

.caller-selected .flag{
  font-size:18px;
}

.caller-selected .number{
  flex:1;
  font-size:15px;
  font-weight:600;
  letter-spacing:.02em;
}

.caller-selected .chev{
  font-size:14px;
  opacity:.5;
}

/* DROPDOWN */
.caller-dropdown{
  position:absolute;
  top:62px;
  left:0;
  right:0;
  z-index:30;
  background:linear-gradient(180deg,#0e1626,#0b1220);
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow:0 30px 80px rgba(0,0,0,.6);
  overflow:hidden;
}

/* SEARCH */
.caller-search{
  display:flex;
  align-items:center;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
  color:rgba(229,231,235,.6);
}

.caller-search input{
  width:100%;
  border:0;
  background:transparent;
  color:var(--text);
  outline:none;
  font-size:14px;
}

/* LIST */
.caller-list{
  max-height:220px;
  overflow-y:auto;
}

.caller-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  cursor:pointer;
  border-bottom:1px solid rgba(255,255,255,.05);
}

.caller-item:last-child{
  border-bottom:none;
}

.caller-item:hover{
  background:rgba(255,255,255,.06);
}

.caller-item .meta{
  flex:1;
}

.caller-item strong{
  display:block;
  font-size:14px;
}

.caller-item small{
  font-size:12px;
  opacity:.6;
}

.caller-item.active{
  background:rgba(34,197,94,.15);
}

.caller-item .dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#22c55e;
}

/* =====================
   DIAL INPUT
===================== */
.dial-input{
  margin-top:6px;
  padding:16px;
  border-radius:16px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:var(--text);
  font-size:16px;
  text-align: -webkit-center;
}

/* =====================
   DIALPAD
===================== */
.key{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}

.key .k{
  font-size:18px;
  font-weight:800;
  line-height:1;
}

.key .sub{
  font-size:10px;
  margin-top:6px;
  opacity:.55;
  letter-spacing:.14em;
}

/* =====================
   UTIL
===================== */
.hidden{display:none}


/* =====================
   CALL HISTORY
===================== */

.history-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:14px;
}

.icon-btn{
  background:var(--glass);
  border:1px solid var(--stroke);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
  color:var(--text);
}

.icon-btn:hover{
  background:rgba(255,255,255,.08);
}

/* SEARCH ROW */
.history-search{
  display:flex;
  gap:10px;
  margin-bottom:14px;
}

.search-input{
  flex:1;
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:var(--glass);
}

.search-input input{
  border:0;
  background:transparent;
  color:var(--text);
  outline:none;
  width:100%;
}

.search-btn{
  padding:10px 16px;
  border-radius:14px;
  border:0;
  background:rgba(255,255,255,.12);
  color:var(--text);
  cursor:pointer;
}

.search-btn:hover{
  background:rgba(255,255,255,.18);
}

/* FILTERS */
.history-filters{
  display:flex;
  gap:10px;
  margin-bottom:10px;
}

.history-filters select{
  flex:1;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--stroke);
  background:var(--glass);
  color:var(--text);
}

/* COUNT */
.history-count{
  font-size:13px;
  color:var(--muted);
  margin-bottom:24px;
}

/* EMPTY STATE */
.history-empty{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  color:var(--muted);
}

.history-icon{
  font-size:40px;
  opacity:.5;
  margin-bottom:10px;
}

.history-empty strong{
  color:var(--text);
  margin-bottom:4px;
}
