:root {
  --dialer-bg: #ffffff;
  --dialer-surface: #ffffff;
  --dialer-surface-soft: #f7f7f7;
  --dialer-border: #dedede;
  --dialer-text: #111111;
  --dialer-muted: #6a6a6a;
  --dialer-primary: #111111;
  --dialer-primary-dark: #111111;
  --dialer-accent: #111111;
  --dialer-ok-bg: #e8f7ee;
  --dialer-ok-text: #10633a;
  --dialer-warn-bg: #fff4e5;
  --dialer-warn-text: #975a16;
  --dialer-bad-bg: #fdecec;
  --dialer-bad-text: #a12b2b;
  --dialer-shadow: 0 10px 24px rgba(0, 0, 0, 0.04);
}

body.login,
body {
  background: var(--dialer-bg);
  color: var(--dialer-text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

#header {
  background: #111111;
  color: #fff;
  box-shadow: none;
}

#header a:link,
#header a:visited {
  color: #fff;
}

.dialer-branding {
  display: flex;
  align-items: center;
}

.dialer-brand {
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dialer-brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.dialer-brand-subtitle {
  font-size: 12px;
  opacity: 0.75;
}

#content {
  max-width: 1500px;
}

h1,
h2,
h3,
.module caption,
#content h1 {
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: #111111;
  letter-spacing: 0;
}

.module,
#content-main .module,
.inline-group,
.submit-row,
.breadcrumbs {
  border-radius: 16px;
}

.module,
.inline-group,
#changelist-filter,
#changelist .actions,
#changelist table thead th,
#content-related .module {
  border-color: var(--dialer-border);
}

.module,
.inline-group,
#changelist-filter {
  background: var(--dialer-surface);
  box-shadow: var(--dialer-shadow);
}

.button,
input[type=submit],
input[type=button],
.submit-row input,
a.button {
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
  box-shadow: none;
}

.button:hover,
input[type=submit]:hover,
input[type=button]:hover,
.submit-row input:hover,
a.button:hover {
  transform: translateY(-1px);
  box-shadow: none;
}

.button.default,
input[type=submit].default,
.submit-row input.default {
  background: var(--dialer-primary);
}

.button,
input[type=button],
a.button {
  background: var(--dialer-primary-dark);
}

.button.default:hover,
input[type=submit].default:hover,
.submit-row input.default:hover {
  background: #000000;
}

.dialer-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 20px;
  background: var(--dialer-surface);
  border: 1px solid var(--dialer-border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: none;
}

.dialer-page-head h1 {
  margin: 0 0 8px;
}

.dialer-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--dialer-muted);
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}

.dialer-muted {
  color: var(--dialer-muted);
}

.dialer-page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button.button-secondary {
  background: #ffffff;
  color: var(--dialer-primary-dark);
  border: 1px solid var(--dialer-border);
}

.button.button-danger,
a.button.button-danger {
  background: #b53a3a;
  color: #fff;
  border: 1px solid #9f2f2f;
}

.dialer-kpi-grid,
.dialer-status-grid {
  display: grid;
  gap: 14px;
}

.dialer-kpi-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 20px;
}

.dialer-kpi-card,
.dialer-status-card {
  background: var(--dialer-surface);
  border: 1px solid var(--dialer-border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: none;
}

.dialer-kpi-card p,
.dialer-status-kind {
  color: var(--dialer-muted);
  margin: 0 0 8px;
}

.dialer-kpi-card h2 {
  margin: 0 0 6px;
  font-size: 34px;
}

.dialer-kpi-card small,
.dialer-status-card small {
  color: var(--dialer-muted);
}

.dialer-status-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.dialer-status-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.dialer-status-pill,
.dialer-status-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 12px;
}

.status-ok .dialer-status-pill,
.dialer-status-badge.status-ok {
  background: var(--dialer-ok-bg);
  color: var(--dialer-ok-text);
}

.status-warn .dialer-status-pill {
  background: var(--dialer-warn-bg);
  color: var(--dialer-warn-text);
}

.status-bad .dialer-status-pill,
.dialer-status-badge.status-bad {
  background: var(--dialer-bad-bg);
  color: var(--dialer-bad-text);
}

.dialer-status-banner {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid var(--dialer-border);
  border-radius: 14px;
  background: var(--dialer-surface);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  box-shadow: none;
}

.dialer-row-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dialer-row-tools .button {
  padding: 6px 10px;
  font-size: 12px;
}

.dialer-status-badge small {
  font-weight: 500;
  font-size: 11px;
}

.dialer-bulk-form {
  margin-bottom: 14px;
}

.dialer-bulk-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--dialer-border);
  border-radius: 14px;
  background: var(--dialer-surface);
}

.dialer-bulk-label,
.dialer-bulk-counter {
  color: var(--dialer-text);
  font-weight: 600;
}

#changelist #changelist-form .results,
#changelist #changelist-form #result_list,
#changelist #changelist-form .paginator {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#changelist #changelist-form table {
  min-width: max-content;
}

#changelist #changelist-form .results table {
  width: max-content;
  min-width: 100%;
}

