:root {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #1f2937;
  background: #f3f4f6;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: #f3f4f6;
}

.login-body {
  min-height: 100vh;
  display: block;
  padding: 0;
}

.login-shell {
  width: min(460px, 100%);
  margin: 36px auto 24px auto;
  padding: 0 16px;
}

.login-panel {
  display: grid;
  gap: 10px;
}

.login-panel button {
  margin-top: 6px;
}

.site-nav {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-nav-inner {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-nav-left,
.site-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-brand {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.page-content {
  padding: 24px;
}

.home-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #e5e7eb;
}

.workspace-shell {
  flex: 1;
  max-width: 100%;
  width: auto;
  margin: 24px 0 32px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
}

.left-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-self: stretch;
}

.left-rail-nav {
  display: grid;
  gap: 8px;
}

.left-rail-item {
  width: 100%;
  text-align: left;
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.left-rail-item.is-active {
  background: #0f766e;
  border-color: #115e59;
  color: #ffffff;
}

.dialer-card {
  display: grid;
  gap: 10px;
}

.dialer-title {
  margin: 0;
}

.dialer-actions {
  display: grid;
  gap: 8px;
}

.voicemail-picker {
  display: grid;
  gap: 6px;
}

.workspace-main {
  display: grid;
  gap: 8px;
  min-width: 0;
  align-content: flex-start;
}

.dashboard-main {
  display: grid;
  gap: 12px;
}

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

.dashboard-title {
  margin: 0;
  font-size: 1.4rem;
}

.dashboard-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-main .panel.customer-hero {
  padding: 12px 14px;
  box-shadow: none;
}

.dashboard-main .subtitle {
  margin-top: 2px;
  font-size: 0.9rem;
}

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

.dashboard-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  padding: 14px 16px;
  display: grid;
  gap: 4px;
}

.dashboard-card-label {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.dashboard-card-value {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
}

.setup-todo {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.setup-todo-heading {
  margin: 0 0 6px 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
}

.setup-todo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.setup-todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed #e5e7eb;
  background: #f9fafb;
}

.setup-todo-item.is-pending {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.setup-todo-item.is-complete {
  border-color: #bbf7d0;
  background: #ecfdf5;
  color: #166534;
}

.setup-todo-main {
  display: grid;
  gap: 2px;
}

.setup-todo-title {
  font-weight: 600;
  font-size: 0.9rem;
}

.setup-todo-text {
  font-size: 0.88rem;
}

.setup-todo-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
}

.customer-hero {
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1px solid #dbeafe;
  padding: 8px 12px;
  box-shadow: none;
}

.customer-eyebrow {
  margin: 0 0 4px 0;
  color: #475569;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.active-customer-name {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.1;
}

.settings-hero {
  padding: 6px 10px;
}

.settings-hero .active-customer-name {
  font-size: 1.25rem;
}

.settings-hero .subtitle {
  margin-top: 2px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.workspace-panel {
  padding-top: 14px;
}

.workspace-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.calls-main .calls-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.calls-main .calls-workspace-main {
  min-width: 0;
}

.calls-main .live-customer-hero {
  position: fixed;
  top: 88px;
  right: 32px;
  width: min(340px, 30vw);
  z-index: 10;
}

.live-call-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.live-init-button {
  white-space: nowrap;
}

.live-call-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.current-call-notes,
.current-call-followup {
  margin-top: 6px;
  font-size: 0.9rem;
}

.current-call-sms {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.current-call-sms-title {
  margin: 4px 0 0;
  font-size: 1rem;
}

.current-call-sms textarea {
  resize: vertical;
  min-height: 80px;
}

.workspace-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.workspace-tab.is-active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

.workspace-tab-panel {
  display: none;
}

.workspace-tab-panel.is-active {
  display: block;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.panel {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.panel.settings-hero {
  padding: 10px 14px;
}

h1, h2 {
  margin-top: 0;
}

.subtitle {
  margin-top: 0;
  color: #4b5563;
}

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

.row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.gap {
  gap: 10px;
  margin-bottom: 12px;
}

.muted {
  color: #4b5563;
}

.hidden {
  display: none;
}

input,
textarea,
select,
button {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 9px 10px;
}

label {
  display: block;
}

input {
  min-width: 180px;
}

input[type='checkbox'] {
  min-width: 0;
  width: auto;
}

input[type='file'] {
  min-width: 260px;
}

button {
  cursor: pointer;
  background: #2563eb;
  border-color: #1d4ed8;
  color: white;
  font-weight: 600;
}

.btn-secondary {
  background: #334155;
  border-color: #1e293b;
}

.btn-call {
  background: #047857;
  border-color: #065f46;
}

.btn-voicemail {
  background: #7c3aed;
  border-color: #6d28d9;
}

.btn-sms {
  background: #0f766e;
  border-color: #115e59;
}

.btn-success {
  background: #15803d;
  border-color: #166534;
}

.btn-danger {
  background: #dc2626;
  border-color: #b91c1c;
}

button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.link-button {
  display: inline-block;
  text-decoration: none;
  padding: 9px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #1f2937;
  background: #ffffff;
}

.status {
  margin-bottom: 12px;
  padding: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px;
}

td button {
  margin-right: 8px;
}

.phone-link {
  background: transparent;
  color: #1d4ed8;
  border: none;
  padding: 0;
  text-decoration: underline;
}

textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
}

audio {
  width: 100%;
}

.audio-preview {
  width: 100%;
  margin-top: 8px;
}

.recording {
  background: #dc2626;
  border-color: #b91c1c;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
  overflow-y: auto;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(960px, 100%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.2);
  padding: 18px;
}

.rapid-modal-card {
  width: min(1380px, calc(100vw - 20px));
  min-height: calc(100vh - 20px);
  border-radius: 14px;
  padding: 20px;
}

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

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
}

.rapid-customer-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 100%);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}

.rapid-customer-name {
  font-size: 1.6rem;
  font-weight: 700;
  color: #0f172a;
}

.rapid-customer-meta {
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #334155;
  font-size: 1.02rem;
}

.rapid-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: start;
}

.rapid-call-controls {
  margin-bottom: 12px;
}

.rapid-section-no-top-border {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.modal-section {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.modal-group {
  margin-top: 8px;
  margin-bottom: 10px;
}

.form-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  align-items: center;
  gap: 6px 10px;
  margin-top: 8px;
}

.form-row label {
  font-size: 0.9rem;
  color: #4b5563;
}

.inline-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.quick-actions button {
  background: #4f46e5;
  border-color: #4338ca;
}

.quick-actions button:nth-child(2) {
  background: #0f766e;
  border-color: #115e59;
}

.quick-actions button:nth-child(3) {
  background: #c2410c;
  border-color: #9a3412;
}

.quick-actions button:nth-child(4) {
  background: #b45309;
  border-color: #92400e;
}

.quick-actions button:nth-child(5) {
  background: #be123c;
  border-color: #9f1239;
}

.star-rating {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 10px;
}

.star-rating button {
  background: #e2e8f0;
  color: #334155;
  border-color: #cbd5e1;
  font-size: 1.05rem;
  line-height: 1;
  padding: 8px 10px;
}

.star-rating button.star-active {
  background: #f59e0b;
  border-color: #d97706;
  color: white;
}

.modal-footer-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.action-log-section {
  max-height: 420px;
  overflow: auto;
}

.action-log-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-log-list li {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #f8fafc;
}

.action-log-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

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

  .calls-main .live-customer-hero {
    position: static;
    margin-top: 12px;
  }
}

@media (max-width: 980px) {
  .site-nav-inner {
    padding: 10px 12px;
    flex-wrap: wrap;
  }

  .page-content {
    padding: 12px;
  }

  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .rapid-modal-grid {
    grid-template-columns: 1fr;
  }

  .rapid-modal-card {
    width: calc(100vw - 12px);
    min-height: calc(100vh - 12px);
    padding: 14px;
  }
}