/* Klinia UI — shadcn/ui inspired design tokens (Blazor / Razor) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 240 10% 3.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 240 10% 3.9%;
  --primary: 173 58% 39%;
  --primary-foreground: 0 0% 100%;
  --secondary: 240 4.8% 95.9%;
  --secondary-foreground: 240 5.9% 10%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --accent: 173 40% 96%;
  --accent-foreground: 173 58% 25%;
  --destructive: 0 72% 51%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 5.9% 90%;
  --input: 240 5.9% 90%;
  --ring: 173 58% 39%;
  --radius: 0.625rem;
  --sidebar: 240 5.9% 96%;
  --sidebar-foreground: 240 5.9% 10%;
  --sidebar-border: 240 5.9% 90%;
  --shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
}

.dark, .k-dark {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 6%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 6%;
  --popover-foreground: 0 0% 98%;
  --primary: 173 58% 45%;
  --primary-foreground: 0 0% 100%;
  --secondary: 240 3.7% 15.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 3.7% 15.9%;
  --muted-foreground: 240 5% 64.9%;
  --accent: 173 30% 12%;
  --accent-foreground: 173 58% 65%;
  --destructive: 0 62% 50%;
  --border: 240 3.7% 15.9%;
  --input: 240 3.7% 15.9%;
  --ring: 173 58% 45%;
  --sidebar: 240 10% 5%;
  --sidebar-foreground: 0 0% 98%;
  --sidebar-border: 240 3.7% 15.9%;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-size: 14px;
  line-height: 1.5;
}

/* —— Layout —— */
.ui-shell { display: flex; min-height: 100vh; }
.ui-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: hsl(var(--sidebar));
  border-right: 1px solid hsl(var(--sidebar-border));
  display: flex;
  flex-direction: column;
  padding: 1rem;
}
.ui-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  font-size: 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
}
.ui-sidebar-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}
.ui-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.ui-nav-link:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.ui-nav-link.active {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.ui-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ui-topbar {
  height: 56px;
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: hsl(var(--background) / 0.8);
  backdrop-filter: blur(8px);
}
.ui-content { flex: 1; padding: 1.5rem; overflow: auto; }
.ui-container { max-width: 1200px; margin: 0 auto; }

/* —— Auth —— */
.ui-auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, hsl(173 58% 39% / 0.15), transparent),
    hsl(var(--background));
}
.ui-auth-card {
  width: 100%;
  max-width: 400px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
}
.ui-auth-card h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.ui-auth-card .ui-muted { margin-bottom: 1.5rem; }

/* —— Card —— */
.ui-card {
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.ui-card-header {
  padding: 1.25rem 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ui-card-title { font-size: 1.125rem; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.ui-card-desc { font-size: 0.875rem; color: hsl(var(--muted-foreground)); margin: 0.25rem 0 0; }
.ui-card-content { padding: 1.25rem 1.5rem 1.5rem; }

/* —— Button —— */
.ui-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}
.ui-btn:disabled { opacity: 0.5; pointer-events: none; }
.ui-btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}
.ui-btn-primary:hover { filter: brightness(1.05); }
.ui-btn-secondary {
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}
.ui-btn-secondary:hover { filter: brightness(0.97); }
.ui-btn-outline {
  background: transparent;
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}
.ui-btn-outline:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.ui-btn-ghost {
  background: transparent;
  color: hsl(var(--foreground));
}
.ui-btn-ghost:hover { background: hsl(var(--accent)); }
.ui-btn-sm { height: 2.25rem; padding: 0 0.75rem; font-size: 0.8125rem; }
.ui-btn-icon { width: 2.5rem; padding: 0; }

/* —— Form —— */
.ui-label {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.375rem;
  display: block;
}
.ui-input, .ui-select, .ui-textarea {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ui-textarea { height: auto; min-height: 80px; padding: 0.625rem 0.75rem; resize: vertical; }
.ui-input:focus, .ui-select:focus, .ui-textarea:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}
.ui-input::placeholder { color: hsl(var(--muted-foreground)); }
.ui-form-group { margin-bottom: 1rem; }
.ui-form-stack { display: flex; flex-direction: column; gap: 1rem; }

/* —— Table —— */
.ui-table-wrap { overflow: auto; border-radius: calc(var(--radius) - 2px); border: 1px solid hsl(var(--border)); }
.ui-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ui-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.5);
  border-bottom: 1px solid hsl(var(--border));
}
.ui-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
}
.ui-table tr:last-child td { border-bottom: none; }
.ui-table tbody tr:hover { background: hsl(var(--muted) / 0.3); }
.ui-col-hidden { display: none !important; }

