/**
 * ENNU Check-In Enhanced Interface Styles
 * Version 3.4.0 - Perfect Code Release
 * Production Ready with Enhanced UX
 * - EST Date/Time Display
 * - Week View (Monday-Friday Columns)
 * - Next Week Tab
 */

/* ============================================
   CSS VARIABLES - Modern Color Palette
   ============================================ */
:root {
    --ennu-primary: #2563eb;
    --ennu-primary-dark: #1e40af;
    --ennu-primary-light: #3b82f6;
    --ennu-success: #10b981;
    --ennu-success-dark: #059669;
    --ennu-warning: #f59e0b;
    --ennu-danger: #ef4444;
    --ennu-info: #06b6d4;
    
    --ennu-gray-50: #f9fafb;
    --ennu-gray-100: #f3f4f6;
    --ennu-gray-200: #e5e7eb;
    --ennu-gray-300: #d1d5db;
    --ennu-gray-400: #9ca3af;
    --ennu-gray-500: #6b7280;
    --ennu-gray-600: #4b5563;
    --ennu-gray-700: #374151;
    --ennu-gray-800: #1f2937;
    --ennu-gray-900: #111827;
    
    --ennu-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --ennu-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --ennu-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --ennu-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ennu-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --ennu-radius-sm: 0.375rem;
    --ennu-radius: 0.5rem;
    --ennu-radius-md: 0.75rem;
    --ennu-radius-lg: 1rem;
    --ennu-radius-xl: 1.5rem;
    
    --ennu-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --ennu-transition-fast: all 0.15s ease;
}

/* ============================================
   BASE CONTAINER
   ============================================ */
.ennu-checkin-interface-enhanced {
    padding: 2rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--ennu-gray-800);
}

/* ============================================
   HEADER SECTION - Modern Stats Dashboard
   ============================================ */
.checkin-header {
    background: white;
    padding: 2rem;
    border-radius: var(--ennu-radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--ennu-shadow-lg);
    border: 1px solid var(--ennu-gray-200);
    position: relative;
    overflow: hidden;
}

.checkin-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--ennu-primary) 0%, var(--ennu-success) 100%);
}

.header-date-time {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--ennu-gray-200);
}

.est-date-time {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ennu-gray-900);
}

.est-date-time .est-day {
    color: var(--ennu-primary);
    font-weight: 700;
    font-size: 1.5rem;
}

.est-date-time .est-date {
    color: var(--ennu-gray-700);
    font-weight: 600;
}

.est-date-time .est-time {
    color: var(--ennu-success);
    font-weight: 700;
    font-family: 'Courier New', monospace;
    font-size: 1.35rem;
    margin-left: auto;
}

.header-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    align-items: center;
}

.stat-badge {
    text-align: center;
    padding: 1.5rem 1.25rem;
    border-radius: var(--ennu-radius-md);
    background: #ffffff;
    border: 2px solid #d1d5db;
    transition: var(--ennu-transition);
    position: relative;
    overflow: hidden;
    min-width: 140px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ennu-gray-300);
    transform: scaleX(0);
    transition: var(--ennu-transition);
}

.stat-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--ennu-shadow-md);
    border-color: var(--ennu-gray-300);
}

.stat-badge:hover::before {
    transform: scaleX(1);
}

.stat-badge.active {
    background: linear-gradient(135deg, var(--ennu-success) 0%, var(--ennu-success-dark) 100%);
    color: white;
    border-color: var(--ennu-success-dark);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.stat-badge.active::before {
    background: rgba(255, 255, 255, 0.3);
    transform: scaleX(1);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1;
    color: #111827 !important; /* Force dark color for readability */
}

.stat-badge.active .stat-value {
    color: #ffffff !important; /* Force white for readability */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #374151 !important; /* Force dark gray for readability */
}

.stat-badge.active .stat-label {
    color: #ffffff !important; /* Force white for readability */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    font-weight: 800;
}

.stat-refresh {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--ennu-gray-50);
    border-radius: var(--ennu-radius);
    border: 1px solid var(--ennu-gray-200);
}

