/* ── 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; }
.view-header h1 { font-size: 16px; font-weight: 700; color: #1c1917; }
.view-body { padding: 16px 24px; flex: 1; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 1.5px solid #e6ebf1; }
.tab {
    padding: 8px 16px; border: none; background: none;
    color: #6b7280; font-size: 13px; font-weight: 500;
    cursor: pointer; border-bottom: 2px solid transparent;
    margin-bottom: -1.5px; transition: all 0.15s;
    width: auto; font-family: inherit;
}
.tab:hover { color: #1c1917; }
.tab.active { color: #1c1917; border-bottom-color: #bfbfbf; font-weight: 600; }

.tab-header { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* ── Loading ── */
.loading-spinner {
    width: 28px; height: 28px;
    border: 2px solid rgba(193,211,254,0.4); border-top-color: #e6ebf1;
    border-radius: 50%; animation: spin 0.7s linear infinite;
    margin: 20px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty-icon { font-size: 36px; margin-bottom: 10px; }
.small { font-size: 12px; }
.text-center { text-align: center; }
.text-muted { color: #9ca3af; font-size: 13px; }

/* ── Cards ── */
.card {
    background: #fff; border: 1.5px solid #e6ebf1;
    border-radius: 4px; padding: 16px 18px; margin-bottom: 0;
}

/* ── Lines List ── */
.lines-list { display: flex; flex-direction: column; gap: 10px; }

.line-card {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; border: 1.5px solid #e6ebf1;
    border-radius: 4px; padding: 14px 16px;
    transition: box-shadow 0.15s;
}
.line-card:hover { box-shadow: 0 2px 10px rgba(193,211,254,0.3); }

.line-info { flex: 1; min-width: 0; }
.line-name { font-weight: 600; font-size: 14px; color: #1c1917; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; }
.line-details { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: #6b7280; align-items: center; }
.line-detail-item { display: flex; align-items: center; gap: 4px; }
.line-phone { color: #78716c; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; font-weight: 600; }
.line-agent-badge { background: #f5f6f7; border: 1px solid #e6ebf1; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; color: #1c1917; font-weight: 600; }
.line-date { font-size: 11.5px; color: #b0b7c3; }
.line-sip { font-family: monospace; font-size: 11.5px; color: #9ca3af; }

.badge-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ── Sync dot ── */
.sync-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.sync-dot.synced { background: #16a34a; }
.sync-dot.not-synced { background: #ef4444; }

/* ── Badges ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-blue { background: #f5f6f7; color: #2563eb; }
.badge-green { background: #f0fdf4; color: #16a34a; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-yellow { background: #fefce8; color: #a16207; }
.badge-cyan { background: #f0f9ff; color: #0891b2; }

/* ── Line Actions ── */
.line-actions { display: flex; gap: 7px; flex-shrink: 0; margin-left: 14px; }

.btn-edit { background: #f5f6f7; color: #1c1917; padding: 6px 12px; border: 1.5px solid #e6ebf1; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; width: auto; }
.btn-edit:hover { background: #e6ebf1; }

.btn-delete { background: #fff4f4; color: #b91c1c; padding: 6px 12px; border: 1.5px solid #fca5a5; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; width: auto; }
.btn-delete:hover { background: #fee2e2; }
.btn-delete:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-manage { background: #fafafa; color: #374151; padding: 6px 12px; border: 1.5px solid #e6ebf1; border-radius: 7px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; width: auto; }
.btn-manage:hover { background: #f5f6f7; color: #1c1917; border-color: #e6ebf1; }

/* ── Buttons (general) ── */
.btn-primary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: #e6ebf1; color: #1c1917; border: 1.5px solid #e6ebf1; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-primary:hover { background: #bfbfbf; border-color: #bfbfbf; }
.btn-secondary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: #f3f4f6; color: #374151; border: 1.5px solid #e5e7eb; border-radius: 4px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s; }
.btn-secondary:hover { background: #e9eaec; }

/* ── Messages ── */
.error-message { background: #fff4f4; border: 1px solid #fca5a5; color: #b91c1c; padding: 10px 14px; border-radius: 4px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.success-message { background: #f0fdf4; border: 1px solid #86efac; color: #15803d; padding: 10px 14px; border-radius: 4px; font-size: 13px; font-weight: 500; margin-bottom: 12px; }

/* ── Forms (in modals) ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 11px; background: #fafafb; border: 1.5px solid #e6ebf1; border-radius: 4px; font-size: 13px; color: #1c1917; font-family: inherit; transition: border-color 0.15s; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #e6ebf1; background: #fff; }
.form-group fieldset { border: 1.5px solid #e6ebf1; border-radius: 4px; padding: 10px 12px; }
.form-group fieldset legend { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; padding: 0 4px; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; margin-bottom: 0; }

/* ── Checkbox group ── */
.checkbox-group { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
.checkbox-group label { display: flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1.5px solid #e6ebf1; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: #374151; font-weight: 500; transition: all 0.15s; }
.checkbox-group label:hover { border-color: #e6ebf1; background: #f5f6f7; }
.checkbox-group label:has(input:checked) { background: #e6f4ff; border-color: #bfbfbf; color: #1c1917; }
.checkbox-group input[type="checkbox"] { accent-color: #bfbfbf; }

/* ── Modal ── */
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { width: 90%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: #fff; border: 1.5px solid #e6ebf1; border-radius: 4px; padding: 20px 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1.5px solid #e6ebf1; }
.modal-header h3 { font-size: 15px; font-weight: 700; color: #1c1917; }
.btn-close { background: none; border: none; color: #9ca3af; font-size: 22px; cursor: pointer; padding: 0; line-height: 1; width: auto; }
.btn-close:hover { color: #374151; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1.5px solid #e6ebf1; }
.modal-footer button { width: auto; }

.confirm-text { font-size: 13.5px; color: #374151; line-height: 1.5; margin-bottom: 10px; }
.confirm-detail { font-size: 12.5px; color: #6b7280; font-family: monospace; background: #f9fafb; padding: 8px 12px; border-radius: 7px; border: 1px solid #e6ebf1; }

/* ── Manage Assigned Numbers ── */
.label { font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.4px; display: block; margin-bottom: 6px; }
.assigned-numbers-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.assigned-number-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #f9fafb; border: 1px solid #e6ebf1; border-radius: 4px; }
.assigned-number-info { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #374151; }
.assigned-number-phone { color: #78716c; font-family: monospace; font-size: 12px; }
.btn-remove { background: #fff4f4; color: #b91c1c; border: 1px solid #fca5a5; padding: 3px 9px; border-radius: 5px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; width: auto; }
.btn-remove:hover { background: #fee2e2; }

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

@media (max-width: 768px) {
    .sidebar { width: 190px; }
    .main-content { margin-left: 190px; }
    .view-body { padding: 12px 14px; }
    .line-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .line-actions { margin-left: 0; }
    .form-row { flex-direction: column; }
}
