/* ============================================
   PRESCRIPTION COMPONENT - Modern Medical UI
   ============================================ */

@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

/* ============================================
   DESIGN TOKENS (CSS Custom Properties)
   ============================================ */

.rx-container {
    --rx-primary: #4f46e5;
    --rx-primary-light: #818cf8;
    --rx-primary-lighter: #e0e7ff;
    --rx-primary-bg: #eef2ff;
    --rx-primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);

    --rx-success: #059669;
    --rx-success-light: #d1fae5;
    --rx-danger: #dc2626;
    --rx-danger-light: #fee2e2;
    --rx-warning: #d97706;
    --rx-warning-light: #fef3c7;

    --rx-surface: #ffffff;
    --rx-surface-hover: #f8fafc;
    --rx-bg: #f1f5f9;
    --rx-bg-subtle: #f8fafc;

    --rx-text: #0f172a;
    --rx-text-secondary: #475569;
    --rx-text-muted: #94a3b8;
    --rx-border: #e2e8f0;
    --rx-border-light: #f1f5f9;

    --rx-radius-sm: 8px;
    --rx-radius-md: 12px;
    --rx-radius-lg: 16px;
    --rx-radius-xl: 20px;
    --rx-radius-full: 9999px;

    --rx-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --rx-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --rx-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
    --rx-shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.12), 0 8px 20px rgba(15, 23, 42, 0.06);

    --rx-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CONTAINER
   ============================================ */

.rx-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--rx-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   HEADER
   ============================================ */

.rx-header {
    position: relative;
    background: var(--rx-surface);
    border-bottom: 1px solid var(--rx-border);
    box-shadow: var(--rx-shadow-sm);
}

.rx-header-accent {
    height: 3px;
    background: var(--rx-primary-gradient);
}

.rx-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    min-height: 64px;
}

.rx-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.rx-header-brand {
    width: 44px;
    height: 44px;
    background: var(--rx-primary-gradient);
    border-radius: var(--rx-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.rx-header-brand .material-icons {
    font-size: 24px;
    color: white;
}

.rx-header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rx-header-title h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rx-text);
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.rx-header-subtitle {
    font-size: 0.8125rem;
    color: var(--rx-text-muted);
    line-height: 1.2;
}

.rx-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rx-item-count {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--rx-primary-bg);
    border-radius: var(--rx-radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rx-primary);
}

.rx-item-count .material-icons {
    font-size: 16px;
}

/* ============================================
   SUCCESS TOAST
   ============================================ */

.rx-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 0.8125rem;
    font-weight: 500;
    animation: rx-toast-in 0.3s ease-out;
}

.rx-toast .material-icons {
    font-size: 18px;
}

.rx-toast-success {
    background: var(--rx-success-light);
    color: var(--rx-success);
    border-bottom: 1px solid #a7f3d0;
}

@keyframes rx-toast-in {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   BUTTONS
   ============================================ */

.rx-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1px solid var(--rx-border);
    border-radius: var(--rx-radius-sm);
    background: var(--rx-surface);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--rx-text-secondary);
    cursor: pointer;
    transition: all var(--rx-transition);
    font-family: inherit;
    line-height: 1;
}

.rx-btn .material-icons {
    font-size: 18px;
}

.rx-btn:hover:not(:disabled) {
    background: var(--rx-surface-hover);
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: var(--rx-shadow-sm);
}

.rx-btn:active:not(:disabled) {
    transform: translateY(0);
}

.rx-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.rx-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--rx-text-muted);
}

.rx-btn-ghost:hover:not(:disabled) {
    background: var(--rx-bg);
    color: var(--rx-text-secondary);
    border-color: transparent;
}

.rx-btn-outline {
    background: var(--rx-surface);
    border-color: var(--rx-border);
    color: var(--rx-text-secondary);
}

.rx-btn-outline:hover:not(:disabled) {
    border-color: var(--rx-primary-light);
    color: var(--rx-primary);
    background: var(--rx-primary-bg);
}

.rx-btn-primary {
    background: var(--rx-primary-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.rx-btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    background: var(--rx-primary-gradient);
    border-color: transparent;
}

.rx-btn-add {
    background: var(--rx-primary-gradient);
    border-color: transparent;
    color: white;
    padding: 11px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--rx-radius-sm);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.rx-btn-add:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.35);
    background: var(--rx-primary-gradient);
    border-color: transparent;
}

