.cl-box-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px 0;
}
.cl-box-preview.hidden { display: none; }
.cl-box-preview img {
  max-height: 64px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cl-box-preview #cl-box-caption {
  font-size: 0.9rem;
  color: #555;
}

/* Inline image inside brand/model dropdown options */
.simple-dropdown.model-dropdown .dropdown-option,
.simple-dropdown.brand-dropdown .dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-mini-box {
  flex: 0 0 auto;
  height: 18px;
  width: 28px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.cl-brand-logo {
  flex: 0 0 auto;
  height: 18px;
  width: auto;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  object-fit: cover;
}
/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    background: #0f172a;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-weight: 400;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #ffffff;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Auth Container - GatherSet Style */
.auth-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: #0f172a; /* Dark blue background like GatherSet */
    position: relative;
    overflow: hidden;
}

/* Grid lines removed for cleaner look */

/* Main title section at the top like GatherSet */
.main-title-section {
    text-align: center;
    margin-bottom: 32px;
    max-width: 480px;
}

.main-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    text-transform: none; /* Changed from uppercase to normal case */
}

.secure-portal-title {
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    margin: 0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Grid lines completely removed for clean background */

.auth-card {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    text-align: center;
    position: relative;
    z-index: 1;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
}

.auth-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-form {
    text-align: center;
}

.auth-form h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #ffffff;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #e2e8f0;
    font-size: 14px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(15, 23, 42, 0.8);
    color: #ffffff;
    font-weight: 400;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.form-group input::placeholder {
    color: #94a3b8;
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 140px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #f8fafc;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.auth-switch {
    text-align: center;
    margin-top: 24px;
    color: #94a3b8;
}

.auth-switch a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.auth-switch a:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Security Statement - GatherSet Style */
.security-statement {
    margin-top: 24px;
    padding: 16px;
    background: transparent;
    border: none;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.secure-connection {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #10b981;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.pulse-circle {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Main App - Modern Clean Theme */
.main-app {
    min-height: 100vh;
    background: #0f172a;
    color: #ffffff;
}

.app-header {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-weight: 500;
    color: #e2e8f0;
    padding: 8px 16px;
    background: rgba(148, 163, 184, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.app-nav {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0 32px;
}

.app-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
    padding: 16px 32px;
}

.nav-btn {
    background: none;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.nav-btn:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

.nav-btn.active {
    background: rgba(148, 163, 184, 0.2);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
}

.app-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 32px;
}

/* Views */
.view {
    display: none;
}

.view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.view-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Dashboard - Modern Dark Theme */
.dashboard-header {
    text-align: center;
    margin-bottom: 60px;
}

.dashboard-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 12px;
    letter-spacing: -0.025em;
}

.dashboard-header p {
    color: #94a3b8;
    font-size: 18px;
    font-weight: 400;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
    margin-bottom: 60px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(148, 163, 184, 0.4);
}

.stat-icon {
    font-size: 32px;
    width: 64px;
    height: 64px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2e8f0;
    box-shadow: 0 8px 20px rgba(148, 163, 184, 0.2);
}

.stat-content h3 {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
}

.stat-content p {
    color: #94a3b8;
    font-size: 16px;
    font-weight: 500;
}

.quick-actions {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

.quick-actions::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.quick-actions h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

/* Filters */
.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 20px;
    border: 1px solid #374151;
    border-radius: 12px;
    font-size: 14px;
    background: rgba(31, 41, 55, 0.8);
    color: #ffffff;
    min-width: 180px;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Prescriptions List */
.prescriptions-list {
    display: grid;
    gap: 24px;
}

.prescription-card {
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 20px;
    padding: 32px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.prescription-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.prescription-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(148, 163, 184, 0.4);
}

.prescription-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.prescription-type {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.prescription-type.glasses {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.prescription-type.contact_lens {
    background: rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
}

.prescription-date {
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    margin-left: auto;
}

.prescription-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-label {
    font-size: 12px;
    color: #94a3b8;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.detail-value {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.prescription-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-width: auto;
    border-radius: 8px;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* Prescription Form - Modern Dark Theme */
.prescription-form {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 20px;
    padding: 40px;
    position: relative;
    overflow: visible;
}

.prescription-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(148, 163, 184, 0.3);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
}

.form-actions {
    display: flex;
    gap: 20px;
    justify-content: flex-end;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

/* OCR Upload Section */
.ocr-upload-section {
    background: rgba(30, 41, 59, 0.5);
    border: 2px dashed rgba(148, 163, 184, 0.4);
    border-radius: 20px;
    padding: 48px;
    text-align: center;
    margin-bottom: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ocr-upload-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(148, 163, 184, 0.05);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ocr-upload-section:hover::before {
    opacity: 1;
}

.ocr-upload-section:hover {
    border-color: #94a3b8;
    background: rgba(30, 41, 59, 0.8);
    transform: translateY(-2px);
}

.ocr-upload-section.dragover {
    border-color: #94a3b8;
    background: rgba(30, 41, 59, 0.8);
}

.upload-icon {
    font-size: 64px;
    color: #94a3b8;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(148, 163, 184, 0.3));
}

.upload-text h4 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.upload-text p {
    color: #a1a1aa;
    font-size: 16px;
    margin-bottom: 24px;
}

.file-input {
    /* Keep input accessible for iOS/Safari; labels won't trigger if display:none */
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    border: 0;
    padding: 0;
    margin: 0;
}

.upload-btn {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.upload-btn-wrap {
    position: relative;
    display: inline-block;
}

.upload-btn-wrap .file-input {
    /* Ensure the input remains clickable overlay for Chrome quirks */
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #4338ca, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

/* Prescription Type Tabs */
.prescription-type-tabs {
    display: flex;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    padding: 6px;
    margin-bottom: 32px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.type-tab {
    flex: 1;
    padding: 14px 20px;
    text-align: center;
    background: none;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-tab.active {
    background: rgba(148, 163, 184, 0.2);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
}

/* Enhanced Dropdowns - Modern Style */
.enhanced-select {
    position: relative;
    width: 100%;
}

.enhanced-select select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    font-size: 16px;
    background: rgba(30, 41, 59, 0.8);
    color: #ffffff;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.enhanced-select select:focus {
    outline: none;
    border-color: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.1);
}

.enhanced-select::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.enhanced-select:focus-within::after {
    transform: translateY(-50%) rotate(180deg);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.toast {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-left: 4px solid;
    min-width: 320px;
    animation: slideIn 0.3s ease;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #4f46e5;
}

.toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.toast-close:hover {
    color: #ffffff;
}

.toast-message {
    font-size: 14px;
    color: #a1a1aa;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: rgba(26, 26, 46, 0.5);
    border-radius: 20px;
    border: 1px solid rgba(79, 70, 229, 0.2);
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.empty-state p {
    color: #a1a1aa;
    font-size: 16px;
    margin-bottom: 24px;
}

/* Prescription Table - Professional Style */
.prescription-table-container {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(79, 70, 229, 0.2);
    margin-bottom: 32px;
    position: relative;
}

.prescription-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.prescription-table thead {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.prescription-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prescription-table th:first-child {
    width: 120px;
}

.prescription-table tbody tr {
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
    transition: background-color 0.3s ease;
}

.prescription-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.05);
}

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

.prescription-table td {
    padding: 16px 12px;
    vertical-align: middle;
}

.eye-label {
    font-weight: 600;
    font-size: 14px;
    color: #d1d5db;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    text-align: center;
    white-space: nowrap;
}

.eye-row:nth-child(odd) .eye-label {
    background: rgba(59, 130, 246, 0.1);
}

.eye-row:nth-child(even) .eye-label {
    background: rgba(139, 92, 246, 0.1);
}

.prescription-table .enhanced-select {
    margin: 0;
}

.prescription-table .enhanced-select select {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    min-width: 100px;
    transition: all 0.3s ease;
}

.prescription-table .enhanced-select select:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
    background: rgba(31, 41, 55, 1);
}

.prescription-table .enhanced-select::after {
    right: 12px;
    font-size: 10px;
}

/* Contact Lens Section - Professional Style */
.contact-lens-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(26, 26, 46, 0.8);
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    margin-top: 16px;
}

.contact-lens-table thead {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.contact-lens-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-lens-table tbody tr {
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
    transition: background-color 0.3s ease;
}

.contact-lens-table tbody tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.contact-lens-table tbody tr:last-child {
    border-bottom: none;
}

.contact-lens-table td {
    padding: 14px 12px;
    vertical-align: middle;
}

.contact-lens-table .eye-label {
    background: rgba(139, 92, 246, 0.1);
    color: #d1d5db;
}

.contact-lens-table .enhanced-select select {
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    min-width: 80px;
}

.contact-lens-table .enhanced-select select:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* Contact Lens Table Container */
.contact-lens-table-container {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    margin-bottom: 32px;
    position: relative;
}

.contact-lens-table-container .contact-lens-table {
    margin-top: 0;
}

/* Responsive Table */
@media (max-width: 768px) {
    .auth-card {
        padding: 32px 24px;
        margin: 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .app-nav {
        padding: 12px 24px;
    }

    .nav-btn {
        padding: 10px 16px;
        font-size: 14px;
    }

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .prescription-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .prescription-details {
        grid-template-columns: 1fr;
    }

    .prescription-actions {
        justify-content: flex-start;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        min-width: auto;
    }

    .toast-container {
        left: 20px;
        right: 20px;
    }

    .toast {
        min-width: auto;
    }

    .prescription-table-container {
        padding: 16px;
        overflow-x: auto;
    }
    
    .prescription-table {
        min-width: 600px;
    }
    
    .prescription-table th,
    .prescription-table td {
        padding: 12px 8px;
        font-size: 13px;
    }
    
    .eye-label {
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .prescription-table .enhanced-select select {
        padding: 8px 10px;
        font-size: 13px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .app-content {
        padding: 20px 16px;
    }

    .prescription-form {
        padding: 24px;
    }

    .stat-card {
        padding: 24px;
    }

    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
} 

/* Simple dropdown styles (like 1-800 Contacts) */
.simple-dropdown {
    position: relative;
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    overflow: visible;
}

.simple-dropdown:hover {
    border-color: #4f46e5;
}

.simple-dropdown.open {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dropdown-display {
    padding: 14px 18px;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 400;
    position: relative;
    overflow: visible;
}

.simple-dropdown[data-selected]:not([data-selected=""]) .dropdown-display {
    color: #ffffff;
}

.dropdown-display::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.simple-dropdown.open .dropdown-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid #374151;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.simple-dropdown.open .dropdown-options {
    display: block;
}

/* Wider panel for brand list to improve readability */
.brand-dropdown .dropdown-options,
.model-dropdown .dropdown-options {
    min-width: 700px;
    white-space: nowrap;
}

/* Power (sphere) width same as glasses (no extra min-width) */
.power-dropdown .dropdown-options { min-width: 380px; }

/* Disabled state for custom dropdowns */
.simple-dropdown.disabled,
.contacts-dropdown.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.dropdown-option {
    padding: 12px 18px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(55, 65, 81, 0.3);
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: rgba(79, 70, 229, 0.2);
}

.dropdown-option.selected {
    background: rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.hidden-select {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* Scrollbar styling */
.dropdown-options::-webkit-scrollbar {
    width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
}

.dropdown-options::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Keep old side-by-side styles for backward compatibility */
.side-by-side-dropdown {
    position: relative;
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.side-by-side-dropdown .dropdown-display {
    padding: 14px 18px;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 400;
    position: relative;
    background: rgba(31, 41, 55, 0.8);
    border-bottom: 1px solid #374151;
    z-index: 100;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.side-by-side-dropdown[data-selected]:not([data-selected=""]) .dropdown-display {
    color: #ffffff;
}

.side-by-side-dropdown .dropdown-display::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.side-by-side-dropdown.open .dropdown-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.side-by-side-dropdown:hover {
    border-color: #4f46e5;
}

.side-by-side-dropdown.open {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dropdown-column {
    flex: 1;
    display: none;
    flex-direction: column;
    position: relative;
    max-height: 200px;
    /* Debug: ensure columns don't overlay the display */
    z-index: 1;
}

.side-by-side-dropdown.open .dropdown-column {
    display: flex;
}

.column-header {
    background: #6b7280;
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 8px;
    font-size: 14px;
    border-bottom: 1px solid #374151;
}

.dropdown-divider {
    width: 1px;
    background: #374151;
    margin: 0 4px;
}

.column-values {
    max-height: 200px;
    overflow-y: auto;
    display: none;
    scroll-behavior: smooth;
}

.side-by-side-dropdown.open .column-values {
    display: block;
}

/* Synchronized scrolling */
.side-by-side-dropdown .column-values {
    scroll-snap-type: y mandatory;
}

.side-by-side-dropdown .dropdown-option {
    scroll-snap-align: start;
}

/* Display selected value for side-by-side dropdowns - REMOVED */

/* Scrollbar styling for dropdown */
.column-values::-webkit-scrollbar {
    width: 6px;
}

.column-values::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
}

.column-values::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.column-values::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
} 

/* 1-800 Contacts style dropdown */
.contacts-dropdown {
    position: relative;
    width: 100%;
    background: rgba(31, 41, 55, 0.8);
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
}

.contacts-dropdown:hover {
    border-color: #4f46e5;
}

.contacts-dropdown.open {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.contacts-dropdown .dropdown-display {
    padding: 14px 18px;
    color: #ffffff;
    font-size: 16px;
    font-weight: 400;
    position: relative;
}

.contacts-dropdown[data-selected]:not([data-selected=""]) .dropdown-display {
    color: #ffffff;
}

.contacts-dropdown .dropdown-display::after {
    content: '▼';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.3s ease;
}

.contacts-dropdown.open .dropdown-display::after {
    transform: translateY(-50%) rotate(180deg);
}

.contacts-dropdown .dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid #374151;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.contacts-dropdown.open .dropdown-options {
    display: flex;
}

.contacts-dropdown .dropdown-options .negative-column,
.contacts-dropdown .dropdown-options .positive-column {
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.contacts-dropdown .dropdown-options .column-header {
    background: rgba(55, 65, 81, 0.8);
    color: #d1d5db;
    font-weight: bold;
    text-align: center;
    padding: 12px;
    font-size: 14px;
    border-bottom: 1px solid #374151;
    position: sticky;
    top: 0;
    z-index: 1;
}

.contacts-dropdown .dropdown-options .negative-column .column-header {
    color: #fca5a5;
}

.contacts-dropdown .dropdown-options .positive-column .column-header {
    color: #86efac;
}

.contacts-dropdown .dropdown-option {
    padding: 12px 16px;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #374151;
    text-align: center;
}

.contacts-dropdown .dropdown-option:last-child {
    border-bottom: none;
}

.contacts-dropdown .dropdown-option:hover {
    background: rgba(79, 70, 229, 0.2);
}

.contacts-dropdown .dropdown-option.selected {
    background: rgba(79, 70, 229, 0.4);
    color: #ffffff;
}

.contacts-dropdown .dropdown-options .divider {
    width: 1px;
    background: #374151;
    margin: 0;
}

/* Scrollbar styling for 1-800 Contacts style */
.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar {
    width: 6px;
}

.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar-track,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.5);
}

.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar-thumb,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar-thumb {
    background: #6b7280;
    border-radius: 3px;
}

.contacts-dropdown .dropdown-options .negative-column::-webkit-scrollbar-thumb:hover,
.contacts-dropdown .dropdown-options .positive-column::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
} 