/* DigitalRx Design System - Premium Clinical Theme & White-Label Support */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --brand-primary: #0284c7;       /* Default Medical Sapphire */
    --brand-accent: #059669;        /* Default Emerald Clinical */
    --brand-primary-light: #e0f2fe;
    --brand-accent-light: #d1fae5;
    
    --clinical-dark: #0f172a;       /* Deep Slate */
    --clinical-gray-bg: #f8fafc;    /* Clean Hospital Clean Background */
    --clinical-card-bg: #ffffff;
    --clinical-border: #e2e8f0;
    --clinical-text: #1e293b;
    --clinical-muted: #64748b;
    
    --alert-critical: #e11d48;
    --alert-critical-bg: #ffe4e6;
    --alert-warning: #d97706;
    --alert-warning-bg: #fef3c7;
    --alert-success: #10b981;
    --alert-success-bg: #ecfdf5;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-soft: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
    --shadow-hover: 0 10px 25px -5px rgba(2, 132, 199, 0.12);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.04);
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--clinical-gray-bg);
    color: var(--clinical-text);
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.01em;
}

/* White-Label Dynamic Overrides */
.brand-themed {
    color: var(--brand-primary) !important;
}
.bg-brand-primary {
    background-color: var(--brand-primary) !important;
    color: #ffffff !important;
}
.btn-brand-primary {
    background: linear-gradient(135deg, var(--brand-primary) 0%, #0369a1 100%);
    border: none;
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.4rem;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    transition: all 0.2s ease-in-out;
}
.btn-brand-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.35);
    color: #ffffff;
}

/* Card Styling */
.card-rx {
    background: var(--clinical-card-bg);
    border: 1px solid var(--clinical-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-rx-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Status Badges */
.badge-status-active {
    background-color: #dcfce7;
    color: #15803d;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.78rem;
}
.badge-status-pending {
    background-color: #fef9c3;
    color: #a16207;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.78rem;
}
.badge-status-alert {
    background-color: #ffe4e6;
    color: #be123c;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    animation: pulseAlert 2s infinite;
}

@keyframes pulseAlert {
    0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(225, 29, 72, 0); }
    100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* EVA Pain Scale (0-10) Interactive Pills */
.pain-scale-container {
    display: flex;
    justify-content: space-between;
    gap: 4px;
    overflow-x: auto;
    padding: 6px 0;
}
.pain-pill {
    flex: 1;
    min-width: 32px;
    height: 44px;
    border: 1px solid var(--clinical-border);
    background: #ffffff;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.pain-pill:hover {
    border-color: var(--brand-primary);
    background: var(--brand-primary-light);
}
.pain-pill.active-mild {
    background: #10b981;
    color: white;
    border-color: #059669;
}
.pain-pill.active-moderate {
    background: #f59e0b;
    color: white;
    border-color: #d97706;
}
.pain-pill.active-severe {
    background: #ef4444;
    color: white;
    border-color: #dc2626;
}

/* Mobile PWA Shell */
.pwa-mobile-shell {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #ffffff;
    box-shadow: 0 0 35px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
}

.pwa-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--clinical-border);
    padding: 0.85rem 1.25rem;
}

.timeline-progress-bar {
    height: 8px;
    border-radius: 9999px;
    background: #e2e8f0;
    overflow: hidden;
}
.timeline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--brand-accent) 0%, var(--brand-primary) 100%);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Checklist Cards */
.task-check-card {
    background: var(--clinical-gray-bg);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}
.task-check-card.completed {
    background: var(--brand-accent-light);
    border-color: #a7f3d0;
}

/* Emergency Floating Button */
.btn-emergency {
    background: #ef4444;
    color: #ffffff;
    border-radius: 9999px;
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}
.btn-emergency:hover {
    background: #dc2626;
    color: #ffffff;
}

/* WhatsApp Share Button */
.btn-whatsapp {
    background-color: #25d366;
    color: #ffffff;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.3);
    transition: all 0.2s ease;
}
.btn-whatsapp:hover {
    background-color: #20bd5a;
    color: #ffffff;
    transform: translateY(-1px);
}
