@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Regular.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "General Sans";
  src: url("fonts/GeneralSans-Medium.woff") format("woff");
  font-display: swap;
  font-style: normal;
  font-weight: 700;
}

:root {
  --crm-color-bg: #eef3f7;
  --crm-color-surface: #ffffff;
  --crm-color-surface-muted: #f3f6f8;
  --crm-color-text: #1f2933;
  --crm-color-muted: #5b6870;
  --crm-color-line: #c8d2dc;
  --crm-color-brand-strong: #0067b8;
  --crm-color-info: var(--crm-color-brand-strong);
  --crm-color-warning: #b45309;
  --crm-color-danger: #b42318;

  --crm-font-ui: "Segoe UI", "General Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --crm-text-xs: 10px;
  --crm-text-sm: 11px;
  --crm-text-md: 12px;

  --crm-space-1: 4px;
  --crm-space-2: 6px;
  --crm-space-3: 8px;
  --crm-space-4: 12px;
  --crm-space-5: 16px;
  --crm-space-6: 20px;
  --crm-space-7: 24px;

  --crm-menu-gap: 10px;
  --crm-menu-link-padding-y: 4px;
  --crm-menu-link-padding-x: 6px;
  --crm-menu-height-min: 34px;

  --crm-input-height: 30px;
  --crm-input-padding-x: 7px;
  --crm-input-padding-y: 4px;
  --crm-input-border: 1px solid var(--crm-color-line);
  --crm-field-gap: 10px;
  --crm-form-row-gap: 12px;
  --crm-label-margin-bottom: 4px;

  --crm-button-height: 30px;
  --crm-button-padding-x: 14px;
  --crm-button-padding-y: 0;
  --crm-button-font-size: 12px;

  --crm-page-header-margin-bottom: 18px;
  --crm-section-margin-bottom: 20px;
  --crm-section-title-margin-bottom: 8px;
  --crm-block-gap: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--crm-color-bg);
  color: var(--crm-color-text);
  font-family: var(--crm-font-ui);
  font-size: var(--crm-text-md);
  line-height: 1.35;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid #8797a0;
  background: #f5f7f8;
}

.menu-bar {
  display: flex;
  min-height: var(--crm-menu-height-min);
  align-items: center;
  gap: var(--crm-space-3);
  padding: 0 var(--crm-space-3);
  border-bottom: 1px solid #c4cdd2;
  background: #fbfbfb;
}

.brand {
  display: flex;
  min-width: 150px;
  align-items: center;
  padding-right: 8px;
  border-right: 1px solid #c4cdd2;
}

.brand strong {
  color: var(--crm-color-text);
  font-size: 12px;
  font-weight: 650;
}

.nav,
.user-box,
.button-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav {
  flex: 0 1 auto;
  justify-content: flex-start;
  gap: var(--crm-menu-gap);
}

.nav a {
  display: flex;
  flex: 0 0 auto;
  min-height: 28px;
  align-items: center;
  padding: var(--crm-menu-link-padding-y) var(--crm-menu-link-padding-x);
  border: 1px solid transparent;
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  font-weight: 700;
}

.nav a:hover,
.nav a.active {
  border-color: var(--crm-color-brand-strong);
  background: #dcecfb;
}

.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  white-space: nowrap;
}

.user-box form {
  margin: 0;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--crm-page-header-margin-bottom);
}

h1 {
  margin: 0;
  font-size: 15px;
  line-height: 1.1;
  letter-spacing: 0;
}

.subtitle {
  max-width: 760px;
  margin: 1px 0 0;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.button,
button.button,
.command-button {
  min-height: var(--crm-button-height);
  border: 1px solid #005a9e;
  border-radius: 2px;
  background: var(--crm-color-brand-strong);
  color: #ffffff;
  padding: var(--crm-button-padding-y) var(--crm-button-padding-x);
  font: inherit;
  font-size: var(--crm-button-font-size);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.button:hover,
button.button:hover {
  border-color: #004f8c;
  background: #005a9e;
}

.button.secondary,
.command-button {
  border-color: #9fb1bb;
  background: #ffffff;
  color: var(--crm-color-text);
}

.button.secondary:hover,
.command-button:hover,
.command-button.active {
  border-color: #0067b8;
  background: #dcecfb;
}

.desktop-module {
  min-height: calc(100vh - 82px);
  border: 1px solid #9fb1bb;
  background: var(--crm-color-surface);
}

.desktop-module-fill {
  display: flex;
  height: calc(100vh - 82px);
  min-height: 520px;
  flex-direction: column;
}

/* Reusable CRM shell: page, module header, command bar, sections, forms, tables, empty states. */
.crm-page {
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - var(--crm-menu-height-min));
  background: var(--crm-color-bg);
}

.crm-workspace {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 24px 40px;
}

.crm-module-header {
  display: grid;
  gap: 0;
  margin-bottom: 18px;
}

.crm-module-header-main {
  display: grid;
  gap: 2px;
}

.crm-module-title {
  margin: 0 0 2px;
  color: var(--crm-color-text);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
}

.crm-module-subtitle {
  margin: 0 0 10px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-md);
  line-height: 1.35;
}

.crm-command-bar {
  display: flex;
  min-height: 28px;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 18px;
}

.crm-command-bar a,
.crm-command-bar span,
.crm-command-bar button {
  color: var(--crm-color-text);
  font: inherit;
  font-size: var(--crm-text-md);
}

.crm-command-bar a {
  color: var(--crm-color-brand-strong);
  text-decoration: none;
}

