/* ── Reset navbar (sidebar replaces it) ── */
.navbar { display: none !important; }

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

/* ════════════════════════════
   SIDEBAR
════════════════════════════ */
.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: #ffffff;
    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; }
.nav-item.active svg { color: #1890ff; }

.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; letter-spacing: -0.2px; }

.view-body { padding: 16px 24px; flex: 1; }

/* ════════════════════════════
   VOICE PAGE
════════════════════════════ */
.voice-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 14px;
    align-items: start;
}

.left-panel { display: flex; flex-direction: column; gap: 12px; }
.right-panel { display: flex; flex-direction: column; }

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

.card-title {
    font-size: 13px; font-weight: 700; color: #1c1917;
    margin-bottom: 12px; padding-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
}

/* ── Forms ── */
.form-group { margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }

.form-group label {
    display: block;
    font-size: 11px; font-weight: 700; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.form-group input,
.form-group select {
    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 {
    outline: none; border-color: #e6ebf1; background: #fff;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row .form-group { margin-bottom: 0; }
.form-group.full-width { grid-column: 1 / -1; }

/* ── Buttons ── */
.btn-primary {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; 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-primary:disabled { opacity: 0.5; cursor: not-allowed; }

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

/* ── Status ── */
.status-bar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.status-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #374151; }

.status-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.status-dot.connected { background: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,0.15); }
.status-dot.connecting { background: #f59e0b; animation: blink 1s infinite; }
.status-dot.disconnected { background: #d1d5db; }

.agent-state {
    font-size: 12px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px;
    background: #f3f4f6; color: #6b7280;
}
.agent-state.listening { background: #f5f6f7; color: #2563eb; }
.agent-state.thinking { background: #fefce8; color: #a16207; }
.agent-state.speaking { background: #f0fdf4; color: #16a34a; }

/* ── Voice / Mic ── */
.voice-section { display: flex; align-items: center; gap: 16px; }

.btn-mic {
    width: 50px; height: 50px; border-radius: 50%;
    border: 2px solid #e6ebf1; background: #f5f6f7;
    font-size: 20px; cursor: pointer; transition: all 0.2s;
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.btn-mic.active { background: #e6ebf1; border-color: #bfbfbf; box-shadow: 0 0 0 4px rgba(193,211,254,0.3); }
.btn-mic.muted { background: #fafafa; border-color: #e5e7eb; }
.btn-mic:disabled { opacity: 0.4; cursor: not-allowed; }

.audio-visualizer { display: flex; align-items: flex-end; gap: 3px; height: 38px; }
.audio-bar { width: 4px; background: linear-gradient(to top, #1890ff, #096dd9); border-radius: 2px; height: 4px; transition: height 0.05s; }

/* ── Chat ── */
.chat-card {
    display: flex; flex-direction: column;
    height: calc(100vh - 110px);
    min-height: 400px;
}

.chat-messages {
    flex: 1; overflow-y: auto; padding: 8px 0;
    display: flex; flex-direction: column; gap: 8px;
}

.message { display: flex; flex-direction: column; gap: 2px; max-width: 85%; }
.message.user { align-self: flex-end; }
.message.agent { align-self: flex-start; }
.message.system { align-self: center; max-width: 100%; }

.message-sender {
    font-size: 10.5px; font-weight: 600; color: #9ca3af;
    text-transform: uppercase; letter-spacing: 0.4px;
}
.message-type { font-size: 10px; color: #bfbfbf; margin-left: 5px; }

.message-text {
    padding: 8px 12px; border-radius: 4px;
    font-size: 13px; line-height: 1.45; color: #1c1917;
    word-break: break-word;
}
.message.user .message-text { background: #e6f4ff; border-radius: 4px 10px 2px 10px; }
.message.agent .message-text { background: #f9fafb; border: 1px solid #e6ebf1; border-radius: 4px 10px 10px 2px; }
.message.system .message-text { background: transparent; color: #9ca3af; font-size: 11.5px; text-align: center; }
.message.spoken .message-text { opacity: 0.85; }

.chat-input {
    display: flex; gap: 8px;
    padding-top: 10px; border-top: 1px solid #f3f4f6;
    margin-top: 8px; flex-shrink: 0;
}
.chat-input input {
    flex: 1; padding: 8px 11px;
    background: #fafafb; border: 1.5px solid #e6ebf1;
    border-radius: 4px; font-size: 13px; color: #1c1917;
    font-family: inherit;
}
.chat-input input:focus { outline: none; border-color: #e6ebf1; background: #fff; }
.chat-input input:disabled { opacity: 0.5; }

/* ── Utilities ── */
.hidden { display: none !important; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.3} }

/* ── Responsive ── */
@media (max-width: 960px) {
    .voice-layout { grid-template-columns: 1fr; }
    .chat-card { height: 420px; }
}
@media (max-width: 768px) {
    .sidebar { width: 190px; }
    .main-content { margin-left: 190px; }
    .view-body { padding: 12px 14px; }
}
