/* ==========================================================================
   AegisMed - Custom Glassmorphic Medical Design System
   ========================================================================== */

/* Design Tokens */
:root {
    --bg-base: #060a0d;
    --bg-surface: rgba(15, 23, 30, 0.65);
    --bg-surface-solid: #0f171e;
    --bg-hover: rgba(22, 38, 51, 0.8);
    
    --primary: #10b981; /* Emerald */
    --primary-glow: rgba(16, 185, 129, 0.25);
    --secondary: #0d9488; /* Teal */
    --secondary-glow: rgba(13, 148, 136, 0.2);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(16, 185, 129, 0.25);
    
    --warning: #f59e0b; /* Amber */
    --warning-glow: rgba(245, 158, 11, 0.15);
    --danger: #ef4444; /* Red */
    --danger-glow: rgba(239, 68, 68, 0.15);
    --success: #10b981;
    
    --font-sans: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glass-blur: blur(12px);
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --border-radius-sm: 6px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(13, 148, 136, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2.5rem;
    background: rgba(6, 10, 13, 0.7);
    backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.logo-text span {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary-glow);
}

/* Navigation Tabs */
.main-nav {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.25rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
}

.nav-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.tab-icon {
    width: 1.1rem;
    height: 1.1rem;
    fill: currentColor;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: inset 0 0 0 1px var(--border-highlight);
}

/* Header Actions */
.cart-trigger {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.cart-trigger:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.cart-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--primary);
    color: #060a0d;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-base);
    box-shadow: 0 0 6px var(--primary-glow);
}

/* Main Content Area */
.app-main {
    flex: 1;
    padding: 2rem 2.5rem;
    position: relative;
}

/* Views Toggle */
.app-view {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.app-view.active {
    display: block;
}

/* ALERTS & INTERACTIONS */
.alerts-container {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.interaction-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-md);
    backdrop-filter: var(--glass-blur);
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.15);
}

.alert-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fca5a5;
    font-weight: 500;
}

.alert-message svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--danger);
    flex-shrink: 0;
}

.btn-dismiss-alert {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0.25rem;
}

.btn-dismiss-alert:hover {
    color: var(--text-primary);
}

/* STORE VIEW */
.store-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.store-sidebar {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    height: fit-content;
}

.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-smooth);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.1rem;
    height: 1.1rem;
    fill: var(--text-secondary);
}

.filter-group {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.filter-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-group h3 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    padding: 0.5rem;
    border-radius: var(--border-radius-sm);
}

.filter-checkbox input {
    display: none;
}

.filter-checkbox:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.02);
}

.filter-checkbox.active-filter {
    color: var(--primary);
    background: rgba(16, 185, 129, 0.06);
    font-weight: 600;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    width: 100%;
    padding: 0.5rem;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: var(--transition-smooth);
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-switch input:checked + .slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

.toggle-switch input:checked + .slider:before {
    transform: translateX(16px);
    background-color: #060a0d;
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Sidebar Disclaimer */
.sidebar-disclaimer {
    background: rgba(245, 158, 11, 0.03);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-top: 1.5rem;
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--warning);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.warning-icon {
    width: 1rem;
    height: 1rem;
    fill: currentColor;
}

.sidebar-disclaimer p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Store Catalog & Products Grid */
.store-catalog h2 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.catalog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.catalog-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* Product Card */
.product-card {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-highlight);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.08);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: var(--transition-smooth);
}

.product-card:hover::before {
    opacity: 1;
}

.product-badge-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rx-badge {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    text-transform: uppercase;
}

.otc-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #a7f3d0;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    text-transform: uppercase;
}

