:root {
  --bg: #f3f1e9;
  --bg-alt: #ece7da;
  --panel: #fffdf8;
  --panel-alt: #54593b;
  --panel-soft: #f3efe2;
  --line: #d9d2be;
  --text: #2f3327;
  --muted: #6f725f;
  --primary: #8a8e51;
  --primary-dark: #767a43;
  --success: #6c7b56;
  --warning: #b48c52;
  --danger: #b1625f;
  --shadow: 0 16px 34px rgba(78, 78, 53, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, #faf8f1 0%, #f1ece0 100%);
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}

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

button,
.button-link {
  cursor: pointer;
}

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

.sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #626744 0%, #4f5438 100%);
  color: #f8f6ef;
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #c9c4ad 0%, #fcfcf5 100%);
  color: #55593a;
  font-weight: 700;
  letter-spacing: 0.08em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.brand h1,
.topbar h2,
.card h3 {
  margin: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-kicker {
  display: inline-block;
  margin-bottom: 6px;
  color: rgba(255, 252, 245, 0.78);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.08;
  color: #fffdf6;
}

.brand p,
.sidebar-card p,
.integration-copy,
.stack-row p,
td small {
  margin: 4px 0 0;
  color: var(--muted);
}

.brand p {
  color: rgba(255, 251, 242, 0.74);
}

.nav-list {
  display: grid;
  gap: 9px;
}

.nav-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(255, 251, 242, 0.84);
  padding: 12px 14px;
  border-radius: 10px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(255, 252, 245, 0.1);
  border-color: rgba(255, 252, 245, 0.16);
  color: #fffef9;
}

.sidebar-card {
  margin-top: auto;
  padding: 20px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.09);
  border: 1px solid rgba(255, 253, 248, 0.12);
}

.main-content {
  padding: 26px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 22px;
  padding: 6px 4px 18px;
  border-bottom: 1px solid rgba(138, 142, 81, 0.12);
}

.topbar-actions,
.action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.refresh-meta {
  min-width: 176px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line);
  display: grid;
  gap: 3px;
}

.refresh-meta strong {
  font-size: 13px;
  color: #3f422f;
}

.refresh-meta span {
  font-size: 12px;
  color: var(--muted);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  color: #7a7d67;
  margin-bottom: 6px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-card,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.metric-card {
  padding: 18px;
  min-height: 122px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.1;
  color: #40432f;
}

.two-column,
.workspace-grid,
.integrations-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.workspace-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
}

.stack-form-column {
  display: grid;
  gap: 18px;
}

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

.full-width-card {
  grid-column: 1 / -1;
}

.card {
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 16px;
}

.topbar h2,
.card h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: 0;
}

.table-wrap {
  overflow: auto;
}

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

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  font-size: 12px;
  color: #7c7f6b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

td strong,
.stack-row strong {
  display: block;
  margin-bottom: 4px;
}

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

.form-grid > * {
  min-width: 0;
}

.form-grid label {
  display: grid;
  gap: 8px;
  color: #40516d;
  font-size: 13px;
  min-width: 0;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: #fdfbf6;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 13px;
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: rgba(138, 142, 81, 0.58);
  box-shadow: 0 0 0 3px rgba(184, 189, 159, 0.26);
  background: #fffefb;
}

.search-select-stack {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.search-select-stack input[type="search"]::-webkit-search-cancel-button {
  cursor: pointer;
}

.form-grid textarea {
  resize: vertical;
}

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

.form-section-title {
  display: grid;
  gap: 4px;
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid rgba(180, 170, 140, 0.45);
}

.form-section-title h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 500;
  color: #2f3a26;
}

.form-section-title .helper-copy {
  margin: 0;
}

.checkbox-line {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding-top: 28px;
  flex-wrap: wrap;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

.primary-button,
.secondary-button,
.tiny-button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.primary-button {
  background: var(--primary);
  color: white;
  border-color: rgba(84, 89, 59, 0.08);
}

.primary-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.secondary-button,
.tiny-button {
  background: #fffcf6;
  color: var(--text);
  border-color: #d1cab5;
}

.secondary-button:hover,
.tiny-button:hover {
  background: #f4f0e4;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.tiny-button {
  min-height: 34px;
  padding: 0 12px;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.stack-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: var(--panel-soft);
  border: 1px solid #e2dbc7;
  border-radius: 10px;
}

.stack-meta {
  text-align: right;
  display: grid;
  gap: 6px;
  flex: 0 0 auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ebe7d6;
  color: #666a45;
  font-size: 12px;
}

.status-line {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--warning);
  flex: 0 0 auto;
}

