/* HealthCore EMR – Glassmorphic Design System v3 */
/* Offline-first, native-feel clinical platform */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;
    color: #0f172a;
    background-color: #d8e4f7;
    background-image:
        radial-gradient(ellipse at 5% 5%, rgba(99,102,241,0.22) 0, transparent 45%),
        radial-gradient(ellipse at 55% 0%, rgba(139,92,246,0.16) 0, transparent 45%),
        radial-gradient(ellipse at 100% 15%, rgba(59,130,246,0.18) 0, transparent 45%),
        radial-gradient(ellipse at 95% 85%, rgba(16,185,129,0.14) 0, transparent 40%),
        radial-gradient(ellipse at 5% 95%, rgba(245,158,11,0.10) 0, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(255,255,255,0.3) 0, transparent 70%);
    background-attachment: fixed;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    letter-spacing: -0.005em;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.5); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.7); }

/* ---- Design Tokens ---- */
:root {
    --accent: #2563eb;
    --accent-light: #dbeafe;
    --accent-dark: #1d4ed8;
    --health-positive: #16a34a;
    --health-warning: #d97706;
    --health-alert: #dc2626;
    --health-neutral: #64748b;

    /* Glass surfaces */
    --glass-white: rgba(255, 255, 255, 0.76);
    --glass-white-strong: rgba(255, 255, 255, 0.92);
    --glass-white-subtle: rgba(255, 255, 255, 0.48);
    --glass-border: rgba(255, 255, 255, 0.70);
    --glass-border-subtle: rgba(255, 255, 255, 0.38);
    --glass-blur: blur(28px) saturate(190%);
    --glass-shadow: 0 4px 24px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15,23,42,0.04), inset 0 1px 0 rgba(255,255,255,0.95);
    --glass-shadow-lg: 0 16px 48px rgba(15, 23, 42, 0.11), 0 4px 8px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.95);
    --glass-shadow-xl: 0 32px 72px rgba(15, 23, 42, 0.15), 0 8px 16px rgba(15,23,42,0.08), inset 0 1px 0 rgba(255,255,255,1);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- Forms ---- */
input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0.875rem 1rem;
    border-radius: 0.875rem;
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #1e293b;
    width: 100%;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    outline: none;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 1px 3px rgba(0,0,0,0.06);
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    -webkit-appearance: none;
    appearance: none;
    padding-right: 3rem;
}
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 0.5rem;
    background: #e2e8f0;
    border-radius: 99px;
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--accent);
    margin-top: -0.5rem;
    box-shadow: 0 2px 6px rgba(37,99,235,0.4);
    cursor: pointer;
}
input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}
label {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    color: #374151;
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

/* ---- Buttons ---- */
button, .btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    border-radius: 0.875rem;
    padding: 0.875rem 1.5rem;
    transition: all var(--transition-fast);
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
button:active, .btn:active { transform: scale(0.96); box-shadow: inset 0 2px 6px rgba(0,0,0,0.08); }
button:disabled, .btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 60%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32), 0 1px 3px rgba(37,99,235,0.2), inset 0 1px 0 rgba(255,255,255,0.15);
    letter-spacing: -0.01em;
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 8px 28px rgba(37, 99, 235, 0.42), 0 2px 6px rgba(37,99,235,0.25), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 60%, #1d4ed8 100%);
}
.btn-secondary {
    background: var(--glass-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    color: #374151;
    border: 1.5px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.8);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(255,255,255,0.9);
    border-color: rgba(203,213,225,0.9);
}