.product-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.product-ingredient {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.product-ingredient span {
    color: var(--secondary);
    font-weight: 500;
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-add-cart {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.625rem 1.25rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-add-cart:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #060a0d;
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ==========================================================================
   AI CONSULTANT VIEW (CHAT DESIGN)
   ========================================================================== */
.chat-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    height: 72vh;
    overflow: hidden;
}

.chat-sidebar {
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.consultant-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.avatar-container {
    position: relative;
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 1rem;
}

.avatar-svg {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    padding: 1rem;
    border: 2px solid var(--primary);
}

.avatar-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(16px);
    opacity: 0.25;
}

.consultant-profile h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    margin-top: 0.5rem;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.6s infinite;
}

.chat-suggestions h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.suggest-btn {
    width: 100%;
    text-align: left;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.625rem 0.875rem;
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggest-btn:hover {
    background: rgba(16, 185, 129, 0.05);
    border-color: var(--border-highlight);
    color: var(--text-primary);
}

.suggest-btn .icon {
    font-size: 0.65rem;
    color: var(--primary);
}

.chat-main {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Chat Message Bubbles */
.message {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.message-content {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    font-size: 0.95rem;
}

.message-time {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 0 0.5rem;
}

.ai-message {
    align-self: flex-start;
}

.ai-message .message-content {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.user-message {
    align-self: flex-end;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #060a0d;
    border-bottom-right-radius: 4px;
    font-weight: 500;
}

/* Typing Indicator Animation */
.typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: typing 1s infinite alternate;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Chat Input Area */
.chat-input-bar {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    align-items: center;
    background: rgba(6, 10, 13, 0.3);
}

.chat-input-bar textarea {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: none;
    max-height: 120px;
    transition: var(--transition-smooth);
}

.chat-input-bar textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

#chat-send-btn {
    background: var(--primary);
    border: none;
    color: #060a0d;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

#chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px var(--primary-glow);
}

#chat-send-btn svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* ==========================================================================
   PRESCRIPTION SCANNER VIEW
   ========================================================================== */
.scanner-container {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
}

.scanner-left h2 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.scanner-left p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.upload-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.15);
    background: var(--bg-surface);
    border-radius: var(--border-radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.02);
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    fill: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.upload-dropzone:hover .upload-icon {
    fill: var(--primary);
    transform: translateY(-4px);
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.zone-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.zone-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn-browse {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    padding: 0.625rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}

.upload-dropzone:hover .btn-browse {
    background: var(--primary);
    color: #060a0d;
    border-color: var(--primary);
}

/* Scanner Laser animation overlay */
.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 10, 13, 0.85);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.scan-laser {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    box-shadow: 0 0 15px var(--primary);
    animation: scan 2s ease-in-out infinite;
}

.scan-status-text {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
    text-shadow: 0 0 8px var(--primary-glow);
}

.sample-prescriptions {
    margin-top: 2rem;
}

.sample-prescriptions h4 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.sample-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.btn-sample {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-lg);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.btn-sample:hover {
    background: rgba(13, 148, 136, 0.05);
    border-color: var(--secondary);
}

.btn-sample span {
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-sample small {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Scanner Results Card */
.scanner-right .scanner-results-card {
    height: 100%;
    min-height: 380px;
    padding: 2rem;
}

.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
}

.results-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.doc-icon {
    width: 3.5rem;
    height: 3.5rem;
    fill: var(--text-muted);
    margin-bottom: 1.5rem;
}

.results-content {
    animation: fadeIn 0.4s ease;
}

.patient-info {
    display: flex;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.detected-items h4 {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.detected-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.detected-list-item {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
}

.detected-item-details {
    display: flex;
    flex-direction: column;
}

.detected-item-name {
    font-weight: 600;
}

.detected-item-dosage {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.detected-item-qty {
    align-self: center;
    font-weight: 700;
    color: var(--primary);
}

.detected-warnings {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.scanned-warning {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-md);
    font-size: 0.8rem;
    font-weight: 500;
}

.scanned-warning.critical {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.scanned-warning.info {
    background: rgba(245, 158, 11, 0.1);
    color: #fde047;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Buttons */
.w-full {
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    border: none;
    color: #060a0d;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-md);
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==========================================================================
   CART SYSTEM (DRAWER & MODALS)
   ========================================================================== */
.cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cart-backdrop.open {
    display: block;
    opacity: 1;
}

.cart-drawer {
    position: fixed;
    top: 0;
    right: -420px;
    width: 400px;
    height: 100%;
    background: var(--bg-surface-solid);
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-drawer.open {
    right: 0;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.btn-close-cart {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-close-cart:hover {
    color: var(--text-primary);
}

.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cart-empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.empty-cart-icon {
    width: 3rem;
    height: 3rem;
    fill: currentColor;
    margin-bottom: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

.cart-item-info {
    display: flex;
    flex-direction: column;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.cart-item-req-rx {
    color: #fca5a5;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--text-secondary);
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 0.25rem;
}

.btn-qty {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
}

.btn-qty:hover {
    color: var(--text-primary);
}

.item-qty-val {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}

.btn-remove-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-remove-item:hover {
    color: var(--danger);
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(6, 10, 13, 0.2);
}

.cart-summary-line {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.rx-warning-indicator {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--border-radius-md);
    padding: 0.75rem;
    font-size: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.warning-pill {
    background: var(--warning);
    color: #060a0d;
    align-self: flex-start;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
}

.warning-text {
    color: #fde047;
    font-weight: 500;
}

/* Modal Windows */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal.open {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 460px;
    padding: 2.5rem;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.success-icon-container {
    position: relative;
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
}

.success-svg {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    color: var(--primary);
}

.success-icon-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary);
    border-radius: 50%;
    filter: blur(20px);
    opacity: 0.25;
}

.modal-content h2 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.order-summary-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
    text-align: left;
    font-size: 0.9rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-row span {
    color: var(--text-muted);
}

.summary-row strong {
    color: var(--text-primary);
}

#ref-number {
    color: var(--primary);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes typing {
    from { transform: translateY(0); }
    to { transform: translateY(-4px); }
}

@keyframes scan {
    0% { top: 0; }
    50% { top: 100%; }
    100% { top: 0; }
}

.animate-scale {
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-glow);
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (max-width: 1024px) {
    .store-layout {
        grid-template-columns: 1fr;
    }
    
    .scanner-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .chat-container {
        grid-template-columns: 1fr;
        height: 80vh;
    }
    
    .chat-sidebar {
        display: none;
    }
    
    .app-main {
        padding: 1rem;
    }
    
    .cart-drawer {
        width: 100%;
        right: -100%;
    }
}

/* ==========================================================================
   SETTINGS PANEL & FORM ELEMENTS
   ========================================================================== */
.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.settings-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.settings-card {
    padding: 2rem;
}

.settings-group {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-row {
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 2rem;
    align-items: center;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.settings-row:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.settings-info label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    cursor: pointer;
}

.settings-icon {
    font-size: 1.25rem;
    color: var(--primary);
    filter: drop-shadow(0 0 6px var(--primary-glow));
}

.settings-subtext {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
}

.settings-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.settings-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(15, 23, 30, 0.95);
}

.settings-select option {
    background-color: var(--bg-surface-solid);
    color: var(--text-primary);
    padding: 0.5rem;
}

@media (max-width: 640px) {
    .settings-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Subdomain Styles */
.header-subdomain {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid var(--border-highlight);
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    margin-left: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-shadow: 0 0 8px var(--primary-glow);
}

.subdomain-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.subdomain-input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(255, 255, 255, 0.05);
}

.settings-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    min-width: 0;
}

.subdomain-domain {
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    border-left: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    user-select: none;
}

.settings-preview-url {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.settings-preview-url a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.settings-preview-url a:hover {
    text-decoration: underline;
    text-shadow: 0 0 8px var(--primary-glow);
}

/* Health Checklist Styles */
.health-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    width: 100%;
}

.health-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.health-checkbox-label:hover {
    color: var(--text-primary);
}

.health-checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    position: relative;
}

.health-checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 8px var(--primary-glow);
}

.health-checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: "✓";
    color: #fff;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Telehealth Call Pulse Indicator */
.pulse-dot {
    animation: tele-pulse 1.5s infinite;
}

@keyframes tele-pulse {
    0% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.7);
    }
    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(13, 148, 136, 0);
    }
    100% {
        transform: scale(0.9);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0);
    }
}

/* Telehealth Chat Message Bubbles */
.telehealth-msg {
    max-width: 85%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    line-height: 1.4;
    word-break: break-word;
}

.telehealth-msg-doctor {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}

.telehealth-msg-patient {
    align-self: flex-end;
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 2px;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* Telehealth Selection Buttons */
.telehealth-option-btn {
    flex: 1;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    transition: var(--transition-smooth);
}

.telehealth-option-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Merchant Inventory Table */
.inventory-table th, .inventory-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.inventory-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

.btn-delete-med {
    background: rgba(225, 29, 72, 0.08);
    border: 1px solid rgba(225, 29, 72, 0.3);
    color: #f43f5e;
    padding: 0.35rem 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.btn-delete-med:hover {
    background: #e11d48;
    border-color: #e11d48;
    color: #fff;
    box-shadow: 0 0 8px rgba(225, 29, 72, 0.4);
}
