@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-600: #0891b2;
    --primary-500: #06b6d4;
    --primary-400: #22d3ee;
    --primary-100: #cffafe;
    --primary-50: #ecfeff;
    
    --green-600: #059669;
    --green-500: #10b981;
    --green-100: #d1fae5;
    
    --amber-500: #f59e0b;
    --amber-100: #fef3c7;
    
    --red-500: #ef4444;
    --red-100: #fee2e2;
    
    --purple-600: #7c3aed;
    --purple-100: #ede9fe;
    
    --teal-600: #0d9488;
    --teal-100: #ccfbf1;
    
    --rose-500: #f43f5e;
    --rose-100: #ffe4e6;
    
    --blue-400: #60a5fa;
    
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body.has-bottom-nav {
    padding-bottom: 80px;
}

a {
    color: var(--primary-600);
    text-decoration: none;
}

a:hover {
    color: var(--primary-500);
}

/* Top Navigation */
.top-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: 56px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    gap: 12px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-brand-logo svg {
    width: 20px;
    height: 20px;
    color: var(--white);
}

.nav-brand-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.3;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    padding: 8px 0;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 12px;
    color: var(--gray-500);
    font-size: 0.625rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
    min-width: 64px;
}

.nav-item:hover {
    color: var(--gray-700);
}

.nav-item.active {
    color: var(--primary-600);
}

.nav-item.active .nav-icon {
    color: var(--primary-600);
}

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    color: inherit;
}

.nav-label {
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Main Content */
.main-content {
    padding: 20px 16px;
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-header .text-muted {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.2;
}

.page-subtitle {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
    background: var(--gray-50);
}

.card-body {
    padding: 16px;
}

.card-body p {
    margin-bottom: 8px;
}

.card-body p:last-child {
    margin-bottom: 0;
}

.card-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    gap: 8px;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover {
    text-decoration: none;
}

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

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-600);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-500);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-200);
}

.btn-success {
    background: var(--green-600);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: var(--green-500);
}

.btn-danger {
    background: var(--red-500);
    color: var(--white);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover:not(:disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
    padding: 8px;
}

.btn-ghost:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--gray-900);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--border-radius);
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    font-family: inherit;
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    background: var(--white);
    transition: border-color 0.15s, box-shadow 0.15s;
    color: var(--gray-900);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--gray-400);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-error {
    font-size: 0.75rem;
    color: var(--red-500);
    margin-top: 4px;
}

/* Patient Search Typeahead */
.patient-search-wrapper {
    position: relative;
}

/* Allow dropdown to overflow card boundaries */
.card:has(.patient-search-wrapper) {
    overflow: visible;
}

.card:has(.patient-search-wrapper) .card-body {
    overflow: visible;
}

.patient-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.patient-search-title {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.patient-search-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.patient-search-item:last-child {
    border-bottom: none;
}

.patient-search-item:hover {
    background: var(--primary-50);
}

.patient-search-name {
    font-weight: 500;
    color: var(--gray-900);
}

.patient-search-phone {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.patient-search-empty {
    padding: 16px 12px;
    text-align: center;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.badge-primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.badge-success {
    background: var(--green-100);
    color: var(--green-600);
}

.badge-warning {
    background: var(--amber-100);
    color: var(--gray-800);
}

.badge-danger {
    background: var(--red-100);
    color: var(--red-500);
}

.badge-secondary {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* Near-expiry banner */
.near-expiry-banner {
    background: var(--amber-100);
    color: var(--gray-800);
    padding: 10px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 8px;
    margin-bottom: 12px;
}

/* List Items */
.list-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    gap: 12px;
    transition: background 0.15s;
    text-decoration: none;
    color: inherit;
}

.list-item:last-child {
    border-bottom: none;
}

.list-item:hover {
    background: var(--gray-50);
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    color: var(--gray-900);
    font-size: 0.9375rem;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Patient Links */
.patient-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.patient-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Stats Grid */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--gray-200);
    padding: 16px;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.stat-icon svg {
    width: 20px;
    height: 20px;
}

.stat-icon.primary {
    background: var(--primary-100);
    color: var(--primary-600);
}

.stat-icon.success {
    background: var(--green-100);
    color: var(--green-600);
}

.stat-icon.warning {
    background: var(--amber-100);
    color: var(--amber-500);
}

.stat-icon.danger {
    background: var(--red-100);
    color: var(--red-500);
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: var(--gray-300);
}

.empty-state p {
    font-size: 0.9375rem;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab {
    padding: 12px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover {
    color: var(--gray-700);
}

.tab.active {
    color: var(--primary-600);
    border-bottom-color: var(--primary-600);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100dvh;
    background: rgba(17, 24, 39, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
    overflow-y: auto;
    animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
    display: flex !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 440px;
    max-height: min(90vh, calc(100dvh - 32px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.2s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-100);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: var(--border-radius);
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--gray-600);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10000;
    max-height: 220px;
    overflow-y: auto;
}

.autocomplete-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--gray-700);
    border-bottom: 1px solid var(--gray-50);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.highlighted {
    background: var(--primary-light);
    color: var(--primary-color);
}

.autocomplete-item strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 32px);
    max-width: 360px;
}

.toast {
    background: var(--gray-900);
    color: var(--white);
    padding: 14px 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    font-size: 0.875rem;
    text-align: center;
}

.toast-success {
    background: var(--green-600);
}

.toast-error {
    background: var(--red-500);
}

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

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* Queue Styles */
.token-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    color: var(--white);
    border-radius: 50%;
    font-size: 1.125rem;
    font-weight: 700;
    flex-shrink: 0;
}

.queue-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 14px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.15s;
}

.queue-item .list-item-content {
    flex: 1;
    min-width: 100px;
}

.queue-item .queue-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

@media (max-width: 480px) {
    .queue-item {
        position: relative;
        padding-left: 70px;
        min-height: 70px;
    }
    
    .queue-item .token-badge {
        position: absolute;
        top: 50%;
        left: 16px;
        transform: translateY(-50%);
    }
    
    .queue-item .list-item-content {
        width: 100%;
        flex: none;
    }
    
    .queue-item .queue-actions {
        width: 100%;
        margin-top: 4px;
    }
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item.waiting {
    background: var(--white);
}

.queue-item.in_progress {
    background: var(--amber-100);
}

.queue-item.completed {
    background: var(--green-100);
    opacity: 0.7;
}

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

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

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--gray-500);
}

