/* ================================================================
   AKTBOT DESIGN TOKENS
   ================================================================
   This file defines the complete design system for AktBot platform.
   
   ARCHITECTURE:
     Layer 1: AktBot Platform Brand (admin UI)        → --aktbot-*
     Layer 2: BM Turkiye Tenant Brand (patient-facing)→ --bm-*
     Layer 3: Semantic Colors (universal)             → --success, --danger, etc.
     Layer 4: Spacing, Typography, Layout             → --space-*, --text-*, etc.
   
   IMPORTANT:
     - Admin UI uses --aktbot-* tokens
     - Patient-facing files (PDFs, emails) use --bm-* tokens
     - DO NOT use hardcoded colors anywhere
     - Existing brand-* Tailwind classes still work (backwards compatible)
   ================================================================ */

:root {
  /* ============================================================
     LAYER 1: AKTBOT PLATFORM BRAND (Internal Admin UI)
     ============================================================ */
  
  /* Primary - Teal */
  --aktbot-teal:        #278A8F;
  --aktbot-teal-dark:   #1F6F73;
  --aktbot-teal-darker: #185558;
  --aktbot-teal-light:  #E8F4F5;
  --aktbot-teal-50:     #F0F9FA;
  --aktbot-teal-100:    #D1ECEE;
  --aktbot-teal-200:    #A3D9DD;
  --aktbot-teal-300:    #75C6CC;
  --aktbot-teal-400:    #4DB3BA;
  --aktbot-teal-500:    #278A8F;
  --aktbot-teal-600:    #1F6F73;
  --aktbot-teal-700:    #185558;
  --aktbot-teal-800:    #103A3D;
  --aktbot-teal-900:    #0F3536;
  
  /* Base */
  --aktbot-dark:  #1A1A1A;
  --aktbot-white: #FFFFFF;
  
  /* Neutrals (Zinc/Gray scale) */
  --aktbot-gray-50:  #FAFAFA;
  --aktbot-gray-100: #F4F4F5;
  --aktbot-gray-200: #E4E4E7;
  --aktbot-gray-300: #D4D4D8;
  --aktbot-gray-400: #A1A1AA;
  --aktbot-gray-500: #71717A;
  --aktbot-gray-600: #52525B;
  --aktbot-gray-700: #3F3F46;
  --aktbot-gray-800: #27272A;
  --aktbot-gray-900: #18181B;
  
  /* ============================================================
     LAYER 2: BM TURKIYE TENANT BRAND (Patient-Facing Only)
     ============================================================
     NOTE: These mirror the existing brand-* values for compatibility.
     Existing code using brand-primary still works.
     ============================================================ */
  
  /* Primary - Brown */
  --bm-primary:      #1F6F73;
  --bm-dark:         #185558;
  --bm-cream:        #F0F9FA;
  --bm-cream-light:  #fdfaf6;
  --bm-cream-dark:   #e8e3da;
  --bm-border:       #e8ddd0;
  
  /* Accent - Gold */
  --bm-gold:         #c9a574;
  --bm-gold-light:   #d9bd96;
  --bm-gold-dark:    #a88758;
  
  /* Text */
  --bm-text-dark:    #185558;
  --bm-text-medium:  #6b6258;
  --bm-text-light:   #8b8278;
  
  /* ============================================================
     LAYER 3: SEMANTIC COLORS (Universal - Both Brands)
     ============================================================ */
  
  --success:       #10B981;
  --success-light: #D1FAE5;
  --success-dark:  #047857;
  
  --warning:       #F59E0B;
  --warning-light: #FEF3C7;
  --warning-dark:  #B45309;
  
  --danger:        #EF4444;
  --danger-light:  #FEE2E2;
  --danger-dark:   #B91C1C;
  
  --info:          #3B82F6;
  --info-light:    #DBEAFE;
  --info-dark:     #1D4ED8;
  
  --critical-medical: #DC2626;
  
  /* ============================================================
     LAYER 4: TYPOGRAPHY
     ============================================================ */
  
  /* Font Families */
  --font-sans:  'Readex Pro', system-ui, -apple-system, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;
  
  /* Font Sizes */
  --text-xs:   11px;
  --text-sm:   12.5px;
  --text-base: 14px;
  --text-lg:   16px;
  --text-xl:   18px;
  --text-2xl:  22px;
  --text-3xl:  28px;
  --text-4xl:  36px;
  
  /* Font Weights */
  --font-light:    300;
  --font-regular:  400;
  --font-medium:   500;
  --font-semibold: 600;
  --font-bold:     700;
  
  /* Line Heights */
  --leading-tight:   1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.75;
  
  /* ============================================================
     LAYER 5: SPACING (4px base)
     ============================================================ */
  
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  
  /* ============================================================
     LAYER 6: LAYOUT & SHAPE
     ============================================================ */
  
  --aktbot-sidebar-width: 240px;
  --aktbot-header-height: 60px;
  
  --aktbot-radius-sm:   4px;
  --aktbot-radius:      6px;
  --aktbot-radius-md:   8px;
  --aktbot-radius-lg:   12px;
  --aktbot-radius-full: 999px;
  
  --aktbot-shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --aktbot-shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.05);
  --aktbot-shadow-lg: 0 10px 15px rgba(0,0,0,0.08);
  --aktbot-shadow-xl: 0 20px 25px rgba(0,0,0,0.1);
  
  /* ============================================================
     LAYER 7: TRANSITIONS
     ============================================================ */
  
  --transition-fast: 100ms ease;
  --transition-base: 150ms ease;
  --transition-slow: 250ms ease;
}

