:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;
  --accent-border: #bfdbfe;
  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --warn: #f59e0b;
  --warn-bg: #fffbeb;
  --err: #ef4444;
  --err-bg: #fef2f2;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header & Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo-img {
  width: auto;
  height: 60px;
  max-width: 120px;
  object-fit: contain;
  display: block;
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.6);
}

.nav-tab.on {
  color: var(--accent);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: var(--err-bg);
  color: var(--err);
  border-color: rgba(239, 68, 68, 0.3);
}

.logout { margin: 0; }

/* Dropdown navigation */
.nav-dropdown { display: block; position: relative; }

.nav-dropdown-btn {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.55rem 0.9rem;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-dropdown-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.nav-caret {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

.nav-dropdown.open .nav-caret { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
  overflow: hidden;
}

.nav-dropdown-menu.open { display: block; }

.nav-dropdown-menu a {
  display: block;
  padding: 0.7rem 1rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.15s, color 0.15s;
}

.nav-dropdown-menu a:last-child { border-bottom: none; }
.nav-dropdown-menu a:hover { background: var(--bg); color: var(--accent); }
.nav-dropdown-menu a.on {
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* Layout Main Content */
main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.25rem 0;
  color: var(--text);
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  margin: 0 0 1rem 0;
  color: var(--text);
}

.muted { color: var(--muted); font-size: 0.85rem; }

/* Cards & Containers */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}

.kpi-value {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.2;
}

.kpi-value.kpi-muted { color: var(--muted); }
.kpi-value.kpi-info { color: var(--accent); }
.kpi-value.kpi-ok { color: var(--ok); }
.kpi-value.kpi-err { color: var(--err); }

.kpi-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--border-subtle);
  overflow: hidden;
  margin-top: 0.2rem;
}

.kpi-bar-fill { height: 100%; border-radius: 999px; }
.kpi-bar-fill.ok { background: var(--ok); }
.kpi-bar-fill.err { background: var(--err); }

/* Filters Bar */
.filters-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.filters-bar input[type="text"],
.filters-bar input[type="date"],
.filters-bar select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  transition: all 0.2s ease;
}

.filters-bar input[type="text"]:focus,
.filters-bar input[type="date"]:focus,
.filters-bar select:focus {
  outline: none;
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.filter-search { min-width: 220px; flex: 1 1 240px; }

.btn-filter {
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  padding: 0.52rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-filter:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-filter-reset {
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
}

.btn-filter-reset:hover { color: var(--text); }

/* Tables */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}

table.docs,
.voice-calls-table,
.chat-history-table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table.docs th,
table.docs td,
.voice-calls-table th,
.voice-calls-table td,
.chat-history-table th,
.chat-history-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  white-space: nowrap;
}

table.docs thead th,
.voice-calls-table thead th,
.chat-history-table thead th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  z-index: 2;
}

table.docs tbody tr:last-child td,
.voice-calls-table tbody tr:last-child td,
.chat-history-table tbody tr:last-child td {
  border-bottom: none;
}

table.docs tbody tr,
.voice-calls-table tbody tr,
.chat-history-table tbody tr {
  transition: background-color 0.15s ease;
}

table.docs tbody tr:hover,
.voice-calls-table tbody tr:hover,
.chat-history-table tbody tr:hover {
  background: var(--bg);
}

td.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
}

a.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

a.link:hover { text-decoration: underline; }

/* Chat History Table Sizing */
.chat-history-table td.preview {
  max-width: 280px;
  width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--muted);
}

.chat-history-table td.summary-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  max-width: 240px;
  min-width: 140px;
  width: 240px;
}

.chat-history-table .summary-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  color: var(--text);
}

.chat-history-table .summary-more {
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.chat-history-table .summary-more:hover {
  background: var(--accent);
  color: #ffffff;
}

.summary-loading { color: var(--muted); font-style: italic; font-size: 0.8rem; }

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding: 1rem 0.25rem 0 0.25rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-page {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  transition: all 0.2s ease;
}

.btn-page:hover:not(.disabled) {
  background: var(--bg);
  border-color: var(--muted);
}

.btn-page.disabled {
  color: var(--muted);
  opacity: 0.5;
  cursor: not-allowed;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  padding: 1.5rem;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-content {
  background: var(--panel);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 850px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--border-subtle);
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
}

.call-summary {
  margin: 0;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
  line-height: 1.6;
  font-size: 0.92rem;
  color: var(--text);
  border: 1px solid var(--border);
}

/* Chat Panel Slide-over */
.chat-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
  z-index: 1000;
}

.chat-panel.open { pointer-events: auto; }

.chat-panel-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.chat-panel.open .chat-panel-overlay { opacity: 1; }

