        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        :root {
            --primary-blue: #2563eb;
            --secondary-blue: #1e40af;
            --light-blue: #dbeafe;
            --dark-blue: #1e3a8a;
            --text-primary: #1f2937;
            --text-secondary: #6b7280;
            --bg-gray: #f9fafb;
            --border-color: #e5e7eb;
            --white: #ffffff;
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
            background: var(--bg-gray);
            color: var(--text-primary);
            line-height: 1.6;
        }

        .sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: 260px;
            height: 100vh;
            background: var(--white);
            border-right: 1px solid var(--border-color);
            padding: 30px 0;
            overflow-y: auto;
        }

        .logo {
            padding: 0 30px 30px;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 30px;
        }

        .logo h2 {
            color: var(--primary-blue);
            font-size: 20px;
            font-weight: 600;
            letter-spacing: -0.5px;
        }

        .nav-menu {
            padding: 0 15px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            margin-bottom: 5px;
            color: var(--text-secondary);
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.2s;
            font-size: 14px;
            font-weight: 500;
        }

        .nav-item:hover {
            background: var(--bg-gray);
            color: var(--text-primary);
        }

        .nav-item.active {
            background: var(--light-blue);
            color: var(--primary-blue);
        }

        .nav-icon {
            width: 20px;
            margin-right: 12px;
            font-size: 18px;
        }

        .main-content {
            margin-left: 260px;
            min-height: 100vh;
        }

        .topbar {
            background: var(--white);
            border-bottom: 1px solid var(--border-color);
            padding: 20px 40px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .topbar-left h1 {
            font-size: 24px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .topbar-left p {
            font-size: 14px;
            color: var(--text-secondary);
            margin-top: 2px;
        }

        .user-profile {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--primary-blue);
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
        }

        .user-info h3 {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .user-info p {
            font-size: 12px;
            color: var(--text-secondary);
        }

        .content-wrapper {
            padding: 40px;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .stats-row {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 24px;
            margin-bottom: 40px;
        }

        .stat-card {
            background: var(--white);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 24px;
        }

        .stat-label {
            font-size: 13px;
            color: var(--text-secondary);
            font-weight: 500;
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .stat-value {
            font-size: 32px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .section-header {
            margin-bottom: 24px;
        }

        .section-title {
            font-size: 18px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .section-subtitle {
            font-size: 14px;
            color: var(--text-secondary);
        }

        .card {
            background: var(--white);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 24px;
            margin-bottom: 16px;
        }

        .card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 16px;
        }

        .card-title {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }

        .card-subtitle {
            font-size: 13px;
            color: var(--text-secondary);
        }

        .badge {
            display: inline-block;
            padding: 4px 12px;
            border-radius: 12px;
            font-size: 12px;
            font-weight: 500;
        }

        .badge-blue { background: #dbeafe; color: #1e40af; }
        .badge-green { background: #d1fae5; color: #065f46; }
        .badge-yellow { background: #fef3c7; color: #92400e; }
        .badge-red { background: #fee2e2; color: #991b1b; }
        .badge-gray { background: #f3f4f6; color: #374151; }

        .info-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 16px;
            margin-bottom: 16px;
        }

        .info-item {
            font-size: 14px;
        }

        .info-label {
            color: var(--text-secondary);
            margin-bottom: 2px;
        }

        .info-value {
            color: var(--text-primary);
            font-weight: 500;
        }

        .btn-group {
            display: flex;
            gap: 10px;
            margin-top: 16px;
        }

        .btn {
            padding: 10px 20px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-primary {
            background: var(--primary-blue);
            color: white;
        }

        .btn-primary:hover {
            background: var(--secondary-blue);
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-primary);
        }

        .btn-outline:hover {
            background: var(--bg-gray);
        }

        .btn-danger {
            background: transparent;
            border: 1px solid #ef4444;
            color: #ef4444;
        }

        .btn-danger:hover {
            background: #fef2f2;
        }

        .form-group {
            margin-bottom: 24px;
        }

        .form-label {
            display: block;
            font-size: 14px;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 8px;
        }

        .form-control {
            width: 100%;
            padding: 10px 14px;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            font-size: 14px;
            transition: all 0.2s;
            font-family: inherit;
        }

        .form-control:focus {
            outline: none;
            border-color: var(--primary-blue);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .prescription-box {
            background: var(--bg-gray);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 16px;
            margin-top: 12px;
        }

        .prescription-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 12px;
        }

        .medicine-item {
            padding: 10px 0;
            border-bottom: 1px solid var(--border-color);
            font-size: 14px;
        }

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

        .medicine-name {
            font-weight: 600;
            color: var(--text-primary);
        }

        .medicine-dosage {
            color: var(--text-secondary);
            margin-top: 2px;
        }

        .note-box {
            background: #eff6ff;
            border-left: 3px solid var(--primary-blue);
            padding: 12px;
            border-radius: 4px;
            margin-top: 12px;
            font-size: 13px;
            color: var(--text-primary);
        }

        .table-wrapper {
            overflow-x: auto;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        th {
            text-align: left;
            padding: 12px;
            border-bottom: 2px solid var(--border-color);
            font-weight: 600;
            color: var(--text-secondary);
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        td {
            padding: 16px 12px;
            border-bottom: 1px solid var(--border-color);
        }

        @media (max-width: 1024px) {
            .sidebar {
                transform: translateX(-100%);
            }

            .main-content {
                margin-left: 0;
            }

            .stats-row {
                grid-template-columns: repeat(2, 1fr);
            }

            .info-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 640px) {
            .topbar {
                padding: 15px 20px;
            }

            .content-wrapper {
                padding: 20px;
            }

            .stats-row {
                grid-template-columns: 1fr;
            }
        }

        /* Modal & Report Enhancements */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 23, 42, 0.6);
            backdrop-filter: blur(4px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 20px;
        }
        .modal-overlay.active {
            display: flex;
        }
        .modal-card {
            background: #ffffff;
            border-radius: 16px;
            max-width: 620px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            padding: 28px;
            position: relative;
            animation: modalSlideIn 0.25s ease-out;
        }
        @keyframes modalSlideIn {
            from { opacity: 0; transform: translateY(20px) scale(0.97); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border-bottom: 1px solid #e2e8f0;
            padding-bottom: 16px;
            margin-bottom: 20px;
        }
        .modal-header h3 {
            font-size: 1.25rem;
            font-weight: 700;
            color: #1e293b;
            margin: 0;
        }
        .modal-close-btn {
            background: none;
            border: none;
            font-size: 1.5rem;
            line-height: 1;
            color: #94a3b8;
            cursor: pointer;
            padding: 4px;
        }
        .modal-close-btn:hover {
            color: #1e293b;
        }
        .report-param-table {
            width: 100%;
            border-collapse: collapse;
            margin: 16px 0;
            font-size: 0.9rem;
        }
        .report-param-table th, .report-param-table td {
            padding: 10px 12px;
            border-bottom: 1px solid #e2e8f0;
            text-align: left;
        }
        .report-param-table th {
            background: #f8fafc;
            color: #64748b;
            font-weight: 600;
        }

        /* Access Locked Screen when not logged in */
        body.auth-locked .sidebar,
        body.auth-locked .main-content {
            display: none !important;
        }
        .auth-locked-screen {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: #f1f5f9;
            z-index: 99999;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 24px;
        }
        .auth-locked-card {
            background: #ffffff;
            max-width: 500px;
            width: 100%;
            padding: 44px 32px;
            border-radius: 16px;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
            text-align: center;
            border: 1px solid #e2e8f0;
            animation: modalFadeIn 0.3s ease;
        }
        .auth-locked-icon {
            font-size: 2.8rem;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #eff6ff;
            width: 76px;
            height: 76px;
            border-radius: 50%;
        }
        .auth-locked-card h2 {
            font-size: 1.5rem;
            font-weight: 700;
            color: #1e293b;
            margin-bottom: 12px;
        }
        .auth-locked-card p {
            color: #64748b;
            font-size: 0.95rem;
            line-height: 1.55;
            margin-bottom: 24px;
        }
        .auth-locked-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .btn-auth-primary {
            background: #2563eb;
            color: #ffffff;
            font-weight: 600;
            padding: 13px 20px;
            border-radius: 8px;
            text-decoration: none;
            transition: all 0.2s;
        }
        .btn-auth-primary:hover {
            background: #1d4ed8;
            transform: translateY(-1px);
        }
        .btn-auth-secondary {
            background: #f1f5f9;
            color: #475569;
            font-weight: 600;
            padding: 13px 20px;
            border-radius: 8px;
            text-decoration: none;
            transition: all 0.2s;
        }
        .btn-auth-secondary:hover {
            background: #e2e8f0;
        }
        .auth-redirect-hint {
            font-size: 0.85rem !important;
            color: #94a3b8 !important;
            margin-top: 18px !important;
            margin-bottom: 0 !important;
        }