/* ================================================================
   AKTBOT DESIGN SYSTEM — V1 (refined "Stripe-calm" layer over teal)
   ================================================================
   Additive. Consumes the existing tokens (--aktbot-teal-*, --aktbot-gray-*,
   semantic) and adds the polish the base layer lacks: soft teal-tinted
   elevation, subtle gradients, a cohesive radius/type rhythm, and a set of
   `.ds-*` component classes + React primitives (components/admin/ui/ds).
   NOTHING here touches existing bm-* / akt-* classes or any current page.
   Identity = teal #278A8F. Zero Stripe blue/purple.
   ================================================================ */

:root {
  /* ── Soft teal-tinted elevation (Stripe-style dual-layer) ── */
  --ds-shadow-xs:    0 1px 2px 0 rgba(16, 58, 61, 0.05);
  --ds-shadow-sm:    0 1px 3px 0 rgba(16, 58, 61, 0.07), 0 1px 2px -1px rgba(16, 58, 61, 0.05);
  --ds-shadow-md:    0 4px 14px -2px rgba(16, 58, 61, 0.10), 0 2px 6px -3px rgba(16, 58, 61, 0.06);
  --ds-shadow-lg:    0 12px 32px -6px rgba(16, 58, 61, 0.13), 0 6px 14px -8px rgba(16, 58, 61, 0.08);
  --ds-shadow-xl:    0 28px 56px -12px rgba(16, 58, 61, 0.17), 0 12px 24px -12px rgba(16, 58, 61, 0.10);
  --ds-ring:         0 0 0 3px rgba(39, 138, 143, 0.18);   /* teal focus ring */
  --ds-ring-danger:  0 0 0 3px rgba(239, 68, 68, 0.16);

  /* ── Subtle gradients ── */
  --ds-gradient-hero:    linear-gradient(180deg, #F0F9FA 0%, #FFFFFF 72%);
  --ds-gradient-teal:    linear-gradient(135deg, #2E9BA0 0%, #1F6F73 100%);
  --ds-gradient-surface: linear-gradient(135deg, #FFFFFF 0%, #F7FCFC 100%);
  --ds-gradient-accent:  linear-gradient(135deg, #F0F9FA 0%, #E8F4F5 100%);

  /* ── Radius rhythm (slightly softer than base — used by ds-* only) ── */
  --ds-radius-sm:  8px;
  --ds-radius:     12px;
  --ds-radius-lg:  16px;
  --ds-radius-xl:  22px;
  --ds-radius-full: 9999px;

  /* ── Type scale (maps display→caption over existing sizes) ── */
  --ds-display: 700 2rem/1.15 var(--font-sans);
  --ds-h1:      700 1.5rem/1.2 var(--font-sans);
  --ds-h2:      650 1.25rem/1.3 var(--font-sans);
  --ds-h3:      600 1.0625rem/1.4 var(--font-sans);
}

/* ── Elevation utilities ── */
.ds-shadow-xs { box-shadow: var(--ds-shadow-xs); }
.ds-shadow-sm { box-shadow: var(--ds-shadow-sm); }
.ds-shadow-md { box-shadow: var(--ds-shadow-md); }
.ds-shadow-lg { box-shadow: var(--ds-shadow-lg); }
.ds-shadow-xl { box-shadow: var(--ds-shadow-xl); }

/* ── Gradient surfaces ── */
.ds-gradient-hero    { background: var(--ds-gradient-hero); }
.ds-gradient-teal    { background: var(--ds-gradient-teal); }
.ds-gradient-surface { background: var(--ds-gradient-surface); }
.ds-gradient-accent  { background: var(--ds-gradient-accent); }

/* ── Surface / Card ── */
.ds-card {
  background: #ffffff;
  border: 1px solid var(--aktbot-teal-100);
  border-radius: var(--ds-radius-lg);
  box-shadow: var(--ds-shadow-sm);
}
.ds-card-pad { padding: 20px 22px; }
.ds-card-hover {
  transition: box-shadow var(--transition-slow), border-color var(--transition-slow), transform var(--transition-slow);
}
.ds-card-hover:hover {
  box-shadow: var(--ds-shadow-lg);
  border-color: var(--aktbot-teal-200);
  transform: translateY(-2px);
}

/* ── Buttons ── */
.ds-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--ds-radius-sm);
  font: var(--font-semibold) 13.5px/1 var(--font-sans);
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: background var(--transition-base), box-shadow var(--transition-base),
              border-color var(--transition-base), transform var(--transition-fast), color var(--transition-base);
}
.ds-btn:active:not(:disabled) { transform: translateY(0.5px) scale(0.99); }
.ds-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ds-btn:focus-visible { outline: none; box-shadow: var(--ds-ring); }

.ds-btn-primary   { background: var(--aktbot-teal); color: #fff; box-shadow: var(--ds-shadow-xs); }
.ds-btn-primary:hover:not(:disabled)   { background: var(--aktbot-teal-dark); box-shadow: var(--ds-shadow-sm); }
.ds-btn-secondary { background: #fff; color: var(--aktbot-teal-dark); border-color: var(--aktbot-teal-200); }
.ds-btn-secondary:hover:not(:disabled) { background: var(--aktbot-teal-50); border-color: var(--aktbot-teal-300); }
.ds-btn-ghost     { background: transparent; color: var(--aktbot-gray-600); }
.ds-btn-ghost:hover:not(:disabled)     { background: var(--aktbot-gray-100); color: var(--aktbot-gray-900); }
.ds-btn-subtle    { background: var(--aktbot-teal-50); color: var(--aktbot-teal-dark); }
.ds-btn-subtle:hover:not(:disabled)    { background: var(--aktbot-teal-100); }
.ds-btn-danger    { background: var(--danger-light); color: var(--danger-dark); border-color: rgba(239,68,68,0.22); }
.ds-btn-danger:hover:not(:disabled)    { background: #fdd6d6; }
.ds-btn-danger:focus-visible { box-shadow: var(--ds-ring-danger); }

.ds-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 7px; }
.ds-btn-lg { padding: 12px 22px; font-size: 15px; border-radius: var(--ds-radius); }
.ds-btn-block { width: 100%; }

/* ── Inputs ── */
.ds-input, .ds-select, .ds-textarea {
  width: 100%; background: #fff; color: var(--aktbot-dark);
  border: 1px solid var(--aktbot-gray-200); border-radius: var(--ds-radius-sm);
  padding: 9px 12px; font: 400 13.5px/1.4 var(--font-sans);
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.ds-input::-moz-placeholder, .ds-textarea::-moz-placeholder { color: var(--aktbot-gray-400); }
.ds-input::placeholder, .ds-textarea::placeholder { color: var(--aktbot-gray-400); }
.ds-input:focus, .ds-select:focus, .ds-textarea:focus {
  outline: none; border-color: var(--aktbot-teal); box-shadow: var(--ds-ring);
}
.ds-input:disabled, .ds-select:disabled, .ds-textarea:disabled {
  background: var(--aktbot-gray-50); cursor: not-allowed; color: var(--aktbot-gray-500);
}
.ds-input.ds-invalid, .ds-select.ds-invalid, .ds-textarea.ds-invalid {
  border-color: var(--danger);
}
.ds-input.ds-invalid:focus, .ds-select.ds-invalid:focus, .ds-textarea.ds-invalid:focus { box-shadow: var(--ds-ring-danger); }
.ds-textarea { resize: vertical; min-height: 84px; }
.ds-select { -webkit-appearance: none; -moz-appearance: none; appearance: none; cursor: pointer; padding-inline-end: 34px; }

.ds-label { display: block; font: var(--font-medium) 12.5px/1 var(--font-sans); color: var(--aktbot-gray-700); margin-bottom: 6px; }
.ds-label-req::after { content: ' *'; color: var(--danger); }
.ds-hint { font-size: 11.5px; color: var(--aktbot-gray-500); margin-top: 5px; }
.ds-error { font-size: 11.5px; color: var(--danger-dark); margin-top: 5px; display: flex; align-items: center; gap: 4px; }

/* ── Badges ── */
.ds-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--ds-radius-full);
  font: var(--font-semibold) 11.5px/1.5 var(--font-sans); border: 1px solid transparent;
}
.ds-badge-neutral { background: var(--aktbot-gray-100); color: var(--aktbot-gray-700); border-color: var(--aktbot-gray-200); }
.ds-badge-teal    { background: var(--aktbot-teal-50); color: var(--aktbot-teal-dark); border-color: var(--aktbot-teal-100); }
.ds-badge-success { background: var(--success-light); color: var(--success-dark); border-color: rgba(16,185,129,0.22); }
.ds-badge-warning { background: var(--warning-light); color: var(--warning-dark); border-color: rgba(245,158,11,0.24); }
.ds-badge-danger  { background: var(--danger-light);  color: var(--danger-dark);  border-color: rgba(239,68,68,0.22); }
.ds-badge-info    { background: var(--info-light);    color: var(--info-dark);    border-color: rgba(59,130,246,0.20); }

/* ── Table ── */
.ds-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.ds-table thead th {
  background: var(--aktbot-teal-50); color: var(--aktbot-teal-dark);
  font: var(--font-semibold) 11px/1 var(--font-sans); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 11px 14px; white-space: nowrap; border-bottom: 1px solid var(--aktbot-teal-100);
}
html[dir="rtl"] .ds-table thead th { text-align: right; }
html[dir="ltr"] .ds-table thead th { text-align: left; }
.ds-table tbody td { padding: 11px 14px; color: var(--aktbot-dark); border-bottom: 1px solid var(--aktbot-gray-100); }
.ds-table tbody tr:last-child td { border-bottom: 0; }
.ds-table tbody tr { transition: background var(--transition-fast); }
.ds-table tbody tr:hover { background: var(--aktbot-teal-50); }

/* ── Tabs ── */
.ds-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--aktbot-gray-100); border-radius: var(--ds-radius); }
.ds-tab {
  padding: 7px 14px; border-radius: var(--ds-radius-sm); border: none; background: transparent; cursor: pointer;
  font: var(--font-medium) 13px/1 var(--font-sans); color: var(--aktbot-gray-600);
  transition: background var(--transition-base), color var(--transition-base), box-shadow var(--transition-base);
}
.ds-tab:hover { color: var(--aktbot-teal-dark); }
.ds-tab[aria-selected="true"], .ds-tab.active { background: #fff; color: var(--aktbot-teal-dark); box-shadow: var(--ds-shadow-xs); }

/* ── Typography helpers ── */
.ds-eyebrow { font: var(--font-semibold) 11px/1 var(--font-sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--aktbot-teal); }
.ds-display { font: var(--ds-display); color: var(--aktbot-dark); letter-spacing: -0.02em; }
.ds-h1 { font: var(--ds-h1); color: var(--aktbot-dark); letter-spacing: -0.015em; }
.ds-h2 { font: var(--ds-h2); color: var(--aktbot-dark); letter-spacing: -0.01em; }
.ds-h3 { font: var(--ds-h3); color: var(--aktbot-dark); }
.ds-body { font: 400 14px/1.6 var(--font-sans); color: var(--aktbot-gray-700); }
.ds-caption { font: 400 12px/1.5 var(--font-sans); color: var(--aktbot-gray-500); }
.ds-mono { font: 500 13px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--aktbot-gray-700); }

/* ── Divider ── */
.ds-divider { height: 1px; background: var(--aktbot-gray-100); border: 0; }

/* ================================================================
   V2-ج — المكوّنات الناقصة (modal/empty/skeleton/alert/risk/nav)
   بدائل ds-* لـ bm-modal/bm-empty/bm-skeleton/alert-*/risk-*/nav-item.
   ================================================================ */

/* ── Modal / Dialog ── */
.ds-modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(15, 23, 23, 0.44);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: ds-fade 0.16s ease-out;
}
.ds-modal {
  background: #fff; border-radius: var(--ds-radius-lg); box-shadow: var(--ds-shadow-xl);
  width: 100%; max-width: 32rem; max-height: 90vh; overflow-y: auto;
  border: 1px solid var(--aktbot-teal-100);
  animation: ds-slide-up 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.ds-modal-header {
  padding: 16px 22px; border-bottom: 1px solid var(--aktbot-gray-100);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.ds-modal-body { padding: 20px 22px; }
.ds-modal-footer {
  padding: 14px 22px; border-top: 1px solid var(--aktbot-gray-100);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  position: sticky; bottom: 0; background: #fff;
}
@keyframes ds-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ds-slide-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Empty state ── */
.ds-empty { text-align: center; padding: 56px 16px; }
.ds-empty-icon { color: var(--aktbot-teal-300); margin-bottom: 12px; display: inline-flex; }
.ds-empty-title { color: var(--aktbot-dark); font: var(--font-semibold) 15px/1.4 var(--font-sans); margin-bottom: 4px; }
.ds-empty-desc { color: var(--aktbot-gray-500); font-size: 13px; }

/* ── Skeleton ── */
.ds-skeleton {
  border-radius: var(--ds-radius-sm);
  background: linear-gradient(90deg, var(--aktbot-teal-50) 25%, var(--aktbot-teal-100) 50%, var(--aktbot-teal-50) 75%);
  background-size: 200% 100%; animation: ds-shimmer 1.4s ease-in-out infinite;
}
@keyframes ds-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Alert banners (soft semantic) ── */
.ds-alert { border-radius: var(--ds-radius); border: 1px solid; padding: 14px 16px; box-shadow: var(--ds-shadow-xs); font-size: 13.5px; }
.ds-alert-info    { background: var(--info-light);    border-color: rgba(59,130,246,0.22);  color: var(--info-dark); }
.ds-alert-success { background: var(--success-light); border-color: rgba(16,185,129,0.24);  color: var(--success-dark); }
.ds-alert-warning { background: var(--warning-light); border-color: rgba(245,158,11,0.26);  color: var(--warning-dark); }
.ds-alert-danger  { background: var(--danger-light);  border-color: rgba(239,68,68,0.24);   color: var(--danger-dark); }
.ds-alert-teal    { background: var(--aktbot-teal-50); border-color: var(--aktbot-teal-100); color: var(--aktbot-teal-dark); }

/* ── Risk pills (medical severity — semantic, not brand) ── */
.ds-risk { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--ds-radius-full); font: var(--font-semibold) 11.5px/1.5 var(--font-sans); border: 1px solid transparent; }
.ds-risk-critical { background: #F3E8FF; color: #6B21A8; border-color: #E9D5FF; }
.ds-risk-high     { background: var(--danger-light);  color: var(--danger-dark);  border-color: rgba(239,68,68,0.22); }
.ds-risk-medium   { background: var(--warning-light); color: var(--warning-dark); border-color: rgba(245,158,11,0.24); }
.ds-risk-low      { background: var(--success-light); color: var(--success-dark); border-color: rgba(16,185,129,0.22); }

/* ── Nav item (dark sidebar · teal active) ── */
.ds-nav-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: var(--ds-radius-sm);
  font: var(--font-medium) 13.5px/1 var(--font-sans); color: var(--aktbot-teal-200); cursor: pointer;
  transition: background var(--transition-base), color var(--transition-base);
}
.ds-nav-item:hover { background: rgba(255,255,255,0.08); color: #fff; }
.ds-nav-item.active { background: rgba(255,255,255,0.12); color: #fff; }
.ds-nav-item.disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Field wrapper (vertical rhythm — بديل bm-field) ── */
.ds-field { display: flex; flex-direction: column; gap: 4px; }

/* ── Link + section title (بدائل akt-link / akt-section-title) ── */
.ds-link { color: var(--aktbot-teal); text-decoration: none; font-weight: 500; transition: color var(--transition-base); }
.ds-link:hover { color: var(--aktbot-teal-dark); text-decoration: underline; }
.ds-section-title { font: var(--font-semibold) 16px/1.4 var(--font-sans); color: var(--aktbot-dark); margin: 0 0 12px 0; }

/* ================================================================
   AKTBOT UTILITY CLASSES
   ================================================================
   Custom utility classes for AktBot admin UI.
   Use these in admin pages alongside Tailwind classes.
   ================================================================ */

/* ── AktBot Buttons ────────────────────────────────────────────── */

.akt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  font-family: var(--font-sans);
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.akt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.akt-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.akt-btn-primary {
  background: var(--aktbot-teal);
  color: white;
}
.akt-btn-primary:hover:not(:disabled) {
  background: var(--aktbot-teal-dark);
}

.akt-btn-secondary {
  background: white;
  color: var(--aktbot-dark);
  border: 1px solid var(--aktbot-gray-300);
}
.akt-btn-secondary:hover:not(:disabled) {
  background: var(--aktbot-gray-50);
  border-color: var(--aktbot-gray-400);
}

.akt-btn-ghost {
  background: transparent;
  color: var(--aktbot-gray-700);
}
.akt-btn-ghost:hover:not(:disabled) {
  background: var(--aktbot-gray-100);
}

.akt-btn-danger {
  background: var(--danger);
  color: white;
}
.akt-btn-danger:hover:not(:disabled) {
  background: var(--danger-dark);
}

.akt-btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.akt-btn-lg {
  padding: 10px 20px;
  font-size: 14px;
}

/* ── AktBot Cards ──────────────────────────────────────────────── */

.akt-card {
  background: white;
  border: 1px solid var(--aktbot-gray-200);
  border-radius: var(--aktbot-radius-md);
  padding: var(--space-5);
  box-shadow: var(--aktbot-shadow-sm);
}

.akt-card-hover {
  transition: all var(--transition-base);
}
.akt-card-hover:hover {
  border-color: var(--aktbot-gray-300);
  box-shadow: var(--aktbot-shadow-md);
}

.akt-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--aktbot-gray-200);
}

/* ── AktBot Sidebar Active State ───────────────────────────────── */

.akt-sidebar-item-active {
  background: var(--aktbot-teal);
  color: white;
}

.akt-sidebar-item-active:hover {
  background: var(--aktbot-teal-dark);
}

/* ── AktBot Badges ─────────────────────────────────────────────── */

.akt-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--aktbot-radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.akt-badge-teal {
  background: var(--aktbot-teal-light);
  color: var(--aktbot-teal-dark);
}

.akt-badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}

