/* Shadcn UI-style Design System — Native CSS, no JS */

@layer base {
  :root {
    --background: oklch(1 0 0);
    --foreground: oklch(0.147 0.004 49.25);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.147 0.004 49.25);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.147 0.004 49.25);
    --primary: oklch(0.841 0.238 128.85);
    --primary-foreground: oklch(0.405 0.101 131.063);
    --secondary: oklch(0.967 0.001 286.375);
    --secondary-foreground: oklch(0.21 0.006 285.885);
    --muted: oklch(0.97 0.001 106.424);
    --muted-foreground: oklch(0.553 0.013 58.071);
    --accent: oklch(0.97 0.001 106.424);
    --accent-foreground: oklch(0.216 0.006 56.043);
    --destructive: oklch(0.577 0.245 27.325);
    --border: oklch(0.923 0.003 48.717);
    --input: oklch(0.923 0.003 48.717);
    --ring: oklch(0.709 0.01 56.259);
    --chart-1: oklch(0.897 0.196 126.665);
    --chart-2: oklch(0.768 0.233 130.85);
    --chart-3: oklch(0.648 0.2 131.684);
    --chart-4: oklch(0.532 0.157 131.589);
    --chart-5: oklch(0.453 0.124 130.933);
    --radius: 0.625rem;
    --sidebar: oklch(0.985 0.001 106.423);
    --sidebar-foreground: oklch(0.147 0.004 49.25);
    --sidebar-primary: oklch(0.648 0.2 131.684);
    --sidebar-primary-foreground: oklch(0.986 0.031 120.757);
    --sidebar-accent: oklch(0.97 0.001 106.424);
    --sidebar-accent-foreground: oklch(0.216 0.006 56.043);
    --sidebar-border: oklch(0.923 0.003 48.717);
    --sidebar-ring: oklch(0.709 0.01 56.259);
  }

  .dark {
    --background: oklch(0.147 0.004 49.25);
    --foreground: oklch(0.985 0.001 106.423);
    --card: oklch(0.216 0.006 56.043);
    --card-foreground: oklch(0.985 0.001 106.423);
    --popover: oklch(0.216 0.006 56.043);
    --popover-foreground: oklch(0.985 0.001 106.423);
    --primary: oklch(0.768 0.233 130.85);
    --primary-foreground: oklch(0.405 0.101 131.063);
    --secondary: oklch(0.274 0.006 286.033);
    --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.268 0.007 34.298);
    --muted-foreground: oklch(0.709 0.01 56.259);
    --accent: oklch(0.268 0.007 34.298);
    --accent-foreground: oklch(0.985 0.001 106.423);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%);
    --input: oklch(1 0 0 / 15%);
    --ring: oklch(0.553 0.013 58.071);
    --chart-1: oklch(0.897 0.196 126.665);
    --chart-2: oklch(0.768 0.233 130.85);
    --chart-3: oklch(0.648 0.2 131.684);
    --chart-4: oklch(0.532 0.157 131.589);
    --chart-5: oklch(0.453 0.124 130.933);
    --sidebar: oklch(0.216 0.006 56.043);
    --sidebar-foreground: oklch(0.985 0.001 106.423);
    --sidebar-primary: oklch(0.768 0.233 130.85);
    --sidebar-primary-foreground: oklch(0.274 0.072 132.109);
    --sidebar-accent: oklch(0.268 0.007 34.298);
    --sidebar-accent-foreground: oklch(0.985 0.001 106.423);
    --sidebar-border: oklch(1 0 0 / 10%);
    --sidebar-ring: oklch(0.553 0.013 58.071);
  }

  /* Derived utility variables */
  :root {
    --success: oklch(0.6 0.15 145);
    --success-bg: oklch(0.95 0.03 145);
    --warning: oklch(0.7 0.15 85);
    --warning-bg: oklch(0.97 0.03 85);
    --danger: var(--destructive);
    --danger-bg: oklch(0.95 0.05 25);
    --shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 oklch(0 0 0 / 0.1), 0 1px 2px -1px oklch(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px oklch(0 0 0 / 0.1), 0 2px 4px -2px oklch(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.1), 0 4px 6px -4px oklch(0 0 0 / 0.1);
  }

  .dark {
    --success: oklch(0.7 0.15 145);
    --success-bg: oklch(0.25 0.05 145);
    --warning: oklch(0.75 0.12 85);
    --warning-bg: oklch(0.25 0.04 85);
    --danger-bg: oklch(0.25 0.05 25);
    --shadow-sm: 0 1px 2px 0 oklch(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 oklch(0 0 0 / 0.3), 0 1px 2px -1px oklch(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px oklch(0 0 0 / 0.3), 0 2px 4px -2px oklch(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px oklch(0 0 0 / 0.3), 0 4px 6px -4px oklch(0 0 0 / 0.3);
  }
}

@layer reset {
  *, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  body {
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--background);
    color: var(--foreground);
    line-height: 1.5;
    min-height: 100vh;
  }
}

/* ─── Auth Pages ─── */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--background);
  padding: 2rem;
}

