:root {
    /* Calm & Serene Color Palette */
    --primary-color: #4A6670;
    --secondary-color: #6B7D7D;
    --accent-color: #7BA68C;
    --accent-warm: #B8A094;
    --success-color: #8FB996;
    --danger-color: #C97064;
    --warning-color: #D4A574;
    --light-bg: #F5F3EF;
    --white: #ffffff;
    --text-main: #3D4A4F;
    --text-muted: #7A8A8B;
    --border-color: #E5E2DC;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --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);
    --radius: 12px;
    --app-header-height: 64px;
    --sidebar-width: 240px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4 {
    font-weight: 700;
    color: var(--primary-color);
}

/* Layout Utilities */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem;
}

/* App shell + navigation */
.app-shell {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.app-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-header-height);
    z-index: 200;
}

/* Public Navigation - Simple header for public pages (login, index) */
.public-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-header-height);
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

.public-nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
    transition: opacity 0.2s;
}

.brand-logo:hover {
    opacity: 0.8;
}

.brand-logo img {
    height: 56px;
    width: auto;
    object-fit: contain;
    background: transparent;
}

.brand-icon {
    font-size: 1.5rem;
}

.brand-text {
    display: inline;
}

.public-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Responsive design for public header */
@media (max-width: 480px) {
    .brand-text {
        display: none;
    }
    
    .public-nav-container {
        padding: 0 0.75rem;
    }
}

@media (min-width: 768px) {
    .public-nav-container {
        padding: 0 2rem;
    }
}

/* Content wrapper - contains sidebar and main content */
.app-content-wrapper {
    display: flex;
    flex: 1;
    margin-top: var(--app-header-height);
    min-height: calc(100vh - var(--app-header-height));
    width: 100%;
    overflow-x: hidden;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem;
    max-width: 1200px;
    margin: 0 auto;
    gap: 1rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    background: transparent;
}

.nav-brand img {
    background: transparent;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-toggle:hover {
    background: var(--light-bg);
    border-color: var(--accent-color);
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    transition: transform 0.2s ease, width 0.2s ease;
    z-index: 190;
}

.sidebar-container {
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar-nav .nav-link {
    width: 100%;
}

.app-overlay {
    position: fixed;
    top: var(--app-header-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 180;
}

.app-main {
    flex: 1;
    padding: 2rem 1rem 1rem 1rem; /* Increased top padding from 1rem to 2rem */
    min-height: calc(100vh - var(--app-header-height));
    overflow-x: hidden;
    transition: margin-left 0.2s ease;
}

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: var(--light-bg);
}

.nav-link.active {
    background: rgba(123, 166, 140, 0.1);
    color: var(--accent-color);
}

.nav-text {
    display: inline;
}

/* Mobile: Sidebar overlays content */
@media (max-width: 1023px) {
    .app-content-wrapper {
        position: relative;
    }

    .app-sidebar {
        position: fixed;
        top: var(--app-header-height);
        left: 0;
        height: calc(100vh - var(--app-header-height));
        transform: translateX(-100%);
    }

    /* Show sidebar when open on mobile */
    body.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open .app-overlay {
        opacity: 1;
        pointer-events: auto;
    }
}

/* Desktop: Sidebar is part of flex layout */
@media (min-width: 1024px) {
    .app-sidebar {
        position: relative;
        top: 0;
        height: auto;
        transform: translateX(0);
    }

    /* Hide overlay on desktop */
    body.sidebar-open .app-overlay {
        opacity: 0;
        pointer-events: none;
    }

    /* Collapse sidebar on desktop */
    body.sidebar-collapsed .app-sidebar {
        width: 0;
        overflow: hidden;
        border-right: none;
    }
}

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

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.user-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    object-fit: cover;
}

@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
    font-size: 1rem;
    min-height: 44px; /* Touch-friendly minimum */
}

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