.crm-command-bar a:hover {
  text-decoration: underline;
}

.crm-command-bar span[aria-disabled="true"] {
  color: var(--crm-color-muted);
}

/* Full-screen CRM operating shell for dense desktop modules. */
.crm-os-page {
  display: grid;
  height: calc(100vh - var(--crm-menu-height-min));
  min-height: 0;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--crm-color-bg);
}

.crm-os-page--with-header {
  grid-template-rows: auto auto 1fr;
}

.crm-os-page--with-meta {
  grid-template-rows: auto auto 1fr;
}

.crm-os-header {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  background: var(--crm-color-bg);
}

.crm-os-title {
  margin: 0;
  color: var(--crm-color-text);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
}

.crm-os-subtitle {
  margin: 2px 0 0;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-os-commandbar {
  display: flex;
  min-height: 30px;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
  font-size: var(--crm-text-md);
}

.crm-os-commandbar a {
  color: var(--crm-color-brand-strong);
  text-decoration: none;
}

.crm-os-commandbar a:hover {
  text-decoration: underline;
}

.crm-os-commandbar span[aria-disabled="true"] {
  color: var(--crm-color-muted);
}

.crm-os-meta {
  display: flex;
  min-height: 28px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f8fafc;
  color: var(--crm-color-text);
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-os-meta strong {
  margin-right: 4px;
  color: var(--crm-color-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.crm-os-body {
  display: grid;
  min-height: 0;
  overflow: hidden;
  background: var(--crm-color-surface);
}

.crm-os-body--marketing {
  grid-template-columns: minmax(0, 1fr);
}

.crm-os-body--tools {
  grid-template-columns: minmax(0, 1fr);
}

.crm-os-body--single {
  grid-template-columns: minmax(0, 1fr);
}

.crm-os-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-right: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
}

.crm-os-pane:last-child {
  border-right: 0;
}

.crm-os-pane--main {
  grid-template-rows: 150px minmax(120px, 34vh) minmax(320px, 1fr);
}

.crm-os-pane--side {
  border-right: 0;
  border-left: 1px solid var(--crm-color-line);
}

.crm-os-body--tools .crm-os-pane {
  grid-template-rows: auto minmax(90px, 210px) minmax(0, 1fr);
  border-right: 0;
}

.crm-os-body--single .crm-os-pane {
  grid-template-rows: minmax(0, 1fr);
  border-right: 0;
}

.crm-os-pane-header {
  min-height: 30px;
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f8fafc;
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  font-weight: 600;
  line-height: 1.25;
}

.crm-os-pane-body {
  min-height: 0;
  overflow: auto;
}

.crm-os-pane-description,
.crm-os-pane-count {
  margin: 0;
  padding: 8px 10px 0;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-os-pane-count {
  padding-top: 4px;
  padding-bottom: 8px;
}

.crm-os-section-note {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--crm-color-line);
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-os-section-note strong {
  color: var(--crm-color-muted);
  font-weight: 600;
  white-space: nowrap;
}

.crm-os-section {
  display: grid;
  min-height: 0;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-bottom: 1px solid var(--crm-color-line);
}

.crm-os-section:last-child {
  border-bottom: 0;
}

.crm-os-section-header {
  min-height: 28px;
  margin: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f8fafc;
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  font-weight: 600;
  line-height: 1.25;
}

.crm-os-section-body {
  min-height: 0;
  overflow: auto;
}

.crm-os-preview-body {
  padding: 10px;
}

.crm-os-form {
  display: grid;
  gap: 0;
  background: var(--crm-color-surface);
}

.crm-os-form-grid {
  display: grid;
  grid-template-columns: minmax(360px, 520px) 260px;
  gap: 18px;
  align-items: start;
  padding: 10px;
}

.crm-os-form-actions {
  display: flex;
  align-items: center;
  gap: var(--crm-space-2);
  padding: 0 10px 10px;
}

.crm-os-form input,
.crm-os-form select,
.crm-os-form textarea {
  min-height: 28px;
  border: 1px solid var(--crm-color-line);
  background: #ffffff;
  padding: 4px 7px;
  font-size: var(--crm-text-md);
}

.crm-os-form input[type="file"] {
  padding: 3px 7px;
}

.crm-os-form.tools-upload-form {
  max-width: none;
}

.crm-os-form--single .form-grid {
  max-width: 900px;
  padding: 10px;
}

.crm-os-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-os-pane--main .crm-os-table {
  min-width: 860px;
}

.crm-os-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 5px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #dbeaf2;
  color: #35424a;
  font-size: var(--crm-text-xs);
  font-weight: 600;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-os-table td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  vertical-align: top;
}

.crm-os-table tbody tr:hover td {
  background: #f7fafb;
}

.crm-os-table a {
  color: var(--crm-color-brand-strong);
  text-decoration: none;
}

.crm-os-table a:hover {
  text-decoration: underline;
}

.crm-os-table--permission {
  min-width: 720px;
}

.module-titlebar {
  min-height: 18px;
  padding: 2px 6px;
  background: #0067b8;
  color: #ffffff;
  font-size: var(--crm-text-sm);
  font-weight: 650;
}

.command-strip {
  display: flex;
  min-height: 32px;
  align-items: stretch;
  gap: 0;
  padding: 4px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #eef4f7;
}

.command-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border-right: 1px solid #c4cdd2;
}

.command-group span {
  color: var(--crm-color-muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.command-group strong {
  font-size: var(--crm-text-sm);
  line-height: 1.2;
  white-space: nowrap;
}

.today-command-strip {
  min-height: 28px;
}

.today-filter-groups {
  gap: 4px;
}

.today-filter-groups span:not(:first-child) {
  margin-left: 8px;
}

.today-submenu-link {
  min-height: 20px;
  padding: 3px 5px;
  color: var(--crm-color-text);
  font-size: var(--crm-text-sm);
  font-weight: 650;
}

.today-submenu-link:hover,
.today-submenu-link.active {
  color: var(--crm-color-brand-strong);
  text-decoration: underline;
}

.queue-strip {
  display: grid;
  grid-template-columns: repeat(8, minmax(110px, 1fr));
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
}

.queue-strip a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 23px;
  align-items: center;
  gap: 4px;
  padding: 2px 5px;
  border-right: 1px solid #d2dadd;
  color: var(--crm-color-text);
  font-size: var(--crm-text-sm);
}

.queue-strip a:hover {
  background: #dcecfb;
}

.queue-strip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-strip strong {
  color: #0067b8;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
}

.workspace-single {
  display: block;
}

.inbox-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 0;
}

.crm-inbox-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(440px, 2fr);
  gap: 18px;
  align-items: stretch;
  padding: 14px;
  background: #f7fafb;
}

.crm-detail-command-strip {
  min-height: 32px;
  padding: 3px 6px;
}

.crm-detail-command-group {
  gap: 8px;
  padding: 0 6px;
}

.crm-detail-command-group .today-submenu-link {
  min-height: 24px;
  padding: 4px 6px;
  font-size: var(--crm-text-md);
  line-height: 1.25;
}

.crm-chat-panel {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.crm-side-panel {
  min-width: 0;
  height: 100%;
  border: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
  font-size: var(--crm-text-md);
}

.crm-conversation-card {
  overflow: hidden;
  border: 1px solid var(--crm-color-line);
  border-radius: 4px;
  background: #ffffff;
}

.crm-conversation-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f8fafc;
  color: #1e3a8a;
  font-size: 13px;
  font-weight: 700;
}

.crm-conversation-header small {
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  font-weight: 400;
}

.crm-conversation-thread {
  display: grid;
  min-height: 430px;
  max-height: calc(100vh - 300px);
  align-content: start;
  gap: 16px;
  overflow: auto;
  padding: 24px 22px 28px;
  background: #ffffff;
}

.crm-chat-message {
  display: grid;
  min-width: 0;
}

.crm-chat-message-inbound {
  justify-items: start;
}

.crm-chat-message-outbound {
  justify-items: end;
}

.crm-chat-message-system {
  justify-items: center;
}

.crm-chat-label {
  max-width: min(66%, 540px);
  margin-bottom: 4px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-xs);
  font-weight: 650;
  line-height: 1.2;
}