/* —— Table toolbar —— */
.ui-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ui-table-toolbar:has(+ .ui-table-wrap--toolbar) {
  margin-bottom: 0;
  padding: 0.65rem 1rem;
  border: 1px solid hsl(var(--border));
  border-bottom: none;
  border-radius: calc(var(--radius) - 2px) calc(var(--radius) - 2px) 0 0;
  background: hsl(var(--muted) / 0.25);
}
.ui-table-toolbar__start { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; flex: 1; min-width: 0; }
.ui-table-toolbar__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ui-table-menu { position: relative; }
.ui-table-menu__trigger { list-style: none; cursor: pointer; user-select: none; }
.ui-table-menu__trigger::-webkit-details-marker { display: none; }
.ui-table-menu__icon { margin-right: 0.35rem; opacity: 0.7; font-size: 0.85em; }
.ui-table-menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 40;
  min-width: 220px;
  padding: 0.75rem;
  background: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.ui-table-menu__panel--narrow { min-width: 180px; }
.ui-table-menu__hint {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  color: hsl(var(--muted-foreground));
}
.ui-table-menu__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.25rem;
  font-size: 0.8125rem;
  cursor: pointer;
  border-radius: calc(var(--radius) - 4px);
}
.ui-table-menu__item:hover { background: hsl(var(--muted) / 0.6); }
.ui-table-menu__item input { accent-color: hsl(var(--primary)); }
.ui-table-menu__reset { width: 100%; margin-top: 0.5rem; justify-content: center; }
.ui-table-menu__action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: none;
  background: transparent;
  border-radius: calc(var(--radius) - 4px);
  font-size: 0.8125rem;
  cursor: pointer;
  color: hsl(var(--foreground));
}
.ui-table-menu__action:hover { background: hsl(var(--accent)); color: hsl(var(--accent-foreground)); }
.ui-table-wrap--toolbar { border-top-left-radius: 0; border-top-right-radius: 0; border-top: none; }

/* —— Badge —— */
.ui-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  border: 1px solid transparent;
}
.ui-badge-default { background: hsl(var(--secondary)); color: hsl(var(--secondary-foreground)); }
.ui-badge-success { background: hsl(142 76% 36% / 0.12); color: hsl(142 72% 29%); }
.ui-badge-warning { background: hsl(38 92% 50% / 0.12); color: hsl(32 95% 35%); }
.ui-badge-outline {
  border-color: hsl(var(--border));
  color: hsl(var(--foreground));
}

/* —— Stats —— */
.ui-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ui-stat {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow);
}
.ui-stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ui-stat-value {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 0.25rem;
  line-height: 1.2;
}

/* —— List item —— */
.ui-list { display: flex; flex-direction: column; gap: 0.5rem; }
.ui-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ui-list-item:hover { border-color: hsl(var(--ring) / 0.4); box-shadow: var(--shadow-md); }
.ui-list-item-clickable { cursor: pointer; }
.ui-list-item-main { min-width: 0; }
.ui-list-item-title { font-weight: 500; margin: 0; }
.ui-list-item-sub { font-size: 0.8125rem; color: hsl(var(--muted-foreground)); margin: 0.125rem 0 0; }

/* —— Mobile app shell —— */
.k-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  --k-nav-h: 64px;
  --k-safe-bottom: env(safe-area-inset-bottom, 0px);
}
.k-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem clamp(0.75rem, 3vw, 1rem);
  padding-top: calc(0.65rem + env(safe-area-inset-top, 0));
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  min-width: 0;
}
.k-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}
@media (max-width: 479.98px) {
  .k-header-clinic { max-width: 10rem; font-size: 0.65rem; }
  .k-header-actions .ui-btn { padding: 0.35rem 0.55rem; font-size: 0.75rem; }
}
.k-header-title { font-weight: 600; font-size: 0.9375rem; }
.k-header-user { font-size: 0.75rem; color: hsl(var(--muted-foreground)); }
.k-main {
  flex: 1;
  width: 100%;
  min-width: 0;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  padding-bottom: calc(var(--k-nav-h) + var(--k-safe-bottom) + 1rem);
}
.k-page {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}
.k-page--narrow { max-width: min(100%, 40rem); }

/* Alt menü olan sayfalarda içerik footer altında kalmaz */
@media (max-width: 767.98px) {
  .k-page-more,
  .k-page-menu {
    padding-bottom: calc(var(--k-nav-h) + var(--k-safe-bottom) + 0.5rem);
  }
}

