/* Основные настройки и шрифты */

:root {
    --primary-red: #E82A3A; /* Цвет из логотипа */
    --bg-body: #F4F5F7;     /* Светло-серый фон страницы */
    --bg-white: #FFFFFF;
    --text-main: #1F2937;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --panel-header-bg: #eaedf1; /* Серый для всех заголовков RGB(151, 156, 166) */
}

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

/* Обновляем настройки body для правильного фона и шрифта */
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #F4F5F7; /* Светлый фон как на макете */
    color: #1F2937;
    margin: 0;
    padding: 0; /* Убираем отступы у body, они будут в контейнере */
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px 20px; /* Отступы контента от краев экрана */
}

/* --- Логотип и Шапка объединенная с настройками --- */
header {
    background: var(--bg-white);
    padding: 16px 24px;
    border-radius: 6px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.header-unified {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.header-left-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ─── Единая навигационная полоса (присутствует на всех страницах) ─── */
.app-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-white);
    padding: 6px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.app-nav-btn {
    border: none;
    background: transparent;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    font-family: inherit;
}

.app-nav-btn:hover {
    background: #F3F4F6;
    color: #111827;
}

.app-nav-btn.active {
    background: #F3F4F6;
    color: #111827;
    font-weight: 600;
}

.app-nav-btn:disabled {
    opacity: 0.5;
    cursor: default;
    background: transparent;
}

.app-nav-btn--danger {
    color: #B91C1C;
    margin-left: auto;
}

.app-nav-btn--danger:hover {
    background: #FEF2F2;
    color: #991B1B;
}

.logo-section {
    flex-shrink: 0;
}

h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

/* Красная буква A */
.logo-first {
    color: #E82A3A;
}

/* Черная часть lfred */
.logo-rest {
    color: #000000;
}

/* Красный крестик */
.logo-cross {
    color: #E82A3A;
    font-size: 18px;
    margin-left: 2px;
    margin-top: -8px;
    font-weight: 600;
}

/* Группа: Тип встречи */
.meeting-type-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.meeting-type-label {
    margin: 0;
    white-space: nowrap;
    font-size: 14px;
    color: var(--text-secondary);
}

.meeting-type-select {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #fff;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    min-width: 180px;
}

/* Группа: Модель LLM */
.model-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

.model-input {
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #fff;
    color: var(--text-main);
    font-size: 12px;
    font-family: 'Montserrat', monospace;
    outline: none;
    width: clamp(180px, 20vw, 260px);
    transition: border-color 0.2s;
}

.model-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(232, 42, 58, 0.1);
}

.model-input::placeholder {
    color: #9CA3AF;
    font-size: 11px;
}

/* Группа: Источник звука */
.audio-source-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 260px;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.source-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.source-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    margin-right: 8px;
    position: relative;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    flex-shrink: 0;
}

.source-option input[type="radio"]:checked {
    border-color: var(--primary-red);
}

.source-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: var(--primary-red);
    border-radius: 50%;
}

/* Группа: Таймер и кнопка */
.right-controls-group {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    margin-left: auto;
}

.status-info-compact {
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding: 8px 14px;
    background: #F3F4F6;
    border-radius: 6px;
    min-width: 85px;
    text-align: center;
}

.btn-record {
    background-color: #E82A3A;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
    min-width: 165px;
}

.btn-record:hover {
    background-color: #d12432;
}

.btn-record.recording {
    background-color: #E82A3A;
}

/* Скрываем старые элементы */
.audio-source-selector,
.control-panel,
.top-controls-bar {
    display: none !important;
}

/* --- Скачивание файлов --- */
.panel, .final-report-panel {
    position: relative; 
}

.btn-download-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    z-index: 10;
}

.btn-download-icon:hover {
    background: #F9FAFB;
    color: #1F2937;
    border-color: #D1D5DB;
}

.final-dl-btn {
    bottom: 90px;
}

/* Скрываем кнопки очистки */
.btn-clear {
    display: none !important;
}