.btn-icon {
    background: white;
    border: 1px solid var(--ennu-gray-300);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--ennu-radius-sm);
    color: var(--ennu-gray-600);
    transition: var(--ennu-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-icon:hover {
    background: var(--ennu-primary);
    color: white;
    border-color: var(--ennu-primary);
    transform: rotate(180deg);
}

.btn-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

#last-update {
    color: var(--ennu-gray-500);
    font-size: 0.875rem;
    font-weight: 500;
}

/* ============================================
   TABS SECTION - Modern Tab Design
   ============================================ */
.checkin-content {
    background: white;
    border-radius: var(--ennu-radius-lg);
    box-shadow: var(--ennu-shadow-lg);
    border: 1px solid var(--ennu-gray-200);
    overflow: hidden;
    margin-bottom: 2rem;
}

.checkin-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-bottom: 2px solid var(--ennu-gray-200);
    flex-wrap: wrap;
}

.checkin-tab {
    padding: 0.875rem 1.5rem;
    background: #f3f4f6;
    border: 2px solid #d1d5db;
    border-radius: var(--ennu-radius);
    cursor: pointer;
    transition: var(--ennu-transition);
    font-size: 0.9375rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #1f2937 !important; /* Force dark color for readability */
    position: relative;
    overflow: hidden;
}

.checkin-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--ennu-primary);
    transform: scaleX(0);
    transition: var(--ennu-transition);
}

.checkin-tab:hover {
    background: #e5e7eb;
    border-color: #2563eb;
    color: #1e40af !important; /* Force dark blue for readability */
    transform: translateY(-1px);
    box-shadow: var(--ennu-shadow);
}

.checkin-tab.active {
    background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%) !important;
    color: #ffffff !important; /* Force white for readability */
    border-color: #1e40af;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.checkin-tab.active::before {
    transform: scaleX(1);
    background: rgba(255, 255, 255, 0.3);
}

.checkin-tab .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: var(--ennu-transition);
    opacity: 0.8;
}

.checkin-tab:hover .dashicons {
    transform: scale(1.1);
    opacity: 1;
}

.checkin-tab.active .dashicons {
    opacity: 1;
    filter: brightness(1.2);
}

/* ============================================
   TAB CONTENT
   ============================================ */
.checkin-tab-content {
    padding: 0;
}

.tab-panel {
    padding: 2rem;
    animation: fadeInUp 0.3s ease-out;
    min-height: 400px;
    display: none;
}

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

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   WEEK VIEW - Monday-Friday Columns
   ============================================ */
.week-view-container {
    width: 100%;
    overflow-x: auto;
}

.week-view-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    min-width: 1200px;
}

.week-day-column {
    background: white;
    border-radius: var(--ennu-radius-md);
    border: 2px solid var(--ennu-gray-200);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 600px;
    box-shadow: var(--ennu-shadow);
    transition: var(--ennu-transition);
}

.week-day-column:hover {
    box-shadow: var(--ennu-shadow-md);
    border-color: var(--ennu-primary-light);
}

.week-day-header {
    background: linear-gradient(135deg, var(--ennu-primary) 0%, var(--ennu-primary-light) 100%);
    color: white;
    padding: 1.25rem 1rem;
    text-align: center;
    border-bottom: 2px solid var(--ennu-primary-dark);
}

.week-day-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.week-day-date {
    font-size: 0.95rem;
    font-weight: 600;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.week-day-count {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
}

.week-day-appointments {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 400px);
}

.no-appointments-day {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--ennu-gray-400);
    font-style: italic;
    font-size: 0.9rem;
}

.week-appointment-card {
    background: var(--ennu-gray-50);
    border: 1px solid var(--ennu-gray-200);
    border-radius: var(--ennu-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: var(--ennu-transition);
}

.week-appointment-card:hover {
    background: white;
    box-shadow: var(--ennu-shadow-md);
    border-color: var(--ennu-primary-light);
    transform: translateY(-2px);
}

.week-apt-time {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ennu-primary);
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

.week-apt-patient {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ennu-gray-900);
    margin-bottom: 0.5rem;
}