.k-push-prompt {
  margin: 0 0 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid hsl(var(--border));
  border-left: 3px solid hsl(var(--primary));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.k-push-prompt--compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-left-width: 2px;
}
.k-push-prompt-icon { flex-shrink: 0; color: hsl(var(--primary)); width: 1.25rem; height: 1.25rem; }
.k-push-prompt-body { flex: 1; min-width: 0; }
.k-push-prompt-body strong { display: block; font-size: 0.8125rem; font-weight: 600; }
.k-push-prompt-hint { display: block; font-size: 0.75rem; margin: 0.15rem 0 0; color: hsl(var(--muted-foreground)); line-height: 1.35; }
.k-push-prompt-actions { display: flex; flex-shrink: 0; align-items: center; gap: 0.35rem; }

.k-desktop-nav { display: none; }
.k-app-shell { display: contents; }

/* Tablet+ (768): yan menü, alt tab bar kalkar — iPad yatay dahil */
@media (min-width: 768px) {
  .k-app {
    display: grid;
    grid-template-columns: min(240px, 28vw) 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar header"
      "sidebar main";
  }
  .k-desktop-nav {
    display: block;
    grid-area: sidebar;
    border-right: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    padding: 1rem 0.75rem;
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
  }
  .k-desktop-nav-inner { display: flex; flex-direction: column; gap: 0.125rem; }
  .k-desktop-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: calc(var(--radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
  }
  .k-desktop-nav-link:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
  .k-desktop-nav-link.active {
    background: hsl(var(--primary) / 0.12);
    color: hsl(var(--primary));
  }
  .k-header { grid-area: header; }
  .k-main {
    grid-area: main;
    padding-bottom: 1.25rem;
    max-width: none;
  }
  .k-page { max-width: min(100%, 72rem); }
  .k-bottom-nav { display: none !important; }
  .k-toast {
    bottom: 1.5rem;
    left: calc(min(240px, 28vw) + 1rem);
    right: 1rem;
  }
}

@media (min-width: 1024px) {
  .k-app { grid-template-columns: 260px 1fr; }
  .k-toast { left: calc(260px + 1rem); }
  .k-page { max-width: min(100%, 80rem); }
}

/* Hasta detay — 360° özet */
.k-patient-360 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.k-patient-360-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.k-patient-360-stat:hover,
.k-patient-360-stat.is-active {
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--primary) / 0.06);
}
.k-patient-360-stat--info { cursor: default; }
.k-patient-360-stat--info:hover { background: hsl(var(--card)); border-color: hsl(var(--border)); }
.k-patient-360-stat--warn {
  border-color: hsl(38 92% 50% / 0.45);
  background: hsl(38 92% 50% / 0.08);
}
.k-patient-360-stat strong { font-size: 1.25rem; letter-spacing: -0.02em; }
.k-patient-360-stat strong.is-ok { color: hsl(142 76% 36%); }
.k-patient-360-stat strong.is-warn { color: hsl(38 92% 40%); }
.k-tabs--scroll {
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
@media (min-width: 768px) {
  .k-patient-360 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .k-patient-360 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.65rem; }
  .k-patient-detail .k-tabs { margin-bottom: 1rem; }
  .k-patient-detail .ui-table-wrap { font-size: 0.9375rem; }
}

/* Operasyon bandı */
.k-op-board {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
}
.k-op-board-col {
  flex: 0 0 min(18rem, 85vw);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.k-op-board-col-title {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}
.k-op-board-card {
  padding: 0.75rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.k-op-board-card:hover { border-color: hsl(var(--primary) / 0.4); }
.k-op-board-progress {
  height: 4px;
  background: hsl(var(--muted));
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.25rem;
}
.k-op-board-progress-bar {
  height: 100%;
  background: hsl(var(--primary));
  border-radius: 2px;
}
.k-op-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.k-op-step {
  padding: 0.85rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--card));
}
.k-op-step.is-active { border-color: hsl(var(--primary) / 0.45); background: hsl(var(--primary) / 0.06); }
.k-op-step.is-done { opacity: 0.85; border-left: 3px solid hsl(142 76% 36%); }
.k-op-step.is-skipped { opacity: 0.6; }
.k-op-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.k-op-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}
@media (min-width: 1024px) {
  .k-op-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .k-op-board-col { flex: none; min-width: 0; }
}
.k-title { font-size: 1.25rem; font-weight: 600; margin: 0; letter-spacing: -0.02em; }
.k-subtitle { font-size: 0.875rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: hsl(var(--foreground)); }
.k-muted { color: hsl(var(--muted-foreground)); font-size: 0.875rem; margin: 0 0 1rem; }
.k-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1rem; }
.k-error { color: hsl(var(--destructive)); font-size: 0.875rem; }

