/* ================================================
   HOSPITAL MANAGEMENT SYSTEM - COMPLETE STYLES
   Modern, Responsive, Production-Ready
   ================================================ */

:root {
    /* Colors */
    --primary: #0891b2;
    --primary-dark: #0e7490;
    --primary-light: #06b6d4;
    --primary-bg: #ecfeff;

    --secondary: #64748b;
    --secondary-dark: #475569;

    --success: #10b981;
    --success-light: #d1fae5;
    --success-dark: #059669;

    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --warning-dark: #d97706;

    --danger: #ef4444;
    --danger-light: #fee2e2;
    --danger-dark: #dc2626;

    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Grays */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;

    /* Background */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Border Radius */
    --radius: 8px;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    /* Transitions */
    --transition: all 0.2s ease-in-out;
    --transition-fast: all 0.15s ease-in-out;
}

/* ================================================
   BASE STYLES
   ================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--gray-900);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   CONTAINER & LAYOUT
   ================================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: var(--bg-primary);
    padding: 20px 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    border: 1px solid var(--gray-200);
}

.header h2 {
    color: var(--primary);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
}

.actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ================================================
   CARDS
   ================================================ */

.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    margin-bottom: 24px;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--gray-200);
}

.card-head h3 {
    color: var(--gray-900);
    font-size: 1.375rem;
    font-weight: 600;
    margin: 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.section-header h3 {
    color: var(--gray-900);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* ================================================
   STATISTICS CARDS
   ================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--gray-50) 100%);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card:hover::before {
    width: 8px;
}

.stat-card.primary::before {
    background: var(--primary);
}

.stat-card.success::before {
    background: var(--success);
}

.stat-card.warning::before {
    background: var(--warning);
}

.stat-card.danger::before {
    background: var(--danger);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

/* ================================================
   DETAIL CARDS
   ================================================ */

.detail-card {
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.detail-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.detail-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.detail-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.detail-section {
    margin-bottom: 12px;
}

.detail-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.9375rem;
    color: var(--gray-800);
    font-weight: 500;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

/* ================================================
   PATIENT CARD
   ================================================ */

.patient-card {
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.patient-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.patient-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.patient-card:hover::before {
    opacity: 1;
}

/* ================================================
   BUTTONS
   ================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    background: var(--primary);
    color: white;
    gap: 6px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-dark);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--success-dark);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: var(--warning-dark);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

/* ================================================
   BADGES
   ================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: 9999px;
    background: var(--primary-bg);
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

/* ================================================
   FORMS
   ================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.input {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--gray-900);
    transition: var(--transition);
}

.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

.input::placeholder {
    color: var(--gray-400);
}

textarea.input {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
}

/* ================================================
   GRID
   ================================================ */

.grid {
    display: grid;
    gap: 16px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   TABS
   ================================================ */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 0;
    overflow-x: auto;
}

.tab {
    padding: 12px 24px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    margin-bottom: -2px;
}

.tab:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================
   MODAL
   ================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-medium {
    max-width: 800px;
}

.modal-large {
    max-width: 1200px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 24px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 2px solid var(--gray-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* ================================================
   TIMELINE
   ================================================ */

.timeline {
    position: relative;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-300);
}

.timeline-item {
    position: relative;
    padding: 20px;
    margin-bottom: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -29px;
    top: 25px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg-secondary);
    z-index: 1;
}

.timeline-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.timeline-date {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 8px;
}

.timeline-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.timeline-content {
    color: var(--gray-700);
    line-height: 1.7;
}

.timeline-content p {
    margin-bottom: 8px;
}

/* ================================================
   INFO BOXES
   ================================================ */

.info-box {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--gray-50);
    border-left: 4px solid var(--gray-400);
    margin-bottom: 16px;
}

.info-box.primary {
    background: var(--primary-bg);
    border-left-color: var(--primary);
}

.info-box.success {
    background: var(--success-light);
    border-left-color: var(--success);
}

.info-box.warning {
    background: var(--warning-light);
    border-left-color: var(--warning);
}

.info-box.danger {
    background: var(--danger-light);
    border-left-color: var(--danger);
}

.info-box-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info {
    padding: 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 0.9375rem;
    text-align: center;
}

/* ================================================
   EMPTY STATE
   ================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

/* ================================================
   LIST
   ================================================ */

.list {
    margin: 0;
    padding: 0;
}

/* ================================================
   NOTIFICATIONS & TOASTS
   ================================================ */

.notif-badge {
    position: relative;
}

.notif-badge[data-count]::after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -8px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: white;
    background: var(--danger);
    border-radius: 9999px;
    border: 2px solid var(--bg-primary);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Notification Panel */
.notification-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 400px;
    max-height: 600px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    z-index: 1001;
    display: none;
    flex-direction: column;
    animation: slideInRight 0.3s ease-out;
}

.notification-panel.active {
    display: flex;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-panel-header {
    padding: 20px;
    border-bottom: 2px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, var(--bg-primary), var(--gray-50));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.notification-panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    max-height: 500px;
}

.notification-item {
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.notification-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(-4px);
}

.notification-item:hover::before {
    opacity: 1;
}

.notification-item.unread {
    background: var(--primary-bg);
    border-color: var(--primary);
    font-weight: 500;
}

.notification-item.unread::before {
    opacity: 1;
}

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 1.25rem;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.notification-icon.lab {
    background: var(--warning-light);
    color: var(--warning);
}

.notification-icon.radiology {
    background: var(--success-light);
    color: var(--success);
}

.notification-icon.pharmacy {
    background: var(--danger-light);
    color: var(--danger);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
    font-size: 0.9375rem;
}

.notification-message {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.notification-panel-footer {
    padding: 16px;
    border-top: 2px solid var(--gray-200);
    background: var(--gray-50);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    max-width: 400px;
    animation: slideInDown 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
    pointer-events: all;
    cursor: pointer;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

.toast.success {
    border-left-color: var(--success);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2px;
    font-size: 0.9375rem;
}

.toast-message {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Sound Wave Animation */
.sound-wave {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3000;
}

.sound-wave-circle {
    position: absolute;
    border: 3px solid var(--primary);
    border-radius: 50%;
    animation: soundWave 1.5s ease-out;
}

@keyframes soundWave {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        margin-left: 0;
        margin-top: 0;
    }

    100% {
        width: 300px;
        height: 300px;
        opacity: 0;
        margin-left: -150px;
        margin-top: -150px;
    }
}

/* ================================================
   IMAGE GALLERY
   ================================================ */

.image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.image-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.image-thumb:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

.image-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--danger);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.image-thumb:hover .image-remove {
    opacity: 1;
}

/* ================================================
   FILE UPLOAD
   ================================================ */

.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius-md);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--gray-50);
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

