
:root {
    --primary: #4361ee;
    --primary-light: #4895ef;
    --primary-dark: #3a56d4;
    --secondary: #7209b7;
    --accent: #4cc9f0;
    --success: #06d6a0;
    --warning: #ffd166;
    --danger: #ef476f;
    --light: #f8f9fa;
    --dark: #212529;
    --card-bg: rgba(255, 255, 255, 0.98);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Тёмная тема */
.theme-dark {
    --card-bg: rgba(30, 30, 40, 0.95);
    --light: #1a1a2e;
    --dark: #f8f9fa;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Сброс и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    background: transparent !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.theme-dark {
    background: linear-gradient(135deg, 
        rgba(10, 10, 20, 0.95) 0%, 
        rgba(25, 65, 100, 0.9) 50%, 
        rgba(60, 20, 80, 0.95) 100%) !important;
}

/* Навигация */
.navbar {
    background: linear-gradient(110deg, rgba(255, 255, 255, 0.96), rgba(244, 250, 255, 0.94)) !important;
    border-bottom: 1px solid rgba(32, 72, 143, 0.12) !important;
    box-shadow: 0 10px 28px rgba(20, 45, 84, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1000;
}

.theme-dark .navbar {
    background: #1a1a2e !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.brand-block {
    gap: 0;
    min-width: 0;
}

.logo-icon {
    width: 48px;
    height: 48px;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.36), rgba(255, 255, 255, 0) 42%),
        linear-gradient(145deg, #1f4fc2, #3872ff 52%, #22b8e8);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 12px 28px rgba(34, 78, 186, 0.32);
}

.logo-text-wrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.logo-text {
    font-family: 'Manrope', 'Inter', sans-serif;
    font-weight: 800;
    font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.85rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #1f4fc2, #2563eb 58%, #0f9dc6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-subtitle {
    display: block;
    margin-top: 3px;
    font-size: 0.74rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #43607f;
    font-weight: 700;
}

.theme-dark .logo-subtitle {
    color: #9fc5e8;
}

h1, h2, h3, h4, h5, h6,
.dashboard-highlight strong,
.stat-card h4 {
    font-family: 'Manrope', 'Inter', sans-serif;
    letter-spacing: -0.03em;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary,
.btn-success {
    border: none;
    box-shadow: 0 10px 24px rgba(67, 97, 238, 0.18);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.btn-success {
    background: linear-gradient(135deg, #0fa77f, var(--success));
}

/* Кнопки навигации */
.btn-nav {
    border-radius: 12px;
    padding: 9px 16px;
    font-weight: 600;
    border: 2px solid;
    transition: all 0.24s ease;
}

.btn-nav:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: var(--shadow-hover);
}

.accessibility-toggle-btn {
    white-space: nowrap;
    border-width: 2px;
    border-color: rgba(30, 54, 97, 0.26) !important;
    color: #1d3a65 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 255, 0.96));
    box-shadow: 0 10px 24px rgba(32, 72, 143, 0.14);
}

.accessibility-toggle-btn:hover {
    border-color: rgba(43, 79, 148, 0.4) !important;
    color: #173f78 !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 1), rgba(231, 244, 255, 1));
}

.accessibility-toggle-btn.btn-warning {
    border-color: rgba(167, 108, 0, 0.55) !important;
    color: #3f2a00 !important;
    background: linear-gradient(135deg, #ffe68a, #ffd166) !important;
    box-shadow: 0 12px 26px rgba(184, 126, 0, 0.28);
}

.theme-dark .accessibility-toggle-btn,
.theme-dark .accessibility-toggle-btn.btn-outline-dark {
    border-color: rgba(148, 184, 255, 0.6) !important;
    color: #edf5ff !important;
    background: linear-gradient(135deg, rgba(18, 35, 72, 0.9), rgba(30, 52, 97, 0.88));
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
}

.theme-dark .accessibility-toggle-btn:hover,
.theme-dark .accessibility-toggle-btn.btn-outline-dark:hover {
    border-color: rgba(176, 206, 255, 0.9) !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(35, 62, 112, 0.96), rgba(48, 79, 138, 0.92));
}

.theme-dark .accessibility-toggle-btn.btn-warning {
    border-color: rgba(255, 214, 113, 0.92) !important;
    color: #2e2100 !important;
    background: linear-gradient(135deg, #ffe08a, #ffc94c) !important;
    box-shadow: 0 14px 30px rgba(152, 108, 0, 0.42);
}

.accessibility-toggle-btn .accessibility-toggle-label {
    font-weight: 700;
}

/* Быстрые действия */
.quick-actions {
    margin-bottom: 24px;
}

.btn-action {
    border-radius: 10px;
    padding: 8px 16px;
    font-weight: 500;
    border-width: 2px;
    transition: all 0.2s ease;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Основной контент */
.content-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(18px);
}

.theme-dark .content-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Карточки лекарств */
.medicine-card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-dark .medicine-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(40, 40, 60, 0.8);
}

.medicine-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.medicine-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.medicine-card:hover::before {
    opacity: 1;
}

.medicine-card.removing {
    opacity: 0.5;
    pointer-events: none;
}

/* Кнопка удаления */
.delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--danger);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #dc3545;
    transform: scale(1.1);
}

/* Бейджи */
.badge {
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.badge.bg-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light)) !important;
}