.rx-btn-save {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: transparent;
    color: white;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 600;
    width: 100%;
    justify-content: center;
    border-radius: var(--rx-radius-sm);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
}

.rx-btn-save:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-color: transparent;
}

.rx-btn-delete {
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--rx-text-muted);
    border-radius: var(--rx-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--rx-transition);
}

.rx-btn-delete:hover {
    background: var(--rx-danger-light);
    color: var(--rx-danger);
    transform: scale(1.1);
}

.rx-btn-delete .material-icons {
    font-size: 18px;
}

/* ============================================
   CONTENT LAYOUT
   ============================================ */

.rx-content {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    padding: 24px 28px;
    flex: 1;
    overflow: hidden;
}

.rx-form-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom scrollbar for form column */
.rx-form-column::-webkit-scrollbar {
    width: 5px;
}

.rx-form-column::-webkit-scrollbar-track {
    background: transparent;
}

.rx-form-column::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.rx-list-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

/* ============================================
   CARDS
   ============================================ */

.rx-card {
    background: var(--rx-surface);
    border: 1px solid var(--rx-border);
    border-radius: var(--rx-radius-lg);
    overflow: hidden;
    box-shadow: var(--rx-shadow-sm);
    transition: box-shadow var(--rx-transition);
}

.rx-card:hover {
    box-shadow: var(--rx-shadow-md);
}

.rx-card-list {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.rx-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--rx-bg-subtle);
    border-bottom: 1px solid var(--rx-border);
}

.rx-card-header-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--rx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rx-primary-bg);
    flex-shrink: 0;
}

.rx-card-header-icon .material-icons {
    font-size: 20px;
    color: var(--rx-primary);
}

.rx-card-header-icon.medication-icon {
    background: #ede9fe;
}

.rx-card-header-icon.medication-icon .material-icons {
    color: #7c3aed;
}

.rx-card-header-icon.list-icon {
    background: #dbeafe;
}

.rx-card-header-icon.list-icon .material-icons {
    color: #2563eb;
}

.rx-card-header-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.rx-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rx-text);
}

.rx-card-desc {
    font-size: 0.75rem;
    color: var(--rx-text-muted);
}

.rx-count-badge {
    margin-left: auto;
    padding: 3px 10px;
    background: var(--rx-primary-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--rx-radius-full);
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.rx-card-body {
    padding: 20px;
}

.rx-list-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.rx-list-body::-webkit-scrollbar {
    width: 5px;
}

.rx-list-body::-webkit-scrollbar-track {
    background: transparent;
}

.rx-list-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* ============================================
   FORM FIELDS
   ============================================ */

.rx-form-group {
    margin-bottom: 20px;
}

.rx-form-group-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--rx-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--rx-border-light);
}

.rx-form-group-label .material-icons {
    font-size: 15px;
}

.rx-form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.rx-form-field:last-child {
    margin-bottom: 0;
}

.rx-form-field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rx-text-secondary);
    letter-spacing: 0.01em;
}

.rx-required {
    color: var(--rx-danger);
}

.rx-form-row {
    display: flex;
    gap: 14px;
}

.rx-flex-1 {
    flex: 1;
}

.rx-flex-2 {
    flex: 2;
}

.rx-input,
.rx-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--rx-text);
    transition: all var(--rx-transition);
}

.rx-input:hover,
.rx-textarea:hover {
    border-color: #cbd5e1;
    background: var(--rx-surface-hover);
}

.rx-input:focus,
.rx-textarea:focus {
    outline: none;
    border-color: var(--rx-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background: var(--rx-surface);
}

.rx-input::placeholder,
.rx-textarea::placeholder {
    color: var(--rx-text-muted);
}

.rx-textarea {
    resize: vertical;
    min-height: 72px;
    line-height: 1.5;
}

/* ============================================
   PATIENT SEARCH
   ============================================ */

.rx-search-wrapper {
    position: relative;
}

.rx-autocomplete {
    width: 100%;
}

.rx-patient-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
}

