:root {
  --sidebar-width: 260px;
  --bg-app: #f3f7fc;
  --bg-app-soft: #eef4fb;
  --bg-panel: #ffffff;
  --bg-panel-muted: #f8fbff;
  --bg-control: #f7faff;
  --bg-control-hover: #f1f6ff;
  --bg-segment: #eaf1fb;
  --bg-segment-selected: #ffffff;
  --border-soft: #d9e4f2;
  --border-strong: #c7d5e8;
  --text-primary: #172033;
  --text-secondary: #4f6078;
  --text-muted: #71839b;
  --accent: #2f68f6;
  --accent-strong: #1f56e2;
  --danger: #dc2626;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow-panel: 0 16px 36px rgba(31, 55, 117, 0.08);
  --shadow-soft: 0 10px 24px rgba(31, 55, 117, 0.08);
  --shadow-float: 0 20px 48px rgba(15, 23, 42, 0.14);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 24px;
  color: var(--text-primary);
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg-app);
}

* {
  box-sizing: border-box;
}

body {
  background:
    radial-gradient(circle at top left, rgba(62, 108, 255, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg-app-soft) 0%, var(--bg-app) 100%);
  color: var(--text-primary);
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  min-width: 0;
  padding: var(--space-3);
}

main {
  display: flex;
  flex-direction: column;
  grid-column: 2;
  min-width: 0;
}

.sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82) 0%, rgba(241, 248, 255, 0.9) 100%);
  border: 1px solid rgba(203, 220, 242, 0.92);
  border-radius: 28px;
  box-shadow: 0 22px 48px rgba(42, 88, 175, 0.16);
  color: #17315c;
  display: flex;
  flex-direction: column;
  gap: 8px;
  bottom: 16px;
  height: calc(100vh - 32px);
  max-height: calc(100vh - 32px);
  min-height: 0;
  overflow: hidden;
  padding: 18px 14px;
  position: fixed;
  top: 16px;
  left: 16px;
  width: var(--sidebar-width);
  z-index: 20;
}

.sidebar::before {
  background: url("/assets/sidebar-menu-bg-light.png") center bottom / 122% auto no-repeat;
  bottom: -6px;
  content: "";
  left: -12px;
  opacity: 0.42;
  pointer-events: none;
  position: absolute;
  right: -12px;
  top: 54%;
  z-index: 0;
}

.sidebar-nav {
  align-content: start;
  display: grid;
  flex: 1 1 auto;
  gap: 8px;
  margin-top: 4px;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
  position: relative;
  z-index: 1;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(111, 144, 201, 0.34);
  border-radius: 999px;
}

.brand {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  margin-bottom: 12px;
  padding: 8px 8px 12px;
  position: relative;
  z-index: 1;
}

.brand-mark {
  align-items: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(228, 239, 255, 0.92));
  border: 1px solid rgba(180, 203, 238, 0.9);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 20px rgba(55, 99, 182, 0.12);
  display: inline-flex;
  flex: 0 0 50px;
  height: 50px;
  justify-content: center;
}