.btn-primary { background-color: var(--accent-color); color: white; }
.btn-primary:hover { background-color: #6A9179; box-shadow: var(--shadow-md); }

.btn-success { background-color: var(--success-color); color: white; }
.btn-success:hover { background-color: #7DA885; box-shadow: var(--shadow-md); }

.btn-danger { background-color: var(--danger-color); color: white; }
.btn-danger:hover { background-color: #B85F53; box-shadow: var(--shadow-md); }

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-main);
}
.btn-outline:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.btn-text {
    background: none;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
}
.btn-text:hover {
    color: var(--text-main);
}

/* Card Styles */
.card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.input-hint {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background-color: #fff;
    font-size: 1rem;
    transition: border-color 0.2s;
    min-height: 44px; /* Touch-friendly minimum */
}

.form-group textarea {
    min-height: 100px; /* Allow textarea to be taller */
}

.form-group input:focus, 
.form-group select:focus, 
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(123, 166, 140, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
}
.form-row > * {
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 90%;
    max-width: 400px;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease-out;
    border-left: 4px solid var(--accent-color);
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }

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

/* Mobile-specific adjustments - Small Mobile (< 480px) */
@media (max-width: 480px) {
    .btn {
        width: 100%;
        min-height: 44px;
        font-size: 1rem;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.1rem; }
    
    .card {
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }

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

    /* Modal adjustments for very small screens */
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        border-radius: 8px;
    }

    .modal-header {
        padding: 1rem 1.25rem;
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 1rem 1.25rem;
    }

    .form-section {
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .form-section h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }

    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    .form-actions {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .form-actions .btn {
        width: 100%;
        margin: 0;
    }

    .close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .time-chip {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
        min-height: 44px;
    }

    .time-chips-container {
        gap: 0.5rem;
    }
}

/* Tablet and Mobile (< 768px) */
@media (max-width: 767px) {
    .btn {
        min-height: 44px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .modal-header {
        padding: 1.25rem 1.5rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-footer {
        padding: 1.25rem 1.5rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
    }

    .suggestion-item {
        padding: 12px 16px;
        min-height: 44px;
    }

    .med-actions .btn {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
    }
}

/* Tablet (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .modal-content {
        width: 85%;
        max-width: 700px;
    }

    .modal-header {
        padding: 1.5rem 1.75rem;
    }

    .modal-body {
        padding: 1.75rem;
    }

    .modal-footer {
        padding: 1.5rem 1.75rem;
    }
}

/* Desktop (> 1024px) - Optimal sizing */
@media (min-width: 1025px) {
    .modal-content {
        max-width: 700px;
    }
}

/* Notification Menu */
.notification-menu {
    position: relative;
    margin-right: 8px;
}

.notification-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    position: relative;
}

.notification-btn:hover {
    background: var(--light-bg);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger-color);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--white);
}

.notification-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    margin-top: 8px;
    z-index: 1000;
    display: none;
}

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

.notification-header h3 {
    margin: 0;
    font-size: 1rem;
}

.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--light-bg);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: var(--light-bg);
}

.notification-item.unread {
    background: rgba(123, 166, 140, 0.05);
}

.notification-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.notification-icon.medication_reminder { background: #e0f2fe; color: #0369a1; }
.notification-icon.appointment_reminder { background: #f3e8ff; color: #7e22ce; }
.notification-icon.safety_alert { background: #fee2e2; color: #dc2626; }
.notification-icon.family_activity { background: #dcfce7; color: #16a34a; }

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

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 2px;
}

.notification-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.notification-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 480px) {
    .notification-dropdown {
        position: fixed;
        top: var(--app-header-height);
        left: 0;
        right: 0;
        width: 100%;
        margin-top: 0;
        border-radius: 0;
        max-height: calc(100vh - var(--app-header-height));
    }
}

/* Suggestions Dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--light-bg);
}

.suggestion-item:hover {
    background-color: var(--light-bg);
}

/* Google Places Autocomplete Suggestions */
.places-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.places-suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.places-suggestion-item:hover {
    background-color: var(--light-bg);
}

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

/* Medication List Items */
.medication-item {
    padding: 1rem;
    border-bottom: 1px solid var(--light-bg);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    position: relative;
}
.medication-item:last-child {
    border-bottom: none;
}

.medication-item.collapsed .med-extra-details {
    display: none;
}

.medication-item.expanded .med-extra-details {
    display: block;
}

.med-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    flex-shrink: 0;
}

.med-content {
    flex-grow: 1;
    min-width: 0;
}

.med-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.med-name {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.3;
}

.med-primary-details {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.med-next-dose {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--accent-color);
    margin-top: 0.25rem;
}

.med-extra-details {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--light-bg);
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.med-extra-details > div {
    margin-bottom: 0.5rem;
}

.med-extra-details > div:last-child {
    margin-bottom: 0;
}

.med-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.med-actions .btn {
    flex: 1;
    min-width: 0;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
}

.med-toggle-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
    transition: all 0.2s;
}