@media (max-width: 1200px) {
    .header-unified {
        gap: 16px;
    }
    
    .audio-source-group {
        order: 4;
        width: 100%;
        justify-content: center;
    }

    .right-controls-group {
        margin-left: auto;
    }
}

/* --- Статусная строка генерации --- */
.generation-status {
    background: linear-gradient(90deg, #E82A3A 0%, #d12432 100%);
    padding: 12px 24px;
    border-radius: 6px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(232, 42, 58, 0.2);
    animation: slideDown 0.3s ease-out;
}

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

.generation-status-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- Основной контент (Две колонки) --- */
.main-content {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.main-content.no-interim {
    grid-template-columns: 1fr;
}

body.no-interim-mode .container {
    max-width: none;
}

body.no-interim-mode .main-content.no-interim .panel-transcript {
    height: calc(100vh - 220px);
}

.panel {
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 650px; /* Фиксированная высота для прокрутки */
}

.panel-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Чуть темнее чем фон страницы */
    background-color: #E8EAEE;
    color: #1F2937; /* Черный текст */
    border-bottom: 1px solid #D1D5DB;
}

.panel-header h2 {
    color: #1F2937; /* Черный текст */
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Кнопка скачивания в шапке viewer-панели */
.viewer-download-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #D1D5DB;
    background: #FFFFFF;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}

.viewer-download-btn:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
    color: #111827;
}

.btn-clear {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    font-size: 16px;
    transition: opacity 0.2s;
    color: #1F2937; /* Черная иконка корзины */
}

.btn-clear:hover {
    opacity: 0.8;
}

.panel-content {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0; /* Важно для правильной работы overflow */
}

.panel-content p.placeholder {
    text-align: center;
    color: #9CA3AF;
    font-style: italic;
    font-size: 14px;
    padding: 60px 20px;
}

/* --- Финальный отчет --- */
.final-report-panel {
    background: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 900px; /* Увеличенная высота для удобного чтения */
    display: none; /* Скрыт по умолчанию */
    flex-direction: column;
}

/* Иконка корзины уже белая для всех панелей (см. .btn-clear выше) */

.final-report-panel .panel-content {
    padding: 40px;
}

/* ========== TRANSCRIPT STYLING ========== */
.transcript-line {
    margin-bottom: 8px;
    color: #333;
    line-height: 1.5;
}

/* ========== REPORT CARDS ========== */
.report-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #F0F0F0;
}

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

.report-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: #666;
}

.download-docx-btn {
    background: #F3F4F6; /* Светло-серый фон */
    color: #1F2937; /* Черный текст */
    border: 1px solid #000000; /* Черная обводка */
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.download-docx-btn:hover {
    background: #E5E7EB; /* Чуть темнее при наведении */
    transform: translateY(-1px);
}

/* ========== EMAIL FORM ========== */
.email-section {
    margin-top: auto;
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
    background-color: #F9FAFB;
    display: none; /* Скрыто по умолчанию */
}

.email-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.email-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #AFA1A1;
    background-color: #F3F4F6;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.email-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(232, 42, 58, 0.1);
}

.send-email-btn {
    background-color: #E60000;
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.send-email-btn span {
    color: #FFFFFF;
}

.send-email-btn:hover {
    background-color: #cc0000;
}

.send-email-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ========== MARKDOWN CONTENT STYLING ========== */
.report-content {
    line-height: 1.6;
    font-size: 0.95rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.report-content h1 {
    font-size: 1.5rem;
    color: #000000;
    margin-top: 15px;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--primary-red);
}

.report-content h2 {
    font-size: 1.3rem;
    color: #000000;
    margin-top: 12px;
    margin-bottom: 8px;
}

.report-content h3 {
    font-size: 1.1rem;
    color: #000000;
    margin-top: 10px;
    margin-bottom: 6px;
}

.report-content p {
    margin-bottom: 10px;
    color: #000000;
}

.report-content strong {
    font-weight: 600;
    color: #000000;
}

.report-content em {
    font-style: italic;
    color: #000000;
}

.report-content ul,
.report-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.report-content li {
    margin-bottom: 5px;
    color: #000000;
}

.report-content code {
    background-color: #F5F5F5;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary-red);
}

.report-content pre {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 10px 0;
}

.report-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
}