.brand-mark span {
  color: #2f68f6;
  font-size: 19px;
  font-weight: 800;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand strong {
  color: #18345f;
  font-size: 19px;
  letter-spacing: 0;
  line-height: 1.15;
}

.brand-copy span {
  color: rgba(72, 101, 150, 0.78);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar button {
  align-items: center;
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(203, 220, 242, 0.76);
  border-radius: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 8px 16px rgba(63, 108, 185, 0.05);
  color: #23406d;
  display: flex;
  gap: 12px;
  font-weight: 700;
  justify-content: flex-start;
  line-height: 1.25;
  min-height: 52px;
  padding: 12px 14px;
  text-align: left;
  transition: background 0.18s ease, transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease;
  white-space: normal;
  word-break: break-word;
  width: 100%;
}

.sidebar button:hover {
  background: rgba(236, 245, 255, 0.96);
  border-color: rgba(114, 157, 238, 0.46);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 10px 22px rgba(55, 99, 182, 0.1);
  color: #163562;
  transform: translateY(-1px);
}

.sidebar button.active {
  background: linear-gradient(180deg, rgba(71, 128, 255, 0.98), rgba(45, 103, 246, 0.98));
  border-color: rgba(205, 226, 255, 0.96);
  box-shadow:
    0 16px 30px rgba(42, 88, 175, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  color: white;
  transform: translateY(-1px);
}

.nav-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(193, 213, 243, 0.82);
  border-radius: 12px;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  padding: 5px;
}

.nav-icon svg {
  fill: none;
  filter: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.sidebar button:hover .nav-icon {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(168, 196, 239, 0.8);
}

.sidebar button.active .nav-icon {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.sidebar button > span:last-child {
  align-items: center;
  display: inline-flex;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-spotlight {
  display: none;
}

.sidebar-spotlight::before {
  display: none;
}

.sidebar-tooth {
  display: none;
}

.nav-exit {
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: 2px;
  position: relative;
  z-index: 1;
}

.nav-password {
  flex: 0 0 auto;
  margin-top: auto;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.nav-password:not(.hidden) + .nav-exit {
  margin-top: 0;
}

.topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(217, 228, 242, 0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 86px;
  margin-top: 4px;
  overflow: visible;
  padding: 16px 20px;
  position: relative;
  z-index: 22;
}

.topbar-main {
  align-items: center;
  display: flex;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}

.page-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.page-heading-icon {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #eef4ff);
  border: 1px solid #d8e3f6;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(36, 71, 145, 0.08);
  color: #4f6cab;
  display: inline-flex;
  flex: 0 0 40px;
  height: 40px;
  justify-content: center;
}

.page-heading-icon svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 18px;
}

.page-heading-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.page-heading-copy h1 {
  font-size: 24px;
  line-height: 1.1;
}

.breadcrumbs {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.mobile-menu-button {
  background: linear-gradient(180deg, #ffffff, #eef4ff);
  border: 1px solid #d9e3f7;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(36, 71, 145, 0.08);
  color: #172033;
  display: none;
  font-weight: 700;
  min-height: 42px;
  padding: 0 14px;
}

.topbar-side {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: flex-end;
  overflow: visible;
}

.user-chip {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f5f9ff);
  border: 1px solid #d8e3f6;
  border-radius: 16px;
  box-shadow: 0 10px 22px rgba(30, 64, 147, 0.08);
  display: flex;
  gap: 10px;
  min-height: 52px;
  padding: 8px 12px;
}

.user-chip-icon {
  align-items: center;
  background: linear-gradient(180deg, #4f87ff, #3566f4);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(53, 102, 244, 0.24);
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 34px;
  font-size: 13px;
  font-weight: 800;
  height: 34px;
  justify-content: center;
}

.user-chip-copy {
  display: grid;
  gap: 2px;
}

.user-chip-copy strong {
  color: #24324f;
  font-size: 13px;
}

.user-chip-copy span {
  color: #73819c;
  font-size: 11px;
  font-weight: 600;
}

.page-stats {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  overflow: visible;
  position: relative;
}

.stat-chip-wrap {
  position: relative;
}

.stat-chip {
  align-items: center;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(31, 55, 117, 0.06);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 52px;
  min-width: 132px;
  padding: 8px 12px;
}

.stat-chip.interactive {
  cursor: pointer;
  min-width: 156px;
  text-align: left;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.stat-chip.interactive:hover,
.stat-chip.interactive.open {
  border-color: rgba(79, 124, 219, 0.36);
  box-shadow: 0 12px 24px rgba(31, 55, 117, 0.12);
  transform: translateY(-1px);
}

.stat-chip span {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.stat-chip strong {
  color: var(--text-primary);
  font-size: 13px;
  margin-left: auto;
  line-height: 1.2;
  white-space: nowrap;
}

.stat-chip.primary {
  background: linear-gradient(180deg, #f9fbff, #eef4ff);
}

.stat-chip.success {
  background: linear-gradient(180deg, #f4fff7, #ecfdf3);
}

.stat-chip.warning {
  background: linear-gradient(180deg, #fffaf0, #fff7ed);
}

.stat-chip.danger {
  background: linear-gradient(180deg, #fff7f7, #fef2f2);
}

.topbar-popover {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  margin-top: 8px;
  min-width: 320px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 80;
}

.topbar-popover-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 4px 8px;
}

.topbar-popover-head strong {
  color: var(--text-primary);
  font-size: 13px;
}

.topbar-popover-head span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.topbar-popover-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}

.topbar-popover-item {
  background: var(--bg-panel-muted);
  border: 1px solid #edf2f7;
  border-radius: 12px;
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 9px 10px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
  width: 100%;
}

.topbar-popover-item:hover {
  background: #f3f8ff;
  border-color: rgba(79, 124, 219, 0.28);
  box-shadow: 0 8px 18px rgba(31, 55, 117, 0.08);
  transform: translateY(-1px);
}

.topbar-popover-item strong {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.35;
}

.topbar-popover-item span {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.35;
}

.topbar-popover-more {
  background: linear-gradient(180deg, #f9fbff, #eef4ff);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
  padding: 10px 12px;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
  width: 100%;
}

.topbar-popover-more:hover {
  background: #f3f8ff;
  border-color: rgba(79, 124, 219, 0.34);
  transform: translateY(-1px);
}

.empty.compact {
  padding: 12px 10px;
}

.topbar-popover-list.full-list {
  max-height: min(62vh, 520px);
}

.sidebar-backdrop {
  background: rgba(15, 23, 42, 0.44);
  inset: 0;
  position: fixed;
  z-index: 24;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

h3 {
  font-size: 16px;
  margin-top: 12px;
}

.topbar p,
.muted,
.row-card span,
.appointment span,
.visit span {
  color: #68758a;
}

.message {
  background: #e8f6ef;
  border: 1px solid #b8e2c9;
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
  color: #146239;
  max-width: 420px;
  padding: 12px 14px;
  position: fixed;
  right: 20px;
  top: 18px;
  z-index: 120;
}

.hidden {
  display: none;
}

.sidebar button.hidden,
.sidebar .hidden {
  display: none;
}

.workspace {
  padding: var(--space-4) var(--space-1) var(--space-5);
}

.layout {
  align-items: start;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) 420px;
}

.layout > .panel,
.layout > form.panel {
  align-self: start;
}

.calendar-layout-full {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
  padding: var(--space-4);
}

.toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.segmented {
  background: var(--bg-segment);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: flex;
  padding: 4px;
}

.segmented button {
  background: transparent;
  border-radius: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  min-height: 40px;
  padding: 8px 14px;
}

.segmented button.selected {
  background: var(--bg-segment-selected);
  color: var(--text-primary);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(32, 45, 70, 0.1);
}

.cabinet-filter button {
  min-width: 84px;
}

.period-nav button {
  min-width: 42px;
}

.calendar-toolbar {
  justify-content: flex-start;
}

.calendar-toolbar-primary {
  justify-content: space-between;
}

.calendar-main-filters {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  gap: 12px;
  min-width: 0;
}

.anchor-date-display {
  background: #fff;
  border: 1px solid #bfd0ea;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 10px rgba(26, 46, 84, 0.06);
  display: flex;
  flex: 0 0 180px;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px 8px;
  position: relative;
}

.calendar-main-filters #anchorDate {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: var(--text-primary);
  flex: 0 0 auto;
  font-weight: 700;
  min-height: auto;
  padding: 0 28px 0 0;
  width: 100%;
}

.calendar-main-filters #anchorDate:focus {
  box-shadow: none;
  outline: none;
}

.anchor-date-display:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 104, 246, 0.12);
}

.anchor-date-display::after {
  color: var(--text-secondary);
  content: "📅";
  font-size: 14px;
  pointer-events: none;
  position: absolute;
  right: 12px;
  top: 12px;
}

.anchor-date-weekday {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  padding-left: 1px;
}

.calendar-main-filters #calendarSearch {
  flex: 1 1 360px;
}

.calendar-inline-nav {
  flex: 0 0 auto;
}

.calendar-inline-nav button {
  min-width: 44px;
}

.calendar-add-button {
  background: linear-gradient(180deg, #4f87ff, #2f68f6);
  box-shadow: 0 12px 24px rgba(47, 104, 246, 0.24);
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 190px;
}

.grid {
  display: grid;
  gap: var(--space-2);
}

.patients-layout {
  display: grid;
  gap: 20px;
}

.patients-toolbar {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: space-between;
}

.patients-toolbar input {
  max-width: none;
  min-width: 0;
}

.active-patients-toolbar select {
  max-width: none;
}

.active-patients-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.active-patients-toolbar > input,
.active-patients-toolbar > select {
  max-width: none;
  flex: 0 1 220px;
  min-width: 0;
}

.active-patients-period {
  flex: 0 0 auto;
}

.active-patients-status-filter {
  flex: 0 1 auto;
}

.maintenance-toolbar {
  align-items: center;
  justify-content: flex-start;
}

.maintenance-toolbar input,
.maintenance-toolbar select {
  max-width: 240px;
}

.maintenance-layout {
  gap: 16px;
}

.maintenance-metrics {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.maintenance-metric {
  background: var(--bg-panel-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 6px;
  padding: 14px;
}

.maintenance-metric span,
.maintenance-metric small {
  color: #64748b;
  font-size: 12px;
}

.maintenance-metric strong {
  color: #172033;
  font-size: 20px;
  line-height: 1.2;
}

.maintenance-metric.success {
  background: linear-gradient(180deg, #f4fff8, #ebfbf1);
  border-color: #b7e4c7;
}

.maintenance-metric.danger {
  border-color: #fecaca;
}

.maintenance-service-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.05fr) minmax(280px, 0.9fr);
}

.maintenance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.maintenance-lookup-toolbar {
  justify-content: flex-start;
}

.maintenance-lookup-result {
  margin-top: 8px;
}

.notes-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.note-card {
  background: #ffffff;
  border: 1px solid #dfe5ee;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(31, 55, 117, 0.08);
  color: #172033;
  display: grid;
  gap: 10px;
  min-height: 200px;
  padding: 18px;
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.note-card:hover {
  border-color: #c7d7f0;
  box-shadow: 0 14px 28px rgba(31, 55, 117, 0.12);
  transform: translateY(-2px);
}

.note-card strong {
  color: #172033;
  font-size: 18px;
  line-height: 1.3;
}

.note-card p {
  color: #526174;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  min-height: 96px;
  overflow: hidden;
  white-space: pre-wrap;
}

.note-card span {
  color: #7b8aa0;
  font-size: 12px;
  font-weight: 600;
  margin-top: auto;
}

.note-form textarea {
  min-height: 260px;
  white-space: pre-wrap;
}

.documents-layout {
  display: grid;
  gap: 20px;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 240px);
}

.documents-sidebar-panel,
.documents-editor-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.documents-sidebar-head,
.documents-editor-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.documents-sidebar-head strong,
.documents-editor-meta strong {
  color: #172033;
  font-size: 20px;
}

.documents-editor-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.documents-editor-meta span {
  color: #70819a;
  font-size: 13px;
  font-weight: 600;
}

.documents-list {
  background: var(--bg-panel-muted);
  border: 1px solid #dfe7f3;
  border-radius: 16px;
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
}

.document-item {
  background: #ffffff;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.document-item:hover {
  border-color: #bdd2f1;
  box-shadow: 0 12px 24px rgba(31, 55, 117, 0.08);
  transform: translateY(-1px);
}

.document-item.active {
  border-color: #3b82f6;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.14);
}

.document-item strong {
  color: #172033;
  font-size: 15px;
  line-height: 1.35;
}

.document-item span {
  color: #7b8aa0;
  font-size: 12px;
  font-weight: 600;
}

.documents-form {
  display: grid;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

.documents-text-label {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.documents-form textarea {
  flex: 1;
  min-height: 520px;
  resize: vertical;
  white-space: pre-wrap;
}

.documents-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.maintenance-lookup-card,
.maintenance-backup-row {
  background: #f8fafc;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.maintenance-lookup-card strong,
.maintenance-backup-row strong {
  color: #172033;
}

.maintenance-lookup-card span,
.maintenance-backup-row span,
.maintenance-backup-row small {
  color: #64748b;
}

.maintenance-backup-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.maintenance-backup-head span {
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.maintenance-backup-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 2px;
}

.maintenance-backup-panel {
  min-width: 0;
}

.maintenance-backup-row {
  gap: 3px;
  padding: 10px;
}

.maintenance-backup-row strong,
.maintenance-backup-row span,
.maintenance-backup-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maintenance-backup-row span,
.maintenance-backup-row small {
  font-size: 12px;
}

.maintenance-log-list {
  background: #eef3f9;
  border: 1px solid #d8e1ed;
  border-radius: 12px;
  box-shadow: inset 0 2px 10px rgba(31, 41, 55, 0.08);
  display: grid;
  gap: 8px;
  max-height: 62vh;
  min-height: 420px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
}

.maintenance-summary {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: -4px 0 14px;
}

.maintenance-summary strong {
  color: #172033;
  font-size: 16px;
}

.maintenance-summary span {
  color: #64748b;
  font-size: 13px;
}

.log-row {
  background: #ffffff;
  border: 1px solid #dfe5ee;
  border-radius: 10px;
  min-width: 0;
  overflow: hidden;
  padding: 10px 12px;
}

.log-row.compact-user-log {
  padding: 8px 12px;
}

.log-row-inline {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.log-row-title {
  color: #172033;
  flex: 0 1 auto;
  font-size: 14px;
  line-height: 1.3;
  min-width: 0;
  white-space: normal;
}

.log-row-summary {
  color: #64748b;
  flex: 1 1 auto;
  font-size: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

.log-row-time {
  color: #64748b;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.log-row-id {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.log-row-meta {
  display: flex;
  flex: 1 1 100%;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.log-row.compact-user-log .log-row-inline {
  align-items: center;
  flex-wrap: wrap;
}

.log-row.compact-user-log .log-row-title {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.25;
  min-width: 180px;
  white-space: normal;
}

.log-row.compact-user-log .log-row-meta {
  flex: 0 0 auto;
  margin-left: auto;
}
  
.log-pill {
  background: #f8fafc;
  border: 1px solid #dfe5ee;
  border-radius: 999px;
  color: #526174;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  white-space: nowrap;
}

.log-pill.method {
  background: #eef4ff;
  border-color: #d6e2ff;
  color: #2956a3;
}

.log-pill.id {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.log-pill.path {
  color: #334155;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-pill.status.success {
  background: #ecfdf3;
  border-color: #c7f0d8;
  color: #166534;
}

.log-pill.status.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b45309;
}

.log-pill.status.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.log-pill.session {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #6d28d9;
}

.log-pill.duration,
.log-pill.client {
  color: #475569;
}

.patient-table {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: grid;
  max-height: calc(100vh - 300px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.patient-table-head,
.patient-table-row {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(180px, 1.25fr) minmax(120px, 0.82fr) minmax(110px, 0.72fr) minmax(170px, 1.15fr) minmax(210px, 0.9fr);
  min-width: 860px;
}

.waitlist-table-head,
.waitlist-table-row {
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) minmax(220px, 1fr);
  min-width: 720px;
}

.active-patients-table-head,
.active-patients-table-row {
  grid-template-columns: minmax(170px, 1.08fr) minmax(110px, 0.8fr) minmax(160px, 0.96fr) minmax(96px, 0.72fr) minmax(150px, 0.92fr) minmax(150px, 0.84fr) minmax(90px, 0.68fr);
  min-width: 980px;
}

.work-types-table-head,
.work-types-table-row {
  grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.72fr);
  min-width: 560px;
}

.work-types-table-head > div:last-child {
  justify-self: end;
  text-align: right;
}

.work-types-table-row > strong {
  align-self: center;
}

.active-patients-table-row {
  position: relative;
}

.active-patients-table-row {
  cursor: pointer;
}

.patient-table-head {
  backdrop-filter: blur(8px);
  background: rgba(248, 251, 255, 0.96);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 2;
}

.patient-table-row {
  align-items: center;
  background: var(--bg-panel);
  border-bottom: 1px solid #edf2f7;
  min-height: 58px;
  padding: 10px 16px;
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.patient-table-row:hover {
  background: var(--bg-panel-muted);
  box-shadow: inset 0 0 0 1px rgba(79, 124, 219, 0.08);
}

.patient-table-row > span {
  color: var(--text-secondary);
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.patient-table-row > strong {
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.waitlist-table-row > span:nth-child(2),
.active-patients-table-row > span:nth-child(3),
.active-patients-table-row > span:nth-child(5),
.active-patients-table-row > span:nth-child(6) {
  line-height: 1.35;
  white-space: normal;
}

.table-actions {
  gap: 8px;
}

.table-actions button {
  padding-left: 12px;
  padding-right: 12px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.work-types-table-row .table-actions,
.waitlist-table-row .table-actions {
  justify-content: flex-end;
}

.work-types-table-row .table-actions {
  justify-self: end;
}

.waitlist-table-row .table-actions {
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.table-actions > button,
.modal-actions > button,
.row-card > div > button {
  flex: 0 0 auto;
}

.table-actions .link,
.table-actions .secondary,
.table-actions .success {
  border-radius: 10px;
  min-height: 34px;
  font-size: 13px;
  padding: 7px 10px;
}

.status-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  min-height: 26px;
  padding: 0 10px;
  white-space: nowrap;
}

.status-badge.success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #166534;
}

.status-badge.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #b45309;
}

.status-badge.danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.status-badge.info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.status-badge.neutral {
  background: #f1f5f9;
  border-color: #dbe5ee;
  color: #64748b;
}

.cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.week-mode .calendar-card-list {
  display: none;
}

.appointment-list-view {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: grid;
  overflow: hidden;
}

.appointment-list-head,
.appointment-list-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 160px minmax(170px, 1.2fr) minmax(160px, 1fr) 110px minmax(170px, 1fr) 90px;
}

.appointment-list-head {
  background: var(--bg-panel-muted);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 14px;
  white-space: nowrap;
}

.appointment-list-row {
  align-items: center;
  background: var(--bg-panel);
  border-bottom: 1px solid #edf2f7;
  border-left: 5px solid #2563eb;
  cursor: pointer;
  padding: 12px 14px;
  position: relative;
}

.appointment-list-row:hover {
  background: var(--bg-panel-muted);
}

.appointment-list-row small {
  color: #68758a;
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.appointment-list-head > span,
.appointment-list-row > span,
.appointment-list-row > strong {
  min-width: 0;
}

.appointment-list-head > span,
.appointment-list-row > strong,
.appointment-list-row > span:nth-child(2),
.appointment-list-row > span:nth-child(3),
.appointment-list-row > span:nth-child(4),
.appointment-list-row > span:nth-child(6) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appointment-list-row > span:nth-child(5) {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
}

.week-calendar {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  overflow: auto;
  max-height: calc(100vh - 210px);
  min-height: 620px;
}

.day-calendar {
  min-height: 620px;
}

.month-calendar {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 10px;
  overflow: hidden;
  padding: 10px;
}

.month-calendar-head {
  display: grid;
  gap: 8px;
}

.month-title {
  color: #0f172a;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.1;
  text-transform: capitalize;
}

.month-weekdays {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-weekday {
  color: #4b5563;
  font-size: 12px;
  font-weight: 800;
  padding: 0 4px;
  text-align: center;
}

.month-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.month-day {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid #dbe5f0;
  border-radius: 14px;
  display: grid;
  gap: 8px;
  min-height: 146px;
  padding: 10px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.month-day:hover {
  border-color: #c0d4ff;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.10);
}

.month-day.today {
  border-color: #8db3ff;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.18);
}

.month-day-blank {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

.month-day-top {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.month-day-number {
  background: transparent;
  border: 0;
  color: #0f172a;
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  padding: 0;
}

.month-day-total {
  align-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  height: 24px;
  justify-content: center;
  min-width: 24px;
  padding: 0 7px;
}

.month-day-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.month-day-badges .status-badge {
  font-size: 11px;
  min-height: 20px;
  padding: 0 7px;
}

.month-day-list {
  display: grid;
  gap: 5px;
  align-content: start;
}

.month-appointment,
.month-more,
.month-open-day {
  border-radius: 12px;
  text-align: left;
}

.month-appointment {
  background: #f8fbff;
  border: 1px solid #d9e5f6;
  border-left: 4px solid #2563eb;
  cursor: pointer;
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 8px;
  position: relative;
}

.month-appointment strong {
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.month-appointment span,
.month-appointment small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-appointment span {
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.month-appointment small {
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}

.month-appointment .pending-badge {
  right: 6px;
  top: 6px;
}

.month-more {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
  min-height: 32px;
  padding: 0 8px;
}

.month-open-day {
  align-items: center;
  background: #eef4ff;
  border: 1px solid #d5e4ff;
  color: #1d4ed8;
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
  margin-top: auto;
  min-height: 32px;
  padding: 0 8px;
}

.week-header {
  background: white;
  border-bottom: 1px solid #c7d2df;
  display: grid;
  grid-template-columns: 70px repeat(7, minmax(150px, 1fr));
  min-width: 1120px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.day-calendar-header {
  background: white;
  border-bottom: 1px solid #c7d2df;
  display: grid;
  grid-template-columns: 70px repeat(var(--day-columns, 1), minmax(240px, 1fr));
  min-width: calc(70px + (240px * var(--day-columns, 1)));
  position: sticky;
  top: 0;
  z-index: 4;
}

.time-corner {
  border-right: 1px solid #c7d2df;
}

.day-heading {
  border-right: 1px solid #c7d2df;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 56px;
  overflow: hidden;
  padding: 10px 12px;
}

.day-heading .day-label {
  color: #111827;
  display: block;
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 800;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: capitalize;
}

.day-heading .day-date {
  color: #111827;
  flex-shrink: 0;
  font-size: clamp(13px, 0.95vw, 16px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.day-heading.today {
  background: #eff6ff;
}

.cabinet-heading {
  align-items: center;
  background: white;
  border-right: 1px solid #c7d2df;
  display: flex;
  justify-content: center;
  min-height: 56px;
  padding: 10px 12px;
  text-align: center;
}

.cabinet-heading strong {
  color: #111827;
  font-size: clamp(15px, 1.1vw, 18px);
  font-weight: 800;
  line-height: 1.15;
}

.week-body {
  display: grid;
  grid-template-columns: 70px minmax(1050px, 1fr);
  min-width: 1120px;
}

.day-calendar-body {
  display: grid;
  grid-template-columns: 70px minmax(calc(240px * var(--day-columns, 1)), 1fr);
  min-width: calc(70px + (240px * var(--day-columns, 1)));
}

.time-column {
  background: #f8fafc;
  border-right: 1px solid #c7d2df;
}

.time-slot {
  align-items: center;
  color: #111827;
  display: flex;
  font-size: clamp(14px, 1vw, 17px);
  font-weight: 800;
  height: 64px;
  justify-content: center;
  line-height: 1.1;
  padding: 0;
  text-align: center;
}

.days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(150px, 1fr));
}

.day-cabinets-grid {
  display: grid;
  grid-template-columns: repeat(var(--day-columns, 1), minmax(240px, 1fr));
}

.day-column {
  border-right: 1px solid #c7d2df;
  isolation: isolate;
  min-height: 832px;
  position: relative;
}

.hour-cell {
  background: white;
  border-bottom: 1px solid #d7dee8;
  display: block;
  height: 64px;
  position: relative;
  width: 100%;
  z-index: 0;
}

.hour-cell:hover {
  background: #f8fbff;
}

.week-event {
  background: #ffffff;
  border: 1px solid #2563eb;
  border-left-width: 5px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(32, 45, 70, 0.12);
  display: grid;
  gap: 2px;
  left: 6px;
  min-height: 34px;
  overflow: hidden;
  padding: 4px 26px 4px 8px;
  position: absolute;
  z-index: 5;
  cursor: pointer;
}

.day-event {
  padding: 6px 24px 6px 9px;
}

.day-calendar.single-column .day-event {
  padding: 7px 28px 7px 10px;
}

.day-event.micro,
.day-event.compact {
  align-items: center;
  gap: 0;
}

.day-event.micro {
  padding: 4px 20px 4px 8px;
}

.day-event.compact {
  padding: 4px 20px 4px 8px;
}

.day-event.micro > strong,
.day-event.compact > strong {
  color: #0f172a;
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-inline-line {
  color: #0f172a;
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-calendar.single-column .day-event > strong {
  font-size: 13px;
}

.day-calendar.single-column .day-event > small {
  font-size: 11px;
}

.appointment.status-pending,
.appointment-list-row.status-pending,
.week-event.status-pending {
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.75), 0 8px 18px rgba(32, 45, 70, 0.12);
}

.appointment.status-pending,
.week-event.status-pending {
  background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(245, 158, 11, 0.04));
}

.appointment-list-row.status-pending {
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.45);
}

.pending-badge {
  align-items: center;
  background: #f59e0b;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  height: 18px;
  justify-content: center;
  line-height: 1;
  position: absolute;
  right: 8px;
  top: 8px;
  width: 18px;
  z-index: 2;
}

.appointment-list-row .pending-badge,
.active-patients-table-row .pending-badge {
  right: 10px;
  top: 10px;
}

.week-event .pending-badge {
  right: 4px;
  top: 4px;
}

.week-event.status-pending {
  padding-right: 26px;
}

.week-event.status-pending.compact {
  padding-right: 24px;
}

.week-event.closed,
.week-event.cancelled {
  opacity: 1;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.5), 0 2px 6px rgba(32, 45, 70, 0.03);
}

.appointment.closed,
.appointment.cancelled,
.appointment-list-row.closed,
.appointment-list-row.cancelled {
  opacity: 1;
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.5);
}

.appointment.closed strong,
.appointment.cancelled strong,
.appointment-list-row.closed strong,
.appointment-list-row.cancelled strong,
.week-event.closed strong,
.week-event.cancelled strong {
  color: #64748b;
}

.appointment.closed span,
.appointment.closed small,
.appointment.cancelled span,
.appointment.cancelled small,
.appointment-list-row.closed span,
.appointment-list-row.closed small,
.appointment-list-row.cancelled span,
.appointment-list-row.cancelled small,
.week-event.closed span,
.week-event.closed small,
.week-event.closed em,
.week-event.cancelled span,
.week-event.cancelled small,
.week-event.cancelled em {
  color: #94a3b8;
}

.week-event.compact {
  align-items: flex-start;
  gap: 1px;
  padding: 4px 18px 4px 8px;
}

.week-event.narrow {
  gap: 2px;
  padding: 4px 8px 4px 6px;
}

.week-event.micro {
  align-items: center;
  gap: 0;
  padding: 3px 18px 3px 8px;
}

.week-event-main {
  background: transparent;
  color: #172033;
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.week-event > span,
.week-event > small,
.week-event > em {
  color: #526174;
  font-size: 11px;
  line-height: 1.2;
}

.week-event > strong {
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-event.narrow > strong {
  font-size: 11px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.week-event.compact > strong {
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
}

.week-event.micro > strong {
  color: #1e293b;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-event > small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-event.compact > span {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
}

.week-event.narrow > span {
  color: #334155;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.week-event.compact > small {
  font-size: 10px;
  line-height: 1.1;
}

.week-event.narrow > small {
  display: none;
}

.week-event.compact > em,
.week-event.micro > em {
  display: none;
}

.week-event.micro > span,
.week-event.micro > small {
  display: none;
}

.week-event.micro.narrow {
  align-items: flex-start;
  gap: 2px;
  padding: 4px 8px 4px 6px;
}

.week-event.micro.narrow > span {
  color: #334155;
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.week-event.micro.narrow > strong {
  color: #1e293b;
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.week-event.compact > small {
  display: block;
}

.week-inline-line {
  color: #0f172a;
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-event.closed.micro > strong,
.week-event.closed.compact > strong,
.day-event.closed.micro > strong,
.day-event.closed.compact > strong,
.week-event.closed .week-inline-line,
.day-event.closed .day-inline-line {
  color: #64748b;
  font-weight: 500;
}

.week-event.closed.compact > small,
.week-event.closed.micro > small,
.day-event.closed.compact > small,
.day-event.closed.micro > small {
  color: #94a3b8;
}

.day-event.micro > span,
.day-event.micro > small,
.day-event.compact > small,
.day-event.compact > span {
  display: none;
}

.week-event[style*="/ 2"],
.week-event[style*="/ 3"],
.week-event[style*="/ 4"] {
  padding-right: 8px;
}

.week-event-main span,
.week-event-main small,
.week-status {
  color: #526174;
  font-size: 11px;
  line-height: 1.2;
}

.week-event-main strong {
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-event-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-cancel {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  color: #c2410c;
  height: 20px;
  line-height: 18px;
  padding: 0;
  position: absolute;
  right: 4px;
  top: 4px;
  width: 20px;
}

.week-status {
  bottom: 4px;
  position: absolute;
  right: 6px;
}

.modal-layer {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 100;
}

.confirm-layer {
  align-items: center;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 140;
}

.confirm-backdrop {
  background: rgba(15, 23, 42, 0.36);
  inset: 0;
  position: absolute;
}

.confirm-window {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  display: grid;
  gap: 12px;
  max-width: 420px;
  padding: 22px;
  position: relative;
  width: min(420px, 100%);
  z-index: 1;
}

.confirm-window p {
  color: #526174;
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.46);
  inset: 0;
  position: absolute;
}

.modal-window {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  max-height: min(92vh, 820px);
  max-width: 720px;
  overflow: auto;
  padding: 22px;
  position: relative;
  width: min(720px, 100%);
  z-index: 1;
}

.modal-close {
  align-items: center;
  background: var(--bg-segment);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-primary);
  display: flex;
  font-size: 20px;
  height: 32px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 14px;
  top: 14px;
  width: 32px;
}

.modal-info,
.modal-form {
  display: grid;
  gap: 14px;
}

.modal-info h2,
.modal-form h2 {
  padding-right: 42px;
}

.login-form {
  gap: 18px;
  min-width: min(460px, 100%);
}

.login-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
}

.login-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex: 1 1 160px;
  gap: 10px;
  justify-content: center;
  padding: 10px 14px;
  transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.login-option input {
  accent-color: #2563eb;
  display: none;
  height: 18px;
  margin: 0;
  width: 18px;
}

.login-option span {
  color: #526174;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.login-option.selected {
  background: white;
  box-shadow: 0 2px 8px rgba(32, 45, 70, 0.1);
}

.login-option.selected span {
  color: #172033;
}

.login-backdrop {
  background: rgba(15, 23, 42, 0.6);
}

.details-grid {
  display: grid;
  gap: 10px;
}

.details-grid div {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xs);
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.details-grid span {
  color: var(--text-muted);
  font-size: 13px;
}

.details-grid p {
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.patient-combobox {
  position: relative;
}

.suggestions {
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-float);
  display: grid;
  left: 0;
  max-height: 240px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 5;
}

.suggestions.hidden {
  display: none;
}

.suggestions button {
  background: var(--bg-panel);
  border-bottom: 1px solid #edf2f7;
  color: var(--text-primary);
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  text-align: left;
}

.suggestions button:hover {
  background: var(--bg-panel-muted);
}

.suggestions span {
  color: var(--text-muted);
  font-size: 12px;
}

.appointment {
  background: var(--bg-panel-muted);
  border-left: 5px solid #2563eb;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 6px;
  padding: 12px;
  position: relative;
}

.calendar-day-stack {
  display: grid;
  gap: 12px;
}

.calendar-day-stack .appointment {
  width: 100%;
}

.closed,
.cancelled {
  opacity: 0.55;
}

.form {
  display: grid;
  gap: 12px;
}

.form-warning {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-xs);
  color: #c2410c;
  padding: 10px 12px;
}

label {
  color: var(--text-secondary);
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

input,
select,
textarea {
  background: var(--bg-control);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  min-height: 44px;
  min-width: 0;
  padding: 11px 13px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  width: 100%;
}

input:hover,
select:hover,
textarea:hover {
  background: var(--bg-control-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(47, 104, 246, 0.55);
  box-shadow: 0 0 0 4px rgba(47, 104, 246, 0.12);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: #8a9ab2;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

.primary,
.secondary,
.success,
.link {
  align-items: center;
  border: 1px solid transparent;
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  justify-content: center;
  line-height: 1.2;
  min-height: 44px;
  padding: 10px 16px;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
  vertical-align: middle;
}

.primary:hover,
.secondary:hover,
.success:hover,
.link:hover {
  transform: translateY(-1px);
}

.primary {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  border-color: rgba(47, 104, 246, 0.2);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 24px rgba(47, 104, 246, 0.22);
  color: white;
  padding: 11px 16px;
}

.primary:hover {
  box-shadow: 0 14px 26px rgba(47, 104, 246, 0.28);
}

.primary:disabled,
.secondary:disabled,
.success:disabled,
.link:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.secondary {
  background: var(--bg-segment);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
}

.secondary:hover {
  background: #f2f7ff;
  border-color: #c7d7f0;
  box-shadow: 0 10px 20px rgba(31, 55, 117, 0.08);
}

.success {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  border-color: rgba(22, 163, 74, 0.18);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 24px rgba(22, 163, 74, 0.2);
  color: #ffffff;
}

.success:hover {
  box-shadow: 0 14px 26px rgba(22, 163, 74, 0.26);
}

.link {
  background: #ffffff;
  border-color: var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 14px rgba(31, 55, 117, 0.06);
  color: var(--accent);
  min-height: 38px;
  padding: 8px 12px;
}

.link:hover {
  background: #f6faff;
  border-color: #c9d8ee;
  box-shadow: 0 10px 18px rgba(31, 55, 117, 0.08);
}

.danger {
  color: var(--danger);
}

.secondary.danger,
.link.danger {
  background: linear-gradient(180deg, #fff7f7, #fef2f2);
  border-color: #fecaca;
  color: #dc2626;
}

.secondary.danger:hover,
.link.danger:hover {
  background: #fff1f2;
  border-color: #fca5a5;
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.1);
}

.primary.success,
.secondary.success,
.link.success {
  color: #ffffff;
}

.secondary.success,
.link.success {
  background: linear-gradient(180deg, #ecfdf3, #dcfce7);
  border-color: #bbf7d0;
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.12);
  color: #166534;
}

.secondary.success:hover,
.link.success:hover {
  background: #dff7e8;
  border-color: #86efac;
}

.row-card,
.visit {
  background: var(--bg-panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 6px;
  padding: 12px;
}

.row-card strong {
  align-items: center;
  display: flex;
  gap: 8px;
}

.row-card > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.dot {
  border-radius: 999px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.schedule-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr 1fr;
}

.history {
  border-top: 1px solid #e4e9f1;
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
}

.empty {
  color: #68758a;
  padding: 22px;
  text-align: center;
}

@media (max-width: 980px) {
  .app {
    grid-template-columns: 1fr;
    padding: 0;
  }

  main {
    grid-column: auto;
  }

  .sidebar {
    display: grid;
    gap: 12px;
    height: calc(100vh - 16px);
    left: 0;
    max-width: min(320px, 84vw);
    padding: 18px 14px;
    position: fixed;
    top: 8px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(320px, 84vw);
    z-index: 25;
  }

  .app.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .brand {
    align-items: center;
    flex: none;
    margin-bottom: 0;
    padding: 6px 8px;
  }

  .sidebar-nav {
    align-content: start;
    flex: 1 1 auto;
    gap: 10px;
    overflow-y: auto;
    padding-right: 2px;
  }

  .brand strong {
    font-size: 22px;
  }

  .brand-copy span {
    font-size: 11px;
  }

  .sidebar button {
    flex: none;
    min-height: 44px;
    padding: 10px 14px;
    text-align: left;
  }

  .nav-exit {
    margin-left: 0;
    margin-top: auto;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .appointment-list-head {
    display: none;
  }

  .appointment-list-row {
    grid-template-columns: 1fr;
  }

  .topbar,
  .workspace {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    background: #f3f6fb;
    border-bottom: 1px solid #dfe5ee;
    border-radius: 0 0 20px 20px;
    min-height: 0;
    padding-top: 10px;
    position: static;
    z-index: 18;
  }

  .topbar-main {
    align-items: flex-start;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100%;
  }

  .topbar-side {
    align-items: start;
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    width: 100%;
  }

  .page-heading {
    align-items: flex-start;
    gap: 10px;
  }

  .page-heading-copy h1 {
    font-size: 18px;
  }

  .breadcrumbs {
    font-size: 11px;
    line-height: 1.2;
    white-space: normal;
  }

  .page-stats {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    width: 100%;
  }

  .stat-chip {
    align-items: center;
    flex: none;
    justify-content: space-between;
    min-height: 44px;
    min-width: 0;
    padding: 8px 10px;
  }

  .stat-chip span {
    font-size: 10px;
  }

  .stat-chip strong {
    font-size: 12px;
  }

  .user-chip {
    border-radius: 14px;
    box-shadow: 0 8px 18px rgba(30, 64, 147, 0.08);
    margin-left: 0;
    min-height: 46px;
    padding: 8px 10px;
    width: 100%;
  }

  .user-chip-icon {
    flex-basis: 30px;
    font-size: 12px;
    height: 30px;
  }

  .user-chip-copy strong {
    font-size: 12px;
  }

  .user-chip-copy span {
    font-size: 10px;
  }

  .mobile-menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .panel {
    padding: 14px;
  }

  .toolbar {
    align-items: stretch;
  }

  .toolbar > input,
  .toolbar > .segmented,
  .toolbar > .primary,
  .toolbar > .secondary {
    width: 100%;
  }

  .calendar-toolbar-primary {
    gap: 10px;
  }

  .calendar-main-filters {
    flex-wrap: wrap;
    width: 100%;
  }

  .anchor-date-display,
  .calendar-main-filters #anchorDate,
  .calendar-main-filters #calendarSearch,
  .calendar-inline-nav,
  .calendar-add-button {
    width: 100%;
  }

  .segmented {
    flex-wrap: wrap;
  }

  .segmented button {
    flex: 1 1 auto;
  }

  .period-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .patients-toolbar {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .active-patients-toolbar {
    display: grid;
  }

  .patients-toolbar input,
  .patients-toolbar button,
  .active-patients-toolbar select,
  .maintenance-toolbar select {
    max-width: none;
    width: 100%;
  }

  .maintenance-service-grid {
    grid-template-columns: 1fr;
  }

  .maintenance-metrics {
    grid-template-columns: 1fr;
  }

  .maintenance-metric {
    gap: 4px;
    padding: 12px;
  }

  .maintenance-metric strong {
    font-size: 16px;
  }

  .patient-table-head,
  .appointment-list-head {
    display: none;
  }

  .patient-table {
    border: 0;
    gap: 10px;
    overflow: visible;
  }

  .patient-table-row,
  .waitlist-table-row,
  .appointment-list-row,
  .row-card,
  .visit {
    background: white;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    display: grid;
    gap: 8px;
    padding: 12px;
  }

  .patient-table-row,
  .waitlist-table-row,
  .appointment-list-row,
  .active-patients-table-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .work-types-table-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .patient-table-row > strong,
  .waitlist-table-row > strong,
  .appointment-list-row > strong,
  .active-patients-table-row > strong {
    border-bottom: 1px solid #eef2f7;
    padding-bottom: 6px;
  }

  .patient-table-row > strong,
  .waitlist-table-row > strong,
  .appointment-list-row > strong {
    font-size: 16px;
  }

  .patient-table-row > span,
  .waitlist-table-row > span,
  .appointment-list-row > span,
  .appointment-list-row > strong,
  .active-patients-table-row > span,
  .row-card > span,
  .visit > span {
    white-space: normal;
  }

  .patient-table-row:not(.waitlist-table-row):not(.active-patients-table-row) > span,
  .waitlist-table-row > span,
  .active-patients-table-row > span,
  .appointment-list-row > span {
    display: grid;
    gap: 2px;
  }

  .patient-table-row:not(.waitlist-table-row):not(.active-patients-table-row) > span::before,
  .waitlist-table-row > span::before,
  .active-patients-table-row > span::before,
  .appointment-list-row > span::before {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
  }

  .patient-table-row:not(.waitlist-table-row):not(.active-patients-table-row) > span:nth-of-type(1)::before { content: "\0422\0435\043B\0435\0444\043E\043D"; }
  .patient-table-row:not(.waitlist-table-row):not(.active-patients-table-row) > span:nth-of-type(2)::before { content: "\0414\0430\0442\0430\0020\0440\043E\0436\0434\0435\043D\0438\044F"; }
  .patient-table-row:not(.waitlist-table-row):not(.active-patients-table-row) > span:nth-of-type(3)::before { content: "\041A\043E\043C\043C\0435\043D\0442\0430\0440\0438\0439"; }

  .waitlist-table-row > span:nth-of-type(1)::before { content: "\0412\0438\0434\0020\0440\0430\0431\043E\0442"; }

  .active-patients-table-row > span:nth-of-type(1)::before { content: "\0422\0435\043B\0435\0444\043E\043D"; }
  .active-patients-table-row > span:nth-of-type(2)::before { content: "\0412\0440\0430\0447"; }
  .active-patients-table-row > span:nth-of-type(3)::before { content: "\041A\0430\0431\0438\043D\0435\0442"; }
  .active-patients-table-row > span:nth-of-type(4)::before { content: "\0412\0438\0434\0020\0440\0430\0431\043E\0442"; }
  .active-patients-table-row > span:nth-of-type(5)::before { content: "\041F\0440\0438\0451\043C"; }
  .active-patients-table-row > span:nth-of-type(6)::before { content: "\0421\0442\0430\0442\0443\0441"; }

  .appointment-list-row > span:nth-of-type(1)::before { content: "\0412\0440\0435\043C\044F"; }
  .appointment-list-row > span:nth-of-type(2)::before { content: "\0412\0440\0430\0447"; }
  .appointment-list-row > span:nth-of-type(3)::before { content: "\041A\0430\0431\0438\043D\0435\0442"; }
  .appointment-list-row > span:nth-of-type(4)::before { content: "\0412\0438\0434\0020\0440\0430\0431\043E\0442"; }
  .appointment-list-row > span:nth-of-type(5)::before { content: "\0421\0442\0430\0442\0443\0441"; }

  .work-types-table-row > strong {
    border-bottom: 1px solid #eef2f7;
    font-size: 16px;
    padding-bottom: 6px;
  }

  .table-actions,
  .modal-actions,
  .row-card > div {
    flex-wrap: wrap;
  }

  .table-actions > button,
  .modal-actions > button,
  .row-card > div > button {
    min-height: 42px;
  }

  .modal-window,
  .confirm-window {
    border-radius: 10px;
    max-height: 94vh;
    padding: 18px;
    width: min(680px, calc(100% - 20px));
  }

  .week-calendar {
    max-height: none;
    min-height: 0;
  }

  .month-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .month-weekdays {
    display: none;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1480px) {
  :root {
    --sidebar-width: 244px;
  }

  .sidebar {
    padding: 16px 12px;
  }

  .brand {
    gap: 10px;
    margin-bottom: 10px;
    padding: 6px 6px 10px;
  }

  .brand strong {
    font-size: 17px;
  }

  .brand-copy span {
    font-size: 10px;
  }

  .sidebar button {
    min-height: 48px;
    padding: 10px 12px;
  }
}

@media (max-height: 900px) {
  .sidebar {
    padding: 14px 12px;
  }

  .brand {
    margin-bottom: 8px;
    padding: 4px 6px 8px;
  }

  .sidebar-nav {
    gap: 6px;
    margin-top: 2px;
  }

  .sidebar button {
    min-height: 46px;
    padding: 9px 12px;
  }

  .nav-icon {
    flex-basis: 30px;
    height: 30px;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 24px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 4px;
  }

  .topbar-main {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .page-heading {
    width: 100%;
  }

  .page-heading-icon,
  .mobile-menu-button {
    flex-shrink: 0;
  }

  .topbar-side {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .page-stats {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .stat-chip {
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    min-height: 48px;
    width: 100%;
  }

  .message {
    left: 12px;
    max-width: none;
    right: 12px;
    top: 12px;
    width: auto;
  }

  .workspace {
    overflow-x: hidden;
    padding-top: 12px;
  }

  .calendar-panel .toolbar {
    gap: 10px;
  }

  .calendar-panel .segmented {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .calendar-panel .segmented::-webkit-scrollbar {
    display: none;
  }

  .calendar-card-list {
    grid-template-columns: 1fr;
  }

  .month-calendar {
    padding: 12px;
  }

  .notes-grid {
    grid-template-columns: 1fr;
  }

  .documents-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .documents-form textarea {
    min-height: 360px;
  }

  .month-grid {
    grid-template-columns: 1fr;
  }

  .month-day {
    min-height: 0;
  }

  .month-title {
    font-size: 18px;
  }

  .appointment {
    padding: 12px;
  }

  .appointment span,
  .appointment small,
  .visit span {
    font-size: 13px;
  }

  .row-card > div,
  .table-actions,
  .modal-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .table-actions > button,
  .modal-actions > button,
  .row-card > div > button,
  .row-card > div > .link {
    justify-content: center;
    width: 100%;
  }

  .week-header {
    grid-template-columns: 60px repeat(7, minmax(120px, 1fr));
    min-width: 900px;
  }

  .day-calendar-header {
    grid-template-columns: 60px repeat(var(--day-columns, 1), minmax(180px, 1fr));
    min-width: calc(60px + (180px * var(--day-columns, 1)));
  }

  .week-body {
    grid-template-columns: 60px minmax(840px, 1fr);
    min-width: 900px;
  }

  .day-calendar-body {
    grid-template-columns: 60px minmax(calc(180px * var(--day-columns, 1)), 1fr);
    min-width: calc(60px + (180px * var(--day-columns, 1)));
  }

  .days-grid {
    grid-template-columns: repeat(7, minmax(120px, 1fr));
  }

  .day-cabinets-grid {
    grid-template-columns: repeat(var(--day-columns, 1), minmax(180px, 1fr));
  }

  .time-slot {
    font-size: 13px;
  }

  .day-heading {
    min-height: 52px;
    padding: 8px 10px;
  }

  .day-heading .day-label {
    font-size: 13px;
  }

  .day-heading .day-date {
    font-size: 12px;
  }

  .cabinet-heading {
    min-height: 52px;
    padding: 8px 10px;
  }

  .cabinet-heading strong {
    font-size: 14px;
  }
}

@media (max-width: 560px) {
  .sidebar {
    max-width: min(360px, 94vw);
    padding: 14px 12px;
    width: min(360px, 94vw);
  }

  .brand strong {
    font-size: 20px;
  }

  .sidebar-nav {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .sidebar button {
    border-radius: 12px;
    font-size: 14px;
    min-height: 52px;
    padding: 10px 12px;
    text-align: left;
  }

  .nav-exit {
    min-height: 46px;
    text-align: left;
  }

  .sidebar-spotlight {
    min-height: 90px;
    padding-top: 10px;
  }

  .sidebar-tooth {
    font-size: 26px;
    height: 70px;
    width: 58px;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 12px;
  }

  label {
    font-size: 13px;
  }

  .modal-window,
  .confirm-window {
    padding: 16px;
    width: calc(100% - 16px);
  }

  .page-heading-icon,
  .user-chip-icon {
    flex-basis: 34px;
    height: 34px;
  }

  .user-chip {
    min-height: 52px;
    padding: 8px 12px;
  }
}