.rx-patient-badge {
    padding: 4px 10px;
    background: var(--rx-primary-gradient);
    color: white;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: var(--rx-radius-sm);
}

.rx-patient-details {
    flex: 1;
    min-width: 0;
}

.rx-patient-name {
    font-weight: 600;
    color: var(--rx-text);
    font-size: 0.875rem;
}

.rx-patient-meta {
    font-size: 0.75rem;
    color: var(--rx-text-muted);
    margin-top: 2px;
}

/* Selected Patient Display */
.rx-patient-selected {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1.5px solid #86efac;
    border-radius: var(--rx-radius-md);
    margin-bottom: 16px;
    animation: rx-patient-in 0.3s ease-out;
}

@keyframes rx-patient-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rx-patient-avatar {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border-radius: var(--rx-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
    flex-shrink: 0;
}

.rx-avatar-letter {
    font-size: 1.125rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.rx-patient-info {
    flex: 1;
}

.rx-patient-info-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--rx-text);
    margin-bottom: 6px;
}

.rx-patient-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rx-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--rx-radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

.rx-chip .material-icons {
    font-size: 13px;
}

.rx-chip-id {
    background: var(--rx-primary-bg);
    color: var(--rx-primary);
}

.rx-chip-age {
    background: #fef3c7;
    color: #92400e;
}

.rx-chip-gender {
    background: #fce7f3;
    color: #9d174d;
}

/* ============================================
   FREQUENCY SECTION
   ============================================ */

.rx-frequency-section {
    margin: 8px 0 16px;
    padding: 16px;
    background: var(--rx-bg-subtle);
    border: 1px solid var(--rx-border);
    border-radius: var(--rx-radius-md);
}

.rx-frequency-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.rx-frequency-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius-md);
    transition: all var(--rx-transition);
}

.rx-frequency-item:hover {
    border-color: #cbd5e1;
    box-shadow: var(--rx-shadow-sm);
}

.rx-frequency-item.active {
    border-color: var(--rx-primary-light);
    background: var(--rx-primary-bg);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.rx-frequency-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.rx-frequency-toggle input[type="checkbox"] {
    display: none;
}

.rx-frequency-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--rx-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--rx-transition);
}

.rx-frequency-item.active .rx-frequency-icon {
    transform: scale(1.1);
}

.rx-frequency-icon .material-icons {
    font-size: 22px;
}

.rx-frequency-icon.morning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

.rx-frequency-icon.afternoon {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #c2410c;
}

.rx-frequency-icon.evening {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    color: #6d28d9;
}

.rx-frequency-icon.night {
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    color: #4338ca;
}

.rx-frequency-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--rx-text-secondary);
}

.rx-dose-input {
    padding: 7px 10px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--rx-radius-sm);
    font-size: 0.75rem;
    text-align: center;
    color: var(--rx-text);
    background: var(--rx-surface);
    font-family: inherit;
    transition: all var(--rx-transition);
}

.rx-dose-input:focus {
    outline: none;
    border-color: var(--rx-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ============================================
   FORM ACTIONS
   ============================================ */

.rx-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--rx-border-light);
}

/* ============================================
   ALERTS
   ============================================ */

.rx-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--rx-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    animation: rx-alert-in 0.25s ease-out;
}

@keyframes rx-alert-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.rx-alert .material-icons {
    font-size: 18px;
    flex-shrink: 0;
}

.rx-alert-error {
    background: var(--rx-danger-light);
    border: 1px solid #fca5a5;
    color: var(--rx-danger);
    margin-bottom: 16px;
}

.rx-alert-success {
    background: var(--rx-success-light);
    border: 1px solid #86efac;
    color: var(--rx-success);
}

/* ============================================
   MEDICATIONS LIST
   ============================================ */

.rx-medications-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.rx-medication-card {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--rx-border-light);
    transition: all var(--rx-transition);
    position: relative;
}

.rx-medication-card:last-child {
    border-bottom: none;
}

.rx-medication-card:hover {
    background: var(--rx-bg-subtle);
}

.rx-med-accent {
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    background: var(--rx-primary-gradient);
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity var(--rx-transition);
}

.rx-medication-card:hover .rx-med-accent {
    opacity: 1;
}