.badge.bg-success {
    background: linear-gradient(135deg, var(--success), #06b48f) !important;
}

.badge.bg-secondary {
    background: rgba(108, 117, 125, 0.1) !important;
    color: #6c757d;
    border: 1px solid rgba(108, 117, 125, 0.2);
}

.theme-dark .badge.bg-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #adb5bd;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Прогресс бар */
.progress {
    height: 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-top: 8px;
}

.theme-dark .progress {
    background: rgba(255, 255, 255, 0.1);
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Формы */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 10px 14px;
    transition: all 0.2s ease;
    background: white;
    color: #212529;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background: rgba(50, 50, 70, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
    color: #f8f9fa;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    outline: none;
}

.theme-dark .form-control:focus,
.theme-dark .form-select:focus {
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.3);
}

/* Модальные окна */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.theme-dark .modal-content {
    background: #1a1a2e;
    color: #f8f9fa;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 16px 16px 0 0;
}

.theme-dark .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 20px;
    border-radius: 0 0 16px 16px;
}

.theme-dark .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Мобильная навигация */
.mobile-navbar {
    background: white !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    padding: 8px 0;
}

.theme-dark .mobile-navbar {
    background: #1a1a2e !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.nav-btn {
    width: 100%;
    padding: 8px 4px;
    border: none;
    background: transparent;
    color: #64748b;
    transition: all 0.2s ease;
    border-radius: 8px;
}

.nav-btn.active {
    color: var(--primary) !important;
    background: rgba(67, 97, 238, 0.1);
}

.nav-btn i {
    font-size: 1.2rem;
    display: block;
    margin: 0 auto 4px;
}

/* Алерты */
.alert {
    border-radius: 12px;
    padding: 16px;
    border: 1px solid transparent;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(6, 214, 160, 0.1);
    border-color: rgba(6, 214, 160, 0.2);
    color: #065f46;
}

.alert-warning {
    background: rgba(255, 209, 102, 0.1);
    border-color: rgba(255, 209, 102, 0.2);
    color: #856404;
}

.alert-info {
    background: rgba(76, 201, 240, 0.1);
    border-color: rgba(76, 201, 240, 0.2);
    color: #0c5460;
}

.alert-danger {
    background: rgba(239, 71, 111, 0.1);
    border-color: rgba(239, 71, 111, 0.2);
    color: #721c24;
}

.theme-dark .alert-success {
    background: rgba(6, 214, 160, 0.2);
    border-color: rgba(6, 214, 160, 0.3);
    color: #a7f3d0;
}

.theme-dark .alert-warning {
    background: rgba(255, 209, 102, 0.2);
    border-color: rgba(255, 209, 102, 0.3);
    color: #fef3c7;
}

.theme-dark .alert-info {
    background: rgba(76, 201, 240, 0.2);
    border-color: rgba(76, 201, 240, 0.3);
    color: #cffafe;
}

.theme-dark .alert-danger {
    background: rgba(239, 71, 111, 0.2);
    border-color: rgba(239, 71, 111, 0.3);
    color: #fecdd3;
}

/* Футер */
.footer {
    background: white !important;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    z-index: 100;
    width: 100%;
}

.theme-dark .footer {
    background: #1a1a2e !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer small {
    font-size: 0.85rem;
    color: #64748b;
}

.theme-dark .footer small {
    color: #adb5bd;
}

