:root {
  --app-bg: #f5f7fb;
  --app-text: #18202f;
  --app-muted: #64748b;
  --app-border: #d9e1ea;
  --app-panel: #ffffff;
  --app-accent: #2563eb;
  --app-success: #15803d;
}

body {
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-navbar {
  background: #ffffff;
  border-bottom: 1px solid var(--app-border);
}

.global-search {
  flex: 0 1 420px;
  max-width: min(42vw, 420px);
  position: relative;
  width: 100%;
}

.global-search .form-control {
  border-radius: 8px;
}

.global-search-results {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgb(15 23 42 / 14%);
  display: none;
  left: 0;
  max-height: 420px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 0.375rem);
  z-index: 1080;
}

.global-search-results.open {
  display: block;
}

.global-search-item {
  color: var(--app-text);
  display: block;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
}

.global-search-item:hover,
.global-search-item.active {
  background: #f1f5f9;
}

.notification-nav-link {
  align-items: center;
  display: inline-flex;
  gap: 0.4rem;
}

.live-call-banner {
  align-items: center;
  background: #18324f;
  color: #ffffff;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
}

.live-call-banner .section-kicker,
.live-call-banner .text-secondary {
  color: #cbd5e1 !important;
}

.live-call-title {
  font-weight: 700;
}

.live-call-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.live-call-actions .softphone-timer {
  color: #bbf7d0;
  font-size: 1.1rem;
}

.app-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--app-border);
  flex: 0 0 248px;
  flex-direction: column;
  min-height: 100vh;
  padding: 1rem;
  position: sticky;
  top: 0;
}

.app-content-shell {
  flex: 1;
  min-width: 0;
}

.app-main {
  min-height: calc(100vh - 57px);
}

.sidebar-brand {
  border-bottom: 1px solid var(--app-border);
  font-size: 1.05rem;
  font-weight: 700;
  margin: -0.25rem 0 0.75rem;
  padding: 0.25rem 0 0.875rem;
}

.sidebar-brand a {
  color: var(--app-text);
  text-decoration: none;
}

.sidebar-nav {
  display: grid;
  gap: 0.25rem;
}

.sidebar-link {
  border-radius: 8px;
  color: var(--app-text);
  padding: 0.625rem 0.75rem;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: #eaf1ff;
  color: var(--app-accent);
}

.sidebar-section {
  color: var(--app-muted);
  font-size: 0.72rem;
  font-weight: 700;
  margin: 1rem 0 0.25rem;
  padding: 0 0.75rem;
  text-transform: uppercase;
}

.flash-region {
  margin: 1rem 1.5rem 0;
}

.flash-region:empty {
  display: none;
}