.crm-chat-message-outbound .crm-chat-label {
  text-align: right;
}

.crm-chat-message-system .crm-chat-label {
  display: none;
}

.crm-chat-bubble {
  max-width: min(72%, 680px);
  min-width: 180px;
  padding: 12px 16px 10px;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--crm-color-text);
  font-size: 14px;
  line-height: 1.45;
}

.crm-chat-text {
  white-space: pre-wrap;
}

.crm-chat-message-outbound .crm-chat-bubble {
  background: #2563eb;
  color: #ffffff;
}

.crm-chat-message-system .crm-chat-bubble {
  max-width: min(78%, 620px);
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-xs);
  text-align: center;
}

.crm-chat-time {
  margin-top: 6px;
  color: var(--crm-color-muted);
  font-size: 12px;
  line-height: 1.2;
}

.crm-chat-message-outbound .crm-chat-time {
  color: #dbeafe;
}

.crm-chat-message-system .crm-chat-time {
  display: none;
}

.crm-side-panel section + section {
  border-top: 1px solid var(--crm-color-line);
}

.crm-side-panel h3 {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #d9e8ef;
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  font-weight: 650;
}

.crm-side-panel .crm-kv-table th {
  width: 128px;
  background: #f7fafb;
  color: var(--crm-color-muted);
}

.crm-side-panel .crm-kv-table th,
.crm-side-panel .crm-kv-table td {
  padding: 7px 10px;
  line-height: 1.35;
  vertical-align: middle;
}

.crm-action-stack {
  display: grid;
  gap: 6px;
  padding: 10px 12px 12px;
}

.crm-action-stack a,
.crm-action-stack form,
.crm-action-stack button {
  width: 100%;
  justify-self: start;
}

.crm-action-stack .today-action-link,
.crm-action-stack .link-button {
  display: block;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 4px;
  color: var(--crm-color-text);
  font: inherit;
  font-size: var(--crm-text-md);
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
}

.crm-action-stack .today-action-link:hover,
.crm-action-stack .link-button:hover {
  background: #eef4f7;
}

.grid-block {
  min-width: 0;
  border-right: 1px solid var(--crm-color-line);
  border-bottom: 1px solid var(--crm-color-line);
}

.grid-block-main {
  grid-row: span 2;
}

.grid-title {
  min-height: 19px;
  padding: 2px 5px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #d9e8ef;
  color: var(--crm-color-text);
  font-size: var(--crm-text-sm);
  font-weight: 650;
}

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

th,
td {
  padding: 2px 4px;
  border-right: 1px solid #d2dadd;
  border-bottom: 1px solid #d2dadd;
  text-align: left;
  vertical-align: top;
}