.k-bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--k-nav-h) + var(--k-safe-bottom));
  padding-bottom: var(--k-safe-bottom);
  display: flex;
  background: hsl(var(--background) / 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid hsl(var(--border));
  z-index: 100;
}
.k-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  font-size: 0.625rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  min-height: 48px;
  padding: 0.35rem 0.15rem 0.25rem;
  transition: color 0.15s, background 0.15s;
  border-radius: 0.5rem 0.5rem 0 0;
  position: relative;
}
.k-nav-item.active {
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}
.k-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: hsl(var(--primary));
  border-radius: 0 0 2px 2px;
}
.k-nav-icon {
  width: 1.35rem;
  height: 1.35rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.k-nav-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.k-nav-item.active .k-nav-label { color: hsl(var(--primary)); }

.ui-search-wrap { margin-bottom: 1rem; }
.ui-search-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}
.k-btn-block { width: 100%; margin-top: 0.5rem; }
.k-btn-ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}
.k-btn-ghost:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }
.k-link-center {
  display: block;
  text-align: center;
  margin-top: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  text-decoration: none;
}
.k-login-error { text-align: center; margin-bottom: 1rem; }
.k-badge-danger {
  background: hsl(var(--destructive) / 0.15);
  color: hsl(var(--destructive));
}

/* Data alerts */
.ui-data-alert {
  padding: 1rem 1.125rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  margin-bottom: 1rem;
}
.ui-data-alert--error {
  border-color: hsl(var(--destructive) / 0.35);
  background: hsl(var(--destructive) / 0.06);
}
.ui-data-alert--warning {
  border-color: hsl(38 92% 50% / 0.35);
  background: hsl(38 92% 50% / 0.08);
}
.ui-data-alert-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
}
.ui-data-alert--error .ui-data-alert-title { color: hsl(var(--destructive)); }
.ui-data-alert-desc {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.ui-data-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.875rem;
}

/* Session bootstrap */
.k-session-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: hsl(var(--background));
}
.k-session-loading-card {
  text-align: center;
  max-width: 280px;
  width: 100%;
}
.k-session-loading-mark {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
}
.k-session-loading-title {
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
}
.k-session-loading-sub {
  margin: 0.35rem 0 1rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.k-session-loading-bar {
  height: 0.35rem;
  border-radius: 999px;
}

/* Dashboard */
.k-dashboard-hero {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: linear-gradient(135deg, hsl(var(--primary) / 0.12), hsl(var(--card)));
  box-shadow: var(--shadow-md);
}
.k-dashboard-hero-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}
.k-dashboard-hero-value {
  margin: 0.25rem 0 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.k-dashboard-chart {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid hsl(var(--border) / 0.6);
}
.k-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.k-quick-action {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.875rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.1);
  border: 1px solid hsl(var(--primary) / 0.25);
  transition: background 0.15s, transform 0.15s;
}
.k-quick-action:hover {
  background: hsl(var(--primary) / 0.16);
  transform: translateY(-1px);
}
.k-dashboard-kpis {
  margin-bottom: 1rem;
}
.k-card--stat {
  min-height: 5.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.k-dashboard-panels {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.k-dashboard-panel .k-subtitle:first-child {
  margin-top: 0.5rem;
}
@media (min-width: 1024px) {
  .k-dashboard-kpis {
    grid-template-columns: repeat(4, 1fr);
  }
  .k-dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 1.25rem;
    align-items: start;
  }
  .k-dashboard-panel--wide {
    grid-column: 1 / -1;
  }
}

.k-card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.k-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}
.k-card-label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.375rem;
}
.k-card strong { font-size: 1.375rem; font-weight: 600; letter-spacing: -0.02em; }

.k-form { display: flex; flex-direction: column; gap: 0.875rem; }
.k-input, .k-select {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}
.k-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.2);
}
.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  transition: filter 0.15s;
}
.k-btn:hover { filter: brightness(0.97); }
.k-btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.k-btn-primary:hover { filter: brightness(1.05); }
.k-btn-sm { height: 2rem; padding: 0 0.625rem; font-size: 0.8125rem; }

.k-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.k-clickable { cursor: pointer; }
.k-clickable:hover { border-color: hsl(var(--ring) / 0.35); box-shadow: var(--shadow-md); }
.k-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}
.k-back {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--primary));
  text-decoration: none;
  cursor: pointer;
}
.k-back:hover { text-decoration: underline; }