.status-dot.ok {
  background: var(--success);
}

.status-dot.danger {
  background: var(--danger);
}

.steps-list {
  margin: 0;
  padding-left: 20px;
  color: #52563f;
}

.steps-list li {
  margin-bottom: 10px;
}

.code-block {
  margin: 18px 0 0;
  padding: 16px;
  border-radius: 10px;
  background: #5a5f3d;
  color: #f7f5ee;
  overflow: auto;
}

.integration-status {
  min-height: 120px;
}

.export-result {
  margin-top: 16px;
  min-height: 0;
}

#storage-analysis-card {
  margin-top: 16px;
}

.reminder-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.metrics-inline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.chart-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #f9f6ed;
  margin-bottom: 18px;
}

.chart-head {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.finance-chart {
  min-height: 220px;
}

.finance-chart svg {
  width: 100%;
  height: auto;
  display: block;
}

.bar-label {
  font-size: 11px;
  fill: #6d715c;
}

.bar-value {
  font-size: 11px;
  fill: #3e422d;
  font-weight: 600;
}

.compact-grid {
  align-items: end;
}

.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.storage-file-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: #4d503d;
}

.storage-file-list li {
  margin-bottom: 6px;
}

.metric-inline {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid #e2dbc7;
  min-width: 120px;
}

.metric-inline strong,
.metric-inline span {
  display: block;
}

.helper-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.payment-context-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--panel-soft);
  border: 1px solid #e2dbc7;
  display: grid;
  gap: 12px;
}

.payment-context-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.payment-context-grid article {
  background: #fffcf6;
  border: 1px solid #ddd4bd;
  border-radius: 10px;
  padding: 12px;
}

.payment-context-grid span,
.payment-history-list small {
  color: var(--muted);
}

.payment-context-grid strong,
.payment-history-list strong {
  display: block;
  margin-top: 4px;
}

.payment-history-list {
  display: grid;
  gap: 10px;
}

.payment-history-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fffcf6;
  border: 1px solid #ddd4bd;
}

.payment-history-meta {
  text-align: right;
  flex: 0 0 auto;
}

.message-cell {
  min-width: 280px;
  color: #494c38;
}

.action-stack {
  display: grid;
  gap: 8px;
}

.clinical-list {
  display: grid;
  gap: 14px;
}

.clinical-card {
  padding: 16px;
  border: 1px solid #ded7c2;
  border-radius: 10px;
  background: #fffdf8;
}

.clinical-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.clinical-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

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

.clinical-grid p,
.clinical-notes p {
  margin: 0;
  color: #494c38;
}

.clinical-notes {
  margin-top: 12px;
}

.clinical-status-card,
.odontogram-editor,
.clinical-visit-item {
  padding: 14px 16px;
  border: 1px solid #ddd4bd;
  border-radius: 10px;
  background: #f9f6ed;
}

.modal-shell[hidden] {
  display: none !important;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(47, 51, 39, 0.42);
  backdrop-filter: blur(3px);
}

.modal-dialog {
  position: relative;
  width: min(1440px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  margin: 20px auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 28px 60px rgba(38, 40, 30, 0.24);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.clinical-modal-dialog {
  width: min(1520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
  background: #fffdf8;
}

.modal-body {
  overflow: auto;
  padding: 24px;
}

.clinical-visits {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.clinical-visit-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  align-items: baseline;
}

.clinical-accordion {
  border: 1px solid #ddd4bd;
  border-radius: 14px;
  background: #fcfaf4;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.clinical-accordion + .clinical-accordion {
  margin-top: 2px;
}

.clinical-accordion summary {
  list-style: none;
  cursor: pointer;
}

.clinical-accordion summary::-webkit-details-marker {
  display: none;
}

.clinical-accordion-summary {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(249, 245, 234, 0.9));
}

.clinical-accordion-summary::after {
  content: "+";
  margin-left: auto;
  align-self: center;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #d9d0b9;
  background: #fffdf8;
  color: #5d6245;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}

.clinical-accordion[open] .clinical-accordion-summary::after {
  content: "−";
}

.clinical-accordion-summary-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.clinical-accordion-summary-main strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: #313625;
}

.clinical-accordion-helper {
  margin: 0;
  color: #707461;
  font-size: 12px;
  line-height: 1.45;
  max-width: 720px;
}

.clinical-accordion-summary-meta {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  min-width: 220px;
  padding-right: 8px;
}

.clinical-accordion-summary-meta span {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #fffdf8;
  border: 1px solid #ddd4bd;
  color: #575b45;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.clinical-accordion-body {
  padding: 18px 20px 20px;
  border-top: 1px solid #e8dfcb;
  background: #fffdf8;
}

.clinical-accordion-body .clinical-status-card,
.clinical-accordion-body .odontogram-editor {
  background: #f8f4e8;
}

.odontogram-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.odontogram-header h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
}

.odontogram-layout {
  display: grid;
  gap: 14px;
}

.odontogram-legend-panel {
  background: #fffdf8;
  border: 1px solid #ddd4bd;
  border-radius: 10px;
  overflow: hidden;
}

.odontogram-legend-panel summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.odontogram-legend-panel summary::-webkit-details-marker {
  display: none;
}

.odontogram-legend-panel summary strong {
  font-size: 14px;
  color: #3f4633;
}

.odontogram-legend-grid {
  display: grid;
  gap: 0;
  border-top: 1px solid #e3dbc8;
}

.odontogram-legend-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid #efe7d4;
}

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

