
        :root {
            --primary: #0f172a;
            --accent: #2563eb;
            --danger: #dc2626;
            --warning: #d97706;
            --success: #16a34a;
            --bg-light: #f8fafc;
            --card-bg: #ffffff;
            --border: #cbd5e1;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Cairo', sans-serif; }
        body { background-color: #cbd5e1; color: var(--primary); min-height: 100vh; padding: 15px; display: flex; justify-content: center; align-items: center; }

        .web-container { width: 100%; max-width: 980px; background: var(--card-bg); border-radius: 20px; box-shadow: 0 15px 35px rgba(0,0,0,0.15); overflow: hidden; border: 1px solid var(--border); }
        
        /* Navigation Switcher */
        .role-bar { background: #0f172a; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #334155; color: white; font-size: 13px; }
        .role-btn { background: #2563eb; color: white; border: none; padding: 7px 16px; border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; transition: 0.2s; }
        .role-btn:hover { background: #1d4ed8; }

        .web-header { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); color: white; padding: 20px; text-align: center; border-bottom: 4px solid var(--accent); }
        .web-header h1 { font-size: 22px; font-weight: 800; }
        .web-header p { font-size: 13px; color: #94a3b8; margin-top: 4px; }

        .content-area { padding: 22px; }

        /* Progress Bar */
        .step-progress { display: flex; justify-content: space-between; margin-bottom: 22px; position: relative; }
        .step-progress::before { content: ''; position: absolute; top: 50%; right: 5%; left: 5%; height: 2px; background: #e2e8f0; z-index: 1; transform: translateY(-50%); }
        .step-node { width: 32px; height: 32px; border-radius: 50%; background: #e2e8f0; color: #64748b; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; z-index: 2; position: relative; }
        .step-node.active { background: var(--accent); color: white; box-shadow: 0 0 10px rgba(37, 99, 235, 0.5); }
        .step-node.completed { background: var(--success); color: white; }

        .view-section { display: none; animation: fadeIn 0.3s ease forwards; }
        .view-section.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

        /* Form Controls */
        .patient-info-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; margin-bottom: 14px; }
        .form-group { margin-bottom: 10px; }
        .form-group label { display: block; font-weight: 700; font-size: 12px; margin-bottom: 4px; color: var(--primary); }
        .form-control { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 8px; font-size: 12.5px; outline: none; }
        .form-control:focus { border-color: var(--accent); }

        .chat-box { background: #f1f5f9; border-radius: 12px; padding: 12px; height: 130px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border); }
        .msg { max-width: 85%; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.4; }
        .msg.bot { background: white; color: var(--primary); align-self: flex-start; }
        .msg.user { background: var(--accent); color: white; align-self: flex-end; }

        /* Suggestion Chips */
        .chip { background: #e2e8f0; color: #334155; border: 1px solid #cbd5e1; padding: 4px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: 0.2s; user-select: none; }
        .chip:hover { background: var(--accent); color: white; border-color: var(--accent); }

        .chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
        .chat-input-row input { flex: 1; padding: 10px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 12.5px; }
        .btn-action { background: var(--accent); color: white; border: none; padding: 0 16px; border-radius: 10px; font-weight: 700; cursor: pointer; font-size: 12.5px; display: flex; align-items: center; justify-content: center; gap: 4px; }
        .btn-voice { background: #0284c7; padding: 0 12px; }

        .btn-next-stage { width: 100%; background-color: var(--success); color: white; border: none; padding: 12px; border-radius: 10px; font-weight: 700; font-size: 13.5px; cursor: pointer; margin-top: 14px; }
        .btn-back { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 12.5px; }

        /* Hospitals List */
        .hosp-card { background: white; border: 2px solid #e2e8f0; border-radius: 12px; padding: 14px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition:0.2s; }
        .hosp-card:hover { border-color: var(--accent); background: #f0f6ff; }
        .hosp-badge { background: #e0e7ff; color: #3730a3; padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; text-align: left; }
        .capacity-tag { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 11px; font-weight: 800; margin-top: 4px; }
        .cap-green { background: #dcfce7; color: #15803d; }
        .cap-red { background: #fee2e2; color: #b91c1c; }

        /* Vitals Dashboard Box */
        .vitals-box { background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: white; border-radius: 12px; padding: 14px; margin: 12px 0; border: 1px solid #334155; }
        .vitals-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; text-align: center; margin-top: 10px; }
        .vital-card { background: rgba(255,255,255,0.08); padding: 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.12); }
        .vital-value { font-size: 18px; font-weight: 800; color: #60a5fa; margin-top: 2px; }
        .vital-value.warning { color: #f87171; animation: pulse 1s infinite; }
        @keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } }

        /* Doctor & Queue Status */
        .doctor-status-badge { background: #f8fafc; border: 1.5px solid #cbd5e1; border-radius: 12px; padding: 12px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
        .status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 6px; }
        .dot-green { background: #16a34a; box-shadow: 0 0 8px #16a34a; }
        .dot-red { background: #dc2626; box-shadow: 0 0 8px #dc2626; }
        .dot-orange { background: #d97706; box-shadow: 0 0 8px #d97706; }

        .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
        .stat-card { background: white; padding: 10px; border-radius: 10px; text-align: center; border: 1px solid #e2e8f0; }
        .stat-number { font-size: 22px; font-weight: 800; color: var(--accent); margin-top: 2px; }

        /* Staff Panel Header */
        .staff-panel-header { background: #1e293b; color: white; padding: 14px 18px; border-radius: 12px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
        .badge-shift { background: #16a34a; color: white; padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; display: inline-block; }
        .badge-shift.off { background: #dc2626; }

        .department-nav { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 4px; }
        .dept-btn { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; padding: 8px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
        .dept-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

        .report-section { background: white; border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
        .report-title { font-size: 13.5px; font-weight: 800; color: var(--accent); border-bottom: 2px solid #eff6ff; padding-bottom: 6px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }

        .prescription-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
        .prescription-table th, .prescription-table td { border: 1px solid #e2e8f0; padding: 8px; text-align: right; }
        .prescription-table th { background: #f8fafc; color: #475569; }

        /* Rest Options Buttons */
        .rest-btn-group { display: flex; gap: 6px; }
        .btn-rest { background: var(--warning); color: white; border: none; padding: 5px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; cursor: pointer; }
        .btn-rest:hover { opacity: 0.9; }

        /* Modal Overlay */
        .modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 999; justify-content: center; align-items: center; padding: 15px; }
        .modal-overlay.active { display: flex; }
        .modal-box { background: white; width: 100%; max-width: 500px; border-radius: 16px; padding: 20px; border: 2px solid var(--accent); max-height: 90vh; overflow-y: auto; }
        .modal-header { font-size: 16px; font-weight: 800; color: var(--accent); margin-bottom: 12px; text-align: center; }
        .modal-body { font-size: 12.5px; color: #334155; line-height: 1.5; margin-bottom: 14px; }
        .modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
        .btn-modal-cancel { background: #e2e8f0; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }
        .btn-modal-confirm { background: var(--accent); color: white; border: none; padding: 9px 16px; border-radius: 8px; font-weight: 700; font-size: 12px; cursor: pointer; }

        @media print {
            body * { visibility: hidden; }
            #printable-prescription-area, #printable-prescription-area * { visibility: visible; }
            #printable-prescription-area { position: absolute; left: 0; top: 0; width: 100%; padding: 20px; }
        }
    