.k-page-more { /* padding via @media max 767 */ }
.k-page-menu { }
.k-menu-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 480px) {
  .k-menu-grid { grid-template-columns: repeat(2, 1fr); }
}
.k-menu { display: flex; flex-direction: column; gap: 0.375rem; }
.k-menu-grid.k-menu { display: grid; }
.k-menu-section {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  margin: 1.25rem 0 0.375rem;
  padding: 0 0.25rem;
}
.k-menu-section:first-child { margin-top: 0; }
.k-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  color: hsl(var(--foreground));
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.k-menu-item::after {
  content: '›';
  margin-left: auto;
  font-size: 1.125rem;
  line-height: 1;
  color: hsl(var(--muted-foreground));
  font-weight: 400;
}
.k-menu-item:hover {
  background: hsl(var(--accent));
  border-color: hsl(var(--ring) / 0.25);
}

.k-card-link {
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.k-card-link:hover {
  border-color: hsl(var(--ring) / 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.k-card-link:active { transform: translateY(0); }

.k-list-item-stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.k-list-item-stack > strong { font-size: 0.9375rem; }
.k-list-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}
.k-login-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}
.k-login-brand .clinai-mark {
  margin: 0 auto 0.75rem;
}

.k-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, hsl(173 58% 39% / 0.12), transparent),
    hsl(var(--background));
}
.k-login .k-form {
  width: 100%;
  max-width: 360px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
}
.k-tabs { display: flex; gap: 0.25rem; padding: 0.25rem; background: hsl(var(--muted)); border-radius: var(--radius); margin-bottom: 1rem; }
.k-tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.k-tab.active { background: hsl(var(--background)); color: hsl(var(--foreground)); box-shadow: var(--shadow); }

.k-toast {
  position: fixed;
  bottom: calc(var(--k-nav-h) + var(--k-safe-bottom) + 0.75rem);
  left: 1rem;
  right: 1rem;
  max-width: 420px;
  margin: 0 auto;
  padding: 0.65rem 0.75rem 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  border-radius: calc(var(--radius) + 2px);
  font-size: 0.8125rem;
  font-weight: 500;
  z-index: 200;
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.18);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s;
  pointer-events: none;
}
.k-toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.k-toast-text { flex: 1; text-align: left; line-height: 1.4; }
.k-toast-close {
  flex-shrink: 0;
  border: none;
  background: rgb(255 255 255 / 0.15);
  color: inherit;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.k-toast-close:hover { background: rgb(255 255 255 / 0.25); }
.k-toast:not(.k-toast-error) {
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
  box-shadow: 0 8px 32px rgb(0 0 0 / 0.12);
}
.k-toast:not(.k-toast-error) .k-toast-close {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}
.k-toast-error { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }

.ui-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ui-muted { color: hsl(var(--muted-foreground)); }
.ui-page-header { margin-bottom: 1.5rem; }
.ui-page-header h1 { margin: 0; font-size: 1.875rem; font-weight: 600; letter-spacing: -0.03em; }
.ui-page-header p { margin: 0.375rem 0 0; color: hsl(var(--muted-foreground)); }

/* Marketing */
.ui-landing-hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1.5rem 4rem;
  background:
    radial-gradient(ellipse 100% 80% at 50% -30%, hsl(173 58% 39% / 0.18), transparent),
    hsl(var(--background));
}
.ui-landing-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto 4rem;
  width: 100%;
}
.ui-landing-nav brand { font-weight: 700; font-size: 1.125rem; display: flex; align-items: center; gap: 0.5rem; }
.ui-landing-hero-content { max-width: 720px; margin: 0 auto; text-align: center; }
.ui-landing-hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 0 0 1rem;
}
.ui-landing-hero .lead {
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  margin: 0 auto 2rem;
  max-width: 540px;
}
.ui-landing-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.ui-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}
.ui-feature-card {
  padding: 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  box-shadow: var(--shadow);
}
.ui-feature-card h3 { margin: 0 0 0.5rem; font-size: 1rem; font-weight: 600; }
.ui-feature-card p { margin: 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.ui-landing-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.skeleton {
  background: linear-gradient(90deg, hsl(var(--muted)) 25%, hsl(var(--muted) / 0.5) 50%, hsl(var(--muted)) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: calc(var(--radius) - 2px);
  height: 1rem;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* —— App shared components —— */
.ui-page-header-wrap { align-items: flex-start; margin-bottom: 1.25rem; gap: 1rem; }
.ui-header-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.ui-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.ui-page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}
.ui-page-header p {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.ui-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgb(0 0 0 / 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.ui-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: hsl(var(--card));
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ui-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}
.ui-sheet-title { margin: 0; font-size: 1.125rem; font-weight: 600; }
.ui-sheet-body { padding: 1.25rem; overflow-y: auto; flex: 1; }

.ui-empty {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--muted) / 0.25);
}
.ui-empty-graphic {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 0.75rem;
  color: hsl(var(--primary) / 0.55);
}
.ui-empty-icon { margin-bottom: 0.75rem; color: hsl(var(--muted-foreground)); }
.ui-empty-title { margin: 0; font-weight: 600; font-size: 1.0625rem; }
.ui-empty-desc { margin: 0.5rem auto 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); max-width: 22rem; line-height: 1.5; }

