/* =====================================================================
   NCIS MASTER STYLESHEET
   Japan-Tech Minimalist Design System
   Engineered for high-density clinical UI, admin dashboards, and ADPIE workflow.
   ===================================================================== */

/* 1. DESIGN TOKENS & VARIABLES */
:root {
    /* Core Palette (Deep Slates) */
    --p: #0f172a; --s: #1e293b; --a: #334155; --b: #475569; --c: #64748b; --d: #94a3b8; --e: #cbd5e1; --f: #e2e8f0; --g: #f1f5f9; --h: #f8fafc; --i: #ffffff;
    /* Accent Palette (Tech Blues & Clinical Greens) */
    --p-c: #3b82f6; --p-c-h: #2563eb; --s-c: #10b981; --s-c-h: #059669; --d-c: #ef4444; --d-c-h: #dc2626; --w-c: #f59e0b; --w-c-h: #d97706; --i-c: #6366f1; --i-c-h: #4f46e5;
    /* Typography Scale */
    --t-1: 14px; --t-2: 16px; --t-3: 18px; --t-4: 20px; --t-5: 24px; --t-6: 32px; --t-7: 40px;
    /* Border Radius */
    --r-1: 4px; --r-2: 8px; --r-3: 12px; --r-4: 16px; --r-5: 24px;
    /* Box Shadows */
    --sh-1: 0 1px 2px 0 rgba(0,0,0,0.05);
    --sh-2: 0 4px 6px -1px rgba(0,0,0,0.1),0 2px 4px -1px rgba(0,0,0,0.06);
    --sh-3: 0 10px 15px -3px rgba(0,0,0,0.1),0 4px 6px -2px rgba(0,0,0,0.05);
    --sh-4: 0 20px 25px -5px rgba(0,0,0,0.1),0 10px 10px -5px rgba(0,0,0,0.04);
    /* Spacing Scale */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px; --sp-8: 64px;
    /* Transitions */
    --tr: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --tr-slow: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    /* Font Families */
    --ff: 'Hiragino Kaku Gothic ProN','Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
    --ff-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
    /* Z-Index Scale */
    --z-dropdown: 100; --z-sticky: 200; --z-fixed: 300; --z-modal-backdrop: 400; --z-modal: 500; --z-tooltip: 600;
  }
  
  /* 2. RESET & BASE */
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; }
  html, body { height: 100%; width: 100%; }
  body { font-family: var(--ff); background: var(--g); color: var(--p); font-size: var(--t-2); line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: hidden; }
  a { color: var(--p-c); text-decoration: none; transition: var(--tr); } a:hover { color: var(--p-c-h); text-decoration: underline; }
  button { font-family: var(--ff); cursor: pointer; border: none; outline: none; transition: var(--tr); background: none; }
  input, textarea, select { font-family: var(--ff); outline: none; border: none; }
  img, svg { display: block; max-width: 100%; }
  h1,h2,h3,h4,h5,h6 { font-weight: 600; line-height: 1.2; color: var(--p); }
  h1 { font-size: var(--t-6); } h2 { font-size: var(--t-5); } h3 { font-size: var(--t-4); } h4 { font-size: var(--t-3); }
  ul, ol { list-style: none; }
  
  /* 3. LAYOUT UTILITIES */
  .grid { display: grid; gap: var(--sp-4); }
  .flex { display: flex; }
  .flex-col { flex-direction: column; }
  .flex-wrap { flex-wrap: wrap; }
  .items-center { align-items: center; }
  .items-start { align-items: flex-start; }
  .items-end { align-items: flex-end; }
  .justify-between { justify-content: space-between; }
  .justify-center { justify-content: center; }
  .justify-end { justify-content: flex-end; }
  .gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-4 { gap: var(--sp-4); } .gap-6 { gap: var(--sp-6); } .gap-8 { gap: var(--sp-8); }
  .w-full { width: 100%; } .h-full { height: 100%; } .w-auto { width: auto; }
  .text-center { text-align: center; } .text-left { text-align: left; } .text-right { text-align: right; }
  .text-sm { font-size: var(--t-1); } .text-xs { font-size: 12px; } .text-lg { font-size: var(--t-3); } .text-xl { font-size: var(--t-4); }
  .text-gray { color: var(--c); } .text-danger { color: var(--d-c); } .text-success { color: var(--s-c); } .text-primary { color: var(--p-c); }
  .font-bold { font-weight: 700; } .font-medium { font-weight: 500; } .font-normal { font-weight: 400; }
  .p-1 { padding: var(--sp-1); } .p-2 { padding: var(--sp-2); } .p-4 { padding: var(--sp-4); } .p-6 { padding: var(--sp-6); } .p-8 { padding: var(--sp-8); }
  .px-1 { padding-left: var(--sp-1); padding-right: var(--sp-1); } .px-2 { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); } .px-6 { padding-left: var(--sp-6); padding-right: var(--sp-6); }
  .py-1 { padding-top: var(--sp-1); padding-bottom: var(--sp-1); } .py-2 { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
  .py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); } .py-6 { padding-top: var(--sp-6); padding-bottom: var(--sp-6); }
  .m-0 { margin: 0; } .mt-2 { margin-top: var(--sp-2); } .mt-4 { margin-top: var(--sp-4); } .mt-6 { margin-top: var(--sp-6); } .mt-8 { margin-top: var(--sp-8); }
  .mb-2 { margin-bottom: var(--sp-2); } .mb-4 { margin-bottom: var(--sp-4); } .mb-6 { margin-bottom: var(--sp-6); } .mb-8 { margin-bottom: var(--sp-8); }
  .mx-auto { margin-left: auto; margin-right: auto; }
  .rounded-full { border-radius: 9999px; }
  
  /* 4. COMPONENTS: CARDS & STATISTICS */
  .card { background: var(--i); border-radius: var(--r-3); box-shadow: var(--sh-2); padding: var(--sp-6); transition: var(--tr); border: 1px solid var(--f); }
  .card:hover { box-shadow: var(--sh-3); border-color: var(--e); }
  .card-header { padding-bottom: var(--sp-4); margin-bottom: var(--sp-4); border-bottom: 1px solid var(--f); display: flex; justify-content: space-between; align-items: center; }
  .card-title { font-size: var(--t-3); font-weight: 600; color: var(--p); }
  .stat-card { background: linear-gradient(135deg, var(--p-c), var(--i-c)); color: var(--i); border: none; }
  .stat-card h3 { color: var(--i); font-size: var(--t-4); }
  .stat-card .stat-value { font-size: 42px; font-weight: 700; margin: var(--sp-2) 0; }
  .stat-card p { color: rgba(255,255,255,0.8); margin-top: var(--sp-2); }
  
  /* 5. COMPONENTS: BUTTONS */
  .btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; border-radius: var(--r-2); font-weight: 500; font-size: var(--t-1); gap: 6px; border: 1px solid transparent; white-space: nowrap; }
  .btn:hover { text-decoration: none; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .btn-lg { padding: 14px 24px; font-size: var(--t-2); }
  .btn-primary { background: var(--p-c); color: var(--i); } .btn-primary:hover { background: var(--p-c-h); color: var(--i); }
  .btn-danger { background: var(--d-c); color: var(--i); } .btn-danger:hover { background: var(--d-c-h); color: var(--i); }
  .btn-success { background: var(--s-c); color: var(--i); } .btn-success:hover { background: var(--s-c-h); color: var(--i); }
  .btn-ghost { background: var(--f); color: var(--a); border-color: var(--e); } .btn-ghost:hover { background: var(--g); color: var(--p); }
  .btn-outline { background: transparent; border-color: var(--e); color: var(--a); } .btn-outline:hover { border-color: var(--p-c); color: var(--p-c); }
  .btn-block { width: 100%; }
  
  /* 6. COMPONENTS: FORMS */
  .form-group { margin-bottom: var(--sp-4); }
  .form-label, .form-group label { display: block; margin-bottom: var(--sp-2); font-weight: 500; color: var(--a); font-size: var(--t-1); }
  .form-control, input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--e); border-radius: var(--r-2); background: var(--i); transition: var(--tr); font-size: var(--t-1); color: var(--p); appearance: none;
  }
  .form-control:focus, input:focus, select:focus, textarea:focus { border-color: var(--p-c); box-shadow: 0 0 0 3px rgba(59,130,246,0.2); outline: none; }
  textarea.form-control { min-height: 120px; resize: vertical; }
  select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='currentColor' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
  input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--p-c); margin-right: 8px; }
  .form-check { display: flex; align-items: center; margin-bottom: var(--sp-2); }
  .input-group { display: flex; align-items: stretch; }
  .input-group .form-control { border-radius: 0; }
  .input-group .btn { border-radius: 0 var(--r-2) var(--r-2) 0; }
  
  /* 7. COMPONENTS: ALERTS & BADGES */
  .alert { padding: 12px 16px; border-radius: var(--r-2); margin-bottom: var(--sp-4); font-size: var(--t-1); display: flex; align-items: center; gap: 10px; border: 1px solid transparent; }
  .alert-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
  .alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
  .alert-success { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
  .alert-info { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
  .badge { padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; display: inline-block; }
  .badge-success { background: #dcfce7; color: #166534; }
  .badge-warning { background: #fef3c7; color: #92400e; }
  .badge-danger { background: #fee2e2; color: #991b1b; }
  .badge-info { background: #e0e7ff; color: #3730a3; }
  .badge-gray { background: var(--f); color: var(--b); }
  .badge-primary { background: var(--p-c); color: var(--i); }
  
  /* 8. AUTHENTICATION (LOGIN) */
  .login-body { background: radial-gradient(circle at top left, #1e3a8a, #0f172a); height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--sp-4); }
  .login-container { width: 100%; max-width: 440px; }
  .login-card { background: var(--i); border-radius: var(--r-5); box-shadow: var(--sh-4); overflow: hidden; animation: slideUp 0.5s ease-out; }
  @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
  .login-header { text-align: center; padding: var(--sp-8) var(--sp-6) var(--sp-4); }
  .login-header h1 { color: var(--p-c); font-size: 48px; margin-bottom: var(--sp-2); font-weight: 700; letter-spacing: -1px; }
  .login-header p { color: var(--c); }
  .login-form { padding: var(--sp-6); }
  .login-form .form-control { padding: 14px; }
  .btn-login { width: 100%; padding: 14px; background: var(--p); color: var(--i); border-radius: var(--r-2); font-weight: 600; font-size: var(--t-2); }
  .btn-login:hover { background: var(--s); }
  .login-footer { text-align: center; padding: var(--sp-4) var(--sp-6) var(--sp-8); color: var(--d); font-size: 12px; }
  
  /* 9. ADMIN SIDEBAR & MAIN LAYOUT */
  .layout-wrapper { display: flex; min-height: 100vh; }
  .sidebar { width: 260px; height: 100vh; background: var(--p); color: var(--e); position: fixed; left: 0; top: 0; display: flex; flex-direction: column; z-index: var(--z-fixed); transition: var(--tr-slow); box-shadow: var(--sh-4); }
  .sidebar-brand { 
    padding: var(--sp-4) var(--sp-6); /* Reduced from sp-6 to sp-4 */
    border-bottom: 1px solid var(--s); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}
  .sidebar-brand h2 { color: var(--i); font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
  .sidebar-nav { flex: 1; overflow-y: auto; padding: var(--sp-4); scrollbar-width: thin; scrollbar-color: var(--s) var(--p); }
  .sidebar-nav::-webkit-scrollbar { width: 6px; }
  .sidebar-nav::-webkit-scrollbar-thumb { background: var(--s); border-radius: 3px; }
  .sidebar-nav ul { list-style: none; }
  .sidebar-nav li { margin-bottom: 2px; }
  .sidebar-nav a { 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    padding: 8px var(--sp-4); /* Reduced padding from 12px to 8px */
    color: var(--d); 
    border-radius: var(--r-2); 
    font-size: 13px; /* Slightly smaller font */
    font-weight: 500; 
    transition: var(--tr); 
}
  .sidebar-nav a:hover { background: var(--s); color: var(--i); text-decoration: none; }
  .sidebar-nav a.active { background: var(--p-c); color: var(--i); box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3); }
  .sidebar-nav a.logout-btn { margin-top: var(--sp-4); background: rgba(239, 68, 68, 0.1); color: var(--d-c); }
  .sidebar-nav a.logout-btn:hover { background: var(--d-c); color: var(--i); }
  .main-content { margin-left: 260px; padding: var(--sp-6); width: calc(100% - 260px); background: var(--h); min-height: 100vh; }
  .main-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-6); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--e); }
  .main-header h1 { color: var(--p); font-size: 28px; font-weight: 600; }
  .user-info { color: var(--b); font-weight: 500; display: flex; align-items: center; gap: 10px; }
  .user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--p-c); color: var(--i); display: flex; align-items: center; justify-content: center; font-weight: 600; }
  
  /* 10. CLINICAL DASHBOARD & TABLES */
  .content-grid { display: grid; grid-template-columns: 1fr 2fr; gap: var(--sp-6); margin-bottom: var(--sp-6); }
  .patient-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-4); }
  .patient-card { background: var(--i); border-radius: var(--r-3); box-shadow: var(--sh-2); padding: var(--sp-4); border-left: 4px solid var(--p-c); transition: var(--tr); cursor: pointer; }
  .patient-card:hover { box-shadow: var(--sh-3); transform: translateY(-2px); }
  .patient-card h3 { font-size: var(--t-3); margin-bottom: 4px; }
  .patient-card p { font-size: var(--t-1); color: var(--c); margin-bottom: 2px; }
  .patient-status { margin-top: var(--sp-3); display: flex; gap: 6px; flex-wrap: wrap; }
  .data-table { width: 100%; border-collapse: collapse; margin-top: var(--sp-4); font-size: var(--t-1); }
  .data-table th, .data-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--f); }
  .data-table th { font-weight: 600; color: var(--a); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; background: var(--h); }
  .data-table tr:hover { background: var(--h); }
  .data-table tr:last-child td { border-bottom: none; }
  .table-striped tbody tr:nth-of-type(odd) { background-color: rgba(0,0,0,0.02); }
  .table-hover tbody tr:hover { background-color: rgba(59,130,246,0.05); cursor: pointer; }
  
  /* 11. ASSESSMENT FORMS & TABS */
  .assessment-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--e); margin-bottom: var(--sp-6); overflow-x: auto; white-space: nowrap; padding-bottom: 1px; }
  .assessment-tab { padding: 12px 20px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--c); font-weight: 500; transition: var(--tr); display: inline-block; }
  .assessment-tab:hover { color: var(--p-c); }
  .assessment-tab.active { color: var(--p-c); border-color: var(--p-c); background: rgba(59, 130, 246, 0.05); border-radius: var(--r-2) var(--r-2) 0 0; }
  .domain-card { background: var(--i); border: 1px solid var(--f); border-radius: var(--r-3); padding: var(--sp-6); margin-bottom: var(--sp-4); transition: var(--tr); }
  .domain-card:hover { border-color: var(--e); }
  .domain-card h4 { border-bottom: 1px solid var(--f); padding-bottom: var(--sp-3); margin-bottom: var(--sp-4); color: var(--s); display: flex; align-items: center; gap: 8px; }
  .grid-cols-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-4); }
  .grid-cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
  .grid-cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); }
  
  /* 12. MODALS & OVERLAYS */
  .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: var(--z-modal-backdrop); padding: var(--sp-4); }
  .modal-overlay.active { display: flex; animation: fadeIn 0.2s ease-out; }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  .modal { background: var(--i); border-radius: var(--r-4); width: 100%; max-width: 600px; padding: var(--sp-6); box-shadow: var(--sh-4); max-height: 90vh; overflow-y: auto; animation: scaleIn 0.2s ease-out; }
  @keyframes scaleIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
  .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); padding-bottom: var(--sp-4); border-bottom: 1px solid var(--f); }
  .modal-header h3 { color: var(--p); }
  .modal-close { background: var(--f); width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--b); font-size: 18px; }
  .modal-close:hover { background: var(--e); color: var(--p); }
  .modal-footer { margin-top: var(--sp-6); display: flex; justify-content: flex-end; gap: var(--sp-2); }
  
  /* 13. AI SUGGESTION & CARE PLAN ELEMENTS */
  .ai-suggestion { background: linear-gradient(to right, #eff6ff, #ffffff); border: 1px solid #bfdbfe; border-radius: var(--r-3); padding: var(--sp-4); margin-bottom: var(--sp-4); position: relative; transition: var(--tr); }
  .ai-suggestion:hover { border-color: var(--p-c); box-shadow: var(--sh-2); }
  .ai-suggestion::before { content: 'AI'; position: absolute; top: 12px; right: 12px; background: var(--i-c); color: var(--i); font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
  .ai-suggestion h4 { color: var(--i-c); margin-bottom: 6px; padding-right: 30px; }
  .ai-suggestion p { font-size: var(--t-1); color: var(--a); margin-bottom: 12px; }
  .ai-actions { display: flex; gap: 8px; }
  .cue-cluster { border-left: 3px solid var(--w-c); padding-left: var(--sp-4); margin-bottom: var(--sp-4); background: var(--h); padding: var(--sp-3); border-radius: var(--r-2); }
  
  /* 14. SBAR & KARDEX SPECIFIC */
  .sbar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .sbar-section { border: 1px dashed var(--e); padding: var(--sp-4); border-radius: var(--r-2); background: var(--h); }
  .sbar-section h4 { color: var(--p-c); margin-bottom: var(--sp-2); text-transform: uppercase; font-size: 12px; letter-spacing: 1px; }
  .kardex-entry { border-left: 4px solid var(--p-c); padding: var(--sp-3); background: var(--i); border-radius: var(--r-2); margin-bottom: var(--sp-2); box-shadow: var(--sh-1); }
  .kardex-entry .source-link { font-size: 11px; color: var(--c); margin-top: var(--sp-2); display: block; font-family: var(--ff-mono); }
  
  /* 15. TOOLTIPS & POPOVERS */
  .tooltip { position: relative; display: inline-block; }
  .tooltip-text { visibility: hidden; width: 120px; background: var(--p); color: var(--i); text-align: center; border-radius: var(--r-1); padding: 6px; position: absolute; z-index: var(--z-tooltip); bottom: 125%; left: 50%; margin-left: -60px; opacity: 0; transition: opacity 0.3s; font-size: 12px; box-shadow: var(--sh-2); white-space: normal; }
  .tooltip:hover .tooltip-text { visibility: visible; opacity: 1; }
  
  /* 16. NAVIGATION & BREADCRUMBS */
  .breadcrumb { display: flex; padding: var(--sp-3) 0; margin-bottom: var(--sp-4); list-style: none; background: transparent; }
  .breadcrumb-item { font-size: var(--t-1); color: var(--c); }
  .breadcrumb-item a { color: var(--p-c); text-decoration: none; }
  .breadcrumb-item a:hover { text-decoration: underline; }
  .breadcrumb-item + .breadcrumb-item::before { display: inline-block; padding-right: var(--sp-2); padding-left: var(--sp-2); color: var(--d); content: "/"; }
  .nav-tabs { border-bottom: 1px solid var(--e); display: flex; gap: var(--sp-2); margin-bottom: var(--sp-4); }
  .nav-tab { padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--c); font-size: var(--t-1); }
  .nav-tab:hover { color: var(--p-c); }
  .nav-tab.active { color: var(--p-c); border-color: var(--p-c); font-weight: 600; }
  
  /* 17. PAGINATION & UTILITY STATES */
  .pagination { display: flex; padding-left: 0; list-style: none; border-radius: var(--r-2); margin-top: var(--sp-4); justify-content: center; }
  .page-link { position: relative; display: block; padding: 8px 12px; margin-left: -1px; line-height: 1.25; color: var(--p-c); background-color: var(--i); border: 1px solid var(--e); text-decoration: none; }
  .page-link:hover { background-color: var(--g); border-color: var(--e); }
  .page-item.active .page-link { z-index: 1; color: var(--i); background-color: var(--p-c); border-color: var(--p-c); }
  .empty-state { text-align: center; padding: var(--sp-8); color: var(--c); }
  .empty-state svg { width: 64px; height: 64px; margin: 0 auto var(--sp-4); opacity: 0.5; }
  .loading-spinner { width: 24px; height: 24px; border: 3px solid var(--f); border-top-color: var(--p-c); border-radius: 50%; animation: spin 1s linear infinite; }
  @keyframes spin { to { transform: rotate(360deg); } }
  
  /* 18. RESPONSIVE MEDIA QUERIES */
  @media (max-width: 1280px) { .content-grid { grid-template-columns: 1fr; } .grid-cols-4 { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; width: 100%; }
    .mobile-menu-btn { display: flex !important; }
    .sbar-grid { grid-template-columns: 1fr; }
  }
  @media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3 { grid-template-columns: 1fr; }
    .main-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .main-header h1 { font-size: 24px; }
    .assessment-tabs { flex-direction: column; border-right: 1px solid var(--e); border-bottom: none; }
    .assessment-tab { border-bottom: none; border-right: 2px solid transparent; }
    .assessment-tab.active { border-right-color: var(--p-c); border-bottom: none; }
  }
  
  /* 19. SCROLLBARS & MISC */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: var(--h); }
  ::-webkit-scrollbar-thumb { background: var(--e); border-radius: 4px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--d); }
  .mobile-menu-btn { display: none; background: var(--p); color: var(--i); padding: 8px 12px; border-radius: var(--r-2); position: fixed; top: 16px; left: 16px; z-index: 101; box-shadow: var(--sh-2); }
  
  /* 20. PRINT STYLES (CRITICAL FOR MEDICAL RECORDS) */
  @media print {
    .sidebar, .main-header, .mobile-menu-btn, .btn, .assessment-tabs { display: none !important; }
    .main-content { margin-left: 0 !important; width: 100% !important; padding: 0 !important; background: var(--i) !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; page-break-inside: avoid; }
    body { background: var(--i) !important; color: #000 !important; }
    a { color: #000 !important; text-decoration: none !important; }
    .badge { border: 1px solid #000 !important; color: #000 !important; background: transparent !important; }
    @page { margin: 2cm; }
  }
  .main-content { margin-top: 64px; padding-top: 24px; }
@media (max-width: 1024px) {
    .global-search-bar { left: 0 !important; }
}