.dashboard-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.section-kicker,
.metric-label {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-card,
.panel {
  background: var(--app-panel);
  border: 1px solid var(--app-border);
  border-radius: 8px;
}

.metric-card {
  min-height: 112px;
  padding: 1rem;
}

.metric-value {
  color: var(--app-accent);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.5rem;
}

.panel {
  min-height: 260px;
  padding: 1rem;
}

.login-shell {
  max-width: 420px;
}

.login-panel {
  min-height: 0;
}

.audit-filter-panel,
.audit-table-panel {
  min-height: 0;
}

.audit-table th {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.audit-values-cell {
  min-width: 220px;
}

.audit-values-cell pre {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  font-size: 0.76rem;
  margin: 0.5rem 0 0;
  max-height: 180px;
  overflow: auto;
  padding: 0.5rem;
}

.customer-search-panel,
.campaign-filter-panel,
.customer-table-panel,
.customer-form-panel,
.customer-detail-panel,
.customer-import-panel,
.call-result-panel,
.call-history-panel,
.campaign-table-panel,
.campaign-form-panel,
.settings-form-panel,
.suppression-filter-panel,
.suppression-table-panel,
.product-filter-panel,
.product-table-panel,
.product-form-panel,
.order-form-panel,
.telephony-table-panel,
.telephony-form-panel,
.operator-panel,
.operator-main-panel,
.operator-timeline-panel,
.manager-filter-panel,
.manager-table-panel,
.admin-users-filter-panel,
.admin-users-panel,
.admin-user-panel,
.admin-user-form-panel,
.jobs-workers-panel,
.jobs-table-panel,
.jobs-dead-letter-panel,
.jobs-schedules-panel,
.notification-center-panel,
.wallboard-agents-panel {
  min-height: 0;
}

.order-qty-input {
  max-width: 90px;
}

.order-status-select {
  min-width: 150px;
}

.import-metric {
  min-height: 96px;
}

.customer-table th {
  color: var(--app-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.notes-block {
  min-height: 160px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.panel-heading {
  align-items: center;
  border-bottom: 1px solid var(--app-border);
  display: flex;
  justify-content: space-between;
  margin: -1rem -1rem 1rem;
  padding: 0.875rem 1rem;
}

.empty-state {
  align-items: center;
  border: 1px dashed var(--app-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 178px;
  text-align: center;
}

.operator-workspace .panel {
  padding: 0.875rem;
}

.operator-empty {
  min-height: 96px;
}

.operator-main-panel {
  min-height: 640px;
}

.operator-timeline-panel {
  min-height: 640px;
}

.operator-stat {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.75rem;
}

.operator-stat .metric-value {
  font-size: 1.5rem;
  margin-top: 0.25rem;
}

.operator-timeline {
  display: grid;
  gap: 0.75rem;
}

.operator-timeline-item {
  border-left: 3px solid var(--app-accent);
  padding-left: 0.75rem;
}

.sales-console-header {
  align-items: flex-start;
}

.sales-console-command {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-left: 4px solid #0f766e;
  border-radius: 8px;
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 2fr);
  padding: 0.875rem 1rem;
}

.sales-console-command-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.sales-console-next {
  color: var(--app-text);
  font-size: 1.1rem;
  font-weight: 700;
}

.sales-console-workflow {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
}

.sales-console-step {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: 0.2rem;
  min-height: 68px;
  padding: 0.55rem 0.65rem;
}

.sales-console-step span,
.sales-console-readiness-item span {
  color: var(--app-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
}

.sales-console-step strong,
.sales-console-readiness-item strong {
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.sales-console-step-complete {
  border-color: #86efac;
  box-shadow: inset 3px 0 0 #16a34a;
}

.sales-console-step-current {
  border-color: #facc15;
  box-shadow: inset 3px 0 0 #ca8a04;
}

.sales-console-step-pending {
  background: #f8fafc;
}

.sales-console-readiness {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
}

.sales-console-readiness-item {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: 0.2rem;
  min-height: 72px;
  padding: 0.65rem 0.8rem;
}

.sales-console-readiness-success {
  border-bottom: 3px solid #16a34a;
}

.sales-console-readiness-warning {
  border-bottom: 3px solid #ca8a04;
}

.sales-console-readiness-neutral {
  border-bottom: 3px solid #64748b;
}

.agent-command-bar {
  background: #ffffff;
  border: 1px solid var(--app-border);
  border-left: 4px solid #2563eb;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgb(15 23 42 / 8%);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(260px, 1.05fr) minmax(300px, 1.2fr);
  padding: 0.85rem;
  position: sticky;
  top: 4.25rem;
  z-index: 1010;
}

.agent-screen-pop {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(160px, 0.85fr) minmax(220px, 1.15fr);
  min-width: 0;
}

.agent-screen-pop-main {
  min-width: 0;
}

.agent-screen-pop-name {
  font-size: 1.05rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.agent-screen-pop-metrics {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
}

.agent-screen-pop-metrics div,
.agent-compliance-prompt,
.agent-script-cue {
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.45rem 0.55rem;
}

.agent-screen-pop-metrics span,
.agent-compliance-prompt span,
.agent-script-cue span {
  color: var(--app-muted);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.agent-screen-pop-metrics strong,
.agent-compliance-prompt strong,
.agent-script-cue strong {
  font-size: 0.82rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.agent-screen-pop-metrics .softphone-timer {
  font-size: 0.98rem;
}

.agent-compliance-stack {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.agent-compliance-success {
  border-color: #86efac;
  box-shadow: inset 3px 0 0 #16a34a;
}

.agent-compliance-warning {
  border-color: #fde68a;
  box-shadow: inset 3px 0 0 #ca8a04;
}

.agent-compliance-danger {
  border-color: #fecaca;
  box-shadow: inset 3px 0 0 #dc2626;
}

.agent-compliance-info {
  border-color: #bae6fd;
  box-shadow: inset 3px 0 0 #0284c7;
}

.agent-compliance-neutral {
  background: #f8fafc;
}

.agent-script-strip,
.agent-quick-disposition,
.agent-recovery {
  grid-column: 1 / -1;
}

.agent-script-strip {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-script-cue strong {
  max-height: 3.4rem;
  overflow: auto;
  white-space: pre-wrap;
}

.agent-quick-disposition,
.agent-recovery-actions,
.presence-quick-reasons,
.objection-insert-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.agent-quick-disposition .btn,
.presence-quick-reasons .btn,
.objection-insert-list .btn {
  min-height: 34px;
}

.agent-recovery {
  align-items: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.6rem 0.7rem;
}

.agent-recovery > span {
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}

.sales-console-customer {
  border-bottom: 1px solid var(--app-border);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr 1fr 1fr;
  padding-bottom: 1rem;
}

.compact-list {
  display: grid;
  gap: 0.4rem;
}

.compact-list div {
  align-items: baseline;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(88px, 0.75fr) minmax(0, 1fr);
}

.compact-list dt,
.compact-list dd {
  margin: 0;
}

.sales-console-warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  color: #78350f;
  padding: 0.75rem;
}

.sales-script-tabs {
  gap: 0.35rem;
}

.sales-script-tabs .nav-link {
  border-radius: 8px;
  color: var(--app-text);
  padding: 0.35rem 0.65rem;
}

.sales-script-tabs .nav-link.active {
  background: #0f766e;
}

.sales-script-content {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  min-height: 124px;
  padding: 0.85rem;
}

.sales-console-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.sales-console-outcome {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  padding: 0.85rem;
}

.sales-offer-list {
  display: grid;
  gap: 0.5rem;
}

.sales-offer-item {
  align-items: center;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  color: var(--app-text);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  text-decoration: none;
}

.sales-offer-item:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.softphone-status {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.softphone-timer {
  color: var(--app-success);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}

.softphone-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.softphone-controls form {
  margin: 0;
}

.browser-softphone-panel {
  border-color: #bae6fd;
}

.softphone-device-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
}

.softphone-media-state {
  border-top: 1px solid var(--app-border);
  display: grid;
  gap: 0.35rem;
  padding-top: 0.75rem;
}

.softphone-media-state div,
.media-event-item {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.softphone-media-state span,
.media-event-item span {
  color: var(--app-muted);
  min-width: 0;
  overflow-wrap: anywhere;
}

.softphone-media-state strong,
.media-event-item strong {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

.media-event-list {
  display: grid;
  gap: 0.25rem;
}

.media-event-item {
  background: #f8fafc;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
}

.playbook-panel {
  border-bottom: 1px solid var(--app-border);
  border-top: 1px solid var(--app-border);
  padding: 0.875rem 0;
}

.playbook-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.playbook-grid {
  display: grid;
  gap: 0.75rem;
}

.playbook-copy {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.system-list dt {
  color: var(--app-muted);
  font-weight: 600;
}

.system-list dd {
  font-family: "Cascadia Mono", Consolas, monospace;
  overflow-wrap: anywhere;
}

.notification-list {
  display: grid;
  gap: 0.75rem;
}

.notification-item {
  align-items: flex-start;
  border: 1px solid var(--app-border);
  border-radius: 8px;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.9rem;
}

.notification-item.unread {
  border-color: #bfdbfe;
  box-shadow: inset 3px 0 0 var(--app-accent);
}

.notification-main {
  min-width: 0;
}

.notification-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.notification-severity-info {
  background: #e0f2fe;
  color: #075985;
}

.notification-severity-success {
  background: #dcfce7;
  color: #166534;
}

.notification-severity-warning {
  background: #fef3c7;
  color: #92400e;
}

.notification-severity-danger {
  background: #fee2e2;
  color: #991b1b;
}

.wallboard-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.wallboard-metrics .metric-card {
  min-height: 104px;
}

@media (max-width: 575.98px) {
  .dashboard-header {
    align-items: flex-start;
    gap: 1rem;
  }

  .live-call-banner,
  .notification-item {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 1199.98px) {
  .agent-command-bar {
    grid-template-columns: 1fr;
    position: static;
  }

  .agent-screen-pop,
  .agent-compliance-stack,
  .agent-script-strip {
    grid-template-columns: 1fr;
  }

  .sales-console-command,
  .sales-console-customer {
    grid-template-columns: 1fr;
  }

  .sales-console-workflow {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .sales-console-readiness {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 575.98px) {
  .agent-screen-pop-metrics,
  .sales-console-workflow,
  .sales-console-readiness {
    grid-template-columns: 1fr;
  }

  .agent-recovery {
    align-items: stretch;
    flex-direction: column;
  }
}