/* Themed Secondary Buttons - Replacing Grey Shading */
.btn-blue-light { background: #eff6ff; color: #2563eb; border: 1.5px solid #dbeafe; }
.btn-blue-light:hover { background: #dbeafe; }

.btn-indigo-light { background: #f5f3ff; color: #4f46e5; border: 1.5px solid #e0e7ff; }
.btn-indigo-light:hover { background: #e0e7ff; }

.btn-emerald-light { background: #ecfdf5; color: #059669; border: 1.5px solid #d1fae5; }
.btn-emerald-light:hover { background: #d1fae5; }

.btn-rose-light { background: #fff1f2; color: #e11d48; border: 1.5px solid #ffe4e6; }
.btn-rose-light:hover { background: #ffe4e6; }

.btn-amber-light { background: #fffbeb; color: #d97706; border: 1.5px solid #fef3c7; }
.btn-amber-light:hover { background: #fef3c7; }

.btn-teal-light { background: #f0fdfa; color: #0d9488; border: 1.5px solid #ccfbf1; }
.btn-teal-light:hover { background: #ccfbf1; }

.btn-purple-light { background: #faf5ff; color: #9333ea; border: 1.5px solid #f3e8ff; }
.btn-purple-light:hover { background: #f3e8ff; }

.btn-violet-light { background: #f5f3ff; color: #7c3aed; border: 1.5px solid #ede9fe; }
.btn-violet-light:hover { background: #ede9fe; }

.btn-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; box-shadow: 0 4px 15px rgba(37,99,235,0.3); border: none; }
.btn-blue:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(37,99,235,0.4); transform: translateY(-1px); }

.btn-emerald { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; box-shadow: 0 4px 15px rgba(16,185,129,0.3); border: none; }
.btn-emerald:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(16,185,129,0.4); transform: translateY(-1px); }

.btn-rose { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); color: #fff; box-shadow: 0 4px 15px rgba(225,29,72,0.3); border: none; }
.btn-rose:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(225,29,72,0.4); transform: translateY(-1px); }

.btn-amber { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; box-shadow: 0 4px 15px rgba(217,119,6,0.3); border: none; }
.btn-amber:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(217,119,6,0.4); transform: translateY(-1px); }

/* badge amber/violet aliases */
.badge-amber  { background: #fef3c7; color: #92400e; }
.badge-violet { background: #ede9fe; color: #5b21b6; }

.btn-danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239,68,68,0.3);
}
.btn-success {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(34,197,94,0.3);
}

/* ---- Card System ---- */
.card {
    background: var(--glass-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    box-shadow: var(--glass-shadow);
    transition: box-shadow var(--transition-smooth), transform var(--transition-smooth), border-color var(--transition-smooth);
}
.card:hover {
    box-shadow: var(--glass-shadow-lg);
    transform: translateY(-1px);
    border-color: rgba(255,255,255,0.85);
}

.glass-card {
    background: var(--glass-white);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    box-shadow: var(--glass-shadow);
    transition: box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}
.glass-card:hover {
    border-color: rgba(255,255,255,0.88);
    box-shadow: var(--glass-shadow-lg);
}

.card-section-header {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

/* ---- Form Layouts ---- */
.form-grid { display: flex; flex-direction: column; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }

/* ---- Option Buttons (tap targets) ---- */
.option-group { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.option-btn {
    padding: 0.875rem 1.25rem;
    border-radius: 0.875rem;
    border: 1.5px solid rgba(226,232,240,0.8);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(8px);
    font-size: 0.9375rem;
    font-weight: 700;
    color: #475569;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
    text-align: center;
    min-width: 5rem;
}
.option-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(255,255,255,0.9); }
.option-btn.active, .option-btn.selected {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}

/* ---- Status Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.65rem;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    white-space: nowrap;
}
.badge-blue    { background: #dbeafe; color: #1d4ed8; }
.badge-green   { background: #dcfce7; color: #15803d; }
.badge-amber   { background: #fef3c7; color: #92400e; }
.badge-red     { background: #fee2e2; color: #b91c1c; }
.badge-purple  { background: #f3e8ff; color: #7c3aed; }
.badge-violet  { background: #ede9fe; color: #5b21b6; }
.badge-rose    { background: #ffe4e6; color: #be123c; }
.badge-teal    { background: #ccfbf1; color: #0f766e; }
.badge-slate   { background: #f1f5f9; color: #475569; }
.badge-positive { background: #dcfce7; color: #15803d; }
.badge-warning  { background: #fef3c7; color: #92400e; }

/* ---- Page Header (Glassmorphic) ---- */
.page-header {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(32px) saturate(200%);
    -webkit-backdrop-filter: blur(32px) saturate(200%);
    border-bottom: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 1px 0 rgba(226,232,240,0.5), 0 4px 16px rgba(15,23,42,0.04);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
}
.page-header h1 {
    font-size: 1.375rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0;
    letter-spacing: -0.02em;
}

/* ---- Table ---- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #64748b;
    padding: 0.875rem 1.25rem;
    background: rgba(248,250,252,0.7);
    border-bottom: 1.5px solid rgba(226,232,240,0.7);
}
.data-table td {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
    color: #334155;
    border-bottom: 1px solid rgba(241,245,249,0.8);
    transition: background var(--transition-fast);
}
.data-table tr:hover td { background: rgba(248,250,252,0.6); }
.data-table tr:last-child td { border-bottom: none; }

/* ---- Icon Containers ---- */
[data-health-icon] svg { width: 100%; height: 100%; display: block; }

/* ---- Animations ---- */
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.8); }
    60% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-up { animation: slideInUp 0.3s cubic-bezier(0.4, 0, 0.2, 1); }

/* Page entry animation */
main, .page-content { animation: pageEnter 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* QR Scanner sweep line */
@keyframes scanLine {
    0%   { top: 8px;   opacity: 1; }
    48%  { opacity: 1; }
    50%  { top: calc(100% - 8px); opacity: 0.4; }
    52%  { opacity: 1; }
    100% { top: 8px;   opacity: 1; }
}

/* Backdrop blur utility */
.backdrop-blur-sm { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.backdrop-blur    { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }

/* Modal pop animation */
@keyframes modalPop {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-modal-pop { animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---- Toast Notification System ---- */
#toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 24rem;
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 600;
    pointer-events: all;
    animation: slideInRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}
.toast-icon { flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-top: 0.05rem; }
.toast-content { flex: 1; }
.toast-title { font-weight: 800; font-size: 0.875rem; margin-bottom: 0.1rem; }
.toast-message { font-size: 0.8125rem; opacity: 0.8; line-height: 1.4; }
.toast.success { border-left: 3px solid #22c55e; }
.toast.error   { border-left: 3px solid #ef4444; }
.toast.warning { border-left: 3px solid #f59e0b; }
.toast.info    { border-left: 3px solid #3b82f6; }

/* Inline-toast animations (used by JS-generated toasts) */
@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(40px); }
}
@keyframes toastProgress {
    from { width: 100%; }
    to   { width: 0; }
}


/* ---- Offline Indicator ---- */
#offline-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #94a3b8;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    z-index: 9998;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
#offline-bar.visible { transform: translateY(0); }
#offline-bar .offline-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: #ef4444; animation: pulse 1.5s infinite; }

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Display */
.hidden   { display: none !important; }
.block    { display: block; }
.flex     { display: flex; }
.inline-flex { display: inline-flex; }
.grid     { display: grid; }
.contents { display: contents; }

/* Flexbox */
.flex-col     { flex-direction: column; }
.flex-row     { flex-direction: row; }
.flex-wrap    { flex-wrap: wrap; }
.flex-1       { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-start  { align-items: flex-start; }
.items-center { align-items: center; }
.items-end    { align-items: flex-end; }
.justify-start   { justify-content: flex-start; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.self-start   { align-self: flex-start; }

/* Gap */
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-5  { gap: 1.25rem; }
.gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.gap-10 { gap: 2.5rem; }

/* Grid columns */
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Grid col spans */
.col-span-2 { grid-column: span 2; }
.col-span-full { grid-column: 1 / -1; }

/* Space-y */
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Position */
.static   { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed    { position: fixed; }
.sticky   { position: sticky; }

/* Inset */
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0   { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0  { left: 0; }

/* Z-index */
.z-0  { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden  { overflow: hidden; }
.overflow-auto    { overflow: auto; }
.overflow-y-auto  { overflow-y: auto; }
.overflow-x-auto  { overflow-x: auto; }

/* Width */
.w-2  { width: 0.5rem; }
.w-3  { width: 0.75rem; }
.w-4  { width: 1rem; }
.w-5  { width: 1.25rem; }
.w-6  { width: 1.5rem; }
.w-7  { width: 1.75rem; }
.w-8  { width: 2rem; }
.w-9  { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-14 { width: 3.5rem; }
.w-16 { width: 4rem; }
.w-20 { width: 5rem; }
.w-24 { width: 6rem; }
.w-full { width: 100%; }
.w-screen { width: 100vw; }
.w-auto { width: auto; }

/* Height */
.h-2  { height: 0.5rem; }
.h-3  { height: 0.75rem; }
.h-4  { height: 1rem; }
.h-5  { height: 1.25rem; }
.h-6  { height: 1.5rem; }
.h-7  { height: 1.75rem; }
.h-8  { height: 2rem; }
.h-9  { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-20 { height: 5rem; }
.h-24 { height: 6rem; }
.h-28 { height: 7rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

/* Min/Max */
.min-h-0      { min-height: 0; }
.min-h-screen { min-height: 100vh; }
.max-w-xs  { max-width: 20rem; }
.max-w-sm  { max-width: 24rem; }
.max-w-md  { max-width: 28rem; }
.max-w-lg  { max-width: 32rem; }
.max-w-xl  { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

/* Margin */
.mx-auto  { margin-left: auto; margin-right: auto; }
.ml-auto  { margin-left: auto; }
.m-0  { margin: 0; }
.mt-0  { margin-top: 0; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1  { margin-top: 0.25rem; }
.mt-2  { margin-top: 0.5rem; }
.mt-3  { margin-top: 0.75rem; }
.mt-4  { margin-top: 1rem; }
.mt-5  { margin-top: 1.25rem; }
.mt-6  { margin-top: 1.5rem; }
.mt-8  { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-0  { margin-bottom: 0; }
.mb-1  { margin-bottom: 0.25rem; }
.mb-2  { margin-bottom: 0.5rem; }
.mb-3  { margin-bottom: 0.75rem; }
.mb-4  { margin-bottom: 1rem; }
.mb-5  { margin-bottom: 1.25rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.ml-1  { margin-left: 0.25rem; }
.ml-2  { margin-left: 0.5rem; }
.mr-1  { margin-right: 0.25rem; }
.mr-2  { margin-right: 0.5rem; }

/* Padding */
.p-0  { padding: 0; }
.p-2  { padding: 0.5rem; }
.p-3  { padding: 0.75rem; }
.p-4  { padding: 1rem; }
.p-5  { padding: 1.25rem; }
.p-6  { padding: 1.5rem; }
.p-8  { padding: 2rem; }
.p-10 { padding: 2.5rem; }
.p-12 { padding: 3rem; }
.p-20 { padding: 5rem; }
.px-2  { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3  { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4  { padding-left: 1rem; padding-right: 1rem; }
.px-5  { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6  { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8  { padding-left: 2rem; padding-right: 2rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1  { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2  { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3  { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4  { padding-top: 1rem; padding-bottom: 1rem; }
.py-5  { padding-top: 1.25rem; padding-bottom: 1.25rem; }
.py-6  { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8  { padding-top: 2rem; padding-bottom: 2rem; }
.py-10 { padding-top: 2.5rem; padding-bottom: 2.5rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.pt-0  { padding-top: 0; }
.pb-4  { padding-bottom: 1rem; }
.pb-6  { padding-bottom: 1.5rem; }
.pb-8  { padding-bottom: 2rem; }
.pb-16 { padding-bottom: 4rem; }
.pb-24 { padding-bottom: 6rem; }
.pb-32 { padding-bottom: 8rem; }
.pb-40 { padding-bottom: 10rem; }

/* Typography */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

.text-\[9px\]  { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs   { font-size: 0.75rem; }
.text-sm   { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg   { font-size: 1.125rem; }
.text-xl   { font-size: 1.25rem; }
.text-2xl  { font-size: 1.5rem; }
.text-3xl  { font-size: 1.875rem; }
.text-4xl  { font-size: 2.25rem; }
.text-5xl  { font-size: 3rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }

.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }

.italic { font-style: italic; }
.not-italic { font-style: normal; }

.uppercase   { text-transform: uppercase; }
.lowercase   { text-transform: lowercase; }
.capitalize  { text-transform: capitalize; }
.normal-case { text-transform: none; }

.tracking-tight   { letter-spacing: -0.025em; }
.tracking-normal  { letter-spacing: 0; }
.tracking-wide    { letter-spacing: 0.025em; }
.tracking-wider   { letter-spacing: 0.05em; }
.tracking-widest  { letter-spacing: 0.1em; }
.tracking-\[0\.2em\] { letter-spacing: 0.2em; }
.tracking-\[0\.05em\] { letter-spacing: 0.05em; }

.leading-none    { line-height: 1; }
.leading-tight   { line-height: 1.25; }
.leading-snug    { line-height: 1.375; }
.leading-normal  { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }
.leading-loose   { line-height: 2; }

.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical; }
.line-clamp-2 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.line-clamp-3 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whitespace-nowrap { white-space: nowrap; }
.break-words { overflow-wrap: break-word; }

/* Colors – Text */
.text-white      { color: #ffffff; }
.text-slate-300  { color: #cbd5e1; }
.text-slate-400  { color: #94a3b8; }
.text-slate-500  { color: #64748b; }
.text-slate-600  { color: #475569; }
.text-slate-700  { color: #334155; }
.text-slate-800  { color: #1e293b; }
.text-slate-900  { color: #0f172a; }
.text-blue-400   { color: #60a5fa; }
.text-blue-500   { color: #3b82f6; }
.text-blue-600   { color: #2563eb; }
.text-blue-700   { color: #1d4ed8; }
.text-indigo-600 { color: #4f46e5; }
.text-violet-600 { color: #7c3aed; }
.text-violet-700 { color: #6d28d9; }
.text-purple-600 { color: #9333ea; }
.text-rose-400   { color: #fb7185; }
.text-rose-600   { color: #e11d48; }
.text-red-400    { color: #f87171; }
.text-red-500    { color: #ef4444; }
.text-red-600    { color: #dc2626; }
.text-amber-400  { color: #fbbf24; }
.text-amber-600  { color: #d97706; }
.text-orange-600 { color: #ea580c; }
.text-emerald-500 { color: #10b981; }
.text-emerald-600 { color: #059669; }
.text-teal-600   { color: #0d9488; }
.text-green-600  { color: #16a34a; }
.text-positive   { color: var(--health-positive); }
.text-warning    { color: var(--health-warning); }
.text-alert      { color: var(--health-alert); }

/* Colors – Background */
.bg-white      { background-color: #ffffff; }
.bg-transparent { background-color: transparent; }
.bg-slate-50   { background-color: #f8fafc; }
.bg-slate-100  { background-color: #f1f5f9; }
.bg-blue-50    { background-color: #eff6ff; }
.bg-blue-100   { background-color: #dbeafe; }
.bg-blue-600   { background-color: #2563eb; }
.bg-indigo-50  { background-color: #eef2ff; }
.bg-violet-50  { background-color: #f5f3ff; }
.bg-violet-600 { background-color: #7c3aed; }
.bg-purple-50  { background-color: #faf5ff; }
.bg-rose-50    { background-color: #fff1f2; }
.bg-rose-600   { background-color: #e11d48; }
.bg-red-50     { background-color: #fef2f2; }
.bg-amber-50   { background-color: #fffbeb; }
.bg-orange-50  { background-color: #fff7ed; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-teal-50    { background-color: #f0fdfa; }
.bg-teal-600   { background-color: #0d9488; }
.bg-green-50   { background-color: #f0fdf4; }

/* Semi-transparent backgrounds */
.bg-white\/40  { background-color: rgba(255,255,255,0.40); }
.bg-white\/50  { background-color: rgba(255,255,255,0.50); }
.bg-white\/60  { background-color: rgba(255,255,255,0.60); }
.bg-white\/80  { background-color: rgba(255,255,255,0.80); }
.bg-blue-50\/30   { background-color: rgba(239,246,255,0.30); }
.bg-rose-50\/20   { background-color: rgba(255,241,242,0.20); }
.bg-rose-50\/30   { background-color: rgba(255,241,242,0.30); }
.bg-blue-50\/50   { background-color: rgba(239,246,255,0.50); }
.bg-teal-50\/10   { background-color: rgba(240,253,250,0.10); }
.bg-slate-50\/50  { background-color: rgba(248,250,252,0.50); }
.bg-slate-50\/60  { background-color: rgba(248,250,252,0.60); }
.bg-positive { background: var(--health-positive); color: #fff; }
.bg-warning  { background: var(--health-warning); color: #431407; }
.bg-alert    { background: var(--health-alert); color: #fff; }

/* Borders */
.border      { border-width: 1px; border-style: solid; }
.border-0    { border-width: 0; }
.border-2    { border-width: 2px; border-style: solid; }
.border-4    { border-width: 4px; border-style: solid; }
.border-t    { border-top-width: 1px; border-top-style: solid; }
.border-b    { border-bottom-width: 1px; border-bottom-style: solid; }
.border-l    { border-left-width: 1px; border-left-style: solid; }
.border-r    { border-right-width: 1px; border-right-style: solid; }
.border-dashed { border-style: dashed; }

.border-transparent      { border-color: transparent; }
.border-white\/40        { border-color: rgba(255,255,255,0.40); }
.border-white\/50        { border-color: rgba(255,255,255,0.50); }
.border-slate-100        { border-color: #f1f5f9; }
.border-slate-200        { border-color: #e2e8f0; }
.border-slate-300        { border-color: #cbd5e1; }
.border-blue-100         { border-color: #dbeafe; }
.border-blue-200         { border-color: #bfdbfe; }
.border-indigo-100       { border-color: #e0e7ff; }
.border-violet-100       { border-color: #ede9fe; }
.border-violet-200       { border-color: #ddd6fe; }
.border-purple-100       { border-color: #f3e8ff; }
.border-rose-100         { border-color: #ffe4e6; }
.border-rose-200         { border-color: #fecdd3; }
.border-rose-300         { border-color: #fda4af; }
.border-rose-500         { border-color: #f43f5e; }
.border-red-100          { border-color: #fee2e2; }
.border-amber-100        { border-color: #fef3c7; }
.border-amber-200        { border-color: #fde68a; }
.border-orange-100       { border-color: #ffedd5; }
.border-emerald-100      { border-color: #d1fae5; }
.border-emerald-200      { border-color: #a7f3d0; }
.border-teal-100         { border-color: #ccfbf1; }
.border-teal-200         { border-color: #99f6e4; }

/* Border radius */
.rounded     { border-radius: 0.25rem; }
.rounded-md  { border-radius: 0.375rem; }
.rounded-lg  { border-radius: 0.5rem; }
.rounded-xl  { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* Shadows */
.shadow-sm  { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.shadow     { box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06); }
.shadow-md  { box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06); }
.shadow-lg  { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05); }
.shadow-xl  { box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
.shadow-none { box-shadow: none; }
.shadow-\[0_20px_50px_rgba\(0\,0\,0\,0\.1\)\] { box-shadow: 0 20px 50px rgba(0,0,0,0.1); }

/* Ring / Focus ring */
.ring-4 { box-shadow: 0 0 0 4px rgba(37,99,235,0.12); }
.ring-blue-500\/10 { box-shadow: 0 0 0 4px rgba(59,130,246,0.1); }

/* Opacity */
.opacity-0   { opacity: 0; }
.opacity-10  { opacity: 0.1; }
.opacity-20  { opacity: 0.2; }
.opacity-30  { opacity: 0.3; }
.opacity-40  { opacity: 0.4; }
.opacity-50  { opacity: 0.5; }
.opacity-60  { opacity: 0.6; }
.opacity-70  { opacity: 0.7; }
.opacity-80  { opacity: 0.8; }
.opacity-90  { opacity: 0.9; }
.opacity-100 { opacity: 1; }

/* Cursor */
.cursor-pointer    { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }
.cursor-default    { cursor: default; }

/* User select */
.user-select-none { user-select: none; }
.select-none { user-select: none; }

/* Transitions */
.transition-all      { transition: all var(--transition-smooth); }
.transition-colors   { transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast); }
.transition-opacity  { transition: opacity var(--transition-fast); }
.transition-transform { transition: transform var(--transition-smooth); }

/* Transform */
.-translate-y-1   { transform: translateY(-0.25rem); }
.-translate-y-2   { transform: translateY(-0.5rem); }
.translate-x-1    { transform: translateX(0.25rem); }
.scale-95         { transform: scale(0.95); }
.scale-100        { transform: scale(1); }

/* Backdrop filter */
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-lg { backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.backdrop-blur-xl { backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }

/* Filter / image */
.filter     { filter: var(--filter, none); }
.drop-shadow-sm { filter: drop-shadow(0 1px 1px rgba(0,0,0,0.05)); }
.drop-shadow-md { filter: drop-shadow(0 4px 3px rgba(0,0,0,0.07)) drop-shadow(0 2px 2px rgba(0,0,0,0.06)); }
.object-contain { object-fit: contain; }
.object-cover   { object-fit: cover; }

/* Misc */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }
.pointer-events-none { pointer-events: none; }

/* Pseudo-class variants (last:) */
.last\:border-0:last-child { border-width: 0; }
.last\:mb-0:last-child { margin-bottom: 0; }

/* has-[:checked] for checkbox labels */
.has-\[\:checked\]\:bg-rose-50:has(:checked)    { background-color: rgba(255,241,242,0.8); }
.has-\[\:checked\]\:border-rose-500:has(:checked) { border-color: #f43f5e; }

/* ========================================
   RESPONSIVE GRID
   ======================================== */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .sm\:flex-row    { flex-direction: row; }
    .sm\:hidden      { display: none; }
    .sm\:block       { display: block; }
    .sm\:flex        { display: flex; }
    .sm\:col-span-2  { grid-column: span 2; }
    .sm\:col-span-1  { grid-column: span 1; }
    .sm\:p-6         { padding: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .md\:col-span-2  { grid-column: span 2; }
    .md\:col-span-1  { grid-column: span 1; }
    .md\:hidden      { display: none; }
    .md\:block       { display: block; }
    .md\:flex        { display: flex; }
    .hidden.md\:flex { display: flex; }
    .md\:p-10        { padding: 2.5rem; }
    .md\:items-end   { align-items: flex-end; }
    .md\:flex-row    { flex-direction: row; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg\:hidden      { display: none; }
    .lg\:block       { display: block; }
    .lg\:flex        { display: flex; }
    .form-grid-2-desktop { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Hide on mobile, show on larger screens */
@media (max-width: 767px) {
    .hidden.md\:flex { display: none; }
    .hidden.md\:block { display: none; }
}

/* ========================================
   HOVER VARIANTS
   ======================================== */
.hover\:-translate-y-2:hover    { transform: translateY(-0.5rem); }
.hover\:translate-x-1:hover     { transform: translateX(0.25rem); }
.hover\:shadow-\[0_20px_50px_rgba\(0\,0\,0\,0\.1\)\]:hover { box-shadow: 0 20px 50px rgba(0,0,0,0.1); }
.hover\:border-rose-300:hover   { border-color: #fda4af; }
.hover\:border-amber-200:hover  { border-color: #fde68a; }
.hover\:border-teal-200:hover   { border-color: #99f6e4; }
.hover\:bg-red-50:hover         { background-color: #fef2f2; }
.hover\:border-red-200:hover    { border-color: #fecaca; }
.hover\:text-red-500:hover      { color: #ef4444; }
.hover\:bg-slate-50\/50:hover   { background-color: rgba(248,250,252,0.5); }
.group:hover .group-hover\:text-white   { color: #fff; }
.group:hover .group-hover\:bg-blue-600  { background-color: #2563eb; }
.group:hover .group-hover\:shadow-lg    { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.group:hover .group-hover\:opacity-100  { opacity: 1; }
.group:hover .group-hover\:translate-x-1 { transform: translateX(0.25rem); }

/* ========================================
   MODULE COLOR SYSTEM (replaces dynamic Tailwind)
   ======================================== */
.module-icon-blue     { background-color: #eff6ff; color: #2563eb; }
.module-icon-emerald  { background-color: #ecfdf5; color: #047857; }
.module-icon-violet   { background-color: #f5f3ff; color: #7c3aed; }
.module-icon-amber    { background-color: #fffbeb; color: #b45309; }
.module-icon-rose     { background-color: #fff1f2; color: #be123c; }
.module-icon-indigo   { background-color: #eef2ff; color: #4f46e5; }
.module-icon-teal     { background-color: #f0fdfa; color: #0f766e; }
.module-icon-purple   { background-color: #faf5ff; color: #9333ea; }
.module-icon-pink     { background-color: #fce7f3; color: #be185d; }

.group:hover .module-icon-blue    { background-color: #2563eb; color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,0.35); }
.group:hover .module-icon-emerald { background-color: #047857; color: #fff; box-shadow: 0 6px 18px rgba(5,150,105,0.35); }
.group:hover .module-icon-violet  { background-color: #7c3aed; color: #fff; box-shadow: 0 6px 18px rgba(124,58,237,0.35); }
.group:hover .module-icon-amber   { background-color: #92400e; color: #fff; box-shadow: 0 6px 18px rgba(146,64,14,0.35); }
.group:hover .module-icon-rose    { background-color: #e11d48; color: #fff; box-shadow: 0 6px 18px rgba(225,29,72,0.35); }
.group:hover .module-icon-indigo  { background-color: #4f46e5; color: #fff; box-shadow: 0 6px 18px rgba(79,70,229,0.35); }
.group:hover .module-icon-teal    { background-color: #0f766e; color: #fff; box-shadow: 0 6px 18px rgba(13,148,136,0.35); }
.group:hover .module-icon-purple  { background-color: #9333ea; color: #fff; box-shadow: 0 6px 18px rgba(147,51,234,0.35); }
.group:hover .module-icon-pink    { background-color: #be185d; color: #fff; box-shadow: 0 6px 18px rgba(190,24,93,0.35); }

/* Add missing slate module icon */
.module-icon-slate   { background-color: #f1f5f9; color: #475569; }
.group:hover .module-icon-slate { background-color: #475569; color: #fff; box-shadow: 0 6px 18px rgba(71,85,105,0.35); }
.module-label-slate  { color: #475569; }

.module-label-blue    { color: #2563eb; }
.module-label-emerald { color: #059669; }
.module-label-violet  { color: #7c3aed; }
.module-label-amber   { color: #92400e; }
.module-label-rose    { color: #e11d48; }
.module-label-indigo  { color: #4f46e5; }
.module-label-teal    { color: #0d9488; }
.module-label-purple  { color: #9333ea; }
.module-label-pink    { color: #be185d; }

/* ========================================
   CLINICAL COLOR HELPERS
   ======================================== */

/* ========================================
   GROUP UTILITIES (for dashboard cards)
   ======================================== */
.group { position: relative; }
.group-hover\:text-blue-700 { color: #1d4ed8; }



/* ──── Form Validation Styles ───────────────────────────────────────────── */

/* Focus state errors (real-time feedback when user gets it wrong) */
input:not(:placeholder-shown):focus:invalid, 
textarea:not(:placeholder-shown):focus:invalid {
    border-color: #ef4444;
    background-color: rgba(254, 226, 226, 0.4);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

/* Focus state success */
input:not(:placeholder-shown):focus:valid {
    border-color: #22c55e;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15);
}

/* Validated Form class (added via JS on submit attempt or blur) */
.was-validated input:invalid, 
.was-validated select:invalid, 
.was-validated textarea:invalid {
    border-color: #ef4444;
    background-color: rgba(254, 226, 226, 0.3);
    color: #991b1b;
}

.was-validated input:valid:not(:placeholder-shown), 
.was-validated select:valid:not([value=""]) {
    border-color: #22c55e;
}

/* Visual cues for required fields */
label > .req {
    color: #ef4444;
    font-weight: 900;
    margin-left: 2px;
}

/* Validation Tooltip / Message */
.validation-tip {
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 800;
    margin-top: 4px;
    display: none;
    animation: slideUp 0.2s ease-out;
}

.was-validated *:invalid ~ .validation-tip {
    display: flex;
    align-items: center;
    gap: 4px;
}

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

/* ── Extra hover utilities ─────────────────────── */
.hover\:bg-blue-100:hover       { background-color: #dbeafe; }
.hover\:bg-blue-50:hover        { background-color: #eff6ff; }
.hover\:bg-indigo-100:hover     { background-color: #e0e7ff; }
.hover\:bg-rose-100:hover       { background-color: #ffe4e6; }
.hover\:text-blue-600:hover     { color: #2563eb; }
.hover\:text-indigo-600:hover   { color: #4f46e5; }
.hover\:text-rose-600:hover     { color: #e11d48; }
.hover\:bg-rose-50:hover        { background-color: #fff1f2; }
.hover\:text-rose-500:hover     { color: #f43f5e; }
.hover\:scale-110:hover         { transform: scale(1.1); }
.hover\:shadow-xl:hover         { box-shadow: 0 20px 50px rgba(0,0,0,0.12); }
.hover\:border-blue-200:hover   { border-color: #bfdbfe; }
.hover\:border-indigo-200:hover { border-color: #c7d2fe; }
.active\:scale-95:active        { transform: scale(0.95); }

/* ── Focus-visible ring for keyboard nav ───────── */
a:focus-visible, button:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 3px;
    border-radius: 0.5rem;
}

/* ── Selection color ───────────────────────────── */
::selection { background: rgba(37,99,235,0.18); color: #1e3a8a; }