.odontogram-legend-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
}

.odontogram-legend-item + .odontogram-legend-item {
  border-left: 1px solid #efe7d4;
}

.odontogram-legend-button {
  width: 100%;
  border: 0;
  background: #fffdf8;
  text-align: left;
}

.odontogram-legend-button:hover {
  background: #f6f1e4;
}

.odontogram-legend-button.is-active {
  background: #f0ebdc;
  box-shadow: inset 0 0 0 2px #6a6e4c;
}

.odontogram-legend-item-empty {
  background: #fbf8ef;
}

.odontogram-legend-text {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: #464938;
}

.odontogram-legend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 44px;
  border-radius: 8px;
  background: #f7f3ea;
  border: 1px solid rgba(180, 168, 136, 0.3);
}

.odontogram-legend-icon .odontogram-favorite-icon {
  width: 28px;
  height: 28px;
}

.odontogram-helper-top {
  max-width: 420px;
  margin: 0;
  text-align: right;
}

.odontogram-canvas-card,
.odontogram-sidecard {
  background: #fffdf8;
  border: 1px solid #ddd4bd;
  border-radius: 10px;
  padding: 12px;
}

.odontogram-canvas-wrap {
  overflow: hidden;
}

.odontogram-canvas-wrap svg {
  width: 100%;
  height: auto;
  display: block;
}

.odontogram-bottom-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 0.92fr) minmax(360px, 1.4fr) minmax(260px, 0.95fr);
  align-items: start;
}

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

.odontogram-selected-action,
.odontogram-clear-button {
  align-self: end;
}

.odontogram-clear-button {
  min-height: 48px;
}

.odontogram-actions-card,
.odontogram-sidepanel {
  display: grid;
  gap: 12px;
}

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

.odontogram-favorite-slot {
  min-width: 0;
  display: block;
}

.odontogram-favorite-slot.is-active .odontogram-favorite-button {
  border-color: #595d3f;
  box-shadow: inset 0 0 0 1px rgba(89, 93, 63, 0.28);
}

.odontogram-favorite-button,
.odontogram-favorite-remove {
  border-radius: 10px;
  border: 1px solid #d7cfbb;
  background: #fffdf8;
}

.odontogram-favorite-button {
  min-width: 0;
  min-height: 68px;
  padding: 8px 9px 8px;
  text-align: left;
  display: grid;
  gap: 4px;
  color: #454938;
  align-content: start;
}

.odontogram-favorite-button span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.odontogram-favorite-button-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 6px;
}

.odontogram-favorite-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

.odontogram-favorite-icon {
  width: 28px;
  height: 28px;
}

