html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6fb;
    overflow: hidden;
}

/* Responzivní meta tag */
@media screen and (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }
}
.topbar { 
    width: 100vw; 
    height: 56px; 
    background: #1a365d; 
    color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    position: fixed; 
    top: 0; 
    left: 0; 
    z-index: 100; 
}

.topbar-left { 
    font-size: 22px; 
    font-weight: bold; 
    padding-left: 32px; 
}

.topbar-right { 
    font-size: 18px; 
    padding-right: 32px; 
}

/* Responzivní topbar */
@media screen and (max-width: 768px) {
    .topbar {
        height: 50px;
    }
    
    .topbar-left {
        font-size: 18px;
        padding-left: 16px;
    }
    
    .topbar-right {
        font-size: 16px;
        padding-right: 16px;
    }
}

@media screen and (max-width: 480px) {
    .topbar-left {
        font-size: 16px;
        padding-left: 12px;
    }
    
    .topbar-right {
        font-size: 14px;
        padding-right: 12px;
    }
}
.container {
    display: flex;
    width: 100vw;
    height: 100%;
    min-height: 0;
    margin-top: 0;
}

.sidebar {
    flex: 0 0 20vw;
    min-width: 220px;
    max-width: 400px;
    background: #f4f6fb;
    padding: 16px 10px 16px 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: calc(100vh - 56px);
    min-height: 0;
    margin-top: 56px;
    transition: transform 0.3s ease;
}

.main-content {
    flex: 1 1 80vw;
    background: #fff;
    padding: 40px;
    box-sizing: border-box;
    height: calc(100vh - 56px);
    min-height: 0;
    overflow: auto;
    margin-top: 56px;
}

/* Responzivní container a sidebar */
@media screen and (max-width: 1024px) {
    .sidebar {
        flex: 0 0 250px;
        min-width: 250px;
    }
    
    .main-content {
        padding: 30px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        flex-direction: column;
        height: 100vh;
        overflow: hidden;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 50px;
        width: 280px;
        height: calc(100vh - 50px);
        background: #f4f6fb;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
        padding: 12px;
        order: 2;
    }
    
    .sidebar.sidebar-open {
        left: 0;
    }
    
    /* Overlay pro zatemnění pozadí */
    .sidebar-overlay {
        position: fixed;
        top: 50px;
        left: 0;
        width: 100%;
        height: calc(100vh - 50px);
        background: rgba(0,0,0,0.5);
        z-index: 998;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .main-content {
        flex: 1;
        width: 100%;
        height: calc(100vh - 50px);
        margin-top: 50px;
        padding: 20px;
        order: 1;
        overflow-y: auto;
        overflow-x: hidden;
    }
}

@media screen and (max-width: 480px) {
    .sidebar {
        width: 260px;
        padding: 10px;
    }
    
    .main-content {
        padding: 15px;
    }
}

/* Sjednocené ovládací prvky */
:root {
    --input-height: 40px;
    --input-radius: 10px;
    --input-font-size: 15px;
    --input-padding-x: 14px;
    --input-padding-icon: 36px;
}

/* Globální box-sizing pro všechny inputy a tlačítka */
input, button, label, .search-input, .upload-btn, .record-btn, .upload-btn-outline, .record-btn-dark {
    box-sizing: border-box;
}

/* Sidebar vyhledávání - sjednocený styl */
.sidebar-search {
    position: relative;
    margin-bottom: 18px;
    width: 100%;
    max-width: 100%;
    padding: 0;
}
.sidebar-search .search-input {
    width: 100%;
    height: var(--input-height);
    padding: 0 var(--input-padding-icon) 0 var(--input-padding-x);
    border-radius: var(--input-radius);
    border: 1.5px solid #bfc9d8;
    font-size: var(--input-font-size);
    background: #f7f9fc;
    color: #1a365d;
    font-weight: 500;
    box-shadow: 0 2px 8px #0001;
    transition: border 0.2s, box-shadow 0.2s;
    outline: none;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.sidebar-search .search-input:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 4px 16px #3b82f633;
}
.sidebar-search .search-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #3b82f6;
    font-size: 20px;
    pointer-events: none;
}