.akt-badge-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
}

.akt-badge-danger {
  background: var(--danger-light);
  color: var(--danger-dark);
}

.akt-badge-info {
  background: var(--info-light);
  color: var(--info-dark);
}

.akt-badge-neutral {
  background: var(--aktbot-gray-100);
  color: var(--aktbot-gray-700);
}

/* ── AktBot Inputs ─────────────────────────────────────────────── */

.akt-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--aktbot-gray-300);
  border-radius: var(--aktbot-radius);
  background: white;
  color: var(--aktbot-dark);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: all var(--transition-base);
}

.akt-input:focus {
  outline: none;
  border-color: var(--aktbot-teal);
  box-shadow: 0 0 0 3px rgba(39, 138, 143, 0.1);
}

.akt-input:disabled {
  background: var(--aktbot-gray-50);
  cursor: not-allowed;
}

.akt-input.error {
  border-color: var(--danger);
}

.akt-input.error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── AktBot Links ──────────────────────────────────────────────── */

.akt-link {
  color: var(--aktbot-teal);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-base);
}

.akt-link:hover {
  color: var(--aktbot-teal-dark);
  text-decoration: underline;
}

/* ── AktBot Status Indicators ──────────────────────────────────── */

.akt-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.akt-status-dot-success { background: var(--success); }
.akt-status-dot-warning { background: var(--warning); }
.akt-status-dot-danger  { background: var(--danger); }
.akt-status-dot-info    { background: var(--info); }
.akt-status-dot-teal    { background: var(--aktbot-teal); }

