/* Modern Phlebotomist Portal Styles */

:root {
    /* Color Palette */
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    /* Indigo 700 */
    --primary-light: #eef2ff;
    /* Indigo 50 */
    --secondary-color: #8b5cf6;
    /* Violet 500 */
    --secondary-hover: #7c3aed;
    /* Violet 600 */
    --success-color: #10b981;
    /* Emerald 500 */
    --success-hover: #059669;
    /* Emerald 600 */
    --success-light: #d1fae5;
    /* Emerald 100 */
    --warning-color: #f59e0b;
    /* Amber 500 */
    --warning-hover: #d97706;
    /* Amber 600 */
    --warning-light: #fef3c7;
    /* Amber 100 */
    --danger-color: #ef4444;
    /* Red 500 */
    --danger-hover: #dc2626;
    /* Red 600 */
    --danger-light: #fee2e2;
    /* Red 100 */
    --info-color: #3b82f6;
    /* Blue 500 */
    --info-hover: #2563eb;
    /* Blue 600 */
    --info-light: #dbeafe;
    /* Blue 100 */

    /* Grays */
    --white: #ffffff;
    --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;

    /* Layout & Spacing */
    --border-radius: 0.5rem;
    --border-radius-lg: 1rem;
    --border-radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
    flex: 1;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(var(--white) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.1;
}

.login-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 28rem;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.login-header {
    margin-bottom: 30px;
}

.login-header .logo {
    margin: 0 auto 20px;
    width: 60px;
    height: 60px;
}

.login-header h2 {
    color: var(--gray-900);
    margin-bottom: 10px;
    font-size: 1.75rem;
    font-weight: 700;
}

.login-header p {
    color: var(--gray-500);
    margin: 0;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: var(--gray-50);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.alt-login-link {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    text-align: center;
}

.alt-login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.alt-login-link a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    line-height: 1.25;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.btn-success {
    background: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-warning {
    background: var(--warning-color);
    color: var(--white);
}

.btn-warning:hover {
    background: var(--warning-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-info {
    background: var(--info-color);
    color: var(--white);
}

.btn-info:hover {
    background: var(--info-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: var(--danger-color);
    color: var(--white);
}

.btn-danger:hover {
    background: var(--danger-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-light);
}

/* Dashboard Layout */
.phlebotomist-dashboard {
    min-height: 100vh;
    background: var(--gray-50);
    display: flex;
    flex: 1;
}

/* Sidebar Styles */
.sidebar {
    width: 260px;
    background: var(--white);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    border-right: 1px solid var(--gray-200);
}

.sidebar-collapsed {
    width: 70px;
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    height: 64px;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.25rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-nav .nav-item i {
    width: 24px;
    margin-right: 12px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-collapsed .sidebar-nav .nav-item span {
    display: none;
}

.sidebar-nav .nav-item:hover {
    background: var(--gray-50);
    color: var(--primary-color);
}

.sidebar-nav .nav-item.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
}

.sidebar-footer .user-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 0.5rem;
    border-radius: 50%;
}

.sidebar-footer .logout-btn {
    width: 100%;
    justify-content: center;
}

.sidebar-collapsed .sidebar-footer .user-info span,
.sidebar-collapsed .sidebar-footer .logout-btn span {
    display: none;
}

/* Main Wrapper */
.main-wrapper {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* Prevent flex child overflow */
}

.sidebar-collapsed~.main-wrapper {
    margin-left: 70px;
}

/* Dashboard Header */
.dashboard-header {
    background: var(--white);
    padding: 0 2rem;
    height: 64px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
    border-bottom: 1px solid var(--gray-200);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    color: var(--gray-600);
    font-weight: 500;
    font-size: 0.875rem;
}

/* Dashboard Content */
.dashboard-content {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.stat-card:nth-child(1)::before {
    background: var(--info-color);
}

.stat-card:nth-child(2)::before {
    background: var(--success-color);
}

.stat-card:nth-child(3)::before {
    background: var(--warning-color);
}

.stat-card:nth-child(4)::before {
    background: var(--secondary-color);
}

.stat-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, var(--info-color), var(--info-hover));
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, var(--success-color), var(--success-hover));
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, var(--warning-color), var(--warning-hover));
}

.stat-card:nth-child(4) .stat-icon {
    background: linear-gradient(135deg, var(--secondary-color), var(--secondary-hover));
}

.stat-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--gray-900);
    line-height: 1;
}

.stat-content p {
    margin: 0.25rem 0 0;
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Modern Card */
.modern-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 2rem;
}

.modern-card:hover {
    box-shadow: var(--shadow-md);
}

.section-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
}