.week-apt-service {
    font-size: 0.85rem;
    color: var(--ennu-gray-600);
    margin-bottom: 0.4rem;
}

.week-apt-provider {
    font-size: 0.8rem;
    color: var(--ennu-gray-500);
    margin-bottom: 0.75rem;
    font-style: italic;
}

.week-apt-status {
    margin-bottom: 0.75rem;
}

.week-apt-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.week-apt-actions .btn-xs {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--ennu-radius-sm);
}

/* Responsive Week View */
@media (max-width: 1400px) {
    .week-view-grid {
        grid-template-columns: repeat(5, minmax(220px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    .week-view-grid {
        grid-template-columns: repeat(3, 1fr);
        min-width: 800px;
    }
}

@media (max-width: 768px) {
    .week-view-grid {
        grid-template-columns: 1fr;
        min-width: 100%;
    }
    
    .week-day-column {
        min-height: auto;
    }
    
    .week-day-appointments {
        max-height: 400px;
    }
}

/* ============================================
   APPOINTMENTS TABLE - Modern Table Design
   ============================================ */
.appointments-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--ennu-radius);
    overflow: hidden;
}

.appointments-table th {
    background: linear-gradient(135deg, var(--ennu-gray-50) 0%, var(--ennu-gray-100) 100%);
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ennu-gray-700);
    border-bottom: 2px solid var(--ennu-gray-200);
    white-space: nowrap;
}

.appointments-table th:first-child {
    padding-left: 1.5rem;
}

.appointments-table th:last-child {
    padding-right: 1.5rem;
}

.appointments-table td {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--ennu-gray-100);
    vertical-align: middle;
    transition: var(--ennu-transition-fast);
}

.appointments-table td:first-child {
    padding-left: 1.5rem;
}

.appointments-table td:last-child {
    padding-right: 1.5rem;
}

.appointments-table tbody tr {
    transition: var(--ennu-transition-fast);
}

.appointments-table tbody tr:hover {
    background: linear-gradient(90deg, var(--ennu-gray-50) 0%, white 100%);
    transform: scale(1.01);
    box-shadow: var(--ennu-shadow-sm);
}

.appointments-table tbody tr:last-child td {
    border-bottom: none;
}

.appointments-table small {
    color: var(--ennu-gray-500);
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8125rem;
}

/* ============================================
   STATUS BADGES - Modern Badge Design
   ============================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--ennu-transition);
}

.status-badge.approved,
.status-badge.checked-in {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.status-badge.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.status-badge.cancelled {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* ============================================
   BUTTONS - Modern Button Styles
   ============================================ */
.btn {
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--ennu-radius);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: var(--ennu-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--ennu-primary) 0%, var(--ennu-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--ennu-primary-dark) 0%, var(--ennu-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--ennu-gray-400);
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.btn-secondary {
    background: white;
    color: var(--ennu-gray-700);
    border: 2px solid var(--ennu-gray-300);
}

.btn-secondary:hover {
    background: var(--ennu-gray-50);
    border-color: var(--ennu-gray-400);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--ennu-success) 0%, var(--ennu-success-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-success:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-warning {
    background: linear-gradient(135deg, var(--ennu-warning) 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

/* ============================================
   QUEUE SECTION
   ============================================ */
.queue-section {
    margin-top: 2rem;
    background: white;
    padding: 2rem;
    border-radius: var(--ennu-radius-lg);
    box-shadow: var(--ennu-shadow-lg);
    border: 1px solid var(--ennu-gray-200);
}

.queue-section h3 {
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ennu-gray-900);
    font-size: 1.5rem;
    font-weight: 700;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--ennu-gray-300);
}

.queue-section h3 .dashicons {
    color: var(--ennu-primary);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.queue-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.queue-table th {
    background: var(--ennu-gray-50);
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ennu-gray-700);
    border-bottom: 2px solid var(--ennu-gray-200);
}

.queue-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--ennu-gray-100);
}