.ui-search-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background: hsl(var(--background));
  margin-bottom: 1rem;
}
.ui-search-wrap .ui-icon { color: hsl(var(--muted-foreground)); }
.ui-search-input { border: none !important; box-shadow: none !important; padding-left: 0; flex: 1; }

.ui-kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(9rem, 1fr));
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  align-items: start;
}
.ui-kanban-col {
  min-width: 9rem;
  background: hsl(var(--muted) / 0.4);
  border-radius: var(--radius);
  padding: 0.5rem;
}
.ui-kanban-col-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
  margin: 0 0 0.5rem;
  padding: 0 0.25rem;
}
.ui-kanban-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
  padding: 0.625rem;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}
.ui-kanban-card strong { display: block; font-size: 0.875rem; margin-bottom: 0.25rem; }
.ui-kanban-card-actions { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.5rem; }

.ui-date-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.ui-date-strip-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--foreground));
  cursor: pointer;
  font-family: inherit;
}
.ui-date-strip-btn:hover { background: hsl(var(--muted)); }
.ui-date-strip-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.ui-date-strip-input {
  flex: 1;
  min-width: 0;
  border: none !important;
  background: transparent !important;
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.35rem 0.5rem !important;
  box-shadow: none !important;
}
.ui-date-strip-today {
  flex-shrink: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-family: inherit;
}
.ui-date-strip-today.is-active,
.ui-date-strip-today:disabled {
  opacity: 0.55;
  cursor: default;
  background: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--primary));
}

.ui-appointment-list { display: flex; flex-direction: column; gap: 0.5rem; }
.ui-appointment-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.ui-appointment-card:hover {
  border-color: hsl(var(--primary) / 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.ui-appointment-card-time {
  flex-shrink: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--primary));
  min-width: 3rem;
}
.ui-appointment-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ui-appointment-card-body strong {
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-week-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
}
.ui-week-doctor { flex: 1; min-width: 10rem; max-width: 16rem; }
.ui-week-range {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.ui-segmented {
  display: inline-flex;
  padding: 0.2rem;
  background: hsl(var(--muted) / 0.55);
  border-radius: var(--radius);
  gap: 0.15rem;
}
.ui-segmented-btn {
  border: none;
  background: transparent;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  border-radius: calc(var(--radius) - 3px);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.ui-segmented-btn:hover { color: hsl(var(--foreground)); }
.ui-segmented-btn.is-active {
  background: hsl(var(--background));
  color: hsl(var(--primary));
  box-shadow: var(--shadow);
}

.ui-calendar-scroll {
  overflow-x: auto;
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
}
.ui-calendar-grid {
  display: grid;
  grid-template-columns: 3.25rem repeat(7, minmax(4.5rem, 1fr));
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.7rem;
  min-width: 36rem;
}
.ui-calendar-grid-corner { background: hsl(var(--muted)); }
.ui-calendar-grid-header {
  background: hsl(var(--muted));
  padding: 0.5rem 0.25rem;
  text-align: center;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ui-calendar-grid-header--today {
  background: hsl(var(--primary) / 0.12);
  color: hsl(var(--primary));
}
.ui-calendar-day-name {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}
.ui-calendar-day-num {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}
.ui-calendar-grid-time {
  background: hsl(var(--card));
  padding: 0.35rem 0.35rem;
  text-align: right;
  color: hsl(var(--muted-foreground));
  font-variant-numeric: tabular-nums;
  font-size: 0.65rem;
}
.ui-calendar-grid-cell {
  background: hsl(var(--card));
  min-height: 2.75rem;
  padding: 0.2rem;
  position: relative;
}
.ui-calendar-grid-cell--today {
  background: hsl(var(--primary) / 0.04);
}
.ui-calendar-event {
  display: block;
  width: 100%;
  text-align: left;
  background: hsl(var(--primary) / 0.14);
  border: none;
  border-left: 3px solid hsl(var(--primary));
  border-radius: 3px;
  padding: 0.2rem 0.35rem;
  margin-bottom: 0.15rem;
  font-size: 0.65rem;
  line-height: 1.25;
  cursor: pointer;
  font-family: inherit;
  color: hsl(var(--foreground));
}
.ui-calendar-event:hover { background: hsl(var(--primary) / 0.22); }
.ui-calendar-event-time {
  display: block;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--primary));
}
.ui-calendar-event-name {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ui-calendar-event-meta {
  display: block;
  font-size: 0.65rem;
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-calendar-scroll--rooms { overflow-x: auto; }
.ui-room-grid {
  display: grid;
  grid-template-columns: 3.5rem repeat(var(--room-cols, 4), minmax(7rem, 1fr));
  min-width: max(100%, calc(var(--room-cols, 4) * 7.5rem));
  gap: 1px;
  background: hsl(var(--border));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}
.ui-room-grid-corner,
.ui-room-grid-header,
.ui-room-grid-time,
.ui-room-grid-cell {
  background: hsl(var(--card));
  padding: 0.35rem 0.4rem;
  min-height: 2.75rem;
}
.ui-room-grid-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.5rem 0.35rem;
}
.ui-room-grid-name { display: block; }
.ui-room-grid-floor {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}
.ui-room-grid-time {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 0.5rem;
}
.ui-room-grid-cell.has-events { background: hsl(var(--primary) / 0.04); }
.ui-calendar-event--room { width: 100%; margin-bottom: 0.2rem; }
.ui-room-day-picker { max-width: 11rem; }

.k-form-sections { display: flex; flex-direction: column; gap: 1.25rem; }
.k-form-section {
  padding: 1rem 1rem 0.25rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  background: hsl(var(--card));
}
.k-form-section--cost {
  border-color: hsl(var(--primary) / 0.2);
  background: linear-gradient(180deg, hsl(var(--primary) / 0.04), hsl(var(--card)));
}
.k-form-section-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}
.k-form-hint { margin: -0.35rem 0 0.75rem; font-size: 0.8rem; color: hsl(var(--muted-foreground)); }
.k-cost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.75rem;
}
.k-cost-margin {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.08);
  font-size: 0.875rem;
}
.k-cost-margin strong {
  font-size: 1.1rem;
  color: hsl(var(--primary));
  font-variant-numeric: tabular-nums;
}
.k-btn-block { width: 100%; margin-top: 0.5rem; }