.report-content blockquote {
    border-left: 4px solid var(--primary-red);
    padding-left: 12px;
    margin: 10px 0;
    color: #000000;
    font-style: italic;
}

.report-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.report-content table th {
    background-color: #F5F5F5;
    padding: 8px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #DDD;
}

.report-content table td {
    padding: 8px;
    border: 1px solid #DDD;
}

.report-content table tr:nth-child(even) {
    background-color: #FAFAFA;
}

/* ========== ANIMATIONS ========== */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* ========== SCROLLBAR STYLING ========== */
.panel-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track {
    background: #F5F5F5;
}

.panel-content::-webkit-scrollbar-thumb {
    background: #CCC;
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* ========== TOOLTIP ========== */
.tooltip-icon {
    position: relative;
    display: inline-block;
    margin-left: 6px;
    font-size: 14px;
    color: #6B7280;
    cursor: help;
    font-weight: 500;
    user-select: none;
    vertical-align: middle;
    transition: color 0.2s ease;
}

.tooltip-icon:hover {
    color: var(--primary-red);
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 8px);
    background-color: #F9FAFB;
    color: #1F2937;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.5;
    white-space: normal;
    width: 380px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    text-align: left;
    font-weight: 400;
}

.tooltip-content strong {
    color: #000000;
    font-weight: 600;
}

/* Стрелочка сверху */
.tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #F9FAFB;
}

.tooltip-icon:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px;
    }
    
    .audio-source-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .meeting-type-label {
        margin-left: 0;
    }
    
    .control-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .status-info {
        justify-content: space-between;
        width: 100%;
    }
}

/* ========== MEETINGS CABINET ========== */
.header-link-btn {
    border: 1px solid #D1D5DB;
    background: #FFFFFF;
    color: #1F2937;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}

.side-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 999;
}

.side-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #FFFFFF;
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.side-menu.open {
    transform: translateX(0);
}

.side-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid #E5E7EB;
}

.side-menu-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.menu-close-btn {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6B7280;
}

.side-menu-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}

.side-menu-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 6px 2px;
}

.side-menu-settings {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 8px 2px 8px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #F9FAFB;
}

.side-menu-label {
    font-size: 12px;
    color: #6B7280;
}

.side-menu-input {
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    background: #FFFFFF;
}

.side-menu-checkbox {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: #1F2937;
}

.side-menu-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.side-menu-item {
    border: 1px solid #E5E7EB;
    background: #fff;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}

.side-menu-item:hover {
    border-color: #D1D5DB;
    background: #F9FAFB;
}

.side-menu-item.danger {
    color: #B91C1C;
}

.header-link-btn.primary {
    background: #E82A3A;
    color: #FFFFFF;
    border-color: #E82A3A;
}

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

.meetings-page .meetings-header {
    justify-content: flex-start;
    align-items: center;
    gap: 14px;
}

.meetings-username {
    color: #6B7280;
    font-size: 13px;
}

.meetings-filters {
    background: #FFFFFF;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.meetings-filters input,
.meetings-filters select {
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.meetings-filters.in-header {
    margin-bottom: 0;
    margin-left: auto;
    flex: 1;
    justify-content: flex-end;
    padding: 0;
}

/* Meetings page: full-height layout */
.meetings-page .container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-bottom: 0;
}

.meetings-page header {
    flex-shrink: 0;
    margin-bottom: 16px;
}

.meetings-layout {
    display: grid;
    grid-template-columns: 210px 1.2fr 1fr;
    gap: 16px;
    flex: 1;
    min-height: 0; /* critical for flex children overflow */
    margin-bottom: 16px;
}

.meetings-list-panel,
.meetings-viewer-panel {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    transition: box-shadow 0.2s;
}

.meetings-list-panel:hover,
.meetings-viewer-panel:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* === Панель папок === */
.folders-panel {
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    transition: box-shadow 0.2s;
}

.folders-panel:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.folders-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    transition: background 0.15s;
    position: relative;
}

.folder-item:hover {
    background: #F3F4F6;
}

.folder-item.active {
    background: #FEE2E2;
    color: #991B1B;
    font-weight: 600;
}

.folder-item.drag-over {
    background: #DBEAFE;
    outline: 2px dashed #3B82F6;
    outline-offset: -2px;
}

.folder-icon {
    flex-shrink: 0;
    font-size: 15px;
}

.folder-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-name.editing {
    background: #fff;
    box-shadow: 0 0 0 2px var(--primary-red);
    border-radius: 3px;
    padding: 1px 4px;
    outline: none;
}

.folder-count {
    font-size: 11px;
    color: #9CA3AF;
    flex-shrink: 0;
}

.folder-actions {
    display: none;
    gap: 2px;
    flex-shrink: 0;
}

.folder-item:hover .folder-actions {
    display: flex;
}

.folder-item:hover .folder-count {
    display: none;
}

.folder-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #9CA3AF;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
}