.med-toggle-btn:hover {
    color: var(--primary-color);
}

.med-toggle-btn i {
    transition: transform 0.2s;
}

.medication-item.expanded .med-toggle-btn i {
    transform: rotate(180deg);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    margin: auto;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.close {
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.close:hover {
    color: var(--text-main);
    background-color: var(--light-bg);
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.modal-close {
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.modal-close:hover {
    color: var(--text-main);
    background-color: var(--light-bg);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Form Section Dividers */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.form-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Status Badges */
.status-badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 6px;
    display: inline-block;
}

.status-badge.active {
    background-color: #dcfce7;
    color: #16a34a;
}

.status-badge.inactive {
    background-color: #fee2e2;
    color: #dc2626;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-scheduled {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--accent-color);
}

.badge-completed {
    background-color: rgba(39, 174, 96, 0.1);
    color: var(--success-color);
}

.badge-cancelled {
    background-color: rgba(231, 76, 60, 0.1);
    color: var(--danger-color);
}

.badge-rescheduled {
    background-color: rgba(243, 156, 18, 0.1);
    color: var(--warning-color);
}

.badge-no-show {
    background-color: rgba(149, 165, 166, 0.1);
    color: #95a5a6;
}

/* Time Chips */
.time-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.time-chip {
    background: var(--light-bg);
    padding: 0.625rem 0.875rem;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    min-height: 38px;
}

.time-chip button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--danger-color);
    padding: 0.25rem;
    display: flex;
    align-items: center;
    min-width: 24px;
    min-height: 24px;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.time-chip button:hover {
    color: #c0392b;
    background-color: rgba(231, 76, 60, 0.1);
}

/* Day Pill Selectors */
.day-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.day-pill {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.day-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.day-pill .day-pill-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--white);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.day-pill .day-pill-label:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(123, 166, 140, 0.05);
}

.day-pill input[type="checkbox"]:checked + .day-pill-label {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 2px 8px rgba(123, 166, 140, 0.3);
}

.day-pill input[type="checkbox"]:focus-visible + .day-pill-label {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.625rem 1rem;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.toggle-switch:hover {
    background: var(--light-bg);
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.toggle-track {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    min-height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-track {
    background: var(--accent-color);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-track::after {
    transform: translateX(20px);
}

.toggle-switch input[type="checkbox"]:focus-visible + .toggle-track {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
    line-height: 1.3;
}

.toggle-label .toggle-hint {
    display: block;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Time Bucket Buttons */
.time-buckets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.time-bucket-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.125rem;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    background: var(--white);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    transition: all 0.2s ease;
    min-height: 40px;
}

.time-bucket-btn i {
    font-size: 1rem;
    color: var(--accent-color);
}

.time-bucket-btn:hover {
    border-color: var(--accent-color);
    background: rgba(123, 166, 140, 0.05);
    box-shadow: var(--shadow-sm);
}

.time-bucket-btn:active {
    transform: scale(0.97);
}

.time-bucket-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 2px 8px rgba(123, 166, 140, 0.3);
}

.time-bucket-btn.active i {
    color: white;
}

/* Legacy checkbox-label support */
.checkbox-label input[type="checkbox"] {
    margin: 0;
}

.checkbox-label:has(input[type="checkbox"]:checked) {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Medication Dashboard Widget */
        .medication-widget {
            background: var(--white);
            border-radius: var(--radius);
            padding: 1.5rem;
            box-shadow: var(--shadow-sm);
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
            width: 100%;
        }

.medication-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-bg);
}

.medication-widget-header h3 {
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.medication-schedule-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.medication-schedule-item:hover {
    box-shadow: var(--shadow-sm);
    border-color: var(--accent-color);
}

.medication-schedule-item.upcoming {
    border-left: 4px solid var(--accent-color);
}

.medication-schedule-item.overdue {
    border-left: 4px solid var(--danger-color);
    background-color: #fff5f5;
}

.medication-schedule-item.completed {
    border-left: 4px solid var(--success-color);
    opacity: 0.7;
}

.med-schedule-time {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 80px;
}

.med-schedule-info {
    flex-grow: 1;
}

.med-schedule-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.med-schedule-dosage {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.med-quick-action {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Summary Stats */
.med-summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.med-stat-box {
    text-align: center;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
}

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

.med-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Responsive adjustments for medication schedules */
@media (max-width: 767px) {
    .medication-schedule-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .med-schedule-time {
        min-width: auto;
    }

    .med-quick-action {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .medication-widget {
        padding: 1rem;
    }

    .medication-widget-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .medication-widget-header .btn {
        width: 100%;
    }

    .med-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .med-summary-stats {
        grid-template-columns: 1fr;
    }

    .medication-item {
        padding: 0.875rem;
    }

    .med-image {
        width: 50px;
        height: 50px;
    }

    .med-name {
        font-size: 0.95rem;
    }

    .med-primary-details {
        font-size: 0.85rem;
    }

    .med-actions {
        width: 100%;
        gap: 0.5rem;
    }

    .med-actions .btn {
        flex: 1;
        font-size: 0.8rem;
        padding: 0.5rem 0.5rem;
        min-height: 40px;
    }

    .med-actions .btn i {
        font-size: 1rem;
    }

    .med-actions .btn span {
        display: none;
    }

    .medical-history-list li {
        padding: 0.75rem 0.875rem;
        flex-direction: column;
        align-items: flex-start;
    }

    .medical-history-item-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .medical-history-item-actions .btn {
        min-height: 40px;
    }
}

/* Voice Recording Styles */
.voice-input-container {
    position: relative;
}

.voice-btn {
    margin-top: 0.5rem;
}

.voice-btn.recording {
    background-color: var(--danger-color);
    color: white;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Voice Record Button - Red circular button with "REC" text */
.voice-record-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    border: none;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.voice-record-btn:hover {
    background-color: #c0392b;
    transform: scale(1.05);
}

.voice-record-btn.recording {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Autocomplete Suggestions */
.autocomplete-suggestions {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: none;
}

.autocomplete-suggestions .suggestion-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-suggestions .suggestion-item:hover {
    background-color: #f5f5f5;
}

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

/* Visit Summary Result Card */
.summary-result-card {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.summary-result-card h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.summary-result-card h4:first-child {
    margin-top: 0;
}

.summary-result-card ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.summary-result-card li {
    margin: 0.5rem 0;
}

/* Item Tags */
.item-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.item-tags .badge {
    font-size: 0.75rem;
}

/* Medical History List Styles */
.medical-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.medical-history-list li {
    padding: 0.875rem 1rem;
    border-left: 3px solid var(--accent-color);
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 0.625rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.medical-history-list li:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.medical-history-list li:last-child {
    margin-bottom: 0;
}

.medical-history-list.allergy-list li {
    border-left-color: var(--danger-color);
    background: #fff5f5;
}

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

.medical-history-item-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.medical-history-item-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.medical-history-item-actions {
    flex-shrink: 0;
}

.medical-history-item-actions .btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    min-height: auto;
}

/* Empty state for medical history */
.medical-history-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    background: var(--light-bg);
    border-radius: 8px;
}

.medical-history-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
    opacity: 0.5;
}

/* Item List Styles */
.item {
    padding: 1rem;
    border-bottom: 1px solid var(--light-bg);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

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

.item-content {
    flex: 1;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.item-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    min-height: auto;
}

.no-data {
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
}

.error {
    padding: 1rem;
    color: var(--danger-color);
}

.form-help {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.close-btn {
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-muted);
    background: none;
    border: none;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.close-btn:hover {
    color: var(--text-main);
    background-color: var(--light-bg);
}

/* Action Card Styles */
.action-card {
    background: linear-gradient(135deg, #7BA68C 0%, #6B8E8E 100%);
    color: white;
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.action-card .card-icon {
    font-size: 3rem;
    opacity: 0.9;
}

.action-card .card-content {
    flex: 1;
}

.action-card h3 {
    color: white;
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.action-card p {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 1rem 0;
}

.action-card .btn {
    background: white;
    color: var(--accent-color);
    border: none;
    font-weight: 600;
}

.action-card .btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

/* Visit Summary Styles */
.visit-summary-card {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.visit-summary-card:hover {
    box-shadow: var(--shadow-md);
}

.visit-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.visit-summary-provider {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-summary-provider i {
    color: var(--accent-color);
}

.visit-summary-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-summary-section {
    margin-bottom: 1.25rem;
}

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

.visit-summary-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-summary-bullets {
    list-style: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.visit-summary-bullets li {
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.6;
}

.visit-summary-text {
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.visit-summary-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.visit-summary-info-list li {
    padding: 0.625rem 1rem;
    background: var(--light-bg);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.visit-summary-info-list li:last-child {
    margin-bottom: 0;
}

/* Actionable Items */
.visit-summary-action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 0.625rem;
    transition: all 0.2s;
}

.visit-summary-action-item:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-sm);
}

.visit-summary-action-item:last-child {
    margin-bottom: 0;
}

.visit-summary-action-content {
    flex: 1;
    min-width: 0;
}

.visit-summary-action-title {
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.visit-summary-action-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Responsive adjustments for visit summaries */
@media (max-width: 767px) {
    .visit-summary-card {
        padding: 1.25rem;
    }

    .visit-summary-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .visit-summary-action-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .visit-summary-action-item .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .visit-summary-card {
        padding: 1rem;
    }

    .visit-summary-provider {
        font-size: 1.05rem;
    }

    .visit-summary-section-title {
        font-size: 0.9rem;
    }
}

/* Visit Summary Details Modal */
.modal-lg .modal-content {
    max-width: 800px;
    width: 95%;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.visit-summary-details {
    padding: 0.5rem 0;
}

.visit-summary-details .summary-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.visit-summary-details .summary-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.visit-summary-details .summary-meta h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-summary-details .summary-section {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light-bg);
    border-radius: 8px;
}

.visit-summary-details .summary-section:last-child {
    margin-bottom: 0;
}

.visit-summary-details .summary-section h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.visit-summary-details .summary-content {
    color: var(--text-main);
    line-height: 1.6;
}

.visit-summary-details .summary-content p {
    margin: 0 0 0.5rem 0;
}

.visit-summary-details .summary-content li {
    margin-bottom: 0.5rem;
}

.visit-summary-details .summary-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.visit-summary-details .summary-list li {
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color);
}

.visit-summary-details .summary-list li:last-child {
    margin-bottom: 0;
}

.visit-summary-details .summary-list li p {
    margin: 0.5rem 0 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.visit-summary-details .medications-list .medication-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.visit-summary-details .action-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 50px;
    text-align: center;
}

.visit-summary-details .action-badge.add {
    background: var(--success-light);
    color: var(--success-color);
}

.visit-summary-details .action-badge.stop {
    background: var(--danger-light);
    color: var(--danger-color);
}

.visit-summary-details .action-badge.modify {
    background: var(--warning-light);
    color: var(--warning-color);
}

.visit-summary-details .med-details {
    flex: 1;
}

.visit-summary-details .med-details strong {
    display: block;
    margin-bottom: 0.25rem;
}

.visit-summary-details .med-details .dosage,
.visit-summary-details .med-details .frequency {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}

.visit-summary-details .med-details .instructions {
    margin: 0.5rem 0 0 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

.visit-summary-details .location {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.visit-summary-details .raw-notes {
    background: #f8f9fa;
}

.visit-summary-details .raw-content {
    white-space: pre-wrap;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.visit-summary-details .error-state {
    text-align: center;
    padding: 2rem;
    color: var(--danger-color);
}

.visit-summary-details .error-state i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.visit-summary-details .loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.visit-summary-details .loading-spinner i {
    margin-right: 0.5rem;
}

.badge-primary {
    background: var(--accent-color);
    color: white;
}

.badge-trial {
    background: #fef3c7;
    color: #92400e;
}

.badge-admin {
    background: linear-gradient(135deg, #7BA68C 0%, #6B8E8E 100%);
    color: white;
}

.badge-caregiver {
    background: #e0f2fe;
    color: #0369a1;
}

.badge-premium {
    background: #dcfce7;
    color: #16a34a;
}

.badge-expired {
    background: #fee2e2;
    color: #991b1b;
}

.badge-free {
    background: var(--light-bg);
    color: var(--text-muted);
}

.badge-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

@media (max-width: 767px) {
    .visit-summary-details .summary-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .visit-summary-details .medications-list .medication-item {
        flex-direction: column;
        gap: 0.5rem;
    }
}