th {
  background: #d9e8ef;
  color: #35424a;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

tbody tr:nth-child(even) td {
  background: #f5f8fa;
}

tbody tr:hover td {
  background: #fff8d6;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:focus td {
  background: #dcecfb;
  outline: 1px solid var(--crm-color-brand-strong);
  outline-offset: -1px;
}

.compact-table {
  font-size: 11px;
  line-height: 1.3;
}

.compact-table th,
.compact-table td {
  height: 27px;
  padding: 5px 6px;
}

.compact-table a {
  color: var(--crm-color-brand-strong);
}

.patient-link {
  color: var(--crm-color-brand-strong);
}

.patient-link:hover strong {
  text-decoration: underline;
}

.email-link {
  color: var(--crm-color-brand-strong);
}

.email-link:hover {
  text-decoration: underline;
}

.grid-table-fill {
  flex: 1;
  overflow: hidden;
  border-bottom: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
}

.pagination-strip {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 3px;
  padding: 2px 5px;
  border-top: 1px solid var(--crm-color-line);
  background: #eef4f7;
}

.pagination-current,
.pagination-disabled {
  display: inline-flex;
  min-height: 19px;
  align-items: center;
  padding: 1px 5px;
  border: 1px solid #c4cdd2;
  background: #ffffff;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.pagination-current {
  color: var(--crm-color-text);
  font-weight: 650;
}

.status {
  display: inline-flex;
  min-height: 16px;
  align-items: center;
  padding: 0 4px;
  border: 1px solid var(--crm-color-line);
  border-radius: 0;
  background: #edf3f5;
  color: var(--crm-color-brand-strong);
  font-size: var(--crm-text-xs);
  font-weight: 650;
}

.status.warning {
  background: #fff7ed;
  color: var(--crm-color-warning);
}

.status.danger {
  background: #fef3f2;
  color: var(--crm-color-danger);
}

.status.info {
  background: #eff6ff;
  color: var(--crm-color-info);
}

.filters,
.criteria-strip {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px 220px auto;
  align-items: end;
  gap: 5px;
  padding: 4px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
}

.criteria-strip > label {
  margin-bottom: 0;
}

.criteria-strip > .button {
  display: inline-flex;
  min-height: var(--crm-input-height);
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.form-control {
  width: 100%;
  min-height: var(--crm-input-height);
  border: var(--crm-input-border);
  border-radius: 0;
  background: var(--crm-color-surface);
  color: var(--crm-color-text);
  padding: var(--crm-input-padding-y) var(--crm-input-padding-x);
  font: inherit;
  font-size: var(--crm-text-md);
  line-height: 1.35;
}

.form-control:focus {
  border-color: var(--crm-color-brand-strong);
  outline: 1px solid var(--crm-color-brand-strong);
}

label {
  display: block;
  margin-bottom: var(--crm-label-margin-bottom);
  color: var(--crm-color-muted);
  font-size: var(--crm-text-md);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.form-surface {
  display: grid;
  gap: 5px;
  padding: 5px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
}

.case-create-form {
  gap: 8px;
  padding: 8px;
}

.case-form-section {
  border: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
}

.case-form-section-title {
  margin: 0 0 6px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  background: var(--crm-color-bg);
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  font-weight: 700;
}

.case-form-section > .form-grid,
.case-form-section > .crm-field {
  padding: 6px;
}

.case-patient-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px;
}

.case-patient-summary > div {
  display: grid;
  gap: 2px;
}

.case-patient-summary span {
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.case-execution-note {
  margin: 0;
  padding: 2px 7px 7px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.case-execution-note strong {
  color: var(--crm-color-text);
}

.case-form-advanced {
  padding: 7px 8px;
  border: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
}

.case-form-advanced summary {
  color: var(--crm-color-text);
  font-weight: 700;
  cursor: pointer;
}

.case-form-advanced p {
  margin: 6px 0;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.case-automation-field {
  display: flex;
  align-items: center;
  gap: 6px;
}

.case-automation-field label {
  margin: 0;
  color: var(--crm-color-text);
  font-weight: 400;
  text-transform: none;
}

.case-automation-field input {
  width: auto;
  min-height: 0;
}

.case-form-actions {
  display: flex;
  justify-content: flex-end;
  padding: 2px 1px;
}

.case-form-submit {
  appearance: none;
  min-height: 32px;
  padding: 7px 9px;
  border: 0;
  background: transparent;
  color: var(--crm-color-brand-strong);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.case-form-submit:hover {
  background: var(--crm-color-surface-muted);
  text-decoration: underline;
}

.case-form-submit:focus-visible {
  outline: 2px solid var(--crm-color-brand-strong);
  outline-offset: 2px;
}

.form-grid > div {
  display: grid;
  gap: 2px;
}

.form-grid textarea,
.form-grid div:has(textarea) {
  grid-column: 1 / -1;
}

.crm-section {
  margin-bottom: 16px;
  padding: 18px 20px;
  border: 1px solid var(--crm-color-line);
  border-radius: 2px;
  background: var(--crm-color-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.crm-section:last-child {
  margin-bottom: 0;
}

.crm-section-title {
  margin: 0 0 14px;
  color: var(--crm-color-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.crm-section-description {
  margin: -6px 0 12px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-md);
  line-height: 1.4;
}

.crm-form {
  display: grid;
  gap: var(--crm-field-gap);
  padding: var(--crm-space-4);
  background: var(--crm-color-surface);
}

.crm-field {
  display: grid;
  gap: 2px;
}

.crm-label,
.crm-field-label {
  display: block;
  margin-bottom: 5px;
  color: #45525f;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-field label {
  margin-bottom: var(--crm-label-margin-bottom);
}

.crm-form-grid {
  display: grid;
  grid-template-columns: minmax(360px, 560px) 260px;
  gap: 20px;
  align-items: start;
}

.crm-form-actions {
  display: flex;
  align-items: center;
  gap: var(--crm-space-2);
  margin-top: 16px;
}

.crm-help {
  max-width: 520px;
  margin: 5px 0 0;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-actions {
  display: flex;
  align-items: center;
  gap: var(--crm-space-2);
  padding-top: var(--crm-space-1);
}

.crm-command-links {
  display: flex;
  align-items: center;
  gap: var(--crm-menu-gap);
  white-space: nowrap;
}

.crm-command-links a {
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  text-decoration: none;
}

.crm-command-links a:hover {
  color: var(--crm-color-brand-strong);
}

.crm-data-table th {
  width: 132px;
}

.crm-definition-grid {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 8px 18px;
  max-width: 640px;
  margin: 0;
}

.crm-definition-grid dt {
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.crm-definition-grid dd {
  margin: 0;
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
}

.crm-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.crm-scroll-region {
  max-height: 420px;
  overflow: auto;
}

.patient-tab-scroll {
  height: calc(100vh - 310px);
  min-height: 240px;
  overflow: auto;
}

.patient-tab-scroll .crm-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--crm-color-surface-muted);
}

.crm-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.35;
}

.crm-table th,
.crm-table td {
  padding: 6px 8px;
  border-right: 0;
  border-bottom: 1px solid #e2e8ee;
  vertical-align: middle;
}

.crm-table th {
  height: 28px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #dbeaf2;
  color: #35424a;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.crm-table tbody tr:hover td {
  background: #f7fafb;
}

.crm-table a {
  color: var(--crm-color-brand-strong);
  text-decoration: none;
}

.crm-table a:hover {
  text-decoration: underline;
}

.crm-table-empty,
.crm-empty-state {
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  line-height: 1.45;
}

.crm-table-empty {
  padding: 10px 8px;
  text-align: left;
}

.crm-message-preview {
  display: -webkit-box;
  max-width: 620px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

.marketing-template-table {
  table-layout: fixed;
}

.crm-worksheet {
  border: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
}

.crm-worksheet-meta {
  display: flex;
  min-height: 32px;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 32px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--crm-color-line);
  color: var(--crm-color-text);
  font-size: 11px;
  line-height: 1.35;
}

.crm-worksheet-meta strong {
  margin-right: 4px;
  color: var(--crm-color-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.crm-worksheet-section {
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--crm-color-line);
}

.crm-worksheet-section:last-child {
  border-bottom: 0;
}

.crm-worksheet-title {
  margin: 0 0 8px;
  color: var(--crm-color-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.crm-worksheet-description {
  margin: -2px 0 6px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
  line-height: 1.35;
}

.crm-worksheet-count {
  margin: 0 0 8px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.crm-worksheet-table th,
.crm-worksheet-table td {
  padding: 5px 6px;
}

.crm-worksheet-table th {
  font-size: 10px;
}

.crm-permission-scroll {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--crm-color-line);
}

.crm-permission-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.crm-permission-table {
  min-width: 0;
}

.recall-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--crm-space-4);
  width: 100%;
}

.recall-header-actions {
  margin-top: var(--crm-space-1);
}

.recall-header-actions a {
  color: var(--crm-color-brand-strong);
  text-decoration: underline;
}

.recall-admin-layout {
  display: grid;
  gap: 0;
  padding: var(--crm-space-3);
  background: #f7fafb;
}

.recall-action-form {
  padding: var(--crm-space-4);
}

.recall-form-row {
  display: grid;
  gap: var(--crm-form-row-gap);
}

.recall-action-form > div,
.recall-form-row > div {
  display: grid;
  gap: 0;
}

.recall-action-form textarea {
  min-height: 96px;
  resize: vertical;
}

.recall-action-submit-row {
  justify-content: flex-start;
}

.recall-action-submit {
  min-width: 0;
}

.recall-history-section {
  overflow-x: auto;
}

.recall-empty-history {
  padding: 7px 8px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.record-header {
  border-bottom: 1px solid var(--crm-color-line);
  background: var(--crm-color-surface);
}

.record-header table {
  min-width: 0;
}

.record-header th {
  width: 82px;
}

.record-header th,
.record-header td {
  padding-top: 1px;
  padding-bottom: 1px;
}

.patient-detail-screen {
  gap: 0;
}

.patient-page-header h1 {
  margin-bottom: 2px;
}

.patient-page-header .subtitle {
  margin-bottom: var(--crm-space-2);
}

.patient-command-bar {
  display: flex;
  min-height: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--crm-space-2);
  margin-top: var(--crm-space-1);
  margin-bottom: var(--crm-space-4);
  color: var(--crm-color-muted);
  font-size: var(--crm-text-md);
}

.crm-command-link {
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  text-decoration: none;
}

.crm-command-link:hover {
  color: var(--crm-color-brand-strong);
  text-decoration: underline;
}

.patient-summary-block {
  padding: var(--crm-space-3) var(--crm-space-4);
  border-top: 1px solid var(--crm-color-line);
}

.crm-summary-table {
  table-layout: fixed;
  margin-bottom: 18px;
}

.crm-summary-table th {
  width: 136px;
  text-align: left;
  white-space: nowrap;
}

.crm-summary-table td {
  text-align: left;
}

.crm-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: var(--crm-space-5);
  margin-bottom: var(--crm-space-4);
  padding: 0 0 var(--crm-space-1);
  border-bottom: 1px solid var(--crm-color-line);
  font-size: var(--crm-text-md);
}

.crm-tab {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 22px;
  align-items: center;
  padding-bottom: var(--crm-space-1);
  border-bottom: 2px solid transparent;
  color: var(--crm-color-text);
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.crm-tab:hover {
  color: var(--crm-color-brand-strong);
  text-decoration: underline;
}

.crm-tab--active {
  border-bottom-color: var(--crm-color-brand-strong);
  color: var(--crm-color-brand-strong);
  font-weight: 650;
  text-decoration: none;
}

.patient-tab-nav {
  margin-right: var(--crm-space-3);
  margin-left: var(--crm-space-3);
}

.patient-tab-section {
  margin: 0 var(--crm-space-3) var(--crm-space-5);
}

.patient-tab-section .crm-section-title {
  min-height: 0;
  margin: 0 0 var(--crm-space-3);
  padding: 0;
  border-bottom: 0;
  background: transparent;
}

.patient-section-body {
  padding: var(--crm-space-3);
  overflow-x: auto;
}

.patient-detail-screen .crm-data-table th,
.patient-detail-screen .crm-data-table td {
  min-height: 27px;
  padding: 5px 8px;
  line-height: 1.3;
  text-align: left;
}

.patient-detail-screen tbody tr:hover td {
  background: var(--crm-color-surface);
}

.patient-detail-screen tbody tr:nth-child(even):hover td {
  background: #f5f8fa;
}

.patient-detail-screen .crm-data-table thead th {
  width: auto;
}

.patient-detail-screen .crm-data-table tbody th {
  width: 132px;
}

.patient-permission-form {
  max-width: 520px;
  margin-top: var(--crm-space-3);
  padding: var(--crm-space-3) 0 0;
  border-top: 1px solid var(--crm-color-line);
}

.patient-permission-types {
  margin: 0;
  padding: 0;
  border: 0;
}

.patient-permission-types > .permission-checkboxes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  padding: 8px;
  border: var(--crm-input-border);
}

.patient-permission-types > .permission-checkboxes label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--crm-color-text);
  font-weight: 400;
  text-transform: none;
}

.patient-permission-types input[type="checkbox"] {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.patient-empty-state {
  margin: 0;
  padding: 5px 6px;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.tabs {
  border: 0;
  background: var(--crm-color-surface);
}

.tabs > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-list {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--crm-color-line);
  background: #d9e8ef;
}

.tab-list label {
  display: flex;
  min-height: 22px;
  align-items: center;
  padding: 3px 8px;
  border-right: 1px solid var(--crm-color-line);
  color: var(--crm-color-text);
  font-size: var(--crm-text-sm);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.tab-list label:hover {
  background: #f7fafb;
}

.tab-page {
  display: none;
  padding: 3px;
}

#tab-datos:checked ~ .tab-list label[for="tab-datos"],
#tab-permisos:checked ~ .tab-list label[for="tab-permisos"],
#tab-interacciones:checked ~ .tab-list label[for="tab-interacciones"],
#tab-presupuestos:checked ~ .tab-list label[for="tab-presupuestos"],
#tab-recalls:checked ~ .tab-list label[for="tab-recalls"],
#tab-notas:checked ~ .tab-list label[for="tab-notas"] {
  border-top: 1px solid var(--crm-color-brand-strong);
  background: var(--crm-color-surface);
}

#tab-datos:checked ~ .tab-datos,
#tab-permisos:checked ~ .tab-permisos,
#tab-interacciones:checked ~ .tab-interacciones,
#tab-presupuestos:checked ~ .tab-presupuestos,
#tab-recalls:checked ~ .tab-recalls,
#tab-notas:checked ~ .tab-notas {
  display: block;
}

.inline-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr)) auto;
  align-items: end;
  gap: 4px;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1px solid var(--crm-color-line);
}

.inline-form > div {
  display: grid;
  gap: 1px;
}

.inline-form textarea {
  min-height: 30px;
}

.subsection-title {
  margin: 6px 0 2px;
  font-size: var(--crm-text-sm);
  text-transform: uppercase;
}

.notes-box {
  min-height: 110px;
  padding: 4px;
  border: 1px solid var(--crm-color-line);
  background: #fbfcfc;
}

.messages {
  display: grid;
  gap: 3px;
  margin-bottom: 3px;
}

.message,
.error {
  padding: 4px 6px;
  border: 1px solid var(--crm-color-line);
  border-radius: 0;
  background: var(--crm-color-surface);
}

.error {
  border-color: #f4b5ad;
  background: #fef3f2;
  color: var(--crm-color-danger);
}

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

.crm-table-compact th,
.crm-table-compact td {
  padding: 1px 3px;
}

.patient-table-wrap {
  overflow: auto;
}

.inbox-table-wrap {
  overflow: auto;
}

.recall-table-wrap {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.recall-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--crm-color-surface-muted);
}

.crm-list-table-wrap {
  min-height: 0;
  flex: 1;
  overflow: auto;
}

.crm-list-sticky-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--crm-color-surface-muted);
}