/* ── AktBot Section Headers ────────────────────────────────────── */

.akt-section-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--aktbot-dark);
  margin: 0 0 var(--space-3) 0;
}

.akt-section-subtitle {
  font-size: var(--text-sm);
  color: var(--aktbot-gray-500);
  margin: 0 0 var(--space-4) 0;
}

/* ── AktBot Focus Rings (accessibility) ────────────────────────── */

.akt-focus-ring:focus-visible {
  outline: 2px solid var(--aktbot-teal);
  outline-offset: 2px;
}

/* ── AktBot Loading Spinner ────────────────────────────────────── */

.akt-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--aktbot-gray-200);
  border-top-color: var(--aktbot-teal);
  border-radius: 50%;
  animation: akt-spin 0.6s linear infinite;
}

@keyframes akt-spin {
  to { transform: rotate(360deg); }
}

/* ── AktBot Empty States ───────────────────────────────────────── */

.akt-empty {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--aktbot-gray-500);
}

.akt-empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto var(--space-3);
  color: var(--aktbot-gray-400);
}

.akt-empty-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--aktbot-dark);
  margin: 0 0 var(--space-2) 0;
}

.akt-empty-text {
  font-size: var(--text-sm);
  color: var(--aktbot-gray-500);
}

/* ================================================================
   AKTBOT LOGIN PAGE STYLES
   ================================================================ */