.folder-action-btn:hover {
    color: var(--primary-red);
    background: #F3F4F6;
}

.folders-actions {
    padding: 10px 12px;
    border-top: 1px solid #E5E7EB;
}

.folders-add-btn {
    width: 100%;
    font-size: 12px;
    padding: 6px 10px;
}

.folder-select {
    font-size: 11px;
    padding: 4px 6px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    max-width: 120px;
}

.folder-select:focus {
    outline: none;
    border-color: var(--primary-red);
}

.meetings-pagination {
    padding: 12px 16px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meeting-card {
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
    background: #F9FAFB;
}

.meeting-card-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.meeting-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.meeting-name {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    outline: none;
    border-radius: 4px;
    padding: 1px 2px;
    transition: background 0.15s;
}

.meeting-name.editing {
    background: #fff;
    box-shadow: 0 0 0 2px var(--primary-red);
}

.meeting-name-edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #9CA3AF;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.meeting-name-edit-btn:hover {
    color: var(--primary-red);
    background: #F3F4F6;
}

.meeting-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #6B7280;
    font-size: 12px;
}

.meeting-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    align-self: flex-start;
}

.meeting-status.completed {
    background: #D1FAE5;
    color: #065F46;
}

.meeting-status.in_progress {
    background: #FEF3C7;
    color: #92400E;
}

.meeting-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.meeting-files {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-pill {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 999px;
    font-size: 11px;
    padding: 5px 10px;
    cursor: pointer;
}

.file-pill:hover {
    border-color: #E82A3A;
}

.transcript-preview {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #1F2937;
}

/* ==================== FLOATING AI CHAT WIDGET ==================== */

.ai-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-red);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(232, 42, 58, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
}

.ai-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(232, 42, 58, 0.45);
}

.ai-fab.hidden { display: none; }

.ai-chat-popup {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 420px;
    height: 560px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    animation: popupSlideUp 0.25s ease;
}

.ai-chat-popup.open {
    display: flex;
}

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

.ai-chat-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--primary-red);
    color: #fff;
    flex-shrink: 0;
}

.ai-chat-popup-header .ai-badge {
    background: rgba(255,255,255,0.2);
    font-weight: 700;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
}

.ai-chat-popup-header h3 {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.ai-chat-popup-header button {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.8;
    transition: opacity 0.15s;
}

.ai-chat-popup-header button:hover { opacity: 1; }

.ai-chat-close-btn { font-size: 18px !important; }
.ai-chat-fullscreen-btn { font-size: 14px !important; }

/* Chat messages */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
}

.ai-chat-messages:empty::before {
    content: 'Задайте вопрос о ваших встречах...';
    color: #9CA3AF;
    font-style: italic;
    font-size: 13px;
    text-align: center;
    padding: 60px 20px;
    display: block;
}

.ai-chat-messages::-webkit-scrollbar { width: 5px; }
.ai-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }

/* Chat bubbles */
.ai-chat-bubble {
    max-width: 88%;
    animation: fadeInUp 0.2s ease;
}

.ai-chat-user { align-self: flex-end; }
.ai-chat-assistant { align-self: flex-start; }