/* Приветственный блок */
.welcome-box {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.05), rgba(114, 9, 183, 0.05));
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: 1px solid rgba(67, 97, 238, 0.1);
}

.theme-dark .welcome-box {
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1), rgba(114, 9, 183, 0.1));
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.welcome-box h2 {
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.welcome-box p {
    color: #64748b;
    margin-bottom: 0;
}

.theme-dark .welcome-box p {
    color: #adb5bd;
}

.dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr);
    gap: 24px;
    padding: 28px;
    margin-bottom: 24px;
    border-radius: 24px;
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.28), transparent 34%),
        linear-gradient(135deg, #2748d8 0%, #4361ee 48%, #2db4da 100%);
    box-shadow: 0 24px 60px rgba(39, 72, 216, 0.25);
}

.dashboard-badge,
.section-intro__eyebrow,
.profile-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dashboard-badge {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
}

.dashboard-hero h2 {
    margin: 16px 0 12px;
    font-size: clamp(1.9rem, 3vw, 2.8rem);
    line-height: 1.05;
    font-weight: 800;
}

.dashboard-hero p {
    max-width: 620px;
    margin-bottom: 20px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1rem;
}

.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-outline {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-outline:hover {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.16);
}

.dashboard-highlights {
    display: grid;
    gap: 12px;
}

.dashboard-highlight {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(14px);
}

.dashboard-highlight strong {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 6px;
}

.dashboard-highlight__label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(67, 97, 238, 0.08);
    border: 1px solid rgba(67, 97, 238, 0.12);
    color: #324467;
    font-weight: 500;
}

.theme-dark .summary-chip {
    background: rgba(76, 201, 240, 0.1);
    border-color: rgba(76, 201, 240, 0.18);
    color: #d5eff8;
}

.section-intro {
    margin-bottom: 18px;
}

.section-intro__eyebrow,
.profile-eyebrow {
    color: var(--primary);
    margin-bottom: 10px;
}

.theme-dark .section-intro__eyebrow,
.theme-dark .profile-eyebrow {
    color: var(--accent);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 320px;
    padding: 32px 20px;
    text-align: center;
    border: 1px dashed rgba(67, 97, 238, 0.25);
    border-radius: 24px;
    background:
        radial-gradient(circle at top, rgba(76, 201, 240, 0.1), transparent 45%),
        rgba(255, 255, 255, 0.7);
}

.theme-dark .empty-state {
    background:
        radial-gradient(circle at top, rgba(76, 201, 240, 0.16), transparent 45%),
        rgba(26, 26, 46, 0.85);
    border-color: rgba(76, 201, 240, 0.24);
}

.empty-state__icon {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    font-size: 1.8rem;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 18px 35px rgba(67, 97, 238, 0.24);
}

.empty-state__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.medicine-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.medicine-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
}

.theme-dark .medicine-meta__item {
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
}

.medicine-instruction {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(67, 97, 238, 0.08);
    border: 1px solid rgba(67, 97, 238, 0.16);
    color: #2c4167;
    font-size: 0.9rem;
    line-height: 1.45;
}

.medicine-instruction i {
    margin-top: 2px;
    color: #3f63d1;
}

.theme-dark .medicine-instruction {
    background: rgba(76, 201, 240, 0.12);
    border-color: rgba(76, 201, 240, 0.22);
    color: #d7ecff;
}

.theme-dark .medicine-instruction i {
    color: #8ce7ff;
}

.medicine-contraindications {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(239, 71, 111, 0.08);
    border: 1px solid rgba(239, 71, 111, 0.2);
    color: #5d2e39;
    font-size: 0.9rem;
    line-height: 1.45;
}

.medicine-contraindications > i {
    margin-top: 2px;
    color: #c43a63;
}

.medicine-contraindications > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.medicine-source-link {
    display: inline-flex;
    width: fit-content;
    font-size: 0.8rem;
    color: #2f54c6;
    text-decoration: underline;
}

.theme-dark .medicine-contraindications {
    background: rgba(239, 71, 111, 0.16);
    border-color: rgba(239, 71, 111, 0.3);
    color: #ffd9e3;
}

.theme-dark .medicine-contraindications > i {
    color: #ff8fb0;
}

.theme-dark .medicine-source-link {
    color: #b9ccff;
}