.section-header h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.125rem;
    font-weight: 600;
}

/* Appointments List */
.appointments-list {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.appointment-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.appointment-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.appointment-header {
    padding: 1rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.patient-info h3 {
    margin: 0 0 0.25rem;
    color: var(--gray-900);
    font-size: 1rem;
    font-weight: 600;
}

.patient-info p {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.875rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-pending {
    background: var(--warning-light);
    color: var(--warning-hover);
}

.status-confirmed {
    background: var(--info-light);
    color: var(--info-hover);
}

.status-in_progress {
    background: var(--primary-light);
    color: var(--primary-color);
}

.status-completed {
    background: var(--success-light);
    color: var(--success-hover);
}

.status-cancelled {
    background: var(--danger-light);
    color: var(--danger-hover);
}

.appointment-details {
    padding: 1rem;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-600);
    font-size: 0.875rem;
}

.detail-item i {
    color: var(--primary-color);
    width: 1rem;
    text-align: center;
}

.appointment-actions {
    padding: 1rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.modal-header h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close:hover {
    background: var(--gray-200);
    color: var(--gray-600);
}

/* Details Modal Specifics */
.details-modal {
    max-width: 1200px;
    width: 95%;
    height: 90vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    position: relative;
    max-height: 90vh;
}

.details-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}

.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.details-container {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}

/* Quick Actions Bar */
.modal-quick-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.btn-action-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-icon:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    border-color: var(--primary-light);
    transform: translateY(-1px);
}

.btn-action-icon i {
    font-size: 1rem;
}

.action-spacer {
    flex: 1;
}

.details-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background: #f8fafc;
}

.info-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
}

.info-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid var(--gray-100);
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.card-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-header h4 i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.card-body {
    padding: 1.5rem;
}