/* ================================================
   PRESCRIPTION & SUGGESTIONS
   ================================================ */

.prescription-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 8px;
    transition: var(--transition);
}

.prescription-item:hover {
    background: var(--primary-bg);
    border-color: var(--primary);
}

.prescription-item-content {
    flex: 1;
}

.prescription-item-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.prescription-item-details {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.prescription-item-remove {
    padding: 6px 12px;
    font-size: 0.8125rem;
    background: var(--danger-light);
    color: var(--danger);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.prescription-item-remove:hover {
    background: var(--danger);
    color: white;
}

.suggestions {
    position: relative;
    max-height: 300px;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-top: 8px;
    display: none;
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-100);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: var(--primary-bg);
}

.suggestion-name {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.suggestion-meta {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

.selected-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--primary-bg);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    margin: 4px;
}

.selected-item button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.selected-item button:hover {
    background: var(--primary);
    color: white;
}

/* ================================================
   LOGIN PAGE
   ================================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
    animation: modalSlideIn 0.5s ease-out;
}

.login-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.login-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.9375rem;
}

.login-form {
    padding: 30px;
}

.login-footer {
    padding: 20px 30px;
    background: var(--gray-50);
    text-align: center;
    font-size: 0.8125rem;
    color: var(--gray-600);
    border-top: 1px solid var(--gray-200);
}

/* ================================================
   RESPONSIVE
   ================================================ */

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .header h2 {
        font-size: 1.375rem;
    }

    .actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }

    .tabs {
        gap: 4px;
    }

    .tab {
        padding: 10px 16px;
        font-size: 0.875rem;
    }

    .notification-panel {
        width: 90%;
        right: 5%;
        top: 70px;
    }

    .toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .modal-content {
        margin: 20px 0;
    }

    .image-gallery {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    body {
        background: white;
    }

    .header,
    .btn,
    .actions,
    .tabs,
    .modal {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}

/* ================================================
   UTILITY CLASSES
   ================================================ */

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.p-4 {
    padding: 16px;
}

/* ================================================
   END OF STYLES
   ================================================ */