.text-success {
    color: var(--green-600);
}

.text-danger {
    color: var(--red-500);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }

hr {
    border: none;
    border-top: 1px solid var(--gray-200);
    margin: 16px 0;
}

/* Responsive */
@media (min-width: 768px) {
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .main-content {
        padding: 32px 24px;
    }
    
    #toast-container {
        bottom: auto;
        top: 80px;
        left: auto;
        right: 24px;
        transform: none;
    }
}

@media (max-width: 480px) {
    .nav-user .user-info {
        display: none;
    }
    
    .modal-overlay {
        align-items: flex-start;
        padding-top: 16px;
        padding-bottom: 16px;
    }
    
    .modal {
        margin: 0 8px;
        max-height: calc(100dvh - 32px);
    }
}

/* Landing Page Styles */
.landing-page {
    min-height: 100vh;
    background: var(--white);
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.landing-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-500) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing-logo-icon svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.landing-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.landing-hero {
    background: linear-gradient(180deg, var(--primary-50) 0%, var(--white) 100%);
    padding: 48px 24px 64px;
    text-align: center;
}

.hero-content {
    max-width: 600px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--primary-100);
    color: var(--primary-600);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 32px;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.hero-cta .btn {
    min-width: 220px;
}

.landing-features {
    padding: 64px 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.features-header {
    text-align: center;
    margin-bottom: 48px;
}

.features-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.features-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.feature-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background: var(--primary-100);
    color: var(--primary-600);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.feature-desc {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.5;
}

.landing-cta-section {
    background: var(--gray-50);
    padding: 64px 24px;
    text-align: center;
}

.cta-content {
    max-width: 500px;
    margin: 0 auto;
}

.cta-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 12px;
}

.cta-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: 32px;
}

.cta-form {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    text-align: left;
}

.cta-form .form-group:last-of-type {
    margin-bottom: 20px;
}

.landing-footer {
    padding: 32px 24px;
    text-align: center;
    border-top: 1px solid var(--gray-200);
}

.footer-text {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Login Page Styles */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--gray-50);
}

.login-header {
    padding: 24px;
    text-align: center;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 32px 24px;
    width: 100%;
    max-width: 400px;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    text-align: center;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 0.9375rem;
    color: var(--gray-600);
    text-align: center;
    margin-bottom: 24px;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-200);
}

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* Error alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-error {
    background: var(--red-100);
    color: var(--red-500);
    border: 1px solid var(--red-500);
}

.alert-success {
    background: var(--green-100);
    color: var(--green-600);
    border: 1px solid var(--green-600);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }
    
    .landing-features {
        padding: 80px 24px;
    }
}

/* AI Dictation / Voice Scribe Styles */
.ai-dictation-card {
    border: 2px solid var(--primary-100);
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--white) 100%);
}