.queue-table tbody tr:hover {
    background: var(--ennu-gray-50);
}

/* ============================================
   MODAL STYLES - Modern Modal Design
   ============================================ */
.ennu-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.ennu-modal[style*="display: block"],
.ennu-modal[style*="display:block"] {
    display: flex !important;
}

.ennu-modal.show,
.ennu-modal[style*="display: flex"],
.ennu-modal[style*="display:flex"] {
    display: flex !important;
}

.ennu-modal-content {
    background: white;
    border-radius: var(--ennu-radius-xl);
    padding: 2.5rem;
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--ennu-shadow-xl);
    border: 1px solid var(--ennu-gray-200);
}

.ennu-modal-content.large {
    max-width: 1200px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.ennu-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--ennu-gray-400);
    transition: var(--ennu-transition);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ennu-radius);
    background: var(--ennu-gray-100);
}

.ennu-modal-close:hover {
    color: var(--ennu-danger);
    background: var(--ennu-gray-200);
    transform: rotate(90deg);
}

/* ============================================
   PATIENT PROFILE
   ============================================ */
.patient-profile .profile-header {
    border-bottom: 2px solid var(--ennu-gray-200);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.patient-profile h2 {
    margin: 0 0 0.75rem 0;
    color: var(--ennu-gray-900);
    font-size: 1.875rem;
    font-weight: 700;
}

.profile-meta {
    color: var(--ennu-gray-600);
    font-size: 0.875rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.profile-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.profile-meta .meta-label {
    font-weight: 600;
    color: var(--ennu-gray-700);
}

.profile-meta .meta-value {
    color: var(--ennu-gray-900);
    font-weight: 500;
}

.patient-profile .section {
    margin: 1.25rem 0;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--ennu-gray-50) 0%, white 100%);
    border-radius: var(--ennu-radius-md);
    border: 1px solid var(--ennu-gray-200);
}

.patient-profile .section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--ennu-gray-900);
    font-size: 1rem;
    font-weight: 700;
}

.patient-profile .section h3 .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: var(--ennu-primary);
}

/* Appointment Grid - Compact */
.appointment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.875rem;
    margin-top: 0.75rem;
}

.appointment-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--ennu-radius);
    border: 1px solid var(--ennu-gray-200);
}

.appointment-item .app-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ennu-gray-500);
}

.appointment-item .app-value {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ennu-gray-900);
}

/* Requirements Grid - Compact */
.requirements-grid {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

.patient-profile h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--ennu-gray-900);
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--ennu-radius);
    transition: var(--ennu-transition);
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.requirement-item:hover {
    transform: translateX(4px);
}

.requirement-item.complete {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: #6ee7b7;
}

.requirement-item.pending {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #fcd34d;
}

.requirement-item.missing {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #fca5a5;
}

.req-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.visit-history-wrapper {
    margin-top: 0.75rem;
    max-height: 300px;
    overflow-y: auto;
    border-radius: var(--ennu-radius);
    border: 1px solid var(--ennu-gray-200);
}

.visit-history {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--ennu-radius);
    overflow: hidden;
}

.visit-history th {
    background: var(--ennu-gray-50);
    padding: 0.75rem 0.875rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ennu-gray-700);
    border-bottom: 2px solid var(--ennu-gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.visit-history td {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--ennu-gray-100);
    background: white;
    font-size: 0.875rem;
}

.visit-history tbody tr:hover td {
    background: var(--ennu-gray-50);
}

.modal-actions {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 2px solid var(--ennu-gray-200);
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.modal-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: var(--ennu-radius);
    transition: var(--ennu-transition);
    border: none;
    cursor: pointer;
}

.modal-actions .btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.modal-actions .btn-primary {
    background: linear-gradient(135deg, var(--ennu-primary) 0%, var(--ennu-primary-dark) 100%);
    color: white;
}

.modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--ennu-shadow-md);
}

.modal-actions .btn-warning {
    background: linear-gradient(135deg, var(--ennu-warning) 0%, #d97706 100%);
    color: white;
}

.modal-actions .btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: var(--ennu-shadow-md);
}

.modal-actions .btn-secondary {
    background: var(--ennu-gray-200);
    color: var(--ennu-gray-700);
}

.modal-actions .btn-secondary:hover {
    background: var(--ennu-gray-300);
}

.modal-actions .btn-success {
    background: linear-gradient(135deg, var(--ennu-success) 0%, var(--ennu-success-dark) 100%);
    color: white;
}

.modal-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading,
.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--ennu-gray-500);
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    color: var(--ennu-gray-500);
    gap: 1rem;
    min-height: 200px;
    justify-content: center;
    will-change: contents; /* Optimize for rendering */
}

.spin {
    animation: spin 1s linear infinite;
    color: var(--ennu-primary);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   EMPTY STATES
   ============================================ */
.no-appointments {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--ennu-gray-500);
    font-size: 1.125rem;
}

.no-appointments::before {
    content: '📅';
    display: block;
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error,
.ennu-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 1.25rem 1.5rem;
    border-radius: var(--ennu-radius-md);
    margin: 1rem 0;
    border: 1px solid #fca5a5;
    font-weight: 500;
}

.ennu-error {
    text-align: center;
    padding: 2rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .ennu-checkin-interface-enhanced {
        padding: 1.5rem;
    }
    
    .header-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ennu-checkin-interface-enhanced {
        padding: 1rem;
    }

    .checkin-header {
        padding: 1.5rem;
    }

    .header-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-badge {
        width: 100%;
    }

    .stat-refresh {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .checkin-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }

    .checkin-tab {
        width: 100%;
        justify-content: center;
    }

    .tab-panel {
        padding: 1.5rem;
    }

    .appointments-table {
        font-size: 0.875rem;
    }

    .appointments-table th,
    .appointments-table td {
        padding: 0.875rem 0.75rem;
    }

    .appointments-table th:first-child,
    .appointments-table td:first-child {
        padding-left: 1rem;
    }

    .appointments-table th:last-child,
    .appointments-table td:last-child {
        padding-right: 1rem;
    }

    .btn-sm {
        padding: 0.5rem 0.875rem;
        font-size: 0.8125rem;
    }

    .ennu-modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 90vh;
    }

    .queue-section {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .appointments-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .appointments-table thead {
        display: none;
    }

    .appointments-table tbody,
    .appointments-table tr,
    .appointments-table td {
        display: block;
        width: 100%;
    }

    .appointments-table tr {
        margin-bottom: 1rem;
        border: 2px solid var(--ennu-gray-200);
        border-radius: var(--ennu-radius-md);
        padding: 1rem;
        background: white;
        box-shadow: var(--ennu-shadow);
    }

    .appointments-table td {
        padding: 0.75rem 0;
        border: none;
        text-align: left;
    }

    .appointments-table td:before {
        content: attr(data-label) ': ';
        font-weight: 700;
        color: var(--ennu-gray-700);
        margin-right: 0.5rem;
    }

    .appointments-table td:last-child {
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid var(--ennu-gray-200);
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .checkin-header,
    .checkin-tabs,
    .btn,
    .ennu-modal,
    .stat-refresh {
        display: none !important;
    }

    .checkin-tab-content {
        box-shadow: none;
        padding: 0;
        border: none;
    }

    .appointments-table {
        border: 1px solid #000;
    }

    .appointments-table th,
    .appointments-table td {
        border: 1px solid #000;
    }
}

/* ============================================
   ACCESSIBILITY IMPROVEMENTS
   ============================================ */
.btn:focus,
.checkin-tab:focus,
.btn-icon:focus {
    outline: 2px solid var(--ennu-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .stat-badge,
    .checkin-tab,
    .btn {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