.chat-panel-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 650px;
  max-width: 100%;
  background: var(--panel);
  box-shadow: -10px 0 25px -5px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid var(--border);
}

.chat-panel.open .chat-panel-content { transform: translateX(0); }

.chat-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
}

.chat-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  background: #f8fafc;
}

/* Chat Messages & Bubbles */
.thread {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.bubble {
  max-width: 82%;
  padding: 0.65rem 0.95rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.5;
  box-shadow: var(--shadow-xs);
}

.bubble.user {
  align-self: flex-start;
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.bubble.assistant {
  align-self: flex-end;
  background: #dcf8c6;
  color: #0f172a;
  border: 1px solid #c4e6af;
  border-bottom-right-radius: 4px;
}

.bubble-meta {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.bubble-text { white-space: pre-wrap; word-break: break-word; }

/* Buttons & Controls */
button {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius);
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-view {
  background: var(--accent);
  color: #ffffff;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-view:hover { background: var(--accent-hover); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  color: var(--muted);
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.empty-icon { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }

/* Knowledge Base / Documents */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section-header h2 { margin: 0; }

.badge {
  background: var(--bg);
  color: var(--muted);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.type-badge {
  display: inline-block;
  background: var(--bg);
  color: var(--muted);
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-weight: 500;
  text-transform: lowercase;
}

.row-actions { text-align: right; }

.row-actions button {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--border);
  margin-left: 0.5rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
}

.row-actions button:hover {
  color: var(--text);
  border-color: var(--text);
  background: var(--bg);
}

.btn-delete {
  background: transparent;
  color: var(--err);
  border: 1px solid var(--border);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-delete:hover {
  border-color: var(--err);
  background: var(--err);
  color: #ffffff;
}

.btn-sync {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--panel);
  color: var(--accent);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sync:hover { background: var(--accent-light); }

.status-msg {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  min-height: 1.25rem;
  font-weight: 500;
}

.status-msg.success { color: var(--ok); }
.status-msg.error { color: var(--err); }

/* File upload */
.upload-form { display: flex; flex-direction: column; gap: 1rem; }

.file-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2.25rem 1.5rem;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-drop:hover,
.file-drop.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-icon { font-size: 2rem; }

.file-drop-text {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.file-drop-subtext {
  color: var(--muted);
  font-size: 0.8rem;
}

.file-drop-selected {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}

.upload-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* File cell */
.file-cell { display: flex; align-items: center; gap: 0.5rem; }

.file-name {
  display: inline-block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}

.file-name.clickable {
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}

.file-name.clickable:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Chips / preview */
.preview {
  color: var(--muted);
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.chip-ready { background: var(--ok-bg); color: var(--ok); }
.chip-failed { background: var(--err-bg); color: var(--err); }
.chip-pending,
.chip-processing,
.chip-indexing { background: var(--warn-bg); color: var(--warn); }

/* Forms */
input:not([type="file"]),
textarea {
  font-family: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:not([type="file"]):focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

.add-form { display: flex; flex-direction: column; gap: 0.6rem; }

button.secondary {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--accent);
}

button.secondary:hover { background: var(--accent-light); }

/* Login */
.login-card {
  max-width: 400px;
  margin: 5rem auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.login-card form { display: flex; flex-direction: column; gap: 0.8rem; }

.error { color: var(--err); }
.empty { color: var(--muted); padding: 1rem 0; }

/* Voice calls transcript summary */
.voice-calls-table td.summary-cell {
  vertical-align: middle;
  white-space: nowrap;
  max-width: 320px;
  min-width: 180px;
  width: 320px;
}

.voice-calls-table .summary-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.voice-calls-table .summary-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.4;
}

.voice-calls-table .summary-more,
.summary-more {
  padding: 0.15rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.voice-calls-table .summary-more:hover,
.summary-more:hover {
  background: var(--accent);
  color: #ffffff;
}

/* Voice call recording & copy controls */
.btn-recording {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-recording.playing {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.btn-copy {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 0.3rem;
  transition: all 0.2s;
}

.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

/* Voice call status & result badges */
.voice-calls-table .type-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  text-transform: capitalize;
  border: 1px solid transparent;
  font-family: var(--font-sans);
}

.voice-calls-table .type-badge.status-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: rgba(16, 185, 129, 0.25);
}

.voice-calls-table .type-badge.status-err {
  background: var(--err-bg);
  color: var(--err);
  border-color: rgba(239, 68, 68, 0.25);
}

.voice-calls-table .type-badge.status-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.25);
}

.voice-calls-table .type-badge.status-muted {
  background: var(--bg);
  color: var(--muted);
  border-color: var(--border);
}