.communication-date-cell {
  width: 112px;
  min-width: 112px;
  white-space: nowrap;
}

.communication-channel-cell {
  width: 128px;
  min-width: 128px;
}

.inbox-count-text {
  padding: 2px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.inbox-status-summary {
  display: flex;
  min-height: 20px;
  align-items: center;
  gap: 12px;
  padding: 2px 6px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #fbfcfc;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-sm);
}

.inbox-criteria-strip {
  grid-template-columns: minmax(220px, 1fr) 145px 125px 150px 72px auto;
}

.case-filter-form {
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
}

.case-filter-table {
  width: auto;
  min-width: 760px;
}

.case-filter-table th,
.case-filter-table td {
  height: 22px;
  padding: 1px 4px;
  vertical-align: middle;
}

.case-filter-table th {
  width: 54px;
  white-space: nowrap;
}

.case-filter-search {
  width: 260px;
}

.case-filter-queue {
  width: 180px;
}

.case-filter-channel {
  width: 135px;
}

.case-filter-rows {
  width: 58px;
}

.case-filter-action {
  width: 54px;
}

.case-filter-submit {
  min-height: 18px;
  color: var(--crm-color-text);
  line-height: 1.1;
}

.case-table {
  table-layout: fixed;
}

.case-table th,
.case-table td {
  height: 21px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.case-subtext {
  color: var(--crm-color-muted);
  font-size: var(--crm-text-xs);
}

.inbox-table {
  min-width: 1120px;
  table-layout: fixed;
}

.inbox-table th,
.inbox-table td {
  height: 21px;
  padding: 2px 4px;
  line-height: 1.2;
  text-align: center;
  vertical-align: middle;
}

.inbox-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  padding-top: 2px;
  padding-bottom: 2px;
  white-space: nowrap;
}

.inbox-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inbox-table th:nth-child(4),
.inbox-table td:nth-child(4) {
  text-align: left;
}

.inbox-table .col-date {
  width: 12%;
}

.inbox-table .col-patient {
  width: 18%;
}

.inbox-table .col-status {
  width: 13%;
}

.inbox-table .col-intent {
  width: 32%;
}

.inbox-table .col-responsible {
  width: 12%;
}

.inbox-table .col-channel {
  width: 8%;
}

.inbox-table .col-action {
  width: 5%;
}

.inbox-detail-meta th {
  width: 92px;
}

.inbox-detail-meta th,
.inbox-detail-meta td {
  padding: 2px 5px;
  vertical-align: middle;
}

.inbox-action-list {
  display: flex;
  min-height: 23px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 5px;
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
}

.inbox-reply-form {
  display: grid;
  gap: 8px;
  padding: 10px 12px 12px;
}

.inbox-reply-form textarea {
  min-height: 92px;
  padding: 8px 10px;
  line-height: 1.4;
  resize: vertical;
}

.form-help {
  margin: 0;
  color: var(--crm-color-muted);
  font-size: var(--crm-text-xs);
}

.form-help.inbox-reply-help {
  display: block;
  margin: 10px 12px 12px;
  padding: 12px 14px;
  border: 1px solid #d8e7ee;
  border-radius: 4px;
  background: #f6fafc;
  color: var(--crm-color-text);
  font-size: var(--crm-text-md);
  line-height: 1.5;
}

.form-errors {
  padding: 4px 5px;
  border: 1px solid #f4b5ad;
  background: #fef3f2;
  color: var(--crm-color-danger);
  font-size: var(--crm-text-sm);
}

.form-warning,
.form-success {
  margin: 8px;
  padding: 5px 6px;
  border: 1px solid #d7c58b;
  background: #fff8df;
  color: #6f5600;
  font-size: var(--crm-text-sm);
}

.form-success {
  border-color: #9bc5a7;
  background: #eefaf1;
  color: #1f6f3b;
}

.form-warning ul {
  margin: 4px 0 0 16px;
  padding: 0;
}

.patient-filter-form {
  border-bottom: 1px solid var(--crm-color-line);
  background: #f7fafb;
}

.patient-filter-table {
  width: auto;
  min-width: 640px;
}

.patient-filter-table th,
.patient-filter-table td {
  height: 22px;
  padding: 1px 4px;
  vertical-align: middle;
}

.patient-filter-table th {
  width: 54px;
  white-space: nowrap;
}

.patient-filter-search {
  width: 260px;
}

.patient-filter-status {
  width: 150px;
}

.patient-filter-rows {
  width: 58px;
}

.patient-filter-action {
  width: 66px;
}

.patient-filter-submit {
  display: inline-flex;
  min-height: var(--crm-input-height);
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.patient-table {
  min-width: 900px;
  table-layout: fixed;
}

.patient-table th,
.patient-table td {
  height: 27px;
  padding: 5px 6px;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
}

.patient-table th:nth-child(2),
.patient-table td:nth-child(2),
.patient-table th:nth-child(8),
.patient-table td:nth-child(8) {
  text-align: left;
}

.patient-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.patient-table .col-history-number {
  width: 9%;
}

.patient-table .col-patient {
  width: 24%;
}

.patient-table .col-phone {
  width: 13%;
}

.patient-table .col-status {
  width: 13%;
}

.patient-table .col-last-visit {
  width: 11%;
}

.patient-table .col-days {
  width: 11%;
}

.patient-table .col-next-visit {
  width: 11%;
}

.patient-table .col-action {
  width: 8%;
}

.patient-table .cell-nowrap,
.patient-table .cell-strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-upload-form {
  max-width: 940px;
}

.crm-page .crm-form-compact input,
.crm-page .crm-form-compact select,
.crm-page .crm-form-compact textarea {
  min-height: 30px;
  border: 1px solid #b8c4ce;
  background: #ffffff;
  padding: 4px 7px;
  font-size: var(--crm-text-md);
}

.tools-upload-form input[type="file"] {
  padding: 3px 7px;
}

.tools-import-grid {
  grid-template-columns: minmax(360px, 560px) 260px;
}

.tools-sheet-field {
  max-width: 320px;
}

.tools-confirm-form {
  margin-top: 8px;
}

.tools-summary-table {
  max-width: 520px;
  margin-top: 8px;
}

.tools-summary-table th {
  width: 180px;
}

.crm-page .form-warning,
.crm-page .form-success {
  margin: 8px 0 0;
  padding: 6px 0 0;
  border: 0;
  border-top: 1px solid var(--crm-color-line);
  background: transparent;
  color: var(--crm-color-text);
}

.crm-page .form-warning ul {
  margin: 4px 0 0 16px;
  padding: 0;
}

.today-table-wrap {
  overflow: auto;
}

.today-table {
  min-width: 1650px;
  table-layout: fixed;
}

.today-table th,
.today-table td {
  height: 27px;
  padding: 5px 6px;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
}

.today-table th {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-table th:nth-child(10),
.today-table td:nth-child(10) {
  text-align: left;
}

.today-table .col-priority {
  width: 5%;
}

.today-table .col-patient {
  width: 12%;
}

.today-table .col-phone {
  width: 8%;
}

.today-table .col-work {
  width: 10%;
}

.today-table .col-action {
  width: 14%;
}

.today-table .col-due {
  width: 8%;
}

.today-table .col-next-attempt {
  width: 10%;
}

.today-table .col-status {
  width: 8%;
}

.today-table .col-execution {
  width: 9%;
}

.today-table .col-detail {
  width: 10%;
}

.today-table .col-actions {
  width: 4%;
}

.today-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-due-text {
  font-weight: 650;
}

.today-due-text.today {
  color: var(--crm-color-info);
}

.today-due-text.overdue {
  color: var(--crm-color-danger);
}

.today-action-link {
  color: var(--crm-color-text);
  font-weight: 650;
}

.today-action-link:hover {
  text-decoration: underline;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--crm-color-text);
  padding: 0;
  font: inherit;
  font-size: var(--crm-text-sm);
  font-weight: 650;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.crm-form-compact .form-control,
.crm-form-compact input,
.crm-form-compact select,
.crm-form-compact textarea {
  min-height: 20px;
  padding: 1px 4px;
  font-size: 11px;
}

.crm-form-compact textarea {
  height: 22px;
  resize: vertical;
}

.crm-record-header {
  font-size: 11px;
}

.crm-tabs .tab-list label {
  min-height: 21px;
  padding: 2px 7px;
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 48px 48px 48px 150px;
  background:
    linear-gradient(rgba(0, 0, 0, 0.26), rgba(0, 0, 0, 0.26)),
    url("login-background.jpg") center / cover no-repeat;
}

.login {
  width: 420px;
  padding: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: login-panel-enter 300ms ease both;
  transition: transform 250ms ease, box-shadow 250ms ease;
}

.login h1 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.15;
}

.login p {
  margin: 0 0 36px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
}

.login label {
  display: block;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  font-weight: 600;
}

.login input {
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
}

.login input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.login .password-field {
  position: relative;
  display: block;
  margin-top: 8px;
}

.login .password-field input {
  margin-top: 0;
  padding-right: 36px;
}

.login input:focus {
  border-color: var(--crm-color-brand-strong);
  box-shadow: 0 0 0 3px rgba(0, 103, 184, 0.18);
  outline: 0;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.74);
  cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus {
  color: #ffffff;
  outline: 0;
}

.password-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login .error {
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(180, 35, 24, 0.2);
  color: #ffffff;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
}

.login-submit {
  width: 100%;
  height: 54px;
  border: 1px solid var(--crm-color-brand-strong);
  border-radius: 14px;
  background: var(--crm-color-brand-strong);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 250ms ease, background 250ms ease, box-shadow 250ms ease;
}

.login-submit:hover,
.login-submit:focus {
  transform: translateY(-1px);
  background: #0878d1;
  box-shadow: 0 12px 30px rgba(0, 103, 184, 0.35);
  outline: 0;
}

.login-caption {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  text-align: center;
}

@keyframes login-panel-enter {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 1100px) {
  .menu-bar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .recall-page-header {
    flex-direction: column;
  }

  .recall-header-actions {
    flex-wrap: wrap;
  }

  .queue-strip,
  .workspace-grid,
  .recall-form-row,
  .inline-form,
  .filters,
  .criteria-strip,
  .form-grid,
  .crm-form-grid {
    grid-template-columns: 1fr;
  }

  .crm-worksheet-meta {
    gap: 6px 18px;
  }

  .crm-os-page {
    height: auto;
    min-height: calc(100vh - var(--crm-menu-height-min));
    overflow: visible;
  }

  .crm-os-body,
  .crm-os-body--marketing,
  .crm-os-body--tools,
  .crm-os-pane,
  .crm-os-pane--main,
  .crm-os-body--tools .crm-os-pane {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow: visible;
  }

  .crm-os-pane,
  .crm-os-pane--side {
    border-right: 0;
    border-left: 0;
    border-bottom: 1px solid var(--crm-color-line);
  }

  .crm-os-section,
  .crm-os-pane-body,
  .crm-os-section-body {
    overflow: visible;
  }

  .crm-os-form-grid {
    grid-template-columns: 1fr;
  }

  .crm-inbox-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .login-page {
    justify-content: center;
    padding: 24px 16px;
  }

  .login {
    width: min(420px, 100%);
    padding: 28px;
  }

  .main {
    padding: 8px;
  }

  .crm-workspace {
    padding: 16px 0 24px;
  }

  .topbar {
    flex-direction: column;
  }

  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }
}