.ai-chat-user .ai-chat-bubble-content {
    background: var(--primary-red);
    color: #fff;
    border-radius: 14px 14px 4px 14px;
    padding: 10px 14px;
    font-size: 13px;
    line-height: 1.6;
}

.ai-chat-user .ai-chat-bubble-content p { margin: 0; }

.ai-chat-assistant .ai-chat-bubble-content {
    background: #F3F4F6;
    color: #1F2937;
    border-radius: 14px 14px 14px 4px;
    padding: 12px 16px;
    font-size: 13px;
    line-height: 1.7;
}

.ai-chat-assistant .ai-chat-bubble-content p { margin-bottom: 6px; }
.ai-chat-assistant .ai-chat-bubble-content p:last-child { margin-bottom: 0; }
.ai-chat-assistant .ai-chat-bubble-content ul,
.ai-chat-assistant .ai-chat-bubble-content ol { margin: 6px 0; padding-left: 20px; }
.ai-chat-assistant .ai-chat-bubble-content li { margin-bottom: 3px; }
.ai-chat-assistant .ai-chat-bubble-content h2 { font-size: 14px; margin: 10px 0 6px; }
.ai-chat-assistant .ai-chat-bubble-content h3 { font-size: 13px; margin: 8px 0 4px; }
.ai-chat-assistant .ai-chat-bubble-content strong { color: #111; }
.ai-chat-assistant .ai-chat-bubble-content hr { border: none; border-top: 1px solid #E5E7EB; margin: 10px 0; }

.ai-chat-sources {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ai-source-link {
    display: inline-block;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.ai-source-link:hover {
    border-color: var(--primary-red);
    color: var(--primary-red);
}

/* Agent tool trace */
.ai-tool-trace {
    margin-bottom: 8px;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: #6B7280;
}

.ai-tool-trace summary {
    cursor: pointer;
    font-weight: 500;
    color: #4B5563;
    user-select: none;
    outline: none;
}

.ai-tool-trace summary:hover {
    color: #111827;
}

.ai-tool-trace[open] summary {
    margin-bottom: 6px;
}

.ai-tool-step {
    padding: 2px 0 2px 8px;
    border-left: 2px solid #E5E7EB;
    margin-left: 4px;
    line-height: 1.5;
}

.ai-tool-num {
    color: #9CA3AF;
    font-variant-numeric: tabular-nums;
}

.ai-tool-name {
    color: #374151;
    font-weight: 500;
}

.ai-tool-arg {
    color: #6B7280;
    font-style: italic;
}

/* Chat input bar */
.ai-chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-color);
    background: #FAFAFA;
    flex-shrink: 0;
}

.ai-chat-input-bar input {
    flex: 1;
    border: 1px solid #E5E7EB;
    border-radius: 20px;
    padding: 9px 16px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.ai-chat-input-bar input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 2px rgba(232, 42, 58, 0.08);
}

.ai-chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-red);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.ai-chat-send-btn:hover { background: #d12432; }
.ai-chat-send-btn:active { transform: scale(0.93); }

/* Loading */
.ai-search-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: #6B7280;
    font-size: 13px;
}

.ai-search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #E5E7EB;
    border-top-color: var(--primary-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==================== AGENT PAGE ==================== */

.agent-page .container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding-bottom: 0;
}

.agent-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr 280px;
    gap: 0;
    min-height: 0;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin-bottom: 16px;
}

.agent-layout.meetings-collapsed {
    grid-template-columns: 260px 1fr 44px;
}

/* Agent sidebar */
.agent-sidebar {
    background: #1F2937;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.agent-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.agent-new-chat-btn {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.agent-new-chat-btn:hover { background: rgba(255,255,255,0.08); }

.agent-chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    min-height: 0;
}

.agent-chat-list::-webkit-scrollbar { width: 4px; }
.agent-chat-list::-webkit-scrollbar-track { background: transparent; }
.agent-chat-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

.agent-chat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #D1D5DB;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
    overflow: hidden;
}

.agent-chat-item:hover { background: rgba(255,255,255,0.06); }

.agent-chat-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.agent-chat-item-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-chat-item-delete {
    opacity: 0;
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 4px;
    transition: opacity 0.15s, color 0.15s;
    flex-shrink: 0;
}