.auth-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.auth-logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-logo .logo-icon {
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.auth-logo h1 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.auth-logo p {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: var(--background);
  color: var(--foreground);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--muted-foreground);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  height: 2.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
  width: 100%;
}

.btn-primary:hover {
  opacity: 0.9;
}

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-ghost {
  background: transparent;
  color: var(--foreground);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--accent);
  color: var(--accent-foreground);
}

.btn-sm {
  height: 2rem;
  padding: 0 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  height: 2.5rem;
  padding: 0 1.25rem;
  font-size: 0.9375rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.auth-footer a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

/* ─── Sidebar ─── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: var(--sidebar);
  color: var(--sidebar-foreground);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--sidebar-primary);
  color: var(--sidebar-primary-foreground);
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.sidebar-brand span {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  list-style: none;
  padding: 0.5rem;
  flex: 1;
  overflow-y: auto;
}

.sidebar-nav li {
  margin-bottom: 0.125rem;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--sidebar-foreground);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.sidebar-nav a:hover {
  opacity: 1;
  background: var(--sidebar-accent);
  color: var(--sidebar-accent-foreground);
}

.sidebar-nav a.active {
  opacity: 1;
  background: var(--sidebar-primary);
  color: var(--sidebar-primary-foreground);
}

.sidebar-nav .nav-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--sidebar-border);
  font-size: 0.8125rem;
}

.sidebar-footer a {
  color: var(--muted-foreground);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
}

.sidebar-footer a:hover {
  color: var(--foreground);
}

/* ─── Main Layout ─── */
.main-wrapper {
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  background: var(--background);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  backdrop-filter: blur(8px);
}

.topbar-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem 0.25rem 0.25rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
}

.user-avatar {
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  flex-shrink: 0;
}

.content {
  padding: 1.5rem;
  flex: 1;
}

/* ─── Cards ─── */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}

.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.card-header h2,
.card-header h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-body {
  padding: 1.25rem;
}

/* ─── Metrics ─── */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.metric-delta {
  font-size: 0.75rem;
  margin-top: 0.35rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.metric-delta.up { color: var(--success); }
.metric-delta.down { color: var(--destructive); }

/* ─── Tables ─── */
.table-wrap {
  overflow-x: auto;
  margin: -1.25rem;
  padding: 1.25rem;
}

.table-wrap table {
  margin: -1.25rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-indent: 0;
}

thead th {
  text-align: left;
  padding: 0.625rem 1rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  background: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

tbody td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: var(--accent);
  color: var(--accent-foreground);
}

/* ─── Badges ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25rem;
  border: 1px solid transparent;
}

.badge-success {
  background: var(--success-bg);
  color: var(--success);
  border-color: oklch(from var(--success) l c h / 0.2);
}

.badge-warning {
  background: var(--warning-bg);
  color: oklch(0.5 0.1 80);
  border-color: oklch(from var(--warning) l c h / 0.2);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--destructive);
  border-color: oklch(from var(--destructive) l c h / 0.2);
}

.badge-info {
  background: oklch(0.95 0.02 220);
  color: oklch(0.5 0.1 220);
  border-color: oklch(0.8 0.05 220 / 0.3);
}

.dark .badge-success {
  color: oklch(0.85 0.08 145);
}

.dark .badge-warning {
  color: oklch(0.85 0.08 80);
}

.dark .badge-danger {
  color: oklch(0.85 0.08 25);
}

.dark .badge-info {
  color: oklch(0.8 0.08 220);
}

/* ─── Toolbar / Search ─── */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px var(--ring);
}

.search-box input::placeholder {
  color: var(--muted-foreground);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  opacity: 0.4;
  pointer-events: none;
}

/* ─── Tabs ─── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.tab:hover {
  color: var(--foreground);
}

.tab.active {
  color: var(--foreground);
  border-bottom-color: var(--foreground);
}

/* ─── Patient Detail ─── */
.detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  align-items: start;
}