/* Modern Grid for Details */
.modern-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.modern-grid .detail-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.modern-grid .detail-item:hover {
    background: var(--white);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.modern-grid .detail-item.full-width {
    grid-column: 1 / -1;
}

.modern-grid .detail-item label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.modern-grid .detail-item label i {
    color: var(--primary-color);
    font-size: 0.8rem;
    opacity: 0.8;
}

.detail-value {
    font-size: 1rem;
    color: #1e293b;
    font-weight: 600;
    word-break: break-word;
    line-height: 1.4;
}

.detail-value.amount-value {
    font-size: 1.25rem;
    color: var(--success-color);
    font-weight: 700;
}

/* Lab Information Card */
.lab-info-card {
    background: linear-gradient(135deg, #eef2ff 0%, #ffffff 100%);
    border: 2px solid var(--primary-light);
}

.lab-display-modern {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lab-info-main {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
}

.lab-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    background: var(--white);
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.lab-details {
    flex: 1;
}

.lab-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.lab-note {
    margin: 0;
    font-size: 0.875rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lab-note i {
    color: var(--info-color);
}

/* Address Display */
.address-display-modern {
    padding: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    font-size: 0.9375rem;
    color: var(--gray-700);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Status Badge */
.status-badge-modern {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-badge-modern.status-pending,
.status-badge-modern.status-assigned {
    background: var(--warning-light);
    color: var(--warning-color);
}

.status-badge-modern.status-confirmed,
.status-badge-modern.status-completed {
    background: var(--success-light);
    color: var(--success-color);
}

.status-badge-modern.status-cancelled {
    background: var(--danger-light);
    color: var(--danger-color);
}

.status-badge-modern i {
    font-size: 0.5rem;
}

.status-badge-modern.status-paid {
    background: var(--success-light);
    color: var(--success-color);
}

/* Modern Loader */
.modern-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}

.modern-loader .loader-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1976D2, #42A5F5);
    animation: pulse 1.4s ease-in-out infinite;
    box-shadow: 0 2px 6px rgba(25, 118, 210, 0.3);
}

.modern-loader .loader-dot:nth-child(1) {
    animation-delay: 0s;
}

.modern-loader .loader-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.modern-loader .loader-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Map Container */
.map-container {
    width: 100%;
    height: 300px;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

/* Animations */
.fade-transition.ng-enter {
    opacity: 0;
}

.fade-transition.ng-enter.ng-enter-active {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.fade-transition.ng-leave {
    opacity: 1;
}

.fade-transition.ng-leave.ng-leave-active {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        width: 260px;
        transform: translateX(0);
    }

    .main-wrapper {
        margin-left: 0;
    }

    .dashboard-content {
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .appointment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .appointment-actions {
        justify-content: stretch;
    }

    .appointment-actions .btn {
        flex: 1;
    }

    .modal-content {
        max-width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .modal-header {
        border-radius: 0;
    }
}

/* Utility Classes */
.text-muted {
    color: var(--gray-500);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Test Selection Section */
.test-selection-section {
    margin-top: 1.5rem;
}

.test-selection-section h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.test-selection-section h4 i {
    color: var(--primary-color);
}

.test-selection-container {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.test-search-box {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
    border-bottom: 2px solid var(--gray-200);
}

.test-search-box .input-group {
    display: flex;
    align-items: center;
}

.test-search-box .input-group-text {
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-right: none;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    padding: 0.75rem 1rem;
    color: var(--gray-500);
}

.test-search-box .form-control {
    border: 1px solid var(--gray-300);
    border-left: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

.test-search-box .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.available-tests-list {
    max-height: 350px;
    overflow-y: auto;
}

.test-list-item {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-100);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    background: var(--white);
}

.test-list-item:hover {
    background: var(--gray-50);
    transform: translateX(4px);
}

.test-list-item.bg-light {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-color);
}

.test-info {
    flex: 1;
}

.test-info div {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.test-info small {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.test-action {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.test-action div {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 1rem;
}

.selected-tests-summary {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--success-light) 0%, var(--white) 100%);
    border: 2px solid var(--success-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.selected-tests-summary h5 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selected-tests-list {
    margin-bottom: 1rem;
}

.selected-test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.selected-test-item:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.selected-test-item .test-name {
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
}

.selected-test-item .test-price {
    font-weight: 700;
    color: var(--success-color);
    margin: 0 1rem;
    font-size: 1rem;
}

.btn-remove-test {
    background: var(--danger-light);
    color: var(--danger-color);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-remove-test:hover {
    background: var(--danger-color);
    color: var(--white);
    transform: scale(1.1);
}

.tests-total {
    padding: 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    border: 2px solid var(--success-color);
    text-align: center;
    margin-bottom: 1rem;
}

.tests-total strong {
    font-size: 1.5rem;
    color: var(--success-color);
    font-weight: 700;
}

.test-selection-actions {
    display: flex;
    justify-content: center;
}

.test-selection-actions .btn {
    min-width: 180px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
}

.tests-details {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--info-light) 0%, var(--white) 100%);
    border: 2px solid var(--info-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
}

.tests-details h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tests-details h4 i {
    color: var(--info-color);
}

.tests-list {
    margin-bottom: 1rem;
}

.tests-list .test-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: var(--white);
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    border: 1px solid var(--gray-200);
}

.tests-list .test-item .test-name {
    font-weight: 600;
    color: var(--gray-900);
    flex: 1;
}

.tests-list .test-item .test-price {
    font-weight: 700;
    color: var(--info-color);
    font-size: 1rem;
}

/* Phone and Email Links */
.phone-link,
.email-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.phone-link:hover,
.email-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Modal Header Improvements */
.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--gray-200);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header-content h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.modal-header-content h3 i {
    color: var(--white);
}

.modal-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: var(--white);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Full Page Loader */
.full-page-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.loader-container {
    text-align: center;
    color: var(--white);
}

.loader-container h2 {
    color: var(--white);
    margin-top: 30px;
    font-size: 1.5rem;
    font-weight: 600;
}

.loader-container p {
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
    font-size: 1rem;
}

.modern-loader-large {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.loader-dot-large {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--white);
    animation: pulse-large 1.4s ease-in-out infinite;
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.3);
}

.loader-dot-large:nth-child(1) {
    animation-delay: 0s;
}

.loader-dot-large:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dot-large:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse-large {

    0%,
    80%,
    100% {
        transform: scale(0.8);
        opacity: 0.6;
    }

    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* Default state for mobile toggle */
.mobile-sidebar-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-700);
    padding: 0.5rem;
    margin-right: 0.5rem;
    cursor: pointer;
}

/* Mobile App Style Enhancements */
@media (max-width: 768px) {

    /* App-like body styling */
    body {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Allow text selection in inputs */
    input,
    textarea {
        user-select: text;
        -webkit-user-select: text;
    }

    .phlebotomist-dashboard {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        position: relative;
    }

    .main-wrapper {
        width: 100%;
        margin-left: 0;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .dashboard-content {
        padding: 1rem;
        padding-bottom: 100px;
        /* Space for mobile navigation */
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .patient-card,
    .appointment-card,
    .info-card {
        border-radius: 16px;
        margin-bottom: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
        border-radius: 12px;
        width: 100%;
        margin: 0.5rem 0;
        min-height: 48px;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.2s ease;
    }

    .btn:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
        margin: 0;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        transform: none;
    }

    .modal-header {
        border-radius: 0;
        padding: 1.25rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .details-container {
        padding: 1rem;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modern-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .test-selection-container {
        border-radius: 12px;
    }

    .available-tests-list {
        max-height: 250px;
        -webkit-overflow-scrolling: touch;
    }

    /* Mobile-friendly input fields */
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px;
        /* Prevents zoom on iOS */
        padding: 14px 16px;
        border-radius: 12px;
        width: 100%;
        border: 2px solid var(--gray-300);
        background: var(--white);
        -webkit-appearance: none;
        appearance: none;
    }

    input:focus,
    textarea:focus,
    select:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px var(--primary-light);
    }

    /* Touch-friendly buttons */
    .btn,
    button {
        min-height: 48px;
        /* iOS recommended touch target */
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Mobile navigation improvements */
    .sidebar {
        width: 280px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1000;
        height: 100vh;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.2);
    }

    /* Full screen modals on mobile */
    .modal-overlay {
        background: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
    }

    /* OTP Input Mobile Styles */
    .otp-input {
        font-size: 18px !important;
        letter-spacing: 6px !important;
        padding: 16px !important;
        min-height: 56px;
    }

    /* Card spacing on mobile */
    .info-card {
        margin-bottom: 1rem;
    }

    /* Page header mobile */
    .page-header,
    .dashboard-header {
        padding: 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    /* Patient card mobile layout */
    .patient-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .patient-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .patient-actions .btn {
        width: 100%;
    }

    /* Smooth scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent text selection on buttons */
    .btn,
    button {
        -webkit-user-select: none;
        user-select: none;
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .dashboard-content {
        padding: 0.75rem;
    }

    .patient-card,
    .info-card {
        padding: 1rem;
    }

    .modal-header {
        padding: 1rem;
    }

    .details-container {
        padding: 0.75rem;
    }
}

/* Hide global site header/footer when phlebotomist app is open */
.phlebotomist-shell nav.navbar,
.phlebotomist-shell .site-footer,
.phlebotomist-shell .main-footer,
.phlebotomist-shell .global-footer,
.phlebotomist-shell header.site-header,
.phlebotomist-shell footer[role="contentinfo"] {
    display: none !important;
}

/* CSS Updates for Sidebar Refactoring and Mobile Bottom Nav */

/* 1. Desktop Collapsed State Fixes (Replacing ng-if) */
.sidebar-collapsed .nav-text {
    display: none;
}

.sidebar-collapsed .nav-label {
    display: none;
}

/* Ensure badge is hidden when collapsed on desktop if desired, 
   or allow it to show (mini-dot) - for now hiding to match previous behavior */
.sidebar-collapsed .badge {
    display: none;
}

/* 2. Mobile Bottom Navigation Bar */
/* 2. Mobile Sidebar Navigation (Slide-out) */
@media (max-width: 768px) {

    .mobile-sidebar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* SIDEBAR DRAWER STYLES */
    .sidebar,
    .sidebar.sidebar-collapsed {
        width: 280px !important;
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 2000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        border-right: 1px solid var(--gray-200);
        height: 100vh;
        box-shadow: none;
        /* Shadow only when open */
        display: flex;
        flex-direction: column;
        padding: 0;
        /* Reset any padding from overrides */
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 0 0 25px rgba(0, 0, 0, 0.2);
    }

    /* Ensure styles from bottom nav are reset/restored */
    .sidebar-header,
    .sidebar-profile,
    .sidebar-metrics,
    .sidebar-footer,
    .nav-label {
        display: block !important;
        /* Restore elements hidden by previous bottom-nav code */
    }

    .sidebar-header {
        display: flex !important;
    }

    .sidebar-profile {
        display: flex !important;
    }

    .sidebar-metrics {
        display: grid !important;
    }

    .sidebar-nav {
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        justify-content: flex-start !important;
        padding: 1rem 0 !important;
    }

    .sidebar-nav .nav-item {
        flex-direction: row !important;
        /* Icon left, text right */
        padding: 0.75rem 1.25rem !important;
        border-right: none !important;
        border-left: 3px solid transparent !important;
        border-top: none !important;
        justify-content: flex-start !important;
        align-items: center !important;
        text-align: left !important;
        margin: 0 !important;
        height: auto !important;
        width: 100% !important;
    }

    .sidebar-nav .nav-item i {
        margin-right: 12px !important;
        margin-bottom: 0 !important;
        font-size: 1.1rem !important;
        width: 24px !important;
    }

    .sidebar-collapsed .nav-text,
    .sidebar .nav-text,
    /* Reset specific selectors */
    .nav-text {
        display: block !important;
        font-size: 0.9rem !important;
        white-space: normal !important;
        line-height: inherit !important;
        font-weight: 500 !important;
    }

    /* Reset specific bottom nav badge positioning */
    .sidebar-collapsed .badge,
    .sidebar .badge {
        position: static !important;
        transform: none !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        top: auto !important;
        right: auto !important;
    }

    .sidebar-nav .nav-item.active {
        background: var(--primary-light);
        border-left-color: var(--primary-color) !important;
        border-top: none !important;
        color: var(--primary-color);
    }

    /* Reset main wrapper margins (content pushes over on desktop, but overlay on mobile) */
    .main-wrapper,
    .sidebar-collapsed~.main-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }

    /* Adjust Header */
    .dashboard-header {
        position: sticky;
        top: 0;
        z-index: 900;
        padding: 0 1rem;
        height: 60px;
        justify-content: space-between;
    }

    .header-left {
        gap: 0.75rem;
    }

    .dashboard-content {
        padding: 1rem;
        padding-bottom: 2rem !important;
        /* Normal padding, no bottom nav space needed */
    }

    /* Other Mobile Fixes */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .appointment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .detail-row {
        grid-template-columns: 1fr;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 90vh;
        margin-bottom: 0;
    }

    .map-container {
        height: 250px;
    }

    /* Overlay when sidebar is open */
    .mobile-sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1500;
        /* Above regular content, below sidebar (2000) */
        backdrop-filter: blur(2px);
        animation: fadeIn 0.2s ease-out;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }

        to {
            opacity: 1;
        }
    }
}