#changelist table thead th {
  background: #fafafa;
  color: #4f4f4f;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#changelist table tbody tr:nth-child(even) {
  background: #fcfcfc;
}

#changelist table tbody tr:hover {
  background: #f2f2f2;
}

#changelist table tbody th,
#changelist table tbody td {
  border-color: #ededed;
}

#changelist-search input[type="text"],
#searchbar,
input[type="text"],
input[type="number"],
input[type="url"],
input[type="email"],
input[type="password"],
textarea,
select {
  border-radius: 14px;
  border: 1px solid var(--dialer-border);
  background: #ffffff;
  box-shadow: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #111111;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.aligned label,
form .aligned p.help,
.form-row label {
  color: #222222;
}

.app-dialer.model-siptrunk .actions {
  display: none;
}

.app-dialer.model-callscenario .actions {
  display: none;
}

.app-dialer.model-campaign .actions {
  display: none;
}

.app-dialer.model-callscenario .related-widget-wrapper-link,
.app-dialer.model-callscenario .related-widget-wrapper a,
.app-dialer.model-callscenario a.add-another,
.app-dialer.model-callscenario a.change-related,
.app-dialer.model-callscenario a.delete-related,
.app-dialer.model-callscenario a.view-related {
  display: none !important;
}

.field-current_numbers .readonly,
.field-knowledge_documents_summary .readonly {
  line-height: 1.6;
}

.help,
.helptext,
.fieldBox .help,
.fieldBox .helptext,
.form-row .help,
.form-row .helptext,
.aligned .help,
.aligned .helptext {
  margin-top: 6px;
  color: var(--dialer-muted);
  font-size: 12px;
  line-height: 1.45;
}

#nav-sidebar {
  background: #fafafa;
  border-right: 1px solid #e5e5e5;
  backdrop-filter: none;
}

#nav-sidebar .current-app .section,
#nav-sidebar .current-model {
  background: #efefef;
}

#nav-sidebar a,
#nav-sidebar th,
#nav-sidebar td {
  color: #333333;
}

#nav-sidebar .module caption,
#nav-sidebar .module h2 {
  background: #111111;
  color: #ffffff;
  border-radius: 0;
}

#user-tools {
  font-size: 14px;
}

.breadcrumbs {
  background: #ffffff;
  border: 1px solid var(--dialer-border);
  box-shadow: none;
}

.submit-row {
  background: var(--dialer-surface);
  box-shadow: none;
}

@media (max-width: 900px) {
  .dialer-page-head {
    flex-direction: column;
  }
}

.call-log-change-form #content {
  max-width: none;
}

.call-log-change-form .readonly {
  width: 100%;
}

.call-log-panel {
  min-width: 0;
  width: 100%;
}

.call-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.call-log-toolbar input[type="search"] {
  min-width: min(360px, 100%);
  margin: 0;
}

.call-log-count {
  color: var(--dialer-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.call-log-copy-all {
  background: #111111 !important;
  border-color: #111111 !important;
  color: #ffffff !important;
}

.call-log-copy-all:hover,
.call-log-copy-all:focus {
  background: #333333 !important;
  border-color: #333333 !important;
}

.call-log-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--dialer-border);
  background: var(--dialer-border);
}

.call-log-card {
  min-width: 0;
  padding: 12px 14px;
  background: #ffffff;
}

.call-log-card span,
.call-log-card strong {
  display: block;
}

.call-log-card span {
  margin-bottom: 5px;
  color: var(--dialer-muted);
  font-size: 12px;
}

.call-log-card strong {
  overflow-wrap: anywhere;
  color: #111111;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.call-log-table-wrap {
  max-width: 100%;
  max-height: 720px;
  overflow: auto;
  border: 1px solid var(--dialer-border);
  background: #ffffff;
}

.call-log-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.call-log-table th,
.call-log-table td {
  padding: 9px 11px;
  border-bottom: 1px solid var(--dialer-border);
  color: #222222;
  text-align: left;
  vertical-align: top;
}

.call-log-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f7f7;
  font-size: 12px;
}

.call-log-table tbody th {
  width: 220px;
  background: #fafafa;
  font-weight: 600;
}

.call-log-table code,
.call-log-table pre,
.call-log-pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.call-log-table pre {
  max-width: 900px;
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.call-log-pre {
  max-height: 600px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border: 1px solid var(--dialer-border);
  background: #fafafa;
  color: #111111;
  font-size: 12px;
  line-height: 1.55;
  tab-size: 2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.call-log-transcript {
  font-family: inherit;
  font-size: 14px;
}

.call-log-details {
  margin-top: 10px;
}

.call-log-details summary {
  margin-bottom: 10px;
  color: #111111;
  cursor: pointer;
  font-weight: 600;
}

.call-log-empty {
  padding: 12px 14px;
  border-left: 3px solid #777777;
  background: #f7f7f7;
  color: var(--dialer-muted);
}

.call-log-plain-source {
  display: none;
}

@media (max-width: 767px) {
  .call-log-card-grid {
    grid-template-columns: 1fr 1fr;
  }

  .call-log-toolbar input[type="search"] {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .call-log-card-grid {
    grid-template-columns: 1fr;
  }
}