.profile-card {
  text-align: center;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.profile-name {
  font-size: 1rem;
  font-weight: 600;
}

.profile-meta {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

.info-list {
  list-style: none;
  margin-top: 1rem;
  text-align: left;
}

.info-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list .label {
  color: var(--muted-foreground);
}

.info-list .value {
  font-weight: 500;
  text-align: right;
  max-width: 55%;
}

/* ─── Vitals ─── */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.vital-item {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.875rem;
  text-align: center;
}

.vital-value {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--foreground);
}

.vital-unit {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vital-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

/* ─── History / Timeline ─── */
.history-list {
  list-style: none;
}

.history-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.history-item:last-child {
  border-bottom: none;
}

.history-date {
  width: 64px;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
}

.history-body h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.history-body p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* ─── Section Title ─── */
.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  margin: 1.5rem 0 0.75rem;
}

/* ─── Two Column ─── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .metrics-grid {
    grid-template-columns: 1fr 1fr;
  }
  .content {
    padding: 1rem;
  }
  .auth-card {
    padding: 1.5rem;
  }
}

/* ─── Utility Classes ─── */
.muted-text {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.mt-1 {
  margin-top: 0.75rem;
}

.text-left {
  text-align: left;
}

.gap-sm {
  gap: 0.75rem;
}

.sales-total-row {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
}

/* ─── Form Grid ─── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.form-grid .form-group {
  margin-bottom: 0;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.form-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ─── Tab Panels ─── */
.tab-panels {
  margin-top: 1.25rem;
}

.tab-panel {
  display: none;
}

.tab-panel:target,
.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Dosha Bars ─── */
.dosha-item {
  margin-bottom: 1rem;
}

.dosha-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
}

.dosha-track {
  height: 8px;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}

.dosha-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.dosha-fill.vata { background: var(--chart-1); }
.dosha-fill.pitta { background: var(--chart-3); }
.dosha-fill.kapha { background: var(--chart-5); }

/* ─── Treatment Timeline ─── */
.treatment-list {
  list-style: none;
}

.treatment-item {
  display: flex;
  gap: 1rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.treatment-item:last-child {
  border-bottom: none;
}

.treatment-badge {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--muted);
}

.treatment-body h4 {
  font-size: 0.875rem;
  font-weight: 600;
}

.treatment-body p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.treatment-meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

/* ─── Diet / Prescription List ─── */
.presc-list {
  list-style: none;
}

.presc-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.presc-list li:last-child {
  border-bottom: none;
}

.presc-list li::before {
  content: "•";
  color: var(--primary);
  font-weight: 700;
}

/* ─── Receipt / Payment ─── */
.receipt {
  max-width: 420px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.receipt-header {
  text-align: center;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.receipt-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.receipt-header p {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

.receipt-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.875rem;
}

.receipt-row.total {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 1rem;
}

.receipt-footer {
  text-align: center;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
}

.payment-method {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  color: var(--foreground);
  background: var(--background);
}

.payment-method:hover,
.payment-method.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

/* ─── Quick Actions ─── */
.quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

/* ─── Print Styles for Case Sheet ─── */
@media print {
  .sidebar,
  .topbar,
  .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0;
  }
  .content {
    padding: 0;
  }
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
  body {
    background: white;
    color: black;
  }
}

/* ─── Ayurveda Tag / Prakriti Badge ─── */
.prakriti-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
}

/* ─── Checkbox / Radio Grid ─── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checkbox-item:hover {
  background: var(--accent);
  border-color: var(--ring);
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  accent-color: var(--primary);
}

/* ─── Divider ─── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* ─── Responsive Form Grids ─── */
@media (max-width: 768px) {
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
  .payment-methods {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .form-grid,
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr;
  }
  .payment-methods {
    grid-template-columns: 1fr;
  }
}

/* ─── Extra Utility Classes ─── */
.w-auto { width: auto !important; }
.mt-05 { margin-top: 0.5rem !important; }
.mt-1 { margin-top: 0.75rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-lg { font-size: 1.125rem; }
.text-right { text-align: right; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 1rem; }
.justify-end { justify-content: flex-end; }
.dosha-w-5 { width: 5%; }
.dosha-w-15 { width: 15%; }
.dosha-w-22 { width: 22%; }
.dosha-w-30 { width: 30%; }
.dosha-w-31 { width: 31%; }
.dosha-w-42 { width: 42%; }
.dosha-w-65 { width: 65%; }
.dosha-sama { background: var(--chart-2); }

/* ─── AI Module Utilities ─── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin: 1rem 0;
  background: var(--muted);
}

.emoji-lg { font-size: 3rem; margin-bottom: 0.5rem; }
.emoji-md { font-size: 2rem; margin-bottom: 0.25rem; }

.grid-2-sm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.card-muted {
  background: var(--muted);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 1.25rem;
}

.text-center { text-align: center; }
.topbar-tabs { display: flex; gap: 0.25rem; }
.bg-chart-1 { background: var(--chart-1); }
.mb-1 { margin-bottom: 1rem; }
.mb-1 { margin-bottom: 1rem !important; }
.mt-0 { margin-top: 0 !important; }
.font-size-base { font-size: 1rem; }