.aktbot-login-bg {
  background: linear-gradient(135deg, #0F3536 0%, #1A1A1A 50%, #185558 100%);
  position: relative;
}

.aktbot-login-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.aktbot-login-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: white;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: all 150ms ease;
}

.aktbot-login-input::-moz-placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.aktbot-login-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.aktbot-login-input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--aktbot-teal);
  box-shadow: 0 0 0 3px rgba(39, 138, 143, 0.15);
}

.aktbot-login-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.aktbot-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--aktbot-teal) 0%, var(--aktbot-teal-dark) 100%);
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  box-shadow: 0 4px 12px rgba(39, 138, 143, 0.3);
}

.aktbot-login-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(39, 138, 143, 0.4);
}

.aktbot-login-btn:active:not(:disabled) {
  transform: translateY(0);
}

.aktbot-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ================================================================
   AKTBOT SIDEBAR STYLES
   ================================================================
   Used by src/components/admin/Sidebar.tsx
   Independent from existing brand-* styles to allow gradual migration.
   ================================================================ */

/* ── Main sidebar container ──────────────────────────────────── */

.aktbot-sidebar {
  background: linear-gradient(180deg, #1A1A1A 0%, #0F3536 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

html[dir="ltr"] .aktbot-sidebar {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  border-left: none;
}

html[dir="rtl"] .aktbot-sidebar {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  border-right: none;
}

/* ── Logo section ─────────────────────────────────────────────── */

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

.aktbot-logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--aktbot-teal) 0%, var(--aktbot-teal-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(39, 138, 143, 0.3);
  position: relative;
}

.aktbot-logo-mark::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 9px;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
  pointer-events: none;
}