.rx-med-number {
    width: 28px;
    height: 28px;
    background: var(--rx-primary-gradient);
    color: white;
    border-radius: var(--rx-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}

.rx-med-content {
    flex: 1;
    min-width: 0;
}

.rx-med-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.rx-med-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--rx-text);
}

.rx-med-details-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.rx-med-detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: var(--rx-bg);
    border: 1px solid var(--rx-border);
    border-radius: var(--rx-radius-full);
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--rx-text-secondary);
}

.rx-med-detail-chip .material-icons {
    font-size: 12px;
    color: var(--rx-text-muted);
}

.rx-med-schedule {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.rx-schedule-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--rx-radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
}

.rx-schedule-tag .material-icons {
    font-size: 13px;
}

.rx-schedule-tag.morning {
    background: #fef3c7;
    color: #92400e;
}

.rx-schedule-tag.afternoon {
    background: #ffedd5;
    color: #9a3412;
}

.rx-schedule-tag.evening {
    background: #ede9fe;
    color: #5b21b6;
}

.rx-schedule-tag.night {
    background: #e0e7ff;
    color: #3730a3;
}

.rx-med-instructions {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 12px;
    background: var(--rx-bg-subtle);
    border: 1px solid var(--rx-border-light);
    border-radius: var(--rx-radius-sm);
    font-size: 0.75rem;
    color: var(--rx-text-secondary);
    line-height: 1.4;
}

.rx-med-instructions .material-icons {
    font-size: 14px;
    color: var(--rx-text-muted);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================
   LIST FOOTER
   ============================================ */

.rx-list-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--rx-border);
    background: var(--rx-bg-subtle);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.rx-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.rx-empty-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--rx-bg) 0%, var(--rx-primary-bg) 100%);
    border-radius: var(--rx-radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    animation: rx-empty-pulse 2s ease-in-out infinite;
}

@keyframes rx-empty-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.rx-empty-icon .material-icons {
    font-size: 34px;
    color: var(--rx-primary-light);
}

.rx-empty-state h4 {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rx-text);
}

.rx-empty-state p {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--rx-text-muted);
    max-width: 240px;
    line-height: 1.5;
}

/* ============================================
   SPIN ANIMATION
   ============================================ */

.rx-spin {
    animation: rx-spin 1s linear infinite;
}

@keyframes rx-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================
   SHARE MODAL
   ============================================ */

.rx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(6px);
    animation: rx-overlay-in 0.2s ease-out;
}

@keyframes rx-overlay-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rx-modal {
    background: var(--rx-surface);
    border-radius: var(--rx-radius-xl);
    width: 90%;
    max-width: 460px;
    box-shadow: var(--rx-shadow-xl);
    animation: rx-modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

@keyframes rx-modal-in {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.rx-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--rx-bg-subtle);
    border-bottom: 1px solid var(--rx-border);
}

.rx-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rx-modal-title-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--rx-radius-sm);
    background: var(--rx-primary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rx-modal-title-icon .material-icons {
    font-size: 20px;
    color: var(--rx-primary);
}

.rx-modal-title-text {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rx-text);
}

.rx-modal-subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--rx-text-muted);
    margin-top: 1px;
}

.rx-modal-close {
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--rx-text-muted);
    border-radius: var(--rx-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--rx-transition);
}

.rx-modal-close:hover {
    background: var(--rx-border);
    color: var(--rx-text-secondary);
}

.rx-modal-close .material-icons {
    font-size: 20px;
}

.rx-modal-body {
    padding: 24px;
}

.rx-share-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.rx-share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 12px 14px;
    background: var(--rx-surface);
    border: 1.5px solid var(--rx-border);
    border-radius: var(--rx-radius-md);
    cursor: pointer;
    transition: all var(--rx-transition);
    font-family: inherit;
}

.rx-share-option:hover {
    border-color: var(--rx-primary-light);
    background: var(--rx-primary-bg);
    transform: translateY(-2px);
    box-shadow: var(--rx-shadow-md);
}

.rx-share-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--rx-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--rx-transition);
}

.rx-share-option:hover .rx-share-icon {
    transform: scale(1.1);
}

.rx-share-icon .material-icons {
    font-size: 24px;
}

.rx-share-icon.email {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #2563eb;
}

.rx-share-icon.sms {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
}

