/* ── Reset navbar ── */
.navbar { display: none !important; }

.dashboard {
    display: flex; min-height: 100vh; background: #fafafb;
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Sidebar (shared) ── */
.sidebar { width: 220px; background: #fff; border-right: 1.5px solid #e6ebf1; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; z-index: 100; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1.5px solid #e6ebf1; }
.sidebar-logo { width: 32px; height: 32px; background: #1890ff; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #1c1917; flex-shrink: 0; }
.sidebar-brand-name { font-size: 14px; font-weight: 700; color: #1c1917; }
.sidebar-nav { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 4px; font-size: 13.5px; font-weight: 500; color: #6b7280; cursor: pointer; transition: all 0.15s; border: none; background: none; text-align: left; width: 100%; text-decoration: none; font-family: inherit; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.nav-item:hover { background: #f5f6f7; color: #1c1917; }
.nav-item.active { background: #e6f4ff; color: #1890ff; font-weight: 600; }
.sidebar-footer { padding: 12px 10px; border-top: 1.5px solid #e6ebf1; }
.btn-logout { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 11px; border-radius: 4px; border: none; background: none; font-size: 13.5px; font-weight: 500; color: #ef4444; cursor: pointer; font-family: inherit; transition: background 0.15s; }
.btn-logout:hover { background: #fff4f4; }
.btn-logout svg { width: 15px; height: 15px; }

/* ── Main Content ── */
.main-content { margin-left: 220px; flex: 1; min-height: 100vh; display: flex; flex-direction: column; }
.view-header { background: #fff; border-bottom: 1.5px solid #e6ebf1; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.view-header h1 { font-size: 16px; font-weight: 700; color: #1c1917; }
.view-body { padding: 16px 24px; flex: 1; }

/* ── Toolbar actions ── */
.toolbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.auto-refresh-toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #6b7280; cursor: pointer; }
.auto-refresh-toggle input[type="checkbox"] { accent-color: #bfbfbf; width: auto; cursor: pointer; }

.refresh-indicator { font-size: 11.5px; color: #b0b7c3; }
.refresh-indicator.active { color: #78716c; }

.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; background: #f3f4f6; color: #374151; border: 1.5px solid #e5e7eb; border-radius: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-secondary:hover { background: #e9eaec; }

.btn-danger { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; background: #fff4f4; color: #b91c1c; border: 1.5px solid #fca5a5; border-radius: 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-danger:hover { background: #fee2e2; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Summary Cards ── */
.status-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.summary-card {
    background: #fff; border: 1.5px solid #e6ebf1;
    border-radius: 4px; padding: 14px 16px; text-align: center;
}

.summary-card .label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.6px; color: #b0b7c3; font-weight: 700; margin-bottom: 6px; }
.summary-card .value { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.summary-card .value.total { color: #1c1917; }
.summary-card .value.available { color: #16a34a; }
.summary-card .value.busy { color: #d97706; }
.summary-card .value.stuck { color: #dc2626; }

/* ── Phone Grid ── */
.phone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

/* ── Phone Card ── */
.phone-card {
    background: #fff; border: 1.5px solid #e6ebf1;
    border-radius: 4px; padding: 14px 16px;
    border-left: 3px solid #e6ebf1;
    transition: box-shadow 0.15s;
}
.phone-card.available { border-left-color: #16a34a; }
.phone-card.busy { border-left-color: #d97706; }
.phone-card.stuck { border-left-color: #dc2626; box-shadow: 0 0 0 1px rgba(220,38,38,0.08); }

.phone-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.phone-name { font-size: 14px; font-weight: 600; color: #1c1917; }
.phone-number-text { font-size: 12px; color: #78716c; font-family: monospace; margin-top: 2px; }

/* ── Status badge ── */
.status-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; padding: 3px 9px; border-radius: 20px; letter-spacing: 0.4px; }
.status-badge.available { background: #f0fdf4; color: #16a34a; }
.status-badge.busy { background: #fffbeb; color: #d97706; }
.status-badge.stuck { background: #fff4f4; color: #dc2626; animation: blink 1.4s infinite; }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ── Card details ── */
.phone-card-details { font-size: 12.5px; color: #6b7280; margin-bottom: 10px; }
.detail-row { display: flex; justify-content: space-between; padding: 3px 0; }
.detail-label { color: #b0b7c3; font-size: 11.5px; font-weight: 600; }
.detail-value { color: #374151; font-size: 12.5px; }

/* ── Active call ── */
.active-call-info {
    background: #fffbeb; border: 1px solid #fde68a;
    border-radius: 4px; padding: 9px 12px; margin-bottom: 10px; font-size: 12px;
}
.active-call-info .call-header { font-weight: 700; color: #d97706; margin-bottom: 5px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.active-call-info .detail-value { color: #374151; }

/* ── Release button ── */
.btn-release { background: #fff4f4; color: #b91c1c; padding: 6px 14px; font-size: 12px; border-radius: 7px; border: 1px solid #fca5a5; cursor: pointer; font-weight: 600; font-family: inherit; transition: all 0.15s; width: 100%; }
.btn-release:hover { background: #fee2e2; }
.btn-release:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; color: #9ca3af; font-size: 13.5px; }

/* ── Toast ── */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: #fff; border: 1.5px solid #e6ebf1;
    border-radius: 4px; padding: 11px 18px;
    font-size: 13.5px; color: #374151;
    z-index: 1000; box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(80px); opacity: 0;
    transition: transform 0.25s, opacity 0.25s;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid #16a34a; }
.toast.error { border-left: 3px solid #dc2626; }

/* ── Utilities ── */
.hidden { display: none !important; }

@media (max-width: 768px) {
    .sidebar { width: 190px; }
    .main-content { margin-left: 190px; }
    .view-body { padding: 12px 14px; }
    .phone-grid { grid-template-columns: 1fr; }
}