.medicine-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.medicine-group-badge {
    background: rgba(67, 97, 238, 0.1) !important;
    color: #3550c8;
    border: 1px solid rgba(67, 97, 238, 0.15);
}

.theme-dark .medicine-group-badge {
    background: rgba(76, 201, 240, 0.12) !important;
    color: #c4f4ff;
    border-color: rgba(76, 201, 240, 0.2);
}

.medical-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 14px 0 18px;
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(255, 209, 102, 0.14);
    border: 1px solid rgba(255, 209, 102, 0.28);
    color: #7a5d00;
    font-size: 0.94rem;
    line-height: 1.5;
}

.theme-dark .medical-disclaimer {
    color: #fef3c7;
    background: rgba(255, 209, 102, 0.12);
    border-color: rgba(255, 209, 102, 0.2);
}

.safety-warning-card {
    padding: 18px 18px 16px;
    border-radius: 18px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.safety-warning-card--danger {
    background: linear-gradient(135deg, rgba(239, 71, 111, 0.12), rgba(255, 245, 247, 0.9));
    border-color: rgba(239, 71, 111, 0.22);
}

.safety-warning-card--warning {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(255, 250, 240, 0.92));
    border-color: rgba(255, 209, 102, 0.28);
}

.theme-dark .safety-warning-card--danger {
    background: linear-gradient(135deg, rgba(239, 71, 111, 0.2), rgba(39, 18, 28, 0.92));
}

.theme-dark .safety-warning-card--warning {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(46, 36, 16, 0.92));
}

.safety-warning-card__header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-family: 'Manrope', 'Inter', sans-serif;
}

.profile-header-actions,
.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.empty-inline-state {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(76, 201, 240, 0.08);
    color: #47617d;
}

.theme-dark .empty-inline-state {
    background: rgba(76, 201, 240, 0.12);
    color: #d8eff7;
}

.ocr-status {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    font-weight: 500;
}

.ocr-status--ready {
    background: rgba(6, 214, 160, 0.08);
    border-color: rgba(6, 214, 160, 0.18);
    color: #0b7a5d;
}

.ocr-status--browser {
    background: rgba(76, 201, 240, 0.08);
    border-color: rgba(76, 201, 240, 0.18);
    color: #0c5460;
}

.ocr-status--warning {
    background: rgba(255, 209, 102, 0.12);
    border-color: rgba(255, 209, 102, 0.24);
    color: #856404;
}

.theme-dark .ocr-status--ready {
    color: #9ef0d7;
}

.theme-dark .ocr-status--browser {
    color: #cffafe;
}

.theme-dark .ocr-status--warning {
    color: #fef3c7;
}

.ocr-found-card {
    border: 1px solid rgba(67, 97, 238, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.theme-dark .ocr-found-card {
    background: rgba(40, 40, 60, 0.85);
    border-color: rgba(255, 255, 255, 0.08);
}

.ocr-symptom-badge {
    background: rgba(67, 97, 238, 0.12) !important;
    color: #2f4ab7 !important;
    border: 1px solid rgba(67, 97, 238, 0.2) !important;
}

.theme-dark .ocr-symptom-badge {
    background: rgba(76, 201, 240, 0.18) !important;
    color: #d8f5ff !important;
    border: 1px solid rgba(76, 201, 240, 0.3) !important;
}

.theme-dark .ocr-found-card .badge.bg-light.text-dark.border {
    background: rgba(76, 201, 240, 0.18) !important;
    color: #d8f5ff !important;
    border-color: rgba(76, 201, 240, 0.3) !important;
}

/* Карта */
#pharmacyMap {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.theme-dark #pharmacyMap {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Уведомления */
.toast-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 4px solid var(--primary);
    margin-top: 10px;
    animation: slideIn 0.3s ease-out;
    max-width: 300px;
}

.theme-dark .toast {
    background: #1a1a2e;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    color: #f8f9fa;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Стили для профиля */
.profile-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.1);
}