.k-op-report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}
.k-op-report-card {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}
.k-op-report-card span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}
.k-op-report-card strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}
.k-op-report-card--margin strong { color: hsl(142 76% 36%); }
.ui-positive { color: hsl(142 76% 36%); font-weight: 600; }
.ui-negative { color: hsl(0 65% 45%); font-weight: 600; }

@media (min-width: 1024px) {
  .ui-calendar-grid {
    min-width: 100%;
    grid-template-columns: 4rem repeat(7, 1fr);
  }
  .ui-calendar-grid-cell { min-height: 3.25rem; }
}

.ui-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  height: 100px;
  padding: 0.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.ui-chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
}
.ui-chart-bar {
  width: 100%;
  max-width: 32px;
  background: hsl(var(--primary));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.ui-chart-label {
  font-size: 0.625rem;
  color: hsl(var(--muted-foreground));
}

/* —— Sayfa yardımı (?) —— */
.ui-page-header-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-left: auto;
}

.ui-help-trigger {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  background: hsl(var(--background) / 0.65);
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ui-help-trigger:hover,
.ui-help-trigger:focus-visible {
  color: hsl(var(--foreground));
  border-color: hsl(var(--primary) / 0.45);
  background: hsl(var(--card));
  outline: none;
}
.ui-help-trigger__icon {
  width: 1.35rem;
  height: 1.35rem;
}

.ui-help-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgb(0 0 0 / 0.42);
  backdrop-filter: blur(2px);
}

.ui-help-modal {
  position: fixed;
  z-index: 201;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 26rem);
  max-height: min(85vh, 32rem);
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.ui-help-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid hsl(var(--border));
}
.ui-help-modal__head-text { flex: 1; min-width: 0; }
.ui-help-modal__eyebrow {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.ui-help-modal__title {
  margin: 0.25rem 0 0;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.ui-help-modal__close {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: hsl(var(--muted-foreground));
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.ui-help-modal__close:hover { background: hsl(var(--muted)); color: hsl(var(--foreground)); }

.ui-help-modal__body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}
.ui-help-modal__lead {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: hsl(var(--foreground));
}

.ui-help-section { margin-bottom: 1rem; }
.ui-help-section:last-of-type { margin-bottom: 0; }
.ui-help-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}
.ui-help-section ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
}
.ui-help-section li + li { margin-top: 0.35rem; }

