:root {
  --ink: #173b4d;
  --muted: #6c8794;
  --line: #dcebf0;
  --canvas: #f3fafc;
  --panel: #ffffff;
  --primary: #39b7c7;
  --primary-dark: #168ba0;
  --primary-soft: #e7f8fb;
  --accent: #75cfda;
  --danger: #d85f68;
  --warning: #d59739;
  --success: #2f9b78;
  --navy: #123a50;
  --shadow: 0 16px 42px rgba(30, 107, 127, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "DM Sans", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 28px 18px 18px;
  overflow-y: auto;
  color: var(--ink);
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 10px 28px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  clip-path: circle(48%);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-family: "Manrope", sans-serif;
  font-size: 18px;
}

.brand span {
  margin-top: 2px;
  color: var(--primary-dark);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 4px;
}

.nav-section {
  margin: 17px 14px 5px;
  color: #91a8b2;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 12px 14px;
  color: #5f7a87;
  background: transparent;
  border: 0;
  border-radius: 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.nav-item.active {
  box-shadow: inset 3px 0 var(--primary);
}

.nav-icon {
  width: 22px;
  font-size: 19px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.security-note {
  padding: 12px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 1px solid #cdeff3;
  border-radius: 12px;
}

.security-note span,
.security-note small {
  display: block;
}

.security-note span {
  font-size: 12px;
  font-weight: 700;
}

.security-note small {
  margin-top: 4px;
  color: var(--muted);
}

.profile {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

.profile strong,
.profile small {
  display: block;
}

.profile strong {
  font-size: 13px;
}

.profile small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.search {
  display: flex;
  gap: 9px;
  align-items: center;
  width: min(380px, 45vw);
  padding: 10px 14px;
  color: var(--muted);
  background: var(--canvas);
  border: 1px solid transparent;
  border-radius: 11px;
}

.search:focus-within {
  background: #fff;
  border-color: #83d6df;
}

.search input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-button,
.mobile-menu {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.icon-button span {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  background: #cf5757;
  border: 2px solid #fff;
  border-radius: 50%;
}

.mobile-menu {
  display: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--primary);
  border: 1px solid var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid transparent;
}

.ghost-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.danger-button {
  color: #fff;
  background: var(--danger);
  border: 1px solid var(--danger);
}

.view-root {
  max-width: 1500px;
  margin: 0 auto;
  padding: 34px;
}

.page-heading {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 26px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: "Manrope", sans-serif;
}

h1 {
  margin-bottom: 7px;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.035em;
}

.page-heading p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
}

.date-chip {
  padding: 10px 14px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.stat-card {
  padding: 18px;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.stat-icon {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
}

.stat-value {
  display: block;
  margin: 16px 0 5px;
  font-family: "Manrope", sans-serif;
  font-size: 27px;
  font-weight: 800;
}

.stat-trend {
  color: var(--success);
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 18px;
}

.panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  padding: 19px 20px;
  border-bottom: 1px solid var(--line);
}

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

.panel-body {
  padding: 20px;
}

.schedule-list {
  display: grid;
}

.schedule-item {
  display: grid;
  grid-template-columns: 68px 4px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
}

.schedule-item:last-child {
  border-bottom: 0;
}

.schedule-time {
  color: var(--ink);
  font-weight: 700;
}

.schedule-line {
  width: 4px;
  height: 38px;
  background: var(--primary);
  border-radius: 8px;
}

.schedule-line.gold {
  background: var(--accent);
}

.schedule-line.gray {
  background: #a9b5b3;
}

.schedule-patient strong,
.schedule-patient span {
  display: block;
}

.schedule-patient span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.status.confirmed,
.status.paid {
  color: var(--success);
  background: #e8f5ee;
}

.status.waiting,
.status.pending {
  color: var(--warning);
  background: #fff4e3;
}

.status.canceled,
.status.overdue {
  color: var(--danger);
  background: #fbeaea;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.quick-action {
  min-height: 104px;
  padding: 16px;
  color: var(--ink);
  background: #f8faf9;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: left;
}

.quick-action:hover {
  border-color: #9ac3bd;
  transform: translateY(-1px);
}

.quick-action span {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 13px;
  place-items: center;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 9px;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action small {
  margin-top: 4px;
  color: var(--muted);
}

.alert-card {
  display: flex;
  gap: 12px;
  margin-top: 18px;
  padding: 14px;
  color: #6d521d;
  background: #fff8e9;
  border: 1px solid #f2dfb8;
  border-radius: 12px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

.filter-select {
  padding: 10px 34px 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

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

.data-table th,
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.data-table th {
  color: var(--muted);
  background: #fafcfb;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table td {
  font-size: 13px;
}

.patient-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}

.patient-cell .avatar {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.patient-cell strong,
.patient-cell small {
  display: block;
}

.patient-cell small {
  margin-top: 2px;
  color: var(--muted);
}

.empty-state {
  padding: 50px 20px;
  color: var(--muted);
  text-align: center;
}

.recipe-grid,
.message-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 18px;
}

.template-list,
.conversation-list {
  display: grid;
}

.template-item,
.conversation-item {
  padding: 15px 18px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.template-item:hover,
.template-item.active,
.conversation-item:hover,
.conversation-item.active {
  background: var(--primary-soft);
}

.template-item strong,
.template-item small,
.conversation-item strong,
.conversation-item small {
  display: block;
}

.template-item small,
.conversation-item small {
  margin-top: 5px;
  color: var(--muted);
}

.document-preview {
  min-height: 580px;
  padding: 46px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.document-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--primary);
}

.document-title {
  margin: 42px 0 30px;
  text-align: center;
}

.document-body {
  line-height: 1.7;
}

.document-footer {
  margin-top: 80px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.chart {
  display: flex;
  gap: 12px;
  align-items: end;
  height: 210px;
  padding: 15px 0 0;
}

.bar-group {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: end;
  height: 100%;
  color: var(--muted);
  font-size: 11px;
}

.bar {
  width: min(38px, 80%);
  min-height: 8px;
  background: linear-gradient(180deg, #2d8b81, var(--primary));
  border-radius: 7px 7px 3px 3px;
}

.message-layout {
  min-height: 620px;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: #f7faf9;
}

.bubble {
  max-width: 72%;
  padding: 11px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
}

.bubble.incoming {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.bubble.outgoing {
  align-self: flex-end;
  color: #fff;
  background: var(--primary);
  border-bottom-right-radius: 4px;
}

.bubble small {
  display: block;
  margin-top: 5px;
  opacity: 0.7;
  text-align: right;
}

.chat-compose {
  display: flex;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.chat-compose input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
}

.chat-compose input:focus {
  border-color: #8ebdb6;
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(12, 31, 29, 0.48);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

.modal-header,
.modal-footer {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 19px 22px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  font-size: 19px;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
}

.close-button {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f4f7f6;
  border: 0;
  border-radius: 9px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  color: #455654;
  font-size: 12px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #d9e3e1;
  border-radius: 10px;
  outline: 0;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #79aaa4;
  box-shadow: 0 0 0 3px rgba(23, 107, 99, 0.08);
}

.form-warning {
  margin-bottom: 18px;
  padding: 11px 13px;
  color: #745418;
  background: #fff6e4;
  border-radius: 9px;
  font-size: 12px;
}

.toast {
  position: fixed;
  z-index: 30;
  right: 24px;
  bottom: 24px;
  padding: 13px 16px;
  color: #fff;
  background: #183f3b;
  border-radius: 11px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1050px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 15;
    left: -270px;
    width: 248px;
    transition: left 0.2s ease;
  }

  body.menu-open .sidebar {
    left: 0;
  }

  .mobile-menu {
    display: grid;
  }

  .topbar {
    gap: 12px;
    padding: 0 16px;
  }

  .search {
    width: auto;
    flex: 1;
  }

  .primary-button[data-action="new-appointment"] {
    display: none;
  }

  .view-root {
    padding: 24px 16px;
  }

  .recipe-grid,
  .message-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .stats-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .page-heading,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar-group {
    flex-wrap: wrap;
  }

  .schedule-item {
    grid-template-columns: 54px 3px 1fr;
  }

  .schedule-item .status {
    display: none;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .data-table th:nth-child(3),
  .data-table td:nth-child(3) {
    display: none;
  }

  .document-preview {
    padding: 24px;
  }
}

/* Essence v2 */

button {
  color: inherit;
}

.clinic-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.clinic-status i {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px #e5f7f0;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #d7e9ee;
  border-radius: 10px;
}

.sidebar-footer {
  padding-top: 24px;
}

.panel-header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.text-button,
.back-button,
.row-action {
  color: var(--primary-dark);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 700;
}

.back-button {
  margin-bottom: 18px;
  padding: 0;
  font-size: 13px;
}

.schedule-item {
  width: 100%;
  background: #fff;
  border: 0;
  text-align: left;
}

.schedule-item:hover {
  background: #f8fdfe;
}

.schedule-line.purple {
  background: #8b83dc;
}

.schedule-line.blue {
  background: #55a8e5;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.chart-tall {
  height: 250px;
}

.bar-value {
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
}

.bar {
  background: linear-gradient(180deg, #72cfda, #34aebf);
}

.attention-list {
  display: grid;
  padding: 5px 20px 15px;
}

.attention-item {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.attention-item:last-child {
  border-bottom: 0;
}

.attention-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border-radius: 10px;
  font-weight: 800;
}

.attention-icon.warning {
  color: #ad741d;
  background: #fff3d9;
}

.attention-icon.info {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.attention-item strong,
.attention-item small,
.compact-treatment strong,
.compact-treatment small {
  display: block;
}

.attention-item strong,
.compact-treatment strong {
  font-size: 13px;
}

.attention-item small,
.compact-treatment small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.compact-treatment-list {
  display: grid;
}

.compact-treatment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 32px;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.mini-progress,
.progress {
  overflow: hidden;
  height: 7px;
  background: #e5f1f4;
  border-radius: 999px;
}

.mini-progress i,
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #7cd4df);
  border-radius: inherit;
}

.compact-treatment > span {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.agenda-toolbar,
.clinical-toolbar,
.report-filters {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.segmented {
  display: flex;
  padding: 3px;
  background: #eaf4f7;
  border-radius: 11px;
}

.segmented button {
  padding: 8px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.segmented button.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 4px 14px rgba(33, 105, 124, 0.12);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.week-day {
  display: grid;
  gap: 4px;
  padding: 14px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: center;
}

.week-day strong {
  color: var(--ink);
  font-size: 20px;
}

.week-day small {
  font-size: 10px;
}

.week-day.active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.week-day.active strong {
  color: #fff;
}

.agenda-layout,
.odontogram-layout,
.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 18px;
}

.agenda-summary .panel-body {
  display: grid;
  gap: 15px;
}

.donut-wrap {
  display: grid;
  padding: 10px 0 18px;
  place-items: center;
}

.donut {
  display: grid;
  width: 150px;
  height: 150px;
  place-content: center;
  background: radial-gradient(circle at center, #fff 54%, transparent 55%), conic-gradient(var(--primary) 0 80%, #e7f2f5 80%);
  border-radius: 50%;
  text-align: center;
}

.donut strong,
.donut span {
  display: block;
}

.donut strong {
  font-size: 26px;
}

.donut span {
  color: var(--muted);
  font-size: 11px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.summary-row span {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.dot.blue {
  background: var(--primary);
}

.dot.yellow {
  background: #e3ad48;
}

.dot.gray {
  background: #b7c7cd;
}

.dot.coral {
  background: #ee8589;
}

.patient-summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--muted);
}

.patient-summary strong {
  color: var(--primary-dark);
  font-size: 22px;
}

.patient-summary span + strong {
  margin-left: 18px;
}

.patient-link {
  padding: 0;
  background: transparent;
  border: 0;
  text-align: left;
}

.tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.tag.alert {
  color: #b45c61;
  background: #fff0f1;
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.patient-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 24px;
  background: linear-gradient(135deg, #fff, #effbfc);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.patient-identity,
.patient-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.patient-identity h1 {
  margin-bottom: 4px;
}

.patient-identity p {
  margin: 0;
  color: var(--muted);
}

.avatar-lg {
  width: 58px;
  height: 58px;
  font-size: 16px;
}

.avatar-xl {
  width: 76px;
  height: 76px;
  font-size: 20px;
}

.clinical-alert {
  margin-bottom: 16px;
  padding: 13px 16px;
  color: #a64f59;
  background: #fff0f2;
  border: 1px solid #f6d5d9;
  border-radius: 12px;
  font-size: 13px;
}

.clinical-alert.compact {
  margin: 14px 0;
  text-align: left;
}

.patient-profile-grid,
.clinical-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.patient-profile-grid > aside,
.clinical-grid > aside,
.patient-content,
.settings-content {
  display: grid;
  gap: 18px;
  align-content: start;
}

.profile-card,
.mini-card,
.patient-mini-profile,
.checklist-card {
  padding-bottom: 18px;
}

.profile-details {
  display: grid;
  padding: 0 20px;
}

.detail-row {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row span {
  color: var(--muted);
  font-size: 11px;
}

.detail-row strong {
  font-size: 13px;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 14px;
}

.profile-metrics div {
  display: grid;
  gap: 3px;
  text-align: center;
}

.profile-metrics strong {
  color: var(--primary-dark);
  font-size: 21px;
}

.profile-metrics span {
  color: var(--muted);
  font-size: 10px;
}

.profile-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 5px;
  background: #eaf4f7;
  border-radius: 12px;
}

.profile-tabs button {
  padding: 9px 13px;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

.profile-tabs button.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgba(20, 85, 104, 0.1);
}

.treatment-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.treatment-cards.inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

.treatment-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.treatment-card-top,
.progress-label,
.treatment-values {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.treatment-card h3 {
  margin: 16px 0 5px;
  font-size: 15px;
}

.treatment-card p,
.treatment-card > small {
  color: var(--muted);
  font-size: 11px;
}

.progress-label {
  margin: 18px 0 7px;
  color: var(--muted);
  font-size: 11px;
}

.treatment-values {
  margin: 14px 0;
}

.treatment-values span {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
}

.treatment-values strong {
  color: var(--ink);
  font-size: 12px;
}

.timeline {
  display: grid;
  padding: 20px 24px;
}

.timeline.large {
  min-height: 440px;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 12px;
  padding-bottom: 20px;
}

.timeline-item::before {
  position: absolute;
  top: 16px;
  bottom: -2px;
  left: 6px;
  width: 2px;
  content: "";
  background: #dceef2;
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 5px;
  background: var(--primary);
  border: 4px solid #dff5f8;
  border-radius: 50%;
}

.timeline-card {
  padding: 16px;
  background: #f8fcfd;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.timeline-card h3 {
  margin: 12px 0 6px;
  font-size: 14px;
}

.timeline-card p {
  color: #536f7a;
  font-size: 13px;
  line-height: 1.6;
}

.timeline-card > small {
  color: var(--muted);
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}

.inline-field {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-field select {
  min-width: 220px;
  padding: 10px 34px 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.patient-mini-profile {
  padding: 24px;
  text-align: center;
}

.patient-mini-profile .avatar {
  margin: 0 auto 12px;
}

.patient-mini-profile h2 {
  margin-bottom: 4px;
}

.patient-mini-profile p {
  color: var(--muted);
  font-size: 12px;
}

.patient-mini-profile .tags {
  justify-content: center;
}

.check-list,
.health-chips {
  display: grid;
  gap: 11px;
  padding: 16px 20px 4px;
}

.check-list span {
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 12px;
}

.check {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
}

.check.yes {
  color: var(--success);
  background: #e8f6ef;
}

.check.no {
  color: var(--warning);
  background: #fff3dd;
}

.health-chips span {
  padding: 9px 10px;
  color: var(--muted);
  background: #f4fafb;
  border-radius: 9px;
  font-size: 11px;
}

.odontogram-panel {
  min-height: 510px;
}

.odontogram {
  display: grid;
  gap: 20px;
  padding: 30px 24px;
}

.arch-label {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
}

.teeth-row {
  display: grid;
  grid-template-columns: repeat(16, minmax(32px, 1fr));
  gap: 5px;
}

.tooth {
  display: grid;
  gap: 5px;
  justify-items: center;
  padding: 5px 1px;
  background: transparent;
  border: 0;
}

.tooth span {
  color: var(--muted);
  font-size: 9px;
}

.tooth i {
  position: relative;
  width: 28px;
  height: 38px;
  background: #fff;
  border: 2px solid #bcd6dd;
  border-radius: 50% 50% 42% 42%;
  box-shadow: inset 0 -7px 0 #edf6f8;
}

.teeth-row.lower .tooth i {
  transform: rotate(180deg);
}

.tooth:hover i {
  transform: translateY(-3px);
}

.teeth-row.lower .tooth:hover i {
  transform: rotate(180deg) translateY(-3px);
}

.tooth.watch i {
  background: #fff1c8;
  border-color: #e2ad3e;
}

.tooth.treatment i {
  background: #ffdfe2;
  border-color: #de6d76;
}

.tooth.done i {
  background: #dff6f8;
  border-color: var(--primary);
}

.tooth.absent i {
  opacity: 0.35;
  background: #dfe7e9;
  border-style: dashed;
}

.tooth.absent i::after {
  position: absolute;
  inset: 5px;
  content: "×";
  color: #657a82;
  font-size: 18px;
  font-style: normal;
  transform: rotate(0);
}

.midline {
  height: 1px;
  background: linear-gradient(90deg, transparent, #bddce3 20%, #bddce3 80%, transparent);
}

.odontogram-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--muted);
  font-size: 10px;
}

.odontogram-legend span,
.odontogram-count span {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tooth-color {
  width: 11px;
  height: 11px;
  border: 2px solid #bcd6dd;
  border-radius: 4px;
}

.tooth-color.watch {
  background: #fff1c8;
  border-color: #e2ad3e;
}

.tooth-color.treatment {
  background: #ffdfe2;
  border-color: #de6d76;
}

.tooth-color.done {
  background: #dff6f8;
  border-color: var(--primary);
}

.tooth-color.absent {
  background: #dfe7e9;
  border-color: #9dacb1;
}

.odontogram-summary .panel-body {
  display: grid;
  gap: 0;
}

.odontogram-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.odontogram-count strong {
  color: var(--ink);
}

.full-button {
  width: 100%;
  margin-top: 18px;
}

.tooth-history {
  margin-top: 18px;
}

.document-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.document-template {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  box-shadow: var(--shadow);
}

.document-template > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 12px;
}

.document-template strong,
.document-template small {
  display: block;
}

.document-template small {
  margin-top: 3px;
  color: var(--muted);
}

.document-template b {
  color: var(--primary);
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
}

.compact-preview {
  min-height: 520px;
}

.document-header img {
  width: 110px;
  height: 58px;
  object-fit: cover;
  object-position: center;
  clip-path: inset(8% 0 8% 0 round 8px);
}

.finance-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.5fr);
  margin-bottom: 18px;
}

.dual-chart {
  gap: 18px;
}

.dual-bars {
  display: flex;
  gap: 4px;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.dual-bars .bar {
  width: 16px;
}

.dual-bars .cost {
  background: #ef8b91;
}

.chart-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}

.payment-donut {
  display: grid;
  width: 155px;
  height: 155px;
  margin: 5px auto 24px;
  place-content: center;
  background: radial-gradient(circle, #fff 55%, transparent 56%), conic-gradient(var(--primary) 0 46%, #6c8fe1 46% 78%, #7ad1ad 78% 92%, #e8b965 92%);
  border-radius: 50%;
  text-align: center;
}

.payment-donut strong,
.payment-donut span {
  display: block;
}

.payment-donut span {
  color: var(--muted);
  font-size: 10px;
}

.payment-row {
  display: grid;
  grid-template-columns: 60px 1fr 34px;
  gap: 8px;
  align-items: center;
  margin-top: 11px;
  color: var(--muted);
  font-size: 11px;
}

.payment-row > div {
  height: 6px;
  background: #edf3f5;
  border-radius: 999px;
}

.payment-row i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.stock-level {
  display: flex;
  gap: 9px;
  align-items: center;
}

.stock-level > div {
  width: 72px;
  height: 6px;
  overflow: hidden;
  background: #e8f0f2;
  border-radius: 999px;
}

.stock-level i {
  display: block;
  height: 100%;
  background: var(--success);
}

.stock-level i.low {
  background: var(--warning);
}

.report-filters {
  justify-content: flex-start;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.report-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.report-filters select {
  min-width: 180px;
  padding: 9px 30px 9px 10px;
  background: #f8fbfc;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.reports-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 18px;
}

.wide-report {
  grid-row: span 2;
}

.line-chart {
  position: relative;
  height: 300px;
}

.line-chart svg {
  width: 100%;
  height: 250px;
  overflow: visible;
}

.line-chart .area {
  fill: url(#area);
}

.line-chart .line {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-width: 5;
}

.line-labels {
  display: flex;
  justify-content: space-around;
  color: var(--muted);
  font-size: 10px;
}

.ranking-list {
  display: grid;
  gap: 18px;
  padding: 18px 20px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 22px 1fr 24px;
  gap: 10px;
  align-items: center;
}

.ranking-item > span {
  color: var(--primary);
  font-weight: 800;
}

.ranking-item div {
  display: grid;
  gap: 7px;
}

.ranking-item strong {
  font-size: 12px;
}

.ranking-item i {
  height: 5px;
  overflow: hidden;
  background: #e8f2f4;
  border-radius: 999px;
}

.ranking-item i::after {
  display: block;
  width: inherit;
  height: 100%;
  content: "";
  background: var(--primary);
  border-radius: inherit;
}

.professional-report {
  display: grid;
  padding: 10px 20px;
}

.professional-report > div {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.professional-report strong,
.professional-report small {
  display: block;
}

.professional-report small {
  color: var(--muted);
  font-size: 10px;
}

.professional-report i {
  display: block;
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  background: #e8f2f4;
  border-radius: 999px;
}

.professional-report i b {
  display: block;
  height: 100%;
  background: var(--primary);
}

.message-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.message-kpis div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-right: 1px solid var(--line);
}

.message-kpis div:last-child {
  border-right: 0;
}

.message-kpis span {
  color: var(--muted);
  font-size: 11px;
}

.message-kpis strong {
  color: var(--primary-dark);
  font-size: 18px;
}

.message-layout {
  grid-template-columns: 280px minmax(360px, 1fr) 260px;
  gap: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.message-layout > * {
  min-width: 0;
  border-right: 1px solid var(--line);
}

.message-layout > *:last-child {
  border-right: 0;
}

.conversations-panel,
.chat-panel,
.contact-panel {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.conversation-search {
  display: flex;
  gap: 7px;
  margin: 0 14px 10px;
  padding: 9px 11px;
  background: #f2f8fa;
  border-radius: 9px;
}

.conversation-search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
}

.conversation-item {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 9px;
  align-items: center;
}

.conversation-item time {
  align-self: start;
  color: var(--muted);
  font-size: 9px;
}

.unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.chat-day {
  align-self: center;
  padding: 4px 9px;
  color: var(--muted);
  background: #e7f1f3;
  border-radius: 999px;
  font-size: 9px;
}

.contact-panel {
  padding-bottom: 18px;
}

.contact-hero {
  padding: 22px;
  text-align: center;
}

.contact-hero .avatar {
  margin: 0 auto 10px;
}

.contact-hero h3 {
  margin-bottom: 4px;
}

.contact-hero p {
  color: var(--muted);
  font-size: 11px;
}

.message-templates,
.automation-options {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.message-templates button {
  padding: 10px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border: 0;
  border-radius: 9px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
}

.automation-options span {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
}

.toggle {
  position: relative;
  width: 26px;
  height: 15px;
  background: #d4e0e3;
  border-radius: 999px;
}

.toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 9px;
  height: 9px;
  content: "";
  background: #fff;
  border-radius: 50%;
}

.toggle.on {
  background: var(--primary);
}

.toggle.on::after {
  left: 14px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
}

.settings-menu {
  display: grid;
  align-content: start;
  padding: 8px;
}

.settings-menu button {
  padding: 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.settings-menu button.active {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.settings-form {
  padding: 20px;
}

.logo-upload {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.logo-upload img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  clip-path: circle(46%);
}

.logo-upload strong,
.logo-upload small {
  display: block;
}

.logo-upload small {
  margin: 4px 0 10px;
  color: var(--muted);
}

.team-list {
  display: grid;
}

.team-member {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.team-member strong,
.team-member small {
  display: block;
}

.team-member small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.integration-grid,
.security-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 20px;
}

.integration-grid > div,
.security-grid > div {
  display: grid;
  gap: 8px;
  align-items: start;
  padding: 16px;
  background: #f8fcfd;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.integration-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 10px;
}

.integration-grid small,
.security-grid small {
  color: var(--muted);
}

.security-grid {
  grid-template-columns: repeat(2, 1fr);
}

.security-grid > div {
  grid-template-columns: 28px 1fr;
}

.security-grid i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 50%;
  font-style: normal;
}

.modal-backdrop {
  background: rgba(10, 44, 58, 0.55);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.chat-compose input:focus {
  border-color: #72cbd6;
  box-shadow: 0 0 0 3px rgba(57, 183, 199, 0.12);
}

.toast {
  background: var(--navy);
}

@media (max-width: 1200px) {
  .dashboard-bottom,
  .treatment-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-bottom > :first-child {
    grid-column: 1 / -1;
  }

  .message-layout {
    grid-template-columns: 250px 1fr;
  }

  .contact-panel {
    display: none;
  }
}

@media (max-width: 1000px) {
  .agenda-layout,
  .odontogram-layout,
  .document-workspace,
  .finance-grid,
  .reports-grid,
  .patient-profile-grid,
  .clinical-grid,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .settings-menu {
    grid-template-columns: repeat(3, 1fr);
  }

  .wide-report {
    grid-row: auto;
  }

  .teeth-row {
    overflow-x: auto;
    grid-template-columns: repeat(16, 38px);
    padding-bottom: 8px;
  }
}

@media (max-width: 800px) {
  .clinic-status {
    display: none;
  }

  .dashboard-bottom,
  .treatment-cards,
  .treatment-cards.inline,
  .document-template-grid,
  .integration-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-bottom > :first-child {
    grid-column: auto;
  }

  .week-strip {
    grid-template-columns: repeat(6, 100px);
    overflow-x: auto;
  }

  .message-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .message-kpis div:nth-child(2) {
    border-right: 0;
  }

  .message-layout {
    grid-template-columns: 1fr;
  }

  .conversations-panel {
    display: none;
  }

  .patient-hero,
  .patient-actions,
  .clinical-toolbar,
  .agenda-toolbar,
  .report-filters {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-menu {
    display: flex;
    overflow-x: auto;
  }

  .settings-menu button {
    white-space: nowrap;
  }
}

@media (max-width: 560px) {
  .page-heading {
    align-items: stretch;
  }

  .patient-actions {
    width: 100%;
  }

  .patient-actions button {
    flex: 1;
  }

  .patient-identity {
    align-items: flex-start;
  }

  .patient-identity .avatar-xl {
    width: 54px;
    height: 54px;
  }

  .document-template-grid,
  .message-kpis {
    grid-template-columns: 1fr;
  }

  .message-kpis div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profile-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .data-table {
    min-width: 760px;
  }

  .panel:has(.data-table) {
    overflow-x: auto;
  }
}

/* Essence v2 */

.clinic-status {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.clinic-status i {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(47, 155, 120, 0.12);
}

.panel-header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.text-button,
.back-button {
  padding: 0;
  color: var(--primary-dark);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.back-button {
  margin-bottom: 18px;
  font-size: 13px;
}

.schedule-item {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.schedule-item:hover {
  background: #f8fdfe;
}

.schedule-line.purple {
  background: #718ed9;
}

.schedule-line.blue {
  background: #66c9d5;
}

.dashboard-bottom {
  display: grid;
  grid-template-columns: 1.25fr 0.9fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.chart-tall {
  height: 250px;
}

.bar-value {
  color: var(--primary-dark);
  font-size: 10px;
  font-weight: 700;
}

.attention-list,
.compact-treatment-list {
  display: grid;
}

.attention-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.attention-item:last-child,
.compact-treatment:last-child {
  border-bottom: 0;
}

.attention-item strong,
.attention-item small {
  display: block;
}

.attention-item small {
  margin-top: 4px;
  color: var(--muted);
}

.attention-icon {
  display: grid;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  font-weight: 800;
}

.attention-icon.warning {
  color: #aa7021;
  background: #fff3df;
}

.attention-icon.info {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.compact-treatment {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 34px;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  color: var(--ink);
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.compact-treatment strong,
.compact-treatment small {
  display: block;
}

.compact-treatment small {
  margin-top: 3px;
  color: var(--muted);
}

.compact-treatment > span {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.mini-progress,
.progress {
  overflow: hidden;
  height: 7px;
  background: #e9f1f4;
  border-radius: 999px;
}

.mini-progress i,
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #77d3dd);
  border-radius: inherit;
}

.agenda-toolbar,
.clinical-toolbar,
.report-filters {
  display: flex;
  gap: 15px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.segmented {
  display: flex;
  padding: 4px;
  background: #eaf3f6;
  border-radius: 11px;
}

.segmented button {
  padding: 7px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.segmented button.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 3px 10px rgba(24, 104, 124, 0.1);
}

.week-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 16px;
}

.week-day {
  display: grid;
  gap: 3px;
  padding: 13px 8px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.week-day strong {
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  font-size: 20px;
}

.week-day small {
  font-size: 10px;
}

.week-day.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(57, 183, 199, 0.25);
}

.week-day.active strong {
  color: #fff;
}

.agenda-layout,
.odontogram-layout,
.finance-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
}

.agenda-summary .panel-body {
  padding-top: 12px;
}

.donut-wrap {
  display: grid;
  padding: 12px 0 24px;
  place-items: center;
}

.donut,
.payment-donut {
  display: grid;
  width: 140px;
  height: 140px;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(var(--primary) 0 80%, #e8f1f4 80% 100%);
  border-radius: 50%;
}

.donut strong,
.donut span,
.payment-donut strong,
.payment-donut span {
  display: block;
}

.donut strong {
  font-family: "Manrope", sans-serif;
  font-size: 25px;
}

.donut span,
.payment-donut span {
  color: var(--muted);
  font-size: 11px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  font-size: 13px;
}

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

.dot.blue {
  background: var(--primary);
}

.dot.yellow {
  background: var(--warning);
}

.dot.gray {
  background: #bac9ce;
}

.dot.coral {
  background: #ec7d83;
}

.patient-summary {
  display: flex;
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 12px;
}

.patient-summary strong {
  margin-left: 10px;
  color: var(--ink);
  font-size: 18px;
}

.patient-link {
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  text-align: left;
}

.tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.tag.alert {
  color: #b15359;
  background: #fff0f1;
}

.row-action {
  padding: 6px 9px;
  color: var(--primary-dark);
  background: transparent;
  border: 1px solid #bde3e8;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-danger {
  color: var(--danger);
}

.patient-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 24px;
  background: linear-gradient(135deg, #fff, #ecfafd);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.patient-identity,
.patient-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.patient-identity h1 {
  margin-bottom: 6px;
}

.patient-identity p {
  margin-bottom: 0;
  color: var(--muted);
}

.avatar-xl {
  width: 72px;
  height: 72px;
  font-size: 20px;
}

.avatar-lg {
  width: 54px;
  height: 54px;
  font-size: 15px;
}

.clinical-alert {
  margin-bottom: 18px;
  padding: 12px 15px;
  color: #9b4b52;
  background: #fff1f2;
  border: 1px solid #ffd7da;
  border-radius: 11px;
  font-size: 13px;
}

.clinical-alert.compact {
  margin: 13px 0;
  font-size: 11px;
}

.patient-profile-grid,
.clinical-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
}

.patient-profile-grid > aside,
.clinical-grid > aside,
.patient-content {
  display: grid;
  align-content: start;
  gap: 18px;
}

.profile-details {
  padding: 8px 18px 18px;
}

.detail-row {
  display: grid;
  gap: 3px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row span {
  color: var(--muted);
  font-size: 11px;
}

.detail-row strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.profile-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 18px;
}

.profile-metrics div {
  text-align: center;
}

.profile-metrics div + div {
  border-left: 1px solid var(--line);
}

.profile-metrics strong,
.profile-metrics span {
  display: block;
}

.profile-metrics strong {
  color: var(--primary-dark);
  font-family: "Manrope", sans-serif;
  font-size: 21px;
}

.profile-metrics span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.profile-tabs {
  display: flex;
  gap: 7px;
  padding: 6px;
  background: #eaf4f6;
  border-radius: 12px;
}

.profile-tabs button {
  flex: 1;
  padding: 9px 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
}

.profile-tabs button.active {
  color: var(--primary-dark);
  background: #fff;
  box-shadow: 0 4px 12px rgba(38, 113, 131, 0.09);
}

.treatment-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.treatment-cards.inline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

.treatment-card {
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.treatment-cards.inline .treatment-card {
  background: #fafeff;
  box-shadow: none;
}

.treatment-card-top,
.progress-label,
.treatment-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.treatment-card h3 {
  margin: 15px 0 4px;
  font-size: 16px;
}

.treatment-card p,
.treatment-card > small {
  color: var(--muted);
  font-size: 11px;
}

.progress-label {
  margin: 16px 0 7px;
  font-size: 11px;
}

.treatment-values {
  gap: 12px;
  margin: 15px 0;
}

.treatment-values span,
.treatment-values strong {
  display: block;
}

.treatment-values span {
  color: var(--muted);
  font-size: 10px;
}

.treatment-values strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 12px;
}

.timeline {
  padding: 20px 22px;
}

.timeline.large {
  padding: 28px;
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 30px;
  border-left: 2px solid #d7edf1;
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline-dot {
  position: absolute;
  top: 3px;
  left: -7px;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #bde7ec;
}

.timeline-card {
  padding: 16px;
  background: #f9fdfe;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.timeline-card h3 {
  margin: 10px 0 6px;
  font-size: 14px;
}

.timeline-card p {
  margin-bottom: 9px;
  color: #4e6874;
  font-size: 12px;
  line-height: 1.6;
}

.timeline-card > small {
  color: var(--primary-dark);
  font-weight: 700;
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-meta time {
  color: var(--muted);
  font-size: 10px;
}

.inline-field {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inline-field select,
.report-filters select {
  padding: 10px 34px 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.patient-mini-profile {
  padding: 24px;
  text-align: center;
}

.patient-mini-profile .avatar {
  margin: 0 auto 12px;
}

.patient-mini-profile h2 {
  margin-bottom: 5px;
}

.patient-mini-profile p {
  color: var(--muted);
  font-size: 12px;
}

.patient-mini-profile .tags {
  justify-content: center;
}

.check-list,
.health-chips {
  display: grid;
  gap: 11px;
  padding: 16px 18px;
  color: #506d78;
  font-size: 12px;
}

.check {
  display: inline-grid;
  width: 19px;
  height: 19px;
  margin-right: 7px;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
}

.check.yes {
  color: var(--success);
  background: #e7f6f0;
}

.check.no {
  color: var(--warning);
  background: #fff3df;
}

.health-chips span {
  padding: 8px 10px;
  background: #f5fafb;
  border-radius: 8px;
}

.odontogram-legend {
  display: flex;
  gap: 13px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 10px;
}

.tooth-color {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 5px;
  border-radius: 3px;
}

.tooth-color.healthy {
  background: #fff;
  border: 1px solid #b8cbd1;
}

.tooth-color.watch {
  background: #f6c45d;
}

.tooth-color.treatment {
  background: #eb6c73;
}

.tooth-color.done {
  background: #50b9ca;
}

.tooth-color.absent {
  background: #aebdc2;
}

.odontogram-panel {
  min-width: 0;
}

.odontogram {
  overflow-x: auto;
  padding: 30px 22px 34px;
  text-align: center;
}

.arch-label {
  display: block;
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.teeth-row {
  display: flex;
  min-width: 720px;
  gap: 6px;
  justify-content: center;
}

.teeth-row.lower {
  align-items: flex-start;
}

.midline {
  width: 2px;
  height: 22px;
  margin: 5px auto;
  background: #d9e8ec;
}

.tooth {
  display: grid;
  gap: 5px;
  width: 40px;
  padding: 4px 2px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 9px;
}

.tooth i {
  position: relative;
  display: block;
  width: 34px;
  height: 46px;
  background: #fff;
  border: 2px solid #b8cbd1;
  border-radius: 13px 13px 17px 17px;
  box-shadow: inset 0 -8px 0 #f4f8f9;
}

.teeth-row.lower .tooth i {
  border-radius: 17px 17px 13px 13px;
  box-shadow: inset 0 8px 0 #f4f8f9;
}

.tooth:hover i {
  transform: translateY(-2px);
  box-shadow: 0 7px 15px rgba(46, 123, 142, 0.15);
}

.tooth.watch i {
  background: #fff6dc;
  border-color: #efb84b;
}

.tooth.treatment i {
  background: #fff0f1;
  border-color: #e5636b;
}

.tooth.done i {
  background: #e8f9fb;
  border-color: var(--primary);
}

.tooth.absent i {
  opacity: 0.35;
  background: #dae3e6;
  border-style: dashed;
}

.odontogram-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.odontogram-count strong {
  font-family: "Manrope", sans-serif;
  font-size: 17px;
}

.full-button {
  width: 100%;
  margin-top: 18px;
}

.tooth-history {
  margin-top: 18px;
}

.document-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.document-template {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-align: left;
  box-shadow: var(--shadow);
}

.document-template:hover {
  border-color: #a5dde4;
  transform: translateY(-2px);
}

.document-template > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 11px;
  font-size: 18px;
}

.document-template strong,
.document-template small {
  display: block;
}

.document-template small {
  margin-top: 4px;
  color: var(--muted);
}

.document-template b {
  color: var(--primary);
}

.document-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.7fr);
  gap: 18px;
}

.compact-preview {
  min-height: 500px;
  padding: 30px;
  font-size: 12px;
}

.document-header img {
  width: 110px;
  height: 65px;
  object-fit: cover;
  clip-path: inset(5% 4% 5% 4% round 8px);
}

.finance-grid {
  grid-template-columns: minmax(0, 1fr) 340px;
  margin-bottom: 18px;
}

.dual-bars {
  display: flex;
  gap: 4px;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.dual-bars .bar {
  width: 20px;
}

.dual-bars .bar.cost {
  background: #eb7c83;
}

.chart-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.payment-donut {
  width: 126px;
  height: 126px;
  margin: 0 auto 24px;
  background:
    radial-gradient(circle at center, #fff 57%, transparent 58%),
    conic-gradient(var(--primary) 0 46%, #698de2 46% 78%, #75cfda 78% 92%, #dce9ec 92% 100%);
}

.payment-donut strong {
  font-size: 15px;
}

.payment-row {
  display: grid;
  grid-template-columns: 60px 1fr 34px;
  gap: 9px;
  align-items: center;
  margin: 11px 0;
  color: var(--muted);
  font-size: 11px;
}

.payment-row > div {
  height: 6px;
  overflow: hidden;
  background: #e8f0f3;
  border-radius: 999px;
}

.payment-row i {
  display: block;
  height: 100%;
  background: var(--primary);
}

.stock-level {
  display: grid;
  grid-template-columns: 80px auto;
  gap: 8px;
  align-items: center;
}

.stock-level > div {
  overflow: hidden;
  height: 6px;
  background: #e8f0f3;
  border-radius: 999px;
}

.stock-level i {
  display: block;
  height: 100%;
  background: var(--success);
}

.stock-level i.low {
  background: var(--warning);
}

.stock-level span {
  font-size: 10px;
  font-weight: 700;
}

.report-filters {
  justify-content: flex-start;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.report-filters label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.reports-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 18px;
}

.wide-report {
  grid-row: span 2;
}

.line-chart {
  min-height: 300px;
}

.line-chart svg {
  width: 100%;
  height: 250px;
  overflow: visible;
}

.line-chart .area {
  fill: url(#area);
}

.line-chart .line {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
}

.line-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.ranking-list {
  padding: 12px 18px 18px;
}

.ranking-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 28px;
  gap: 9px;
  align-items: center;
  padding: 9px 0;
}

.ranking-item > span {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 6px;
  font-size: 9px;
  font-weight: 800;
}

.ranking-item strong,
.ranking-item i {
  display: block;
}

.ranking-item strong {
  margin-bottom: 5px;
  font-size: 11px;
}

.ranking-item i {
  height: 5px;
  background: #e8f0f3;
  border-radius: 999px;
}

.ranking-item i::after {
  display: block;
  width: inherit;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
  content: "";
}

.ranking-item b {
  color: var(--muted);
  font-size: 11px;
}

.professional-report {
  display: grid;
  padding: 12px 18px 18px;
}

.professional-report > div {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.professional-report > div:last-child {
  border-bottom: 0;
}

.professional-report strong,
.professional-report small,
.professional-report i {
  display: block;
}

.professional-report small {
  margin: 3px 0 7px;
  color: var(--muted);
  font-size: 10px;
}

.professional-report i {
  height: 5px;
  background: #e8f0f3;
  border-radius: 999px;
}

.professional-report i b {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: inherit;
}

.professional-report > div > span:last-child {
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.message-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.message-kpis div {
  padding: 13px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.message-kpis span,
.message-kpis strong {
  display: block;
}

.message-kpis span {
  color: var(--muted);
  font-size: 10px;
}

.message-kpis strong {
  margin-top: 4px;
  color: var(--primary-dark);
  font-size: 18px;
}

.message-layout {
  grid-template-columns: 280px minmax(0, 1fr) 250px;
}

.conversation-search {
  display: flex;
  gap: 7px;
  margin: 12px;
  padding: 9px 11px;
  color: var(--muted);
  background: var(--canvas);
  border-radius: 9px;
}

.conversation-search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
}

.conversation-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
}

.conversation-item time {
  align-self: start;
  color: var(--muted);
  font-size: 9px;
}

.unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.chat-day {
  align-self: center;
  padding: 5px 9px;
  color: var(--muted);
  background: #e9f1f3;
  border-radius: 999px;
  font-size: 9px;
}

.message-templates {
  display: flex;
  gap: 7px;
  padding: 10px 15px;
  overflow-x: auto;
  background: #f8fbfc;
  border-top: 1px solid var(--line);
}

.message-templates button {
  padding: 6px 9px;
  color: var(--primary-dark);
  white-space: nowrap;
  background: var(--primary-soft);
  border: 0;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.contact-hero {
  padding: 24px 18px 16px;
  text-align: center;
}

.contact-hero .avatar {
  margin: auto;
}

.contact-hero h2 {
  margin: 10px 0 3px;
}

.contact-hero p {
  color: var(--muted);
  font-size: 11px;
}

.automation-options {
  display: grid;
  gap: 14px;
  padding: 17px;
  color: #536f7b;
  font-size: 11px;
}

.toggle {
  display: inline-block;
  width: 28px;
  height: 16px;
  margin-right: 8px;
  vertical-align: middle;
  background: #cbd8dc;
  border-radius: 999px;
}

.toggle::after {
  display: block;
  width: 12px;
  height: 12px;
  margin: 2px;
  background: #fff;
  border-radius: 50%;
  content: "";
}

.toggle.on {
  background: var(--primary);
}

.toggle.on::after {
  margin-left: 14px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.settings-menu {
  display: grid;
  align-content: start;
  padding: 8px;
}

.settings-menu button {
  padding: 11px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
}

.settings-menu button.active,
.settings-menu button:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.settings-content {
  display: grid;
  gap: 18px;
}

.settings-form {
  padding: 22px;
}

.logo-upload {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.logo-upload img {
  width: 130px;
  height: 92px;
  object-fit: cover;
  clip-path: inset(3% 3% 3% 3% round 12px);
}

.logo-upload strong,
.logo-upload small {
  display: block;
}

.logo-upload small {
  margin: 4px 0 10px;
  color: var(--muted);
}

.team-list {
  display: grid;
  padding: 4px 18px 16px;
}

.team-member {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.team-member:last-child {
  border-bottom: 0;
}

.team-member strong,
.team-member small {
  display: block;
}

.team-member small {
  margin-top: 3px;
  color: var(--muted);
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px;
}

.integration-grid > div {
  padding: 16px;
  background: #f9fdfe;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.integration-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 10px;
}

.integration-grid strong,
.integration-grid small {
  display: block;
}

.integration-grid small {
  margin: 4px 0 13px;
  color: var(--muted);
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 18px;
}

.security-grid > div {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: #f9fdfe;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.security-grid i {
  display: grid;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.security-grid strong,
.security-grid small {
  display: block;
}

.security-grid small {
  margin-top: 3px;
  color: var(--muted);
}

@media (max-width: 1250px) {
  .dashboard-bottom,
  .reports-grid {
    grid-template-columns: 1fr 1fr;
  }

  .dashboard-bottom > :first-child,
  .wide-report {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .message-layout {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .contact-panel {
    display: none;
  }

  .treatment-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .clinic-status {
    display: none;
  }

  .agenda-layout,
  .odontogram-layout,
  .finance-grid,
  .patient-profile-grid,
  .clinical-grid,
  .document-workspace,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .document-template-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-menu {
    display: flex;
    overflow-x: auto;
  }

  .settings-menu button {
    white-space: nowrap;
  }

  .agenda-summary {
    order: -1;
  }
}

@media (max-width: 700px) {
  .dashboard-bottom,
  .reports-grid,
  .message-layout,
  .treatment-cards,
  .treatment-cards.inline,
  .integration-grid,
  .security-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-bottom > :first-child,
  .wide-report {
    grid-column: auto;
  }

  .week-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .agenda-toolbar,
  .clinical-toolbar,
  .report-filters,
  .patient-hero {
    align-items: stretch;
    flex-direction: column;
  }

  .patient-actions {
    flex-wrap: wrap;
  }

  .patient-actions button {
    flex: 1;
  }

  .document-template-grid,
  .message-kpis {
    grid-template-columns: repeat(2, 1fr);
  }

  .top-actions .icon-button {
    display: none;
  }
}

@media (max-width: 500px) {
  .document-template-grid,
  .message-kpis,
  .profile-metrics {
    grid-template-columns: 1fr;
  }

  .profile-metrics div + div {
    padding-top: 12px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .patient-identity {
    align-items: flex-start;
  }

  .avatar-xl {
    width: 52px;
    height: 52px;
  }

  .data-table th:nth-child(2),
  .data-table td:nth-child(2),
  .data-table th:nth-child(4),
  .data-table td:nth-child(4) {
    display: none;
  }
}