.theme-dark .profile-section {
    background: rgba(30, 30, 40, 0.95);
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.theme-dark .stat-card {
    background: rgba(40, 40, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.achievement {
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.theme-dark .achievement {
    background: rgba(40, 40, 60, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.telegram-care-card {
    margin-top: 8px;
    padding: 16px;
    border: 1px solid rgba(67, 97, 238, 0.2);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(67, 97, 238, 0.05), rgba(67, 97, 238, 0.01));
}

.telegram-care-card .form-control,
.telegram-care-card .input-group-text {
    background: rgba(255, 255, 255, 0.92);
}

.theme-dark .telegram-care-card {
    border-color: rgba(128, 158, 255, 0.35);
    background: linear-gradient(180deg, rgba(57, 88, 170, 0.28), rgba(28, 39, 74, 0.2));
}

.theme-dark .telegram-care-card .form-control,
.theme-dark .telegram-care-card .btn.btn-outline-secondary {
    background: rgba(20, 29, 56, 0.9);
    border-color: rgba(130, 160, 255, 0.35);
    color: #e7edff;
}

/* Адаптивность */
@media (max-width: 768px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 20px;
        border-radius: 20px;
    }

    .dashboard-highlights {
        grid-template-columns: repeat(2, 1fr);
    }

    .content-card {
        padding: 16px;
        margin: 0 8px 16px 8px;
        border-radius: 12px;
    }
    
    .welcome-box {
        padding: 16px;
        margin: 0 8px 16px 8px;
    }
    
    .medicine-card {
        margin: 0 0 12px 0;
        padding: 12px;
    }
    
    .quick-actions {
        margin: 0 8px 16px 8px;
    }
    
    .btn-action {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .mobile-navbar {
        padding: 6px 0;
    }
    
    .nav-btn {
        padding: 6px 4px;
    }
    
    .nav-btn i {
        font-size: 1rem;
    }
    
    #pharmacyMap {
        height: 400px;
    }
}

@media (max-width: 576px) {
    #pharmacyMap {
        height: 300px;
    }
    
    .logo-text {
        font-size: 1.15rem;
    }
    
    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }

    .logo-subtitle {
        display: none;
    }
}

/* Утилиты */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.text-center { text-align: center; }
.text-muted { color: #64748b !important; }
.theme-dark .text-muted { color: #adb5bd !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 8px !important; }
.mt-3 { margin-top: 12px !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-3 { margin-bottom: 12px !important; }
.me-2 { margin-right: 8px !important; }
.ms-2 { margin-left: 8px !important; }
.gap-2 { gap: 8px; }
.w-100 { width: 100% !important; }

/* Кастомный скроллбар */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.theme-dark ::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}
/* ==================== МОБИЛЬНАЯ АДАПТАЦИЯ ==================== */

/* Общие стили для мобильных устройств */
@media (max-width: 768px) {
    /* Улучшаем отступы для мобильных */
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Навигация для мобильных */
    .navbar {
        padding: 12px 16px !important;
    }
    
    .navbar-brand {
        max-width: min(76vw, 430px);
    }

    .logo-subtitle {
        font-size: 0.62rem;
    }
    
    /* Основной контент */
    .content-wrapper {
        padding: 0 8px;
    }
    
    .content-card {
        margin: 8px 0 16px 0;
        padding: 16px;
        border-radius: 12px;
    }
    
    /* Быстрые действия */
    .quick-actions {
        margin: 0 0 16px 0;
    }
    
    .quick-actions .row {
        margin: 0 -4px;
    }
    
    .quick-actions .col-auto {
        padding: 0 4px;
        flex: 1 0 auto;
        max-width: 50%;
    }
    
    .btn-action {
        width: 100%;
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .btn-action i {
        margin-right: 4px;
    }
    
    /* Карточки лекарств */
    .medicine-card {
        padding: 12px;
        margin: 0 0 12px 0;
        border-radius: 10px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* Кнопки в карточках */
    .delete-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    /* Бейджи */
    .badge {
        font-size: 0.75rem;
        padding: 3px 6px;
        margin: 1px;
    }
    
    /* Формы */
    .form-control, .form-select {
        font-size: 16px; /* Предотвращает масштабирование на iOS */
        padding: 12px;
        border-radius: 10px;
    }
    
    /* Кнопки */
    .btn {
        padding: 10px 16px;
        font-size: 0.95rem;
        border-radius: 10px;
    }
    
    /* Модальные окна */
    .auth-form {
        width: 95%;
        max-width: 95%;
        margin: 0 10px;
        padding: 20px;
    }
    
    /* OCR контейнер */
    .ocr-container {
        padding: 16px;
        margin: 8px 0;
    }
    
    .upload-area-ocr {
        padding: 30px 16px;
    }
    
    /* Карта */
    #pharmacyMap {
        height: 300px;
        margin: 0 -8px;
        width: calc(100% + 16px);
        border-radius: 0;
    }
    
    /* Профиль */
    .profile-section {
        padding: 16px;
        margin: 8px 0;
    }
    
    .user-header {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .user-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .achievements {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    /* Футер */
    .footer {
        padding: 16px 8px;
        text-align: center;
    }
    
    .footer small {
        font-size: 0.75rem;
        line-height: 1.4;
    }
    
    /* Уведомления */
    .toast-container {
        bottom: 100px;
        left: 10px;
        right: 10px;
    }
    
    .toast {
        max-width: 100%;
        width: 100%;
    }

    .empty-state {
        min-height: auto;
        padding: 24px 16px;
    }
}

/* Особые стили для очень маленьких экранов */
@media (max-width: 480px) {
    .dashboard-highlights,
    .summary-strip {
        grid-template-columns: 1fr;
    }

    .dashboard-actions,
    .empty-state__actions,
    .profile-header-actions,
    .settings-actions {
        flex-direction: column;
    }

    .dashboard-highlight strong {
        font-size: 1.5rem;
    }

    .quick-actions .col-auto {
        max-width: 100%;
        margin-bottom: 8px;
    }
    
    .btn-action {
        padding: 12px 8px;
        font-size: 0.8rem;
    }
    
    .user-stats {
        grid-template-columns: 1fr;
    }
    
    .achievements {
        grid-template-columns: 1fr;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    /* Мобильная навигация */
    .mobile-navbar {
        height: 70px;
    }
    
    .mobile-navbar .col {
        padding: 4px 2px;
    }
    
    .nav-btn .small {
        font-size: 0.7rem;
    }
    
    .nav-btn i {
        font-size: 1rem;
    }
}

/* Предотвращение зума при фокусе на полях ввода на iOS */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px;
    }
}

/* Улучшение для тач-устройств */
@media (hover: none) and (pointer: coarse) {
    .btn, button, .nav-btn, .delete-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .form-check-label {
        padding-left: 8px;
        padding-top: 4px;
    }
    
    /* Увеличиваем зону клика для ссылок */
    a {
        padding: 4px 0;
    }
    
    /* Убираем hover-эффекты для тач-устройств */
    .btn:hover, button:hover {
        transform: none !important;
    }
    
    .medicine-card:hover {
        transform: none;
        box-shadow: var(--shadow);
    }
}

/* Исправление для iOS Safari */
@supports (-webkit-touch-callout: none) {
    .content-wrapper {
        min-height: -webkit-fill-available;
    }
    
    .mobile-navbar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Улучшение отображения в портретной ориентации */
@media (max-width: 768px) and (orientation: portrait) {
    .content-card {
        max-height: calc(100vh - 200px);
        overflow-y: auto;
    }
    
    .ocr-result {
        max-height: 200px;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .mobile-navbar {
        display: none !important;
    }
    
    .content-wrapper {
        padding-bottom: 20px;
    }
    
    .footer {
        position: relative;
    }
}
/* Мобильные модальные окна */
@media (max-width: 768px) {
    .auth-modal {
        align-items: flex-end;
        padding: 20px 0 0 0;
    }
    
    .auth-form {
        border-radius: 20px 20px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Privacy модалка */
    #privacyModal .auth-form {
        max-height: 80vh;
    }
    
    /* Аватар модалка */
    #avatarModal .auth-form {
        max-height: 70vh;
    }
    
    /* Улучшение скролла в модалках */
    .auth-form {
        -webkit-overflow-scrolling: touch;
    }
}
/* Стили для чекбокса политики конфиденциальности */
.form-check {
    margin: 15px 0;
    padding-left: 30px;
    position: relative;
}

.form-check-input {
    position: absolute;
    left: 0;
    top: 2px;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 2px solid #4361ee;
    cursor: pointer;
}

.form-check-input:checked {
    background-color: #4361ee;
    border-color: #4361ee;
}

.form-check-label {
    font-size: 0.9rem;
    line-height: 1.4;
    cursor: pointer;
}

.form-check-label a {
    color: #4361ee;
    font-weight: 500;
    transition: color 0.2s ease;
}

.form-check-label a:hover {
    color: #3a56d4;
    text-decoration: underline;
}

.theme-dark .form-check-label a {
    color: #4cc9f0;
}

.theme-dark .form-check-label a:hover {
    color: #3ab5d9;
}

/* Мобильные стили для чекбокса */
@media (max-width: 768px) {
    .form-check {
        padding-left: 28px;
        margin: 12px 0;
    }
    
    .form-check-input {
        width: 18px;
        height: 18px;
        top: 3px;
    }
    
    .form-check-label {
        font-size: 0.85rem;
    }
}

/* ==================== РЕЖИМ СЛАБОВИДЯЩИХ ==================== */
body.accessibility-mode {
    background: #000 !important;
    color: #fff !important;
    font-size: 20px;
    line-height: 1.85;
    letter-spacing: 0.01em;
}

body.accessibility-mode .app-background,
body.accessibility-mode .bg-shape {
    display: none !important;
}

body.accessibility-mode h1,
body.accessibility-mode h2,
body.accessibility-mode h3,
body.accessibility-mode h4,
body.accessibility-mode h5,
body.accessibility-mode h6 {
    color: #fff !important;
    line-height: 1.24 !important;
    letter-spacing: 0.01em;
}

body.accessibility-mode .navbar,
body.accessibility-mode .mobile-navbar,
body.accessibility-mode .footer,
body.accessibility-mode .content-card,
body.accessibility-mode .medicine-card,
body.accessibility-mode .dashboard-hero,
body.accessibility-mode .summary-chip,
body.accessibility-mode .alert,
body.accessibility-mode .auth-form,
body.accessibility-mode .stat-card,
body.accessibility-mode .achievement,
body.accessibility-mode .welcome-box,
body.accessibility-mode .ocr-container,
body.accessibility-mode .upload-area-ocr,
body.accessibility-mode .ocr-result,
body.accessibility-mode .empty-state,
body.accessibility-mode .dashboard-highlight,
body.accessibility-mode .safety-warning-card {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #ffd400 !important;
    box-shadow: none !important;
}

body.accessibility-mode .dashboard-hero,
body.accessibility-mode .summary-chip,
body.accessibility-mode .alert,
body.accessibility-mode .medicine-card,
body.accessibility-mode .content-card {
    border-radius: 8px !important;
}

body.accessibility-mode .logo-text {
    background: none !important;
    -webkit-text-fill-color: #fff !important;
    color: #fff !important;
}

body.accessibility-mode .logo-subtitle {
    color: #ffd400 !important;
}

body.accessibility-mode .logo-icon {
    background: #ffd400 !important;
    color: #000 !important;
    border-color: #ffd400 !important;
}

body.accessibility-mode .btn,
body.accessibility-mode .form-control,
body.accessibility-mode .form-select,
body.accessibility-mode .badge,
body.accessibility-mode .text-muted,
body.accessibility-mode p,
body.accessibility-mode span,
body.accessibility-mode label,
body.accessibility-mode li,
body.accessibility-mode small,
body.accessibility-mode a {
    font-size: 1.08rem !important;
    color: #fff !important;
}

body.accessibility-mode a {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

body.accessibility-mode .btn {
    min-height: 52px;
    border: 2px solid #ffd400 !important;
    background: #000 !important;
    color: #fff !important;
}

body.accessibility-mode .btn-primary,
body.accessibility-mode .btn-success,
body.accessibility-mode .btn-warning {
    background: #ffd400 !important;
    color: #000 !important;
    border-color: #ffd400 !important;
}

body.accessibility-mode .btn-outline-primary,
body.accessibility-mode .btn-outline-secondary,
body.accessibility-mode .btn-outline-info,
body.accessibility-mode .btn-outline-warning,
body.accessibility-mode .btn-outline-danger,
body.accessibility-mode .btn-outline-dark {
    background: #000 !important;
    color: #fff !important;
    border-color: #ffd400 !important;
}

body.accessibility-mode .form-control,
body.accessibility-mode .form-select {
    background: #000 !important;
    color: #fff !important;
    border-color: #ffd400 !important;
}

body.accessibility-mode .badge {
    background: #ffd400 !important;
    color: #000 !important;
    border: 1px solid #ffd400 !important;
}

body.accessibility-mode .progress,
body.accessibility-mode .progress-bar {
    background: #ffd400 !important;
}

body.accessibility-mode .nav-btn.active {
    background: #ffd400 !important;
    color: #000 !important;
}