.favorite-tooth-outline {
  stroke: #b2ab96;
  stroke-width: 1.7;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-mark {
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-fill {
  stroke: none;
}

.favorite-glyph {
  font-size: 12px;
  font-weight: 700;
  font-family: Arial, sans-serif;
}

.favorite-mark.tone-red,
.favorite-fill.tone-red,
.favorite-glyph.tone-red {
  stroke: #cf4f57;
  fill: #cf4f57;
  color: #cf4f57;
}

.favorite-mark.tone-blue,
.favorite-fill.tone-blue,
.favorite-glyph.tone-blue {
  stroke: #222222;
  fill: #222222;
  color: #222222;
}

.odontogram-favorite-button small {
  font-size: 10px;
  color: #767a67;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: right;
}

.odontogram-favorite-remove {
  width: 28px;
  min-height: 64px;
  padding: 0;
  font-size: 18px;
  color: #8a705f;
}

.odontogram-favorite-manager {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

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

.odontogram-summary-list ul {
  margin: 0;
  padding-left: 18px;
}

.odontogram-summary-list li {
  margin-bottom: 6px;
  color: #4d503d;
}

.odo-hitbox,
.odo-base,
.odo-base-line {
  cursor: pointer;
}

.odo-hitbox {
  fill: transparent;
  stroke: transparent;
}

.odo-base,
.odo-base-line {
  fill: #fffdf8;
  stroke: #8e907d;
  stroke-width: 1.2;
}

.odo-base.inner {
  fill: none;
}

.odo-tooth.is-selected .odo-base,
.odo-tooth.is-selected .odo-base-line,
.odo-base.is-selected,
.odo-base-line.is-selected {
  stroke: #3f422f;
  stroke-width: 2;
}

.odo-code {
  font-size: 8.5px;
  fill: #52553f;
  font-weight: 600;
  cursor: pointer;
}

.odo-overlay {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.overlay-missing {
  stroke-width: 2.1;
}

.overlay-implant {
  stroke-width: 1.8;
}

.overlay-crown {
  stroke-width: 1.8;
}

.overlay-bridge {
  stroke-width: 2;
}

.overlay-endo {
  stroke-width: 2;
}

.overlay-line,
.overlay-restoration,
.overlay-filling-other {
  stroke-width: 2;
}

.overlay-restoration-fill {
  stroke: none;
}

.overlay-sealant {
  stroke: none;
  font-size: 10px;
  font-weight: 700;
}

.odo-overlay.tone-red { stroke: #cf4f57; }
.odo-overlay.tone-blue { stroke: #222222; }
.overlay-restoration-fill.tone-red,
.overlay-sealant.tone-red { fill: #cf4f57; }
.overlay-restoration-fill.tone-blue,
.overlay-sealant.tone-blue { fill: #222222; }

.favorite-tone-red { border-left: 4px solid #cf4f57; }
.favorite-tone-blue { border-left: 4px solid #222222; }

.overlay-post {
  stroke-width: 2;
  fill: none;
}

.overlay-post.tone-blue {
  fill: #222222;
}

.overlay-post.tone-red {
  fill: #cf4f57;
}

#finance-export-result {
  margin: 8px 0 14px;
}

.photo-strip {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.photo-thumb {
  width: 120px;
  flex: 0 0 auto;
  text-decoration: none;
  color: #55593f;
}

.photo-thumb img {
  width: 120px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #d8d1bc;
  display: block;
  margin-bottom: 6px;
}

.photo-thumb span {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #5b603e;
  color: white;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  background: #975856;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.empty-state,
.done-label {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap table tr:hover td {
  background: rgba(184, 189, 159, 0.1);
}

@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .workspace-grid,
  .two-column,
  .integrations-grid {
    grid-template-columns: 1fr;
  }

  .clinical-accordion-summary {
    flex-wrap: wrap;
  }

  .clinical-accordion-summary::after {
    order: 3;
  }

  .clinical-accordion-summary-meta {
    width: 100%;
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-right: 0;
  }
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .main-content {
    padding: 18px;
  }

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

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

@media (max-width: 640px) {
  .metrics-grid,
  .metrics-inline-grid,
  .form-grid,
  .clinical-grid {
    grid-template-columns: 1fr;
  }

  .odontogram-layout,
  .odontogram-bottom-grid,
  .odontogram-selection-grid,
  .odontogram-favorite-manager {
    grid-template-columns: 1fr;
  }

  .odontogram-favorites,
  .odontogram-legend-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .odontogram-header {
    flex-direction: column;
  }

  .odontogram-helper-top {
    max-width: none;
    text-align: left;
  }

  .modal-dialog,
  .clinical-modal-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    margin: 8px auto;
    border-radius: 12px;
  }

  .modal-header,
  .modal-body {
    padding: 16px;
  }

  .clinical-accordion-summary,
  .clinical-accordion-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .clinical-accordion-summary-meta {
    grid-template-columns: 1fr;
  }

  .odontogram-favorite-remove {
    width: 100%;
    min-height: 34px;
  }

  .filter-actions {
    justify-content: stretch;
    flex-direction: column;
  }
}