/* Checkbox a dropdown */
.sidebar-controls { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.checkbox-all { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 500; color: #1a365d; cursor: pointer; }
#selectedFilter { font-size: 15px; font-weight: 500; color: #1a365d; }
.checkbox-all input[type="checkbox"] { accent-color: #1a365d; width: 18px; height: 18px; }

.dropdown { position: relative; display: flex; align-items: center; }
.dropdown-toggle { background: none; border: none; font-size: 18px; cursor: pointer; color: #1a365d; padding: 2px 8px; border-radius: 4px; transition: background 0.15s; }
.dropdown-toggle:hover { background: #dbeafe; }
.dropdown-menu { display: none; position: absolute; left: 0; top: 120%; min-width: 180px; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px #0002; padding: 8px 0; z-index: 10; }
.dropdown-menu .dropdown-item { padding: 10px 18px; font-size: 15px; color: #1a365d; cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.15s; }
.dropdown-menu .dropdown-item:hover { background: #eaf4fb; }
.dropdown:hover .dropdown-menu, .dropdown-menu.show { display: block; }
.count { background: #eaf4fb; color: #1a365d; border-radius: 10px; padding: 2px 8px; font-size: 13px; margin-left: 8px; }

.delete-selected { background: #e53e3e; color: #fff; border: none; border-radius: 6px; padding: 7px 16px; font-size: 15px; font-weight: 500; cursor: pointer; margin-left: auto; transition: background 0.15s; display: block; }
.delete-selected:hover { background: #c53030; }

/* Seznam poznámek */
.notes-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.note-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px #0001;
    padding: 8px 8px;
    cursor: pointer;
    transition: box-shadow 0.15s, background 0.15s;
    border: 1.5px solid transparent;
    position: relative;
    font-size: 15px;
    min-height: 56px;
    max-height: 56px;
}
.note-box:hover { box-shadow: 0 4px 16px #0002; background: #f3f6fa; border-color: #3b82f6; }
.note-checkbox { margin-top: 4px; accent-color: #1a365d; width: 18px; height: 18px; }
.note-content { flex: 1; }
.note-title { font-weight: bold; color: #1a365d; font-size: 16px; margin-bottom: 2px; }
.note-meta { font-size: 13px; color: #7b8ca3; margin-bottom: 2px; }
.note-desc { font-size: 14px; color: #1a365d; }

.note-menu-dropdown { display: none; position: absolute; right: 0; top: 28px; background: #fff; border-radius: 8px; box-shadow: 0 4px 16px #0002; padding: 8px 0; z-index: 20; min-width: 160px; }
.note-menu-item { padding: 10px 18px; font-size: 15px; color: #1a365d; cursor: pointer; transition: background 0.15s; }
.note-menu-item:hover { background: #eaf4fb; }
.note-menu { position: relative; cursor: pointer; margin-left: 8px; }

/* Hlavní panel - sjednocené inputy a tlačítka */
.main-controls {
    display: flex;
    gap: 28px;
    margin-bottom: 36px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: space-between;
}
.main-controls .left-controls {
    display: flex;
    gap: 28px;
    flex: 0 1 auto;
    align-items: center;
}
.main-controls .right-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 1 auto;
    margin-left: auto;
}
.main-controls .right-controls .control-group {
    min-width: unset;
    max-width: unset;
    margin: 0;
    flex: none;
}
.control-group {
    flex: 0 0 auto;
    min-width: 200px;
    max-width: 320px;
    margin-right: 0;
    display: flex;
    align-items: center;
}
.search-container.small {
    position: relative;
    background: #f7f9fc;
    border-radius: var(--input-radius);
    border: 1.5px solid #bfc9d8;
    box-shadow: 0 2px 8px #0001;
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: var(--input-height);
    width: 100%;
    box-sizing: border-box;
}
.search-input.small {
    width: 100%;
    height: var(--input-height);
    padding: 0 var(--input-padding-icon) 0 var(--input-padding-x);
    border: none;
    background: transparent;
    font-size: var(--input-font-size);
    border-radius: var(--input-radius);
    outline: none;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}
.search-input.small:focus {
    background: #fff;
}
.search-icon {
    position: static;
    margin-left: -28px;
    color: #7b8ca3;
    font-size: 20px;
    pointer-events: none;
}
.upload-btn, .record-btn, .upload-btn-outline, .record-btn-dark {
    min-width: 120px;
    max-width: 200px;
    height: var(--input-height);
    border-radius: var(--input-radius);
    font-size: var(--input-font-size);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    box-shadow: 0 2px 8px #0001;
    font-weight: 500;
    box-sizing: border-box;
}
.upload-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.upload-btn:hover { background: #2563eb; }
.upload-icon { font-size: 18px; }

.record-btn {
    background: #e53e3e;
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.record-btn:hover { background: #c53030; }
.record-btn.recording { background: #38a169; animation: pulse 1.5s infinite; }
.record-btn.recording:hover { background: #2f855a; }
.record-icon { font-size: 18px; }

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@media (max-width: 1200px) {
    .main-controls { gap: 16px; }
    .main-controls .left-controls, .main-controls .right-controls { gap: 16px; }
    .control-group { min-width: 160px; max-width: 100%; }
}
@media (max-width: 900px) {
    .main-controls { flex-direction: column; align-items: stretch; gap: 18px; }
    .main-controls .left-controls, .main-controls .right-controls { flex-direction: column; gap: 12px; }
    .control-group { min-width: 100%; max-width: 100%; }
    .upload-btn, .record-btn, .upload-btn-outline, .record-btn-dark { width: 100%; margin: 0; }
    .search-container.small { width: 100%; }
}

.new-patient-expandable { background: #fff; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); padding: 20px; margin-top: 15px; border: 2px solid #e2e8f0; }
.transcript-display { display: flex; align-items: center; gap: 15px; }
.transcript-text { flex: 1; font-size: 16px; color: #1a365d; line-height: 1.5; padding: 15px; background: #f8fafc; border-radius: 8px; border-left: 4px solid #3b82f6; }
.add-patient-btn { background: #3b82f6; color: #fff; border: none; border-radius: 50%; width: 50px; height: 50px; font-size: 24px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.add-patient-btn:hover { background: #2563eb; transform: scale(1.05); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
.add-icon { font-weight: bold; }

.search-results { margin-top: 20px; }
.no-results { color: #7b8ca3; font-style: italic; text-align: center; padding: 20px; }
.patient-result { background: #fff; border-radius: 8px; padding: 15px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 1px solid #e2e8f0; cursor: pointer; transition: all 0.2s; }
.patient-result:hover { background: #f8fafc; border-color: #3b82f6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.patient-name { font-weight: bold; color: #1a365d; font-size: 16px; margin-bottom: 5px; }
.patient-records { color: #7b8ca3; font-size: 14px; }
.loading { color: #3b82f6; text-align: center; padding: 20px; font-style: italic; }
.sidebar .no-results { color: #7b8ca3; font-style: italic; text-align: center; padding: 15px; font-size: 14px; }

.upload-btn-outline {
    background: #fff !important;
    color: #1a365d !important;
    border: 2px solid #1a365d !important;
    box-shadow: none !important;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border 0.15s;
}
.upload-btn-outline .upload-icon {
    color: #1a365d !important;
    font-size: 16px;
    margin-right: 2px;
    margin-left: 0;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
}
.upload-btn-outline:hover {
    background: #eaf4fb !important;
    color: #1a365d !important;
    border-color: #274472 !important;
}

.record-btn-dark {
    background: #1a365d !important;
    color: #fff !important;
    border: none !important;
    font-weight: 700;
    box-shadow: none !important;
    padding: 0 18px !important;
    font-size: var(--input-font-size) !important;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--input-height);
}
.record-btn-dark .record-icon {
    color: #fff !important;
    font-size: 20px;
}
.record-btn-dark .record-text {
    font-weight: 700;
    color: #fff;
    font-size: var(--input-font-size);
}
.record-btn-dark:hover {
    background: #274472 !important;
    color: #fff !important;
}

.upload-btn-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.upload-btn-icon .upload-icon {
    font-size: 18px;
    margin: 0;
    padding: 0;
    line-height: 1;
}

/* Nahrávací rozhraní */
.recording-interface {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 2px solid #3b82f6;
    margin-top: 0;
    flex: 1;
    min-width: 0;
}
.recording-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
}
.microphone-section {
    display: flex;
    align-items: center;
    gap: 15px;
}
.microphone-icon {
    font-size: 24px;
    color: #3b82f6;
    animation: microphonePulse 2s ease-in-out infinite;
}
.microphone-indicator {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 30px;
}

.indicator-bar {
    width: 3px;
    background: #3b82f6;
    border-radius: 2px;
    min-height: 6px;
    max-height: 30px;
    height: 15px;
    transition: height 0.1s ease;
}


.microphone-select {
    flex: 1;
}
.microphone-dropdown {
    width: 100%;
    height: 35px;
    border-radius: 8px;
    border: 1.5px solid #bfc9d8;
    font-size: 14px;
    padding: 0 10px;
    background: #f7f9fc;
    color: #1a365d;
    outline: none;
    transition: border 0.2s;
}
.microphone-dropdown:focus {
    border-color: #3b82f6;
    background: #fff;
}
.recording-actions {
    display: flex;
    gap: 10px;
}
.pause-btn, .stop-btn {
    height: 35px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    border: none;
}
.pause-btn {
    background: #f59e0b;
    color: #fff;
    display: none;
}
.pause-btn:hover {
    background: #d97706;
}
.stop-btn {
    background: #e53e3e;
    color: #fff;
}
.stop-btn:hover {
    background: #c53030;
}
.pause-icon, .stop-icon {
    font-size: 18px;
}

/* Animace pro mikrofon a indikátor */
@keyframes microphonePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Modal okno pro přidání pacienta */
.modal {
    position: fixed;
    z-index: 200;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(30, 41, 59, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.modal-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(30,41,59,0.18);
    padding: 36px 32px 28px 32px;
    min-width: 340px;
    max-width: 95vw;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.modal-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 28px;
    color: #7b8ca3;
    cursor: pointer;
    transition: color 0.15s;
}
.modal-close:hover { color: #e53e3e; }
.modal-content h2 {
    margin: 0 0 10px 0;
    font-size: 22px;
    color: #1a365d;
    font-weight: 700;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.form-group label {
    font-size: 15px;
    color: #1a365d;
    font-weight: 500;
}
.form-group input[type="text"],
.form-group input[type="date"] {
    height: 38px;
    border-radius: 8px;
    border: 1.5px solid #bfc9d8;
    font-size: 15px;
    padding: 0 12px;
    background: #f7f9fc;
    color: #1a365d;
    font-weight: 500;
    outline: none;
    transition: border 0.2s, background 0.2s;
}
.form-group input:focus {
    border-color: #3b82f6;
    background: #fff;
}
.modal-submit {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.15s;
    width: 100%;
}
.modal-submit:hover { background: #2563eb; }

/* Styly pro stránku pacienta */
.patient-info {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}
.patient-info h2 {
    margin: 0 0 10px 0;
    color: #1a365d;
    font-size: 24px;
    font-weight: 700;
}
.patient-details {
    display: flex;
    gap: 20px;
    color: #7b8ca3;
    font-size: 14px;
}
.patient-date, .patient-records-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.patient-records {
    margin-top: 30px;
}
.patient-records h3 {
    margin: 0 0 20px 0;
    color: #1a365d;
    font-size: 20px;
    font-weight: 600;
}
.records-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.record-item {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
}
.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}
.record-date {
    color: #7b8ca3;
    font-size: 14px;
    font-weight: 500;
}
.record-actions {
    display: flex;
    gap: 8px;
}
.record-action-btn {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.15s;
}
.record-action-btn:hover {
    background: #eaf4fb;
}
.record-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.record-text {
    color: #1a365d;
    font-size: 15px;
    line-height: 1.5;
}
.record-gemini {
    background: #f8fafc;
    border-left: 4px solid #3b82f6;
    padding: 12px;
    border-radius: 4px;
    color: #1a365d;
    font-size: 14px;
    line-height: 1.4;
}

/* Indikátor nahrávání v sidebaru */
.recording-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: #e53e3e;
    border-radius: 50%;
    animation: recordingPulse 1.5s ease-in-out infinite;
    z-index: 5;
    display: none;
}

@keyframes recordingPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(229, 62, 62, 0.7);
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(229, 62, 62, 0);
    }
}

/* Zvýraznění aktivního pacienta v sidebaru */
.note-box.active-patient {
    background: #f0f4ff;
    border-color: #3b82f6;
    border-width: 2px;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.15);
}

.note-box.active-patient .note-title {
    color: #3b82f6;
    font-weight: 700;
}

.note-box.active-patient .note-meta {
    color: #3b82f6;
}

.note-box.active-patient:hover {
    background: #e8f0ff;
    border-color: #2563eb;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.2);
}

/* Dočasný pacient v sidebaru */
.note-box.temporary-patient {
    background: #fff3cd;
    border-color: #ffc107;
    border-width: 2px;
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.15);
}

.note-box.temporary-patient .note-title {
    color: #856404;
    font-weight: 700;
}

.note-box.temporary-patient .note-meta {
    color: #856404;
}

.note-box.temporary-patient .note-desc {
    color: #856404;
    font-style: italic;
}

.note-box.temporary-patient:hover {
    background: #ffeaa7;
    border-color: #f39c12;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.2);
}

.note-box.temporary-patient .recording-indicator {
    background: #ffc107;
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.8;
        box-shadow: 0 0 0 6px rgba(255, 193, 7, 0);
    }
}

/* Toast notifikace */
.toast-container {
    position: fixed;
    top: 32px;
    right: 32px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 16px;
    pointer-events: none;
}
.toast {
    min-width: 260px;
    max-width: 340px;
    background: #fff;
    color: #1a365d;
    border-radius: 10px;
    box-shadow: 0 6px 32px rgba(30,41,59,0.18);
    border: 1.5px solid #3b82f6;
    padding: 18px 24px 18px 20px;
    font-size: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: toastIn 0.3s cubic-bezier(.4,0,.2,1);
    pointer-events: auto;
    position: relative;
}
.toast .toast-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: #7b8ca3;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0;
}
.toast .toast-close:hover {
    color: #e53e3e;
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Sidebar footer a knihovna šablon */
.sidebar-footer {
    flex-shrink: 0;
    margin-top: 0;
    margin-bottom: 60px;
    padding: 10px 0 0 0;
    display: flex;
    justify-content: center;
    border-top: 1.5px solid #e2e8f0;
    background: #f4f6fb;
}
.sidebar-library-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px #0001;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.18s, box-shadow 0.18s;
}
.sidebar-library-btn:hover {
    background: #2563eb;
    box-shadow: 0 4px 16px #3b82f633;
}

/* Sidebar layout s pevně ukotveným footrem a scrollovatelným seznamem */
.sidebar-scroll-footer {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* --- Přidáno z index.php --- */
/* Zvýraznění vybraného pacienta pro nahrávání */
.note-box.selected-for-recording {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    animation: selected-pulse 2s ease-in-out;
}
@keyframes selected-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
/* Toast notifikace s různými typy */
.toast.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}
.toast.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}
.toast.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}
.clear-selection-btn {
    background: none;
    border: none;
    color: #d32f2f;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.clear-selection-btn:hover {
    background: #ffebee;
    transform: scale(1.1);
}
.new-patient-highlight {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
    animation: new-patient-pulse 2s ease-in-out;
}
@keyframes new-patient-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
.processing-patient {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 2px solid #9e9e9e;
    box-shadow: 0 4px 12px rgba(158, 158, 158, 0.3);
    animation: processing-pulse 2s ease-in-out infinite;
}
@keyframes processing-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* --- Přidáno z patient.php --- */
.toast.warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}
.toast.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}
.toast.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}
.note-box.selected-for-recording {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
    animation: selected-pulse 2s ease-in-out;
}
@keyframes selected-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}
.processing-patient {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border: 2px solid #9e9e9e;
    box-shadow: 0 4px 12px rgba(158, 158, 158, 0.3);
    animation: processing-pulse 2s ease-in-out infinite;
}
@keyframes processing-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}
/* ... (další styly z patient.php budou přidány zde, včetně .expandable-record, .record-header, .record-btn-real-time atd.) ... */

/* --- Expandable Records a Expand Arrow --- */
.expandable-record {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.expandable-record:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.2s ease;
    border-bottom: 1px solid #e2e8f0;
}

.record-header:hover {
    background: #e2e8f0;
}

.record-date {
    font-weight: 600;
    color: #1a365d;
    font-size: 15px;
}

.record-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.expand-arrow {
    font-size: 16px;
    color: #64748b;
    transition: transform 0.3s ease;
    cursor: pointer;
    user-select: none;
}

.expand-arrow.expanded {
    transform: rotate(180deg);
    color: #3b82f6;
}

.delete-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.record-content {
    display: none;
    background: #fff;
    padding: 20px;
}

.record-content.expanded {
    display: block !important;
}

.gemini-section {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.gemini-section h4 {
    margin: 0 0 12px 0;
    color: #1a365d;
    font-size: 16px;
    font-weight: 600;
}

.gemini-section p {
    margin: 0 0 16px 0;
    color: #374151;
    line-height: 1.6;
    font-size: 14px;
}

.copy-section-btn {
    background: #3b82f6;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.copy-section-btn:hover {
    background: #2563eb;
}

.combined-section {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border: 2px solid #0ea5e9;
}

.combined-section h4 {
    margin: 0 0 16px 0;
    color: #0c4a6e;
    font-size: 18px;
    font-weight: 700;
}

.combined-section p {
    margin: 0 0 20px 0;
    color: #0c4a6e;
    line-height: 1.7;
    font-size: 15px;
}

/* Nový záznam zvýraznění */
.new-record-highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    animation: new-record-pulse 2s ease-in-out;
}

@keyframes new-record-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Responzivní styly pro všechny komponenty */
@media screen and (max-width: 768px) {
    /* Responzivní inputy a tlačítka */
    :root {
        --input-height: 36px;
        --input-radius: 8px;
        --input-font-size: 14px;
        --input-padding-x: 12px;
        --input-padding-icon: 32px;
    }
    
    /* Responzivní sidebar search */
    .sidebar-search {
        margin-bottom: 15px;
    }
    
    /* Responzivní ovládací prvky */
    .main-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .left-controls,
    .right-controls {
        width: 100%;
    }
    
    .control-group {
        margin-bottom: 10px;
    }
    
    /* Responzivní tlačítka */
    .record-btn,
    .upload-btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    /* Responzivní search input */
    .search-input {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    /* Responzivní dropdown */
    .search-dropdown {
        max-height: 200px;
    }
    
    /* Responzivní záznamy */
    .record-item {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .record-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .record-title {
        font-size: 16px;
    }
    
    .record-date {
        font-size: 12px;
    }
    
    /* Responzivní modaly */
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-height: 80vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* Responzivní formuláře */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 14px;
        padding: 10px 12px;
    }
    
    /* Responzivní tabulky */
    .table-container {
        overflow-x: auto;
    }
    
    table {
        min-width: 600px;
    }
}

@media screen and (max-width: 480px) {
    /* Ještě menší obrazovky */
    :root {
        --input-height: 32px;
        --input-font-size: 13px;
        --input-padding-x: 10px;
    }
    
    .record-btn,
    .upload-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .record-title {
        font-size: 15px;
    }
    
    .modal-content {
        width: 98%;
        margin: 5% auto;
    }
    
    .modal-header {
        padding: 12px 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .form-input,
    .form-textarea {
        font-size: 13px;
        padding: 8px 10px;
    }
}

/* Responzivní styly pro tisk */
@media print {
    .topbar,
    .sidebar,
    .main-controls,
    .record-actions {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
        padding: 0;
    }
    
    .record-item {
        break-inside: avoid;
        margin-bottom: 20px;
    }
}

/* Nový záznam s symbolem + */
.new-record {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    animation: new-record-pulse 3s ease-in-out;
}

/* Odstraněno duplicitní ::before badge - badge se přidává v HTML */

/* Badge pro nový záznam v seznamu */
.new-record-badge {
    display: inline-block;
    background: #ff6b35;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    margin-left: 8px;
    font-weight: bold;
    animation: new-badge-pulse 2s ease-in-out infinite;
}

/* Odstraněno duplicitní CSS - badge se maže v JavaScript */

@keyframes new-badge-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.new-record .record-header {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-bottom: 2px solid #3b82f6;
}

.new-record .record-date {
    color: #1e40af;
    font-weight: 700;
}

/* Odstraněno duplicitní "(NOVÝ)" text - badge se přidává v HTML */
