/* Interaction layer: quiet motion, clear focus, and a full-width clinical workspace. */
:root {
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-fast: 160ms;
  --motion-base: 240ms;
  --header-height: 72px;
}
body {
  background: #f5f8f7;
}
.main-shell {
  margin-left: 0;
}
body[data-route='clinical.encounter'] .mobile-dock {
  display: none;
}
body[data-route='clinical.encounter'] .main-shell {
  padding-bottom: 0;
}
body[data-route='clinical.encounter'] .module-tabs {
  display: none;
}
.cl-workspace {
  --cl-green: #177c72;
}
.cl-workspace .cl-patient-header p {
  font-size: 12px;
}
.cl-workspace .cl-map-keyboard,
.cl-workspace .cl-panel-subtitle {
  font-size: 11px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 44;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 28px;
  gap: 24px;
  background: #ffffffed;
  border-bottom: 1px solid #e3ebe7;
  backdrop-filter: blur(18px);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.topbar .mobile-menu {
  display: inline-flex;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}
.topbar .mobile-menu:hover {
  background: #eaf3ef;
}
.topbar-brand {
  padding: 0;
  gap: 9px;
  flex-shrink: 0;
}
.topbar-brand .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  box-shadow: none;
}
.topbar-brand .brand-mark svg {
  width: 21px;
  height: 21px;
}
.topbar-brand .brand-name {
  font-size: 25px;
  letter-spacing: -1.2px;
}
.topbar-brand .brand-caption {
  display: none;
}
.breadcrumb {
  margin-left: 18px;
  padding-left: 22px;
  border-left: 1px solid #dce8e1;
  font-size: 11px;
}
.breadcrumb > span[data-clinic-name],
.breadcrumb > span:not([data-clinic-name]) {
  display: none;
}
.topbar .search-box {
  border: 1px solid #e7eeea;
  box-shadow: none;
  background: #f6f9f7;
  min-height: 38px;
}
.topbar .search-box input {
  font-size: 11px;
  width: 190px;
  background: transparent;
}
.topbar-actions > .avatar {
  width: 35px;
  height: 35px;
  border-width: 2px;
  font-size: 10px;
}
.demo-banner {
  min-height: 30px;
  border-radius: 0;
  margin: 0;
  padding: 4px 32px;
  background: #edf4f0;
  font-size: 10px;
  color: #61796c;
  display: flex;
  justify-content: space-between;
}
.demo-banner .btn {
  min-height: 26px;
  font-size: 10px;
  padding: 0 8px;
}
.page {
  max-width: 1680px;
  margin: auto;
  padding: 28px 32px 40px;
}
.sidebar {
  width: 300px;
  top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  padding: 18px 15px 20px;
  z-index: 43;
  transform: translateX(-102%);
  visibility: hidden;
  transition:
    transform 280ms var(--ease-out),
    visibility 280ms;
  border-right: 1px solid #dee9e3;
  border-radius: 0 0 22px 0;
  box-shadow: 14px 16px 40px #1e463014;
}
.sidebar > .brand {
  display: none;
}
.sidebar .workspace-card {
  border-radius: 14px;
  padding: 12px;
  margin: 0 0 20px;
}
.sidebar .nav-label {
  padding: 0 12px;
  font-size: 9px;
  letter-spacing: 1.8px;
  color: #92a297;
  margin: 0 0 8px;
}
.sidebar .nav-item {
  min-height: 43px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 500;
  padding: 10px 13px;
  margin: 2px 0;
  gap: 13px;
  flex: 1;
  width: auto;
}
.nav-group {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}
.nav-group.has-children .nav-item {
  padding-right: 39px;
}
.nav-group > .nav-expand {
  position: absolute;
  top: 9px;
  right: 6px;
  width: 29px;
  height: 29px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #879b90;
  display: grid;
  place-items: center;
}
.nav-expand .icon {
  width: 15px;
  height: 15px;
  transition: transform 180ms;
}
.nav-expand[aria-expanded='true'] .icon {
  transform: rotate(180deg);
}
.nav-group:has(.active) > .nav-expand {
  color: #e0f2e9;
}
.nav-group .nav-item.active {
  background: #177c72;
  color: #fff;
  box-shadow: 0 5px 16px #177c721a;
}
.nav-item:hover:not(.active) {
  background: #f0f6f2;
  color: #22594e;
}
.nav-item .nav-icon {
  display: inline-flex;
  width: 21px;
  height: 21px;
}
.nav-submenu {
  width: 100%;
  padding: 5px 0 9px 44px;
  display: grid;
  gap: 3px;
}
.nav-submenu a {
  display: block;
  padding: 8px 10px;
  font-size: 11px;
  border-left: 1px solid #d9e9e0;
  color: #647c6e;
  border-radius: 0 8px 8px 0;
  text-decoration: none;
}
.nav-submenu a:hover,
.nav-submenu a.active {
  background: #edf6f0;
  color: #177c72;
  border-color: #177c72;
}
.sidebar .sidebar-bottom {
  padding: 18px 10px 0;
}
.sidebar .person-name,
.sidebar .user-meta strong {
  font-size: 12px;
}
.nav-overlay {
  display: block;
  position: fixed;
  inset: var(--header-height) 0 0;
  z-index: 42;
  border: 0;
  background: #193a3022;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(1px);
  transition: opacity 240ms var(--ease-out);
}
body.menu-open {
  overflow: hidden;
}
body.menu-open .sidebar {
  transform: translateX(0);
  visibility: visible;
}
body.menu-open .nav-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}
.drawer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 12px;
  color: #536d5f;
  font-size: 11px;
}
.drawer-heading button {
  width: 30px;
  height: 30px;
  border: 0;
  background: #f0f6f3;
  border-radius: 9px;
  color: #648073;
  display: grid;
  place-items: center;
}
.drawer-heading .icon {
  width: 16px;
  height: 16px;
}
.icon {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}
.btn .icon {
  width: 17px;
  height: 17px;
}
.btn,
.icon-btn,
.nav-item,
.chip,
.cl-tooth,
.ag-appointment {
  transition:
    background-color var(--motion-fast),
    color var(--motion-fast),
    border-color var(--motion-fast),
    box-shadow var(--motion-base),
    transform var(--motion-fast) var(--ease-out);
}
.btn:hover:not(:disabled),
.icon-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn:active:not(:disabled),
.icon-btn:active:not(:disabled),
.nav-item:active {
  transform: translateY(0) scale(0.97);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 7px 18px #177c7228;
}
.btn:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.52;
}
.btn .icon {
  transition: transform 180ms var(--ease-out);
}
.btn:hover .icon-arrow {
  transform: translateX(2px);
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #59bda9;
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #4eac98 !important;
  box-shadow: 0 0 0 3px #177c7210;
}
.panel,
.settings-card {
  transition:
    border-color 180ms,
    box-shadow 240ms;
}
.panel:focus-within {
  border-color: #bed8ca;
}
.data-table tbody tr:hover {
  background: #f5faf7;
}
.module-tabs a,
.module-tabs .btn,
.segmented .btn {
  transition:
    background 180ms,
    color 180ms,
    box-shadow 180ms;
}
.module-tabs .active {
  box-shadow: 0 3px 9px #164c3210;
}
dialog.modal[open] {
  animation: dialog-in 220ms var(--ease-out) both;
}
dialog.modal::backdrop {
  animation: veil-in 200ms ease both;
  background: #153a3545;
  backdrop-filter: blur(3px);
}
.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
}
.modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 2;
}
.toast {
  left: 50%;
  bottom: 24px;
  border-radius: 13px;
  transition:
    opacity 180ms,
    transform 280ms var(--ease-out);
}
.toast-visible {
  transform: translate(-50%, 0);
}
.page.route-enter > .page-header,
.page.route-enter > .module-tabs,
.page.route-enter > .panel,
.page.route-enter > .stats-grid,
.page.route-enter > .cl-workspace {
  animation: content-in 280ms var(--ease-out) both;
}
.page.route-enter > .panel:nth-child(3),
.page.route-enter > .stats-grid {
  animation-delay: 35ms;
}
.page.route-enter > .cl-workspace {
  animation: veil-in 240ms ease;
}
.empty-icon {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}
.empty-icon > svg {
  width: 112px;
  height: 80px;
}
.empty-state h3 {
  font-size: 16px;
}
.empty-state p {
  font-size: 12px;
  max-width: 350px;
  margin: 8px auto 16px;
}
.setup-progress span {
  transition: width 250ms var(--ease-out);
}
@keyframes content-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes veil-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding: 0 22px;
  }
  .breadcrumb {
    margin-left: 8px;
    padding-left: 14px;
  }
  .topbar .search-box input {
    width: 150px;
  }
  .page {
    padding: 24px;
  }
}
@media (max-width: 767px) {
  :root {
    --header-height: 64px;
  }
  .topbar {
    padding: 0 16px;
  }
  .topbar .topbar-left {
    width: auto;
  }
  .topbar-brand .brand-name {
    font-size: 23px;
  }
  .breadcrumb {
    display: none;
  }
  .topbar-actions {
    display: flex;
  }
  .topbar-actions .search-box {
    display: none;
  }
  .topbar-actions > .avatar {
    display: grid !important;
  }
  .topbar > div:first-child {
    width: auto;
  }
  .sidebar {
    width: min(300px, 86vw);
    padding: 15px;
  }
  .demo-banner {
    padding: 5px 16px;
    min-height: 31px;
    gap: 5px;
    flex-direction: row;
  }
  .demo-banner > span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .demo-banner .btn {
    font-size: 0;
    min-width: 26px;
  }
  .demo-banner .btn .icon {
    font-size: initial;
    width: 16px;
    height: 16px;
  }
  .page {
    padding: 22px 16px 32px;
  }
  .main-shell {
    margin-left: 0;
  }
  .toast {
    bottom: 100px;
  }
  .mobile-dock {
    box-shadow: 0 6px 28px #244f381a;
  }
  .mobile-dock > .btn {
    min-height: 53px;
  }
  .modal-header,
  .modal-body {
    padding: 20px;
  }
  .modal-header h2 {
    font-size: 20px;
  }
  .modal-footer {
    padding: 16px 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .btn:hover:not(:disabled),
  .icon-btn:hover:not(:disabled) {
    transform: none;
  }
}
@media print {
  .drawer-heading,
  .nav-overlay {
    display: none !important;
  }
  .page {
    max-width: none;
  }
  .topbar {
    position: static;
  }
}