.ai-dictation-card .card-header {
    background: var(--primary-100);
    color: var(--primary-600);
    font-weight: 600;
}

/* AI Scribe Consent Banner */
.consent-banner {
    margin-bottom: 16px;
}

.consent-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
}

.consent-banner-content.consent-yes {
    background: var(--green-50);
    border: 1px solid var(--green-200);
    color: var(--green-700);
}

.consent-banner-content.consent-no {
    background: var(--amber-50);
    border: 1px solid var(--amber-200);
    color: var(--amber-700);
}

.consent-banner .consent-icon {
    font-weight: 700;
    font-size: 16px;
}

.dictation-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

#btn-record {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    justify-content: center;
}

#btn-record.recording {
    background: var(--red-500);
    animation: pulse-recording 1.5s infinite;
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.audio-level-bar {
    flex: 1;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.audio-level-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green-500), var(--primary-500));
    transition: width 0.1s ease;
    border-radius: 4px;
}

.transcript-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 16px;
}

.transcript-text {
    min-height: 60px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--gray-800);
    white-space: pre-wrap;
}

.transcript-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.ai-suggestions {
    margin-top: 16px;
    background: var(--green-100);
    border: 1px solid var(--green-500);
    border-radius: var(--border-radius);
    padding: 16px;
}

.ai-suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
}

.ai-suggestion-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 12px;
    margin-bottom: 8px;
}

.ai-suggestion-item.accepted {
    border-color: var(--green-500);
    background: var(--green-100);
}

.ai-suggestion-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ai-suggestion-value {
    font-size: 0.9375rem;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.ai-suggestion-actions {
    display: flex;
    gap: 8px;
}

.ai-rx-item {
    font-size: 0.875rem;
    color: var(--gray-700);
    padding: 4px 0;
    border-bottom: 1px dashed var(--gray-200);
}

.ai-rx-item:last-of-type {
    border-bottom: none;
    margin-bottom: 8px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.form-input-sm {
    padding: 6px 10px;
    font-size: 0.875rem;
}

.gap-half {
    gap: 4px;
}

.text-sm {
    font-size: 0.875rem;
}

.mic-icon {
    font-size: 1.25rem;
}

/* Photo Preview Styles */
.photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.photo-preview-item {
    position: relative;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.photo-preview-img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--gray-100);
}

.photo-caption {
    font-size: 0.75rem;
}

.photo-remove {
    font-size: 0.7rem;
    padding: 2px 6px;
}

.photo-upload-area {
    display: flex;
    gap: 8px;
    align-items: center;
}

.camera-icon {
    font-size: 1rem;
}

/* Visit Photos Display */
.visit-photos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.visit-photo-item {
    position: relative;
    cursor: pointer;
}

.visit-photo-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
}

.visit-photo-caption {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-top: 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Photo Modal/Lightbox */
.photo-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.photo-lightbox img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.photo-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
}

/* Photo Drop Zone */
.photo-drop-zone {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius-lg);
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--gray-50);
    position: relative;
}

.photo-drop-zone:hover {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.photo-drop-zone.drag-over {
    border-color: var(--primary-500);
    background: var(--primary-100);
    transform: scale(1.02);
}

.photo-drop-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-content {
    pointer-events: none;
}

.drop-zone-icon {
    font-size: 2.5rem;
    color: var(--primary-500);
    margin-bottom: 0.5rem;
    font-weight: 300;
}

.drop-zone-content p {
    margin: 0.25rem 0;
    color: var(--gray-600);
}

/* Photo Preview Container */
.photo-preview-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.photo-preview-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--border-radius-lg);
    padding: 1rem;
}

.photo-preview-large {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.photo-preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--red-500);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 500;
}

.photo-preview-remove:hover {
    background: #dc2626;
}

.photo-upload-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Upload Progress */
.upload-progress {
    padding: 1.5rem;
    text-align: center;
}

.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-500);
    width: 0%;
    animation: progress-pulse 1.5s ease-in-out infinite;
}

@keyframes progress-pulse {
    0%, 100% { width: 20%; margin-left: 0%; }
    50% { width: 60%; margin-left: 40%; }
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-300);
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

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

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Medicine Detail — info grid */
.med-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.med-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.med-info-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.med-info-value {
    font-size: 0.9rem;
    color: var(--gray-800);
}

/* Medicine Detail — stock summary bar */
.med-stock-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    border: 1px solid var(--gray-200);
    margin-top: 4px;
    align-items: center;
}

.med-stock-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.med-stock-stat-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-500);
}

.med-stock-stat-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
}
