:root {
  --bg: #0a0e17;
  --bg-elevated: #131a2a;
  --bg-elevated-2: #1a2338;
  --border: #232c42;
  --text: #eef1f8;
  --text-muted: #8b93ab;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --accent-soft: rgba(79, 140, 255, 0.15);
  --success: #33d17a;
  --danger: #ff5c6c;
  --warning: #ffb454;
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.36);
  --font: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* [hidden] her zaman kazanmalı; aksi halde .app/.modal gibi sınıflardaki
   "display" kuralları hidden özniteliğini geçersiz kılabilir. */
[hidden] {
  display: none !important;
}

html {
  scrollbar-color: #33405e var(--bg);
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #2a3450;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a4668;
}

/* ---------------------------------------------------------------------- */
/* Uygulama iskeleti: sol sidebar + ana içerik                              */
/* ---------------------------------------------------------------------- */
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
}

.sidebar {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, #0d1220 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  gap: 8px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 18px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sidebar-brand .brand-icon {
  font-size: 22px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: var(--shadow-sm);
}

.sidebar-brand .brand-text b {
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-group-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
}
.nav-group-label:first-child {
  padding-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}

.nav-item .nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item .nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

.nav-badge {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}

.ws-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 0 4px;
}

.sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.current-user {
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------- */
/* Ana içerik alanı                                                         */
/* ---------------------------------------------------------------------- */
.main-area {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(19, 26, 42, 0.5);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topheader h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
  }
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot-off {
  background: var(--danger);
}

.dot-on {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.content {
  flex: 1;
  padding: 24px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.stat-value-danger {
  color: var(--danger);
}

.panels {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 22px;
}

@media (max-width: 960px) {
  .panels {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  padding: 20px 22px 24px;
}

.panel-card h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

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

.panel-header h2 {
  margin: 0;
  font-size: 15px;
}

.subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.btn-secondary {
  background: var(--bg-elevated-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 7px 13px;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tbody tr {
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.empty-row {
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.badge-active {
  background: rgba(51, 209, 122, 0.15);
  color: var(--success);
}

.badge-ended {
  background: rgba(139, 147, 171, 0.15);
  color: var(--text-muted);
}

.badge-error {
  background: rgba(255, 92, 108, 0.15);
  color: var(--danger);
}

.badge-pending {
  background: rgba(255, 176, 32, 0.15);
  color: #b8860b;
}

/* Modül sistemi: süper adminin müşteri bazında aç/kapa yaptığı switch bileşeni */
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(139, 147, 171, 0.35);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-slider {
  background: var(--accent);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}
.switch input:disabled + .switch-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.tenant-modules-modal-card {
  width: min(640px, 92vw);
  max-height: 82vh;
  overflow-y: auto;
}

.tenant-modules-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 12px;
}

.tenant-modules-category h4 {
  margin: 0 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.tenant-module-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.tenant-module-row-disabled {
  opacity: 0.65;
}

.tenant-module-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tenant-module-name {
  font-weight: 600;
  font-size: 13px;
}

.tenant-module-info .hint-text {
  margin: 0;
}

.live-feed {
  max-height: 560px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding: 8px;
  align-items: start;
}
.hint-inline {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
}
.live-feed > .empty-row {
  grid-column: 1 / -1;
}

/* Her eşzamanlı çağrı/oturum için ayrı canlı panel */
.session-pane {
  border: 1px solid var(--border);
  border-top: 3px solid var(--session-accent, var(--accent));
  border-radius: 10px;
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.session-pane.session-ended {
  opacity: 0.55;
}
.session-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(79, 140, 255, 0.06);
}
.session-pane-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-pane-status {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.session-pane-status.status-active { color: var(--success); }
.session-pane-status.status-ended { color: var(--text-muted); }
.session-pane-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  max-height: 300px;
  overflow-y: auto;
}

/* Sistem olayları (oturum başladı/sona erdi vb.) */
.feed-item {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(79, 140, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.feed-item .feed-meta {
  font-size: 11px;
  margin-bottom: 2px;
}
.feed-item.type-error { border-left: 3px solid var(--danger); color: var(--danger); }
.feed-item.type-warning { border-left: 3px solid var(--warning); color: var(--warning); }

/* Aynı dil bypass uyarısı — AI, anonsa başladığı anda yetkiliyi bilgilendirir */
.bypass-notice {
  padding: 10px 14px;
  margin: 8px 0;
  border-radius: 8px;
  background: rgba(246, 173, 85, 0.15);
  border: 1px solid #f6ad55;
  color: #7a4a00;
  font-size: 13px;
  font-weight: 600;
  animation: bypass-notice-pulse 1.2s ease-in-out infinite;
}
@keyframes bypass-notice-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Chat baloncukları */
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  font-size: 13px;
}
.chat-customer {
  align-self: flex-start;
}
.chat-rep {
  align-self: flex-end;
  text-align: right;
}
.chat-who {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.chat-lang {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 10px;
}
.chat-time {
  float: right;
  margin-left: 8px;
}
.chat-text {
  padding: 8px 12px;
  border-radius: 12px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-customer .chat-text {
  background: rgba(66, 153, 225, 0.18);
  border-bottom-left-radius: 3px;
}
.chat-rep .chat-text {
  background: rgba(72, 187, 120, 0.18);
  border-bottom-right-radius: 3px;
}

/* ---------------------------------------------------------------------- */
/* Giriş ekranı                                                            */
/* ---------------------------------------------------------------------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 140, 255, 0.10), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(124, 92, 255, 0.10), transparent 45%),
    var(--bg);
}

.login-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, black, transparent 70%);
}

.login-card {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 34px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}

.login-logo-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px rgba(79, 140, 255, 0.35);
}

.login-logo-text b {
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-card .subtitle {
  margin: -8px 0 6px;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
}

.login-card input,
.login-card select,
.login-card textarea,
#settings-form input,
#settings-form select,
#settings-form textarea,
.modal-card input,
.modal-card select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input:focus,
#settings-form input:focus,
#settings-form select:focus,
#settings-form textarea:focus,
.modal-card input:focus,
.modal-card select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-footnote {
  position: relative;
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
}

.error-text {
  color: var(--danger);
  font-size: 12px;
  margin: 0;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
}


/* ---------------------------------------------------------------------- */
/* Formlar (Ayarlarım, kullanıcı yönetimi)                                  */
/* ---------------------------------------------------------------------- */
#settings-form,
#sip-settings-form,
#ai-settings-form,
#contact-form,
#knowledge-doc-form,
#tenant-form,
.modal-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#settings-form fieldset,
#sip-settings-form fieldset,
#ai-settings-form fieldset,
#contact-form fieldset,
#knowledge-doc-form fieldset,
#tenant-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#settings-form legend,
#sip-settings-form legend,
#ai-settings-form legend,
#contact-form legend,
#knowledge-doc-form legend,
#tenant-form legend {
  padding: 0 6px;
  font-size: 13px;
  color: var(--accent);
}

#settings-form label,
#sip-settings-form label,
#ai-settings-form label,
#contact-form label,
#knowledge-doc-form label,
#tenant-form label,
.modal-card label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Faz D: Modüller sekmesinde her modülü (Tercüman/AI Asistan) görsel olarak
   ayıran kart konteyneri — fieldset'lerden bir üst grup, hafif vurgulu. */
.module-card {
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(79, 140, 255, 0.04);
}
.module-card h3 {
  margin: 0;
  font-size: 15px;
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
}

.checkbox-label input {
  width: auto;
}

.stack-gap {
  margin-top: 16px;
}

.clickable {
  cursor: pointer;
}

.incoming-call-alert {
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  padding: 14px 22px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-md);
  animation: incoming-call-pulse 1.4s ease-in-out infinite;
}

@keyframes incoming-call-pulse {
  0%, 100% { box-shadow: var(--shadow-md); }
  50% { box-shadow: 0 0 0 6px rgba(229, 62, 62, 0.18), var(--shadow-md); }
}

.alert-answer-btn {
  background: #fff;
  color: #c53030;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  flex-shrink: 0;
  transition: transform 0.1s ease;
}
.alert-answer-btn:hover {
  transform: translateY(-1px);
}

.hint-text {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0;
}

.key-status {
  font-size: 11px;
  color: var(--text-muted);
}

.panel-card {
  padding: 18px 20px 22px;
}

.panel-card h2 {
  margin-top: 0;
}

.agent-controls {
  display: flex;
  gap: 10px;
  margin: 10px 0;
  flex-wrap: wrap;
}

.room-info {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.log-viewer {
  background: #05070c;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  max-height: 360px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------------------------------------------------------------------- */
/* Modal                                                                    */
/* ---------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 380px;
}

.modal-card h3 {
  margin-top: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------------- */
/* Gelen Çağrılar: KPI şeridi + zengin çağrı kartları                       */
/* ---------------------------------------------------------------------- */
.calls-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 16px 0 20px;
}

.kpi-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
}

.calls-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.calls-empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 24px;
  text-align: center;
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  grid-column: 1 / -1;
}

.call-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: call-card-in 0.25s ease;
}

@keyframes call-card-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.call-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.call-card-caller {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.call-card-caller-icon {
  font-size: 16px;
}

.call-card-number {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.call-card-age {
  font-size: 12px;
  color: var(--warning);
  white-space: nowrap;
  flex-shrink: 0;
}

.call-card-summary {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
  max-height: 4.5em;
  overflow: hidden;
}

.call-card-summary-empty {
  color: var(--text-muted);
  font-style: italic;
}

.call-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.call-card-room {
  font-size: 11px;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Presence seçici (header) */
.presence-select {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}

/* Çağrılar sekmesi: ana + yan panel yerleşimi */
.calls-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .calls-grid {
    grid-template-columns: 1fr;
  }
}

.calls-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.side-panel h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text);
}

/* Temsilci listesi */
.presence-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.presence-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 4px;
}

.presence-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}

.presence-dot {
  font-size: 11px;
}

.presence-name {
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.presence-status {
  font-size: 12px;
  color: var(--text-muted);
}

.presence-caller {
  font-size: 11px;
  color: var(--warning);
  white-space: nowrap;
}

.presence-busy {
  border-left: 3px solid var(--danger);
}

.presence-available {
  border-left: 3px solid var(--success);
}

.presence-break {
  border-left: 3px solid var(--warning);
}

.presence-offline {
  opacity: 0.6;
}

/* Canlı akış paneli */
.calls-live-feed {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 12.5px;
}

.live-feed-item {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  line-height: 1.45;
  color: var(--text);
  animation: call-card-in 0.2s ease;
}

.live-feed-time {
  color: var(--text-muted);
  font-size: 11px;
  margin-right: 4px;
}

.feed-caller {
  color: var(--accent);
  font-weight: 600;
}

/* Küçük tablo butonu */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* Transcript (döküm) modalı */
.transcript-modal-card {
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.transcript-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.transcript-modal-head h3 {
  margin: 0;
}

.transcript-body {
  margin-top: 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.transcript-line {
  display: grid;
  grid-template-columns: 90px 40px 1fr;
  gap: 8px;
  align-items: baseline;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}

.transcript-role {
  font-weight: 600;
  color: var(--accent);
}

.transcript-lang {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}

.transcript-text {
  color: var(--text);
  line-height: 1.4;
}