.agent-chat-item:hover .agent-chat-item-delete { opacity: 1; }
.agent-chat-item-delete:hover { color: #EF4444; }

/* Agent main area */
.agent-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
}

.agent-main-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.agent-main-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-main-header .ai-badge {
    background: var(--primary-red);
    color: #fff;
    font-weight: 700;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    flex-shrink: 0;
}

.agent-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.agent-messages::-webkit-scrollbar { width: 6px; }
.agent-messages::-webkit-scrollbar-track { background: transparent; }
.agent-messages::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }

.agent-messages:empty::before {
    content: 'Начните диалог — задайте вопрос о ваших встречах';
    color: #9CA3AF;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    padding: 120px 40px;
    display: block;
}

.agent-input-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: #FAFAFA;
    flex-shrink: 0;
}

.agent-input-bar input {
    flex: 1;
    border: 1px solid #E5E7EB;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.agent-input-bar input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 3px rgba(232, 42, 58, 0.08);
}

.agent-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-red);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}

.agent-send-btn:hover { background: #d12432; }
.agent-send-btn:active { transform: scale(0.93); }

/* Shared chat bubble styles for agent page */
.agent-messages .ai-chat-bubble { max-width: 75%; }
.agent-messages .ai-chat-user .ai-chat-bubble-content { font-size: 14px; }
.agent-messages .ai-chat-assistant .ai-chat-bubble-content { font-size: 14px; }

/* Agent meetings panel (right sidebar) */
.agent-meetings-panel {
    background: #F9FAFB;
    border-left: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: width 0.2s;
    overflow: hidden;
}

.agent-meetings-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.agent-meetings-title {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
    white-space: nowrap;
}

.agent-meetings-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    color: #6B7280;
    display: flex;
    align-items: center;
    transition: background 0.15s, transform 0.2s;
}

.agent-meetings-toggle:hover { background: #E5E7EB; }
.meetings-collapsed .agent-meetings-toggle svg { transform: rotate(180deg); }

.agent-meetings-controls {
    padding: 10px 14px;
    border-bottom: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.meetings-collapsed .agent-meetings-controls,
.meetings-collapsed .agent-meetings-list,
.meetings-collapsed .agent-meetings-title {
    display: none;
}

.agent-meetings-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    margin-bottom: 8px;
}

.agent-meetings-select-all input[type="checkbox"] {
    accent-color: var(--primary-red);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.agent-meetings-search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.agent-meetings-search input:focus { border-color: var(--primary-red); }

.agent-meetings-selected-count {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 6px;
    min-height: 16px;
}

.agent-meetings-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

.agent-meetings-list::-webkit-scrollbar { width: 4px; }
.agent-meetings-list::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 2px; }

.agent-meeting-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid #F3F4F6;
}