.aktbot-logo-mark span {
  color: white;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
}

/* ── Navigation section ───────────────────────────────────────── */

.aktbot-nav {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.aktbot-nav::-webkit-scrollbar {
  width: 4px;
}

.aktbot-nav::-webkit-scrollbar-track {
  background: transparent;
}

.aktbot-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* ── Section titles ───────────────────────────────────────────── */

.aktbot-nav-section-title {
  font-size: 10px;
  font-weight: 600;
  color: var(--aktbot-teal-200);
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 16px 12px 6px 12px;
  margin: 0;
}

/* ── Navigation items ─────────────────────────────────────────── */

.aktbot-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  transition: all 150ms ease;
  cursor: pointer;
  position: relative;
  margin-bottom: 2px;
  text-decoration: none;
}

.aktbot-nav-item:hover {
  background: rgba(39, 138, 143, 0.1);
  color: white;
}

.aktbot-nav-item.active {
  background: var(--aktbot-teal);
  color: white;
  box-shadow: 0 2px 8px rgba(39, 138, 143, 0.3);
}

.aktbot-nav-item.active:hover {
  background: var(--aktbot-teal-dark);
}

.aktbot-nav-item-indent {
  padding-inline-start: 36px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Badges in nav items ──────────────────────────────────────── */

.aktbot-nav-badge {
  font-size: 10px;
  background: var(--aktbot-teal-light);
  color: var(--aktbot-teal-dark);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

.aktbot-badge-new {
  font-size: 9px;
  background: var(--success);
  color: white;
  padding: 2px 6px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── User section ─────────────────────────────────────────────── */

.aktbot-sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

/* ── Mobile responsiveness ────────────────────────────────────── */

@media (max-width: 1024px) {
  .aktbot-sidebar {
    position: fixed;
    top: 0;
    z-index: 50;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  
  html[dir="ltr"] .aktbot-sidebar {
    left: 0;
    right: auto;
    transform: translateX(-100%);
  }
  
  html[dir="rtl"] .aktbot-sidebar {
    right: 0;
    left: auto;
    transform: translateX(100%);
  }
  
  .aktbot-sidebar.open {
    transform: translateX(0);
  }
}

/* ── Existing nav-item compatibility (don't break old code) ──── */
/* If any old code still uses .nav-item, ensure it still works    */
/* (the old .nav-item styles in globals.css continue to apply)    */

/* ================================================================
   AKTBOT OVERLAY STYLES (Soft Refresh)
   ================================================================
   This file overrides the visual look of existing components
   (Dashboard, Patient detail, etc.) without touching their source code.
   
   It uses a parent class `.aktbot-ui` to scope the overrides
   so it ONLY applies in admin (not in patient-facing PDFs/emails).
   ================================================================ */

/* ── Cards: bm-card receives AktBot treatment ─────────────────── */

.aktbot-ui .bm-card {
  background: white;
  border-color: var(--aktbot-gray-200);
  border-radius: 12px;
  box-shadow: var(--aktbot-shadow-sm);
  transition: all 150ms ease;
}

.aktbot-ui .bm-card-hover:hover {
  border-color: var(--aktbot-gray-300);
  box-shadow: var(--aktbot-shadow-md);
}

.aktbot-ui .bm-card-elevated {
  box-shadow: var(--aktbot-shadow-lg);
}

/* ── Buttons: bm-btn-primary becomes teal ─────────────────────── */

.aktbot-ui .bm-btn-primary {
  background: var(--aktbot-teal);
  color: white;
  border-radius: 8px;
  transition: all 150ms ease;
}

.aktbot-ui .bm-btn-primary:hover {
  background: var(--aktbot-teal-dark);
  box-shadow: var(--aktbot-shadow-sm);
}

.aktbot-ui .bm-btn-secondary {
  background: white;
  color: var(--aktbot-dark);
  border: 1px solid var(--aktbot-gray-300);
  border-radius: 8px;
}

.aktbot-ui .bm-btn-secondary:hover {
  background: var(--aktbot-gray-50);
}

.aktbot-ui .bm-btn-ghost {
  color: var(--aktbot-gray-600);
}

.aktbot-ui .bm-btn-ghost:hover {
  background: var(--aktbot-gray-100);
}

/* ── Form inputs ─────────────────────────────────────────────── */

.aktbot-ui .bm-input,
.aktbot-ui .bm-select,
.aktbot-ui .bm-textarea {
  background: white;
  border-color: var(--aktbot-gray-300);
  border-radius: 8px;
  color: var(--aktbot-dark);
  font-family: var(--font-sans);
}

.aktbot-ui .bm-input:focus,
.aktbot-ui .bm-select:focus,
.aktbot-ui .bm-textarea:focus {
  border-color: var(--aktbot-teal);
  box-shadow: 0 0 0 3px rgba(39, 138, 143, 0.1);
  outline: none;
}

.aktbot-ui .bm-input::-moz-placeholder {
  color: var(--aktbot-gray-400);
}

.aktbot-ui .bm-input::placeholder {
  color: var(--aktbot-gray-400);
}

.aktbot-ui .bm-label {
  color: var(--aktbot-gray-700);
  font-weight: 500;
}

/* ── Tables: bm-table refresh ────────────────────────────────── */

.aktbot-ui .bm-table thead {
  background: var(--aktbot-gray-50);
  border-bottom: 1px solid var(--aktbot-gray-200);
}

.aktbot-ui .bm-table th {
  color: var(--aktbot-gray-600);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.aktbot-ui .bm-table td {
  color: var(--aktbot-dark);
  border-bottom: 1px solid var(--aktbot-gray-100);
}

.aktbot-ui .bm-table tbody tr:hover {
  background: var(--aktbot-gray-50);
}

/* ── Tabs ────────────────────────────────────────────────────── */

.aktbot-ui .bm-tabs {
  border-bottom: 1px solid var(--aktbot-gray-200);
}

.aktbot-ui .bm-tab {
  color: var(--aktbot-gray-500);
  font-weight: 500;
  transition: all 150ms ease;
}

.aktbot-ui .bm-tab:hover {
  color: var(--aktbot-teal);
}

.aktbot-ui .bm-tab.active {
  color: var(--aktbot-teal);
  border-bottom-color: var(--aktbot-teal);
}

/* ── Modals ──────────────────────────────────────────────────── */

.aktbot-ui .bm-modal {
  border-radius: 12px;
  box-shadow: var(--aktbot-shadow-xl);
}

.aktbot-ui .bm-modal-header {
  border-bottom: 1px solid var(--aktbot-gray-200);
}

.aktbot-ui .bm-modal-footer {
  border-top: 1px solid var(--aktbot-gray-200);
  background: var(--aktbot-gray-50);
}

/* ── Empty states ────────────────────────────────────────────── */

.aktbot-ui .bm-empty {
  color: var(--aktbot-gray-500);
}

.aktbot-ui .bm-empty-icon {
  color: var(--aktbot-gray-300);
}

.aktbot-ui .bm-empty-title {
  color: var(--aktbot-dark);
}

.aktbot-ui .bm-empty-desc {
  color: var(--aktbot-gray-500);
}

/* ── Text colors: smart remapping ────────────────────────────── */

.aktbot-ui .text-brand-dark { color: var(--aktbot-dark) !important; }
.aktbot-ui .text-brand-500 { color: var(--aktbot-gray-500) !important; }
.aktbot-ui .text-brand-400 { color: var(--aktbot-gray-400) !important; }
.aktbot-ui .text-brand-600 { color: var(--aktbot-gray-600) !important; }
.aktbot-ui .text-brand-700 { color: var(--aktbot-gray-700) !important; }
.aktbot-ui .text-brand-primary { color: var(--aktbot-teal) !important; }

/* Background remapping (only neutral bg-brand-50/100 — keep semantic bg-brand-primary as-is in patient-facing) */

.aktbot-ui .bg-brand-50 { background-color: var(--aktbot-gray-50) !important; }
.aktbot-ui .bg-brand-100 { background-color: var(--aktbot-teal-light) !important; }
.aktbot-ui .bg-brand-primary { background-color: var(--aktbot-teal) !important; }

.aktbot-ui .border-brand-100 { border-color: var(--aktbot-gray-100) !important; }
.aktbot-ui .border-brand-200 { border-color: var(--aktbot-gray-200) !important; }
.aktbot-ui .border-brand-300 { border-color: var(--aktbot-gray-300) !important; }

/* Hover states */
.aktbot-ui .hover\:bg-brand-100:hover { background-color: var(--aktbot-teal-light) !important; }

/* ── Risk badges keep their semantic colors (no override) ────── */
/* .risk-critical, .risk-high, .risk-medium, .risk-low — unchanged */

/* ── Notification dot ────────────────────────────────────────── */

.aktbot-ui .bm-notif-dot {
  background: var(--danger);
}