.rx-share-icon.pharmacy {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #db2777;
}

.rx-share-icon.link {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4f46e5;
}

.rx-share-icon.pdf {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
}

.rx-share-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--rx-text);
}

.rx-share-desc {
    font-size: 0.6875rem;
    color: var(--rx-text-muted);
}

.rx-share-message {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 16px;
    border-radius: var(--rx-radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    animation: rx-alert-in 0.25s ease-out;
}

.rx-share-message .material-icons {
    font-size: 18px;
}

.rx-share-message.success {
    background: var(--rx-success-light);
    color: var(--rx-success);
}

.rx-share-message.error {
    background: var(--rx-danger-light);
    color: var(--rx-danger);
}

/* ============================================
   PRINT STYLES
   ============================================ */

.prescription-print {
    padding: 40px;
    font-family: 'Georgia', serif;
    color: #000;
    max-width: 800px;
    margin: 0 auto;
}

.print-header {
    text-align: center;
    border-bottom: 3px solid var(--rx-primary);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.print-header h1 {
    margin: 0 0 10px;
    font-size: 28px;
    color: var(--rx-primary);
}

.hospital-info h2 {
    margin: 10px 0 5px;
    font-size: 20px;
    color: #333;
}

.hospital-info p {
    margin: 2px 0;
    font-size: 12px;
    color: #666;
}

.print-patient-info {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.print-patient-info .info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.print-patient-info .info-row:last-child {
    margin-bottom: 0;
}

.print-patient-info strong {
    color: #333;
}

.print-rx-symbol {
    font-size: 48px;
    font-weight: bold;
    color: var(--rx-primary);
    margin: 20px 0;
    text-align: center;
}

.print-medications table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.print-medications th,
.print-medications td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

.print-medications th {
    background: #f9fafb;
    font-weight: 600;
    color: #333;
}

.print-medications td {
    font-size: 13px;
}

.print-footer {
    margin-top: 40px;
    page-break-inside: avoid;
}

.signature-section {
    margin: 40px 0 30px;
    text-align: right;
}

.signature-line p {
    margin: 5px 0;
    font-size: 13px;
}

.print-notes {
    border-top: 2px solid #e5e7eb;
    padding-top: 20px;
}

.print-notes p {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.print-notes ul {
    margin: 0;
    padding-left: 20px;
}

.print-notes li {
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

/* ============================================
   PRINT MEDIA QUERY
   ============================================ */

@media print {
    body * {
        visibility: hidden;
    }
    
    #prescriptionPrintArea,
    #prescriptionPrintArea * {
        visibility: visible;
    }
    
    #prescriptionPrintArea {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        display: block !important;
    }
    
    .prescription-print {
        page-break-after: always;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .rx-content {
        grid-template-columns: 1fr;
    }
    
    .rx-list-column {
        max-height: 400px;
    }
    
    .rx-frequency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rx-header-inner {
        padding: 14px 20px;
    }
    
    .rx-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .rx-header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .rx-header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .rx-content {
        padding: 16px;
        gap: 16px;
    }
    
    .rx-form-row {
        flex-direction: column;
    }
    
    .rx-frequency-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rx-share-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rx-btn span:not(.material-icons) {
        display: none;
    }
    
    .rx-btn-add span:not(.material-icons),
    .rx-btn-save span:not(.material-icons) {
        display: inline;
    }
    
    .rx-patient-chips {
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .rx-frequency-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .rx-card-body {
        padding: 16px;
    }
    
    .rx-share-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ============================================
   SYNCFUSION OVERRIDES
   ============================================ */

.rx-autocomplete .e-input-group {
    border: 1.5px solid var(--rx-border) !important;
    border-radius: var(--rx-radius-sm) !important;
    background: var(--rx-surface) !important;
    transition: all var(--rx-transition) !important;
}

.rx-autocomplete .e-input-group:hover {
    border-color: #cbd5e1 !important;
}

.rx-autocomplete .e-input-group.e-input-focus {
    border-color: var(--rx-primary) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}

.rx-autocomplete .e-input {
    font-size: 0.875rem !important;
    padding: 10px 14px !important;
}

.rx-autocomplete .e-input::placeholder {
    color: var(--rx-text-muted) !important;
}