.ui-help-tip {
  margin-top: 1rem;
  padding: 0.75rem 0.875rem;
  border-radius: calc(var(--radius) - 2px);
  background: hsl(var(--primary) / 0.08);
  border: 1px solid hsl(var(--primary) / 0.2);
}
.ui-help-tip strong {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 0.25rem;
  color: hsl(var(--primary));
}
.ui-help-tip p {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: hsl(var(--foreground));
}

.ui-help-modal__foot {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid hsl(var(--border));
}

.ui-auth-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.ui-auth-card__top .ui-help-trigger {
  margin-top: 0.15rem;
}

/* —— Sosyal medya merkezi —— */
.sm-hub { display: flex; flex-direction: column; gap: 0.75rem; }
.sm-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}
@media (min-width: 520px) { .sm-stats { grid-template-columns: repeat(4, 1fr); } }
.sm-stat-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  box-shadow: var(--shadow);
}
.sm-stat-card strong { font-size: 1.35rem; display: block; }
.sm-stat-label { font-size: 0.7rem; color: hsl(var(--muted-foreground)); text-transform: uppercase; letter-spacing: 0.03em; }
.sm-stat-accent { border-color: hsl(var(--primary) / 0.35); background: hsl(var(--accent)); }
.sm-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.sm-month-label { font-weight: 600; min-width: 8rem; text-align: center; text-transform: capitalize; }
.sm-platform-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sm-chip {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.sm-chip.active { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); border-color: transparent; }
.sm-calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  padding: 0.5rem;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}
.sm-cal-day {
  aspect-ratio: 1;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.8rem;
}
.sm-cal-day.other-month { opacity: 0.35; }
.sm-cal-day.has-activity { background: hsl(var(--accent)); }
.sm-cal-day.selected { outline: 2px solid hsl(var(--primary)); outline-offset: -2px; }
.sm-cal-dots { display: flex; gap: 2px; }
.sm-dot { width: 5px; height: 5px; border-radius: 50%; background: hsl(var(--muted-foreground)); }
.sm-day-title { font-weight: 600; margin: 0.25rem 0 0; text-transform: capitalize; }
.sm-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sm-platform-bars { display: flex; flex-direction: column; gap: 0.4rem; }
.sm-bar-row { display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem; align-items: center; }
.sm-bar-track { height: 6px; background: hsl(var(--muted)); border-radius: 999px; overflow: hidden; }
.sm-bar-fill { height: 100%; border-radius: 999px; background: hsl(var(--primary)); }
.sm-bar-count { font-size: 0.7rem; color: hsl(var(--muted-foreground)); }
.sm-plan-card, .sm-post-card {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  background: hsl(var(--card));
}
.sm-plan-head, .sm-post-head { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; margin-bottom: 0.25rem; }
.sm-group-date { font-size: 0.75rem; font-weight: 600; color: hsl(var(--muted-foreground)); margin: 0.75rem 0 0.35rem; text-transform: capitalize; }
.sm-post-actions { display: flex; gap: 0.35rem; margin-top: 0.35rem; }
.sm-accounts { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sm-account-pill {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.55rem; border-radius: 999px;
  border: 1px solid hsl(var(--border)); text-decoration: none; color: inherit; font-size: 0.8rem;
}
.sm-instagram .sm-dot, .sm-bar-fill.sm-instagram { background: #E4405F; }
.sm-facebook .sm-dot, .sm-bar-fill.sm-facebook { background: #1877F2; }
.sm-tiktok .sm-dot, .sm-bar-fill.sm-tiktok { background: #010101; }
.sm-youtube .sm-dot, .sm-bar-fill.sm-youtube { background: #FF0000; }
.sm-linkedin .sm-dot, .sm-bar-fill.sm-linkedin { background: #0A66C2; }
.sm-x .sm-dot, .sm-bar-fill.sm-x { background: #000; }
.sm-pinterest .sm-dot, .sm-bar-fill.sm-pinterest { background: #BD081C; }
.sm-google .sm-dot, .sm-bar-fill.sm-google { background: #4285F4; }
.sm-platform-badge.sm-instagram.active, .sm-chip.sm-instagram.active { background: #E4405F; }
.sm-platform-badge.sm-facebook.active, .sm-chip.sm-facebook.active { background: #1877F2; }
.sm-platform-badge.sm-tiktok.active, .sm-chip.sm-tiktok.active { background: #010101; color: #fff; }