.agent-meeting-item:hover { background: #EFF1F3; }
.agent-meeting-item.selected { background: #FEF2F2; }

.agent-meeting-item input[type="checkbox"] {
    accent-color: var(--primary-red);
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.agent-meeting-item-info {
    flex: 1;
    min-width: 0;
}

.agent-meeting-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #1F2937;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.agent-meeting-item-date {
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 2px;
}

/* Folder items in meetings panel */
.agent-folder-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid #F3F4F6;
    background: #FEFCE8;
}

.agent-folder-item:hover { background: #FEF9C3; }
.agent-folder-item.selected { background: #FEF2F2; }

.agent-folder-item input[type="checkbox"] {
    accent-color: var(--primary-red);
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.agent-meetings-divider {
    height: 1px;
    background: #D1D5DB;
    margin: 4px 14px;
}

.agent-meeting-item.via-folder {
    opacity: 0.7;
}

.agent-meeting-item.via-folder input[type="checkbox"] {
    accent-color: #9CA3AF;
}

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

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

@media (max-width: 1100px) {
    .meetings-page .container { height: auto; }
    .meetings-layout {
        grid-template-columns: 1fr;
        flex: none;
    }
    .meetings-layout > * { min-height: 300px; max-height: 500px; }
    .folders-panel { min-height: auto; max-height: 200px; }
    .meetings-page .meetings-header { align-items: flex-start; }
    .meetings-filters.in-header {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        margin-top: 8px;
    }
    .ai-chat-popup { width: calc(100vw - 32px); right: 16px; bottom: 16px; height: 70vh; }
    .ai-fab { bottom: 16px; right: 16px; }
    .agent-layout { grid-template-columns: 1fr; }
    .agent-layout.meetings-collapsed { grid-template-columns: 1fr; }
    .agent-sidebar { max-height: 200px; }
    .agent-meetings-panel { max-height: 250px; border-left: none; border-top: 1px solid #E5E7EB; }
}

/* Drag & drop для карточек встреч */
.meeting-card.dragging {
    opacity: 0.5;
}

/* ========== SETTINGS PAGE ========== */
.settings-title {
    margin-left: auto;
    font-weight: 600;
    color: #111;
}

.settings-panel {
    height: auto;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.settings-block {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px;
    background: #F9FAFB;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-block-title {
    font-weight: 600;
    font-size: 13px;
    color: #111;
}

.settings-hint {
    color: #6B7280;
    font-size: 12px;
    line-height: 1.4;
}

.settings-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.settings-status {
    font-size: 12px;
    color: #92400E;
    background: #FEF3C7;
    border-radius: 999px;
    padding: 4px 10px;
}

.settings-status.ok {
    color: #065F46;
    background: #D1FAE5;
}

.settings-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 1100px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== ЗАПИСКИ (BOTTOM PANEL) ==================== */

.notes-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-white);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
    z-index: 900;
    transition: transform 0.3s ease;
    transform: translateY(calc(100% - 42px)); /* свёрнуто — видна только шапка */
}

.notes-panel.open {
    transform: translateY(0);
}

.notes-panel-header {
    height: 42px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-color);
    background: #F9FAFB;
}

.notes-panel-header:hover {
    background: #F3F4F6;
}

.notes-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-panel-count {
    font-weight: 700;
    color: var(--primary-red);
}

.notes-panel-chevron {
    transition: transform 0.3s;
    color: var(--text-secondary);
}

.notes-panel.open .notes-panel-chevron {
    transform: rotate(180deg);
}

.notes-panel-body {
    padding: 14px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 240px;
    overflow-y: auto;
}

/* Форма добавления — горизонтальная */
.notes-form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.notes-form-inline .note-input {
    flex: 1;
    min-width: 0;
}

.note-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.note-input:focus {
    border-color: var(--primary-red);
}

.note-add-btn-inline {
    padding: 8px 18px;
    background: var(--primary-red);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.note-add-btn-inline:hover {
    background: #c4222f;
}

.note-add-btn-inline:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.notes-form-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 10px;
    background: #F3F4F6;
    border-radius: 8px;
}

/* Карточки — горизонтальный скролл */
.notes-cards-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.notes-cards-row:empty {
    display: none;
}

.note-card {
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    min-width: 220px;
    max-width: 300px;
    flex-shrink: 0;
    position: relative;
    transition: box-shadow 0.2s;
}

.note-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}

.note-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
}

.note-card-minute {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-red);
    background: rgba(232,42,58,0.08);
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.note-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
}

.note-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 2px 4px;
    opacity: 0;
    transition: opacity 0.2s, color 0.2s;
}

.note-card:hover .note-card-delete {
    opacity: 1;
}

.note-card-delete:hover {
    color: var(--primary-red);
}

.notes-empty {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    padding: 12px 0;
}

/* ==================== ЗАПИСКИ В ПРОСМОТРЕ ВСТРЕЧИ ==================== */

.meeting-notes-section {
    margin-top: 20px;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

.meeting-notes-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 10px;
}

.meeting-notes-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.meeting-note-card {
    background: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.5;
}

.meeting-note-minute {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-red);
    background: rgba(232,42,58,0.08);
    padding: 1px 7px;
    border-radius: 8px;
    margin-right: 8px;
}

.meeting-note-desc {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    white-space: pre-wrap;
}
