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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f7f7f8;
    color: #1f2937;
    height: 100vh;
    overflow: hidden;
}

/* App Header */
.app-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 44px;
    flex-shrink: 0;
}

.app-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-header .group-selector {
    margin: 0;
}

.group-dropdown {
    position: relative;
}

.group-dropdown-trigger {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 6px 3px 4px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    transition: background-color 0.15s, color 0.15s;
}

.group-dropdown-trigger:hover {
    background: #f3f4f6;
    color: #374151;
}

.group-dropdown-chevron {
    color: #9ca3af;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.group-dropdown.open .group-dropdown-chevron {
    transform: rotate(180deg);
}

.group-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 4px 0;
}

.group-dropdown.open .group-dropdown-panel {
    display: block;
}

.group-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #374151;
    transition: background-color 0.1s;
    gap: 10px;
}

.group-dropdown-item:hover {
    background: #f9fafb;
}

.group-dropdown-item.selected {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 500;
}

.group-dropdown-item-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.group-visibility-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 10px;
    flex-shrink: 0;
    letter-spacing: 0.01em;
}

.group-visibility-badge.public {
    background: #dcfce7;
    color: #15803d;
}

.group-visibility-badge.private {
    background: #f3f4f6;
    color: #6b7280;
}

.app-header .group-selector {
    display: flex;
    align-items: center;
    gap: 4px;
}

.add-group-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.add-group-btn:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.edit-group-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.edit-group-btn:hover {
    background: #f3f4f6;
    color: #3b82f6;
}

.modal-input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.modal-input::placeholder {
    color: #9ca3af;
}

.app-container {
    display: flex;
    height: calc(100vh - 44px);
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    position: relative;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.group-selector {
    margin-bottom: 12px;
}

.group-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f9fafb;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.group-select:hover {
    border-color: #d1d5db;
    background-color: #fff;
}

.group-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.user-role-indicator {
    margin-bottom: 8px;
    text-align: center;
}

.user-role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-role-badge.role-user {
    background: #e5e7eb;
    color: #374151;
}

.user-role-badge.role-admin {
    background: #fef3c7;
    color: #92400e;
}

.user-role-badge.role-moderator {
    background: #dbeafe;
    color: #1e40af;
}

.new-session-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #1f2937;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.new-session-btn:hover {
    background: #374151;
}

.session-search {
    position: relative;
    margin-top: 8px;
}

.session-search .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.session-search input {
    width: 100%;
    padding: 8px 10px 8px 32px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    background: #f9fafb;
    transition: border-color 0.2s, background-color 0.2s;
}

.session-search input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
}

.session-search input::placeholder {
    color: #9ca3af;
}

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

.loading-sessions {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.session-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 2px 0;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.session-item:hover {
    background: #f3f4f6;
}

.view-more-sessions {
    display: block;
    width: 100%;
    margin: 8px 0 4px;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s;
}

.view-more-sessions:hover:not(:disabled) {
    background: #e5e7eb;
}

.view-more-sessions:disabled {
    cursor: default;
    opacity: 0.6;
}

.session-item.active {
    background: #dbeafe;
    color: #1d4ed8;
}

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

.session-item:has(.delete-session-btn) .session-item-content {
    padding-right: 6px;
}

.session-item-title {
    font-weight: 500;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
}

.cluster-icon {
    color: #8b5cf6;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.session-item-title .session-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    flex-shrink: 1;
}

.session-item-owner {
    margin-bottom: 2px;
}

.session-item-meta {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 8px;
}

.session-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
}

.session-status-dot.completed {
    background: #6b7280;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.welcome-content h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
}

.welcome-content p {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
    max-width: 400px;
}

.start-session-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.start-session-btn:hover {
    background: #2563eb;
}

/* Session View */
.session-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.session-header {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.session-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.session-info {
    flex: 1;
    min-width: 0;
}

.session-description-wrapper {
    margin: 4px 0 6px;
}

.session-description {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.session-description.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.session-description.editable {
    cursor: pointer;
}

.session-description.editable:hover {
    color: #374151;
    background: #f3f4f6;
    border-radius: 4px;
}

.session-description.editable:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

.session-description-toggle,
.session-description-add {
    background: none;
    border: none;
    padding: 2px 0;
    margin-top: 2px;
    color: #3b82f6;
    font-size: 12px;
    cursor: pointer;
}

.session-description-toggle:hover,
.session-description-add:hover {
    text-decoration: underline;
}

.session-description-editor {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.4;
    color: #1f2937;
    resize: vertical;
    min-height: 60px;
}

.session-description-editor:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.session-info h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.session-owner-badge {
    background: #f3e8ff;
    color: #7c3aed;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 10px;
}

.session-theme-dropdown {
    position: relative;
    display: inline-block;
}

.session-theme-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 10px;
}

.session-theme-badge.clickable {
    cursor: pointer;
    transition: background-color 0.2s;
}

.session-theme-badge.clickable:hover {
    background: #bae6fd;
}

.theme-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
    min-width: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.theme-dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: block;
}

.theme-dropdown-item:hover {
    background: #f3f4f6;
}

.theme-dropdown-item.selected {
    background: #e0f2fe;
    color: #0369a1;
    font-weight: 500;
}

.session-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
    transition: background-color 0.2s;
}

.status-indicator.ready {
    background: #10b981;
}

.status-indicator.listening {
    background: #3b82f6;
    animation: pulse 1.5s infinite;
}

.status-indicator.error {
    background: #ef4444;
}

.status-indicator.warning {
    background: #f59e0b;
}

.status-indicator.readonly {
    background: #6b7280;
}

/* Session List Styling */
.continue-badge {
    background: #10b981;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.other-user-badge {
    background: #f3e8ff;
    color: #7c3aed;
    font-size: 10px;
    font-weight: 500;
    padding: 1px 5px;
    border-radius: 8px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-item.other-user-session {
    border-left: 3px solid #7c3aed;
}

.session-item.selected {
    background: #f3f4f6;
    border-left: 3px solid #3b82f6;
}

.session-item.active-session {
    border-left: 3px solid #10b981;
}

.session-item.completed-session {
    opacity: 0.7;
}

.session-item-stats {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.session-status-dot.active {
    background: #10b981;
}

.session-status-dot.completed {
    background: #6b7280;
}

.delete-session-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.delete-session-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

.delete-session-btn svg {
    display: block;
}

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

.cluster-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
}

.cluster-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.cluster-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 20px;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

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

.cluster-toggle input:checked + .cluster-toggle-slider {
    background: #8b5cf6;
}

.cluster-toggle input:checked + .cluster-toggle-slider::after {
    transform: translateX(16px);
}

.cluster-toggle:hover .cluster-toggle-slider {
    background: #9ca3af;
}

.cluster-toggle input:checked:hover + .cluster-toggle-slider {
    background: #7c3aed;
}

.cluster-toggle-label {
    user-select: none;
}

.cluster-toggle-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cluster-toggle.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.cluster-toggle-hint {
    font-size: 11px;
    color: #9ca3af;
}

.session-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.end-session-btn {
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.end-session-btn:hover {
    background: #dc2626;
}

/* Controls Panel */
.controls-panel {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-source-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 80px;
}

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

.btn-start {
    background: #10b981;
    color: white;
}

.btn-start:hover:not(:disabled) {
    background: #059669;
}

.btn-stop {
    background: #ef4444;
    color: white;
}

.btn-stop:hover:not(:disabled) {
    background: #dc2626;
}

/* Content Tabs */
.content-tabs {
    display: flex;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 20px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.tab-btn:hover {
    color: #374151;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-badge {
    background: #3b82f6;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1.2;
}

/* Subtabs */
.subtabs {
    display: flex;
    background: #f3f4f6;
    border-bottom: 1px solid #d1d5db;
    margin-bottom: 16px;
}

.subtab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: none;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.subtab-btn:hover {
    color: #374151;
    background: #e5e7eb;
}

.subtab-btn.active {
    color: #3b82f6;
    background: white;
    border-bottom-color: #3b82f6;
}

.subtab-badge {
    background: #6b7280;
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 14px;
    text-align: center;
    line-height: 1.2;
}

.subtab-btn.active .subtab-badge {
    background: #3b82f6;
}

.subtab-content {
    flex: 1;
    overflow: hidden;
}

.subtab-pane {
    display: none;
    height: 100%;
}

.subtab-pane.active {
    display: block;
}

/* Tab Content */
.tab-content {
    flex: 1;
    overflow: hidden;
}

.tab-pane {
    display: none;
    height: 100%;
    padding: 16px 20px;
    overflow-y: auto;
}

.tab-pane.active {
    display: flex;
    flex-direction: column;
}

/* Transcription Area */
.transcription-area {
    flex: 1;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.interim-text {
    color: #6b7280;
    font-style: italic;
    margin-bottom: 12px;
    padding: 8px;
    background: #ffffff;
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
    min-height: 20px;
}

.transcript-content {
    line-height: 1.6;
}

.transcript-segment {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
    transition: box-shadow 0.2s;
}

.transcript-segment:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.speaker-segment {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.speaker-label {
    font-weight: 600;
    margin-right: 8px;
    color: #374151;
}

.speaker-dropdown {
    background: white;
    border: 2px solid #007bff;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: inherit;
    font-family: inherit;
    font-weight: 600;
    color: #333;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    margin-right: 8px;
}

.speaker-dropdown:focus {
    border-color: #0056b3;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.transcript-actions,
.insights-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.action-btn svg {
    flex-shrink: 0;
}

.action-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.action-btn.copied {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

/* Insights Content */
.insights-content {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    height: fit-content;
}

.insight-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #374151;
}

.insight-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.insight-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    font-size: 14px;
    line-height: 1.5;
    transition: box-shadow 0.2s;
}

.insight-item:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 14px;
}

/* Scrollbars */
.sessions-list::-webkit-scrollbar,
.transcription-area::-webkit-scrollbar,
.tab-pane::-webkit-scrollbar {
    width: 6px;
}

.sessions-list::-webkit-scrollbar-track,
.transcription-area::-webkit-scrollbar-track,
.tab-pane::-webkit-scrollbar-track {
    background: transparent;
}

.sessions-list::-webkit-scrollbar-thumb,
.transcription-area::-webkit-scrollbar-thumb,
.tab-pane::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sessions-list::-webkit-scrollbar-thumb:hover,
.transcription-area::-webkit-scrollbar-thumb:hover,
.tab-pane::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 260px;
    }
    
    .controls-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .insights-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .app-header {
        padding: 10px 16px;
        height: 50px;
    }

    .app-header .group-select {
        min-width: 100px;
        font-size: 14px;
    }

    .app-container {
        flex-direction: column;
        height: calc(100vh - 44px);
    }

    .sidebar {
        width: 100%;
        height: 200px;
    }

    .sessions-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .approvals-container {
        min-height: calc(100vh - 44px);
    }
    
    .session-item {
        min-width: 200px;
        margin: 0 4px;
    }
    
    .insights-content {
        grid-template-columns: 1fr;
    }
}

/* Evolution Tab Styles */
.evolution-header {
    margin-bottom: 20px;
}

.evolution-header h3 {
    color: #1f2937;
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
}

.evolution-description {
    color: #6b7280;
    font-size: 14px;
}

.evolution-chart-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 500px;
    position: relative;
    overflow: hidden; /* Prevents content from spilling out */
    width: 100%;
    box-sizing: border-box;
}

.evolution-chart {
    width: 100%;
    height: 500px;
    min-width: 0; /* Ensures it can shrink */
}

.evolution-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.evolution-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #4b5563;
}

.evolution-legend .legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

/* Chart tooltip styles */
.chart-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
}

/* Empty state for evolution */
.evolution-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: #6b7280;
    text-align: center;
}

.evolution-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.evolution-empty-state h4 {
    margin-bottom: 8px;
    font-weight: 500;
}

.evolution-empty-state p {
    font-size: 14px;
    max-width: 300px;
}

/* Legend line styles */
.legend-line {
    width: 30px;
    height: 3px;
    border-radius: 1px;
}

.legend-line.hierarchy {
    background-color: #666;
}

.legend-line.sequence {
    background-color: #e74c3c;
    background-image: repeating-linear-gradient(
        to right,
        #e74c3c 0,
        #e74c3c 5px,
        transparent 5px,
        transparent 10px
    );
}

/* Tone & Outlook Chart Styles */
.tone-outlook-section {
    margin-top: 40px;
    border-top: 1px solid #e0e0e0;
    padding-top: 30px;
}

.tone-outlook-header h3 {
    margin: 0 0 8px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.tone-outlook-description {
    margin: 0 0 20px 0;
    color: #6b7280;
    font-size: 14px;
}

.tone-outlook-chart-container {
    background: #fafafa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.tone-outlook-chart {
    min-height: 300px;
    width: 100%;
}

.tone-outlook-legend {
    display: flex;
    gap: 40px;
    justify-content: space-around;
    margin-top: 15px;
}

.legend-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    margin-right: 8px;
}

/* Empty state for tone/outlook */
.tone-outlook-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #6b7280;
    text-align: center;
}

.tone-outlook-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.tone-outlook-empty-state h4 {
    margin-bottom: 8px;
    font-weight: 500;
}

.tone-outlook-empty-state p {
    font-size: 14px;
    max-width: 300px;
}

/* Legend circle styles */
.legend-circle {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: #66c2a5;
}

.legend-circle.broad {
    border: 3px solid white;
    background-color: #66c2a5;
}

.legend-circle.subtopic {
    border: 1.5px dashed #666;
    background-color: #b3d9ce;
}


@media (max-width: 768px) {
    .evolution-legend {
        gap: 15px;
    }

    .evolution-chart {
        height: 400px;
    }

    .evolution-chart-container {
        min-height: 400px;
        padding: 15px;
    }
}

/* Topic Dropdown Controls */
.topic-name-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topic-dropdown-btn {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    min-width: 28px;
    height: 28px;
}

.topic-dropdown-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #1f2937;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.topic-dropdown-btn:focus {
    outline: none;
    background: #ddd6fe;
    border-color: #8b5cf6;
    color: #1f2937;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.topic-dropdown-btn:active {
    background: #d1d5db;
    transform: translateY(1px);
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    transform: rotate(0deg);
    width: 14px;
    height: 14px;
}

.topic-dropdown-btn:hover .dropdown-arrow {
    transform: rotate(0deg) scale(1.1);
}

/* Add a subtle indicator that this topic is expandable */
.topic-row.topic-row:has(.topic-dropdown-btn) {
    position: relative;
}

.topic-row.topic-row:has(.topic-dropdown-btn):before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #3b82f6, #1d4ed8);
    border-radius: 0 2px 2px 0;
}

/* Topic Table Styles */
.insights-content {
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 0;
}

.topic-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.5fr) 2fr 1.2fr;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    align-items: start;
    min-height: 50px;
}

.topic-row:hover {
    background: #f9fafb;
}

/* Topic rows (main topics) */
.topic-row.topic-row {
    background: #ffffff;
    border-left: 3px solid #3b82f6;
    font-weight: 600;
    padding-left: 16px;
}

/* Subtopic rows */
.topic-row.subtopic-row {
    background: #fafbfc;
    border-left: 3px solid #d1d5db;
    margin-left: 12px;
    padding-left: 12px;
    font-weight: normal;
}

.topic-row.subtopic-row .topic-name {
    position: relative;
}

.topic-row.subtopic-row .topic-name:before {
    content: "└─ ";
    color: #9ca3af;
    margin-right: 4px;
}

/* Column styles */
.topic-name-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.topic-name {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.4;
    word-break: break-word;
}

.topic-row.topic-row .topic-name {
    font-weight: 600;
    font-size: 15px;
}

.topic-row.subtopic-row .topic-name {
    font-weight: 500;
    font-size: 13px;
    color: #374151;
}

.topic-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
}

.segment-count {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
}

.time-range {
    background: #fef3c7;
    color: #d97706;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.topic-summary-col {
    padding-right: 8px;
}

.topic-summary {
    font-size: 14px;
    line-height: 1.5;
    color: #4b5563;
    margin: 0;
}

.topic-highlights-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.highlight-item {
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border: 1px solid;
    position: relative;
}

/* STAT highlights */
.highlight-item.stat {
    background: #f3e5f5;
    border-color: #e1bee7;
    color: #7b1fa2;
}

.highlight-item.stat .highlight-label {
    background: #7b1fa2;
    color: white;
}

.highlight-item.stat:before {
    content: "📊";
}

/* QUESTION highlights */
.highlight-item.question {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1976d2;
}

.highlight-item.question .highlight-label {
    background: #1976d2;
    color: white;
}

.highlight-item.question:before {
    content: "❓";
}

/* PREDICTION highlights */
.highlight-item.prediction {
    background: #e8f5e8;
    border-color: #c8e6c9;
    color: #388e3c;
}

.highlight-item.prediction .highlight-label {
    background: #388e3c;
    color: white;
}

.highlight-item.prediction:before {
    content: "🔮";
}

/* INSIGHT highlights */
.highlight-item.insight {
    background: #e8f5e8;
    border-color: #4caf50;
    color: #2e7d32;
}

.highlight-item.insight .highlight-label {
    background: #4caf50;
    color: white;
}

.highlight-item.insight:before {
    content: "💡";
}

/* ACTION highlights */
.highlight-item.action {
    background: #fff9c4;
    border-color: #fbc02d;
    color: #f57f17;
}

.highlight-item.action .highlight-label {
    background: #fbc02d;
    color: white;
}

.highlight-item.action:before {
    content: "⚡";
}

/* DEFAULT highlights (for items without specific type) */
.highlight-item:not(.stat):not(.question):not(.prediction):not(.insight):not(.action) {
    background: #f5f5f5;
    border-color: #9e9e9e;
    color: #424242;
}

.highlight-item:not(.stat):not(.question):not(.prediction):not(.insight):not(.action) .highlight-label {
    background: #9e9e9e;
    color: white;
}

.highlight-item:not(.stat):not(.question):not(.prediction):not(.insight):not(.action):before {
    content: "📄";
}

/* Highlight label styling */
.highlight-label {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* Highlight text content */
.highlight-text {
    flex: 1;
    font-size: 12px;
    line-height: 1.4;
}

.no-highlights {
    color: #9ca3af;
    font-style: italic;
    font-size: 13px;
}

/* Header row for table */
.insights-content:before {
    content: "";
    display: grid;
    grid-template-columns: 1fr 2fr 1.5fr;
    gap: 20px;
    padding: 12px 16px;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.insights-content:not(:empty):before {
    content: "Macro/Micro Topics";
    white-space: pre;
}

/* Empty state for topics */
.insights-content:empty::before {
    content: "No insights available yet. Start a conversation to see topic analysis.";
    display: block;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 40px 20px;
    background: #f9fafb;
    border-radius: 8px;
    margin: 0;
    grid-template-columns: none;
    font-weight: normal;
    text-transform: none;
    letter-spacing: normal;
}

/* Simple separation between live and historic transcription */
#interimText {
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 20px;
    margin-bottom: 20px;
}

#transcriptContent {
    padding-top: 20px;
    opacity: 0.8;
}

#transcriptContent:not(:empty):before {
    content: "History";
    display: block;
    color: #6b7280;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* Timestamp styling */
.timestamp {
    color: #374151;
    font-size: 11px;
    font-family: monospace;
    margin-left: 6px;
    padding: 2px 5px;
    background: #e5e7eb;
    border-radius: 4px;
    vertical-align: middle;
    font-weight: 500;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.loading-dialog {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 300px;
}

.loading-dialog .loading-spinner {
    width: 40px;
    height: 40px;
    border-width: 4px;
    margin-right: 0;
    margin-bottom: 16px;
}

.loading-dialog h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
}

.loading-dialog p {
    margin: 0 0 16px 0;
    color: #6b7280;
}

.loading-dialog .cancel-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.loading-dialog .cancel-btn:hover {
    background: #dc2626;
}

/* Executive Summary Styling */
.summary-content {
    padding: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.summary-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.summary-type-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-type-selector label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.summary-type-select {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.summary-type-select:hover {
    border-color: #9ca3af;
}

.summary-type-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.summary-header h3 {
    color: #1f2937;
    margin: 0 0 8px 0;
    font-size: 24px;
}

.summary-description {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

.regenerate-summary-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.regenerate-summary-btn:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.regenerate-summary-btn:active {
    background: #d1d5db;
}

.regenerate-summary-btn svg {
    flex-shrink: 0;
}

.summary-unified {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 32px;
    position: relative;
}

.summary-tab-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    padding-top: 12px;
}

.summary-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 24px 0;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.summary-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 24px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-section-title:first-of-type {
    margin-top: 0;
}

.summary-paragraph {
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    margin: 0;
}

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

.summary-list li {
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    padding-left: 20px;
    position: relative;
    margin-bottom: 8px;
}

.summary-list li:before {
    content: "•";
    position: absolute;
    left: 0;
    color: #6b7280;
}

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

/* Key Takeaways with headline/detail structure */
.summary-takeaway-headline {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 20px 0 8px 0;
    line-height: 1.5;
}

.summary-takeaway-headline:first-of-type {
    margin-top: 0;
}

.summary-takeaway-detail {
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    margin: 0 0 16px 0;
    padding-left: 20px;
    border-left: 2px solid #e5e7eb;
}

/* Priority Pathways with headline/detail structure */
.summary-pathway-headline {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 20px 0 8px 0;
    line-height: 1.5;
    position: relative;
    padding-left: 16px;
}

.summary-pathway-headline:first-of-type {
    margin-top: 0;
}

.summary-pathway-headline::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #3b82f6;
    font-weight: bold;
}

.summary-pathway-detail {
    font-size: 14px;
    line-height: 1.7;
    color: #4b5563;
    margin: 0 0 16px 0;
    padding-left: 16px;
}

.summary-contact-info {
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
}

.summary-contact-info .contact-name {
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.summary-contact-info .contact-title {
    color: #6b7280;
    margin: 0 0 2px 0;
}

.summary-contact-info .contact-email {
    color: #2563eb;
    margin: 0;
}

.summary-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.summary-sections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.summary-section {
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.2s ease;
    position: relative;
}

.summary-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
}

.summary-section h4 {
    color: #1f2937;
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 2px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.summary-section h4:before {
    content: "";
    width: 6px;
    height: 6px;
    background: #3b82f6;
    border-radius: 50%;
    flex-shrink: 0;
}

.summary-section p {
    color: #374151;
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 15px;
}

.summary-section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.summary-section li {
    color: #374151;
    line-height: 1.7;
    margin-bottom: 12px;
    padding-left: 24px;
    font-size: 15px;
    position: relative;
}

.summary-section li:before {
    content: "▸";
    color: #3b82f6;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

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

/* Special styling for overview section */
.summary-section[style*="grid-column"] {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-left-color: #059669;
    margin-bottom: 24px;
}

.summary-section[style*="grid-column"] h4:before {
    background: #059669;
}

.summary-section[style*="grid-column"] h4 {
    font-size: 22px;
    color: #065f46;
    border-bottom-color: #d1fae5;
}

.summary-footer {
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.summary-meta {
    color: #9ca3af;
    font-size: 12px;
    text-align: center;
    margin: 0;
}

/* Empty state improvements */
.summary-placeholder {
    padding: 60px 40px;
    text-align: center;
    color: #6b7280;
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    margin: 40px 0;
}

.summary-placeholder p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
}

/* Summary generate button */
.summary-generate {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 40px;
    margin: 40px 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
    border: 2px solid #e0f2fe;
    border-radius: 12px;
}

.summary-generate-content {
    text-align: center;
    max-width: 500px;
}

.summary-generate p {
    color: #374151;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

.generate-summary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.generate-summary-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(59, 130, 246, 0.4);
}

.generate-summary-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px -1px rgba(59, 130, 246, 0.3);
}

.btn-icon {
    font-size: 18px;
}

/* Summary loading state */
.summary-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 80px 40px;
    margin: 40px 0;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    border: 2px solid #dbeafe;
    border-radius: 12px;
}

.summary-loading-content {
    text-align: center;
    max-width: 400px;
}

.summary-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    margin: 0 auto 24px auto;
    animation: spin 1s linear infinite;
}

.summary-loading h4 {
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.summary-loading p {
    color: #6b7280;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 24px 0;
}

/* Responsive adjustments for summary */
@media (max-width: 1200px) {
    .summary-sections-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .summary-sections-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .summary-header,
    .summary-main,
    .summary-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .summary-section {
        padding: 20px;
        margin-bottom: 0;
    }

    .summary-section h4 {
        font-size: 18px;
    }

    .summary-section[style*="grid-column"] h4 {
        font-size: 20px;
    }

    .summary-placeholder {
        padding: 40px 20px;
        margin: 20px 0;
    }

    .summary-loading {
        padding: 60px 20px;
        margin: 20px 0;
    }

    .summary-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

@media (max-width: 480px) {
    .summary-sections-grid {
        gap: 16px;
    }

    .summary-section {
        padding: 16px;
        border-radius: 8px;
    }

    .summary-section li {
        padding-left: 20px;
        font-size: 14px;
    }
}

.summary-error {
    padding: 20px;
    background: #fef2f2;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
    margin-top: 20px;
}

.summary-error p {
    color: #dc2626;
    margin-bottom: 8px;
}

.summary-placeholder {
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    margin-top: 20px;
}

/* Theme Selection Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #1f2937;
}

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

.modal-description {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 16px;
}

.theme-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.theme-option {
    padding: 12px 16px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.theme-option:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.theme-option.selected {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
    font-weight: 500;
}

.modal-group-selector,
.modal-theme-selector {
    margin-bottom: 16px;
}

.modal-group-selector label,
.modal-theme-selector label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.modal-theme-selector label.cluster-toggle {
    display: flex;
    margin-bottom: 0;
}

.modal-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.modal-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-group-dropdown {
    width: 100%;
}

.modal-dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 400;
    color: #1f2937;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-dropdown-trigger:hover {
    background: #fff;
    border-color: #9ca3af;
    color: #1f2937;
}

.modal-group-dropdown.open .modal-dropdown-trigger {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-group-dropdown .group-dropdown-panel {
    position: fixed;
    min-width: unset;
}

.session-name-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-name-input label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.session-name-input input,
.session-name-input textarea {
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    font-family: inherit;
}

.session-name-input textarea {
    resize: vertical;
    min-height: 60px;
}

.session-name-input input:focus,
.session-name-input textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.session-name-input input::placeholder,
.session-name-input textarea::placeholder {
    color: #9ca3af;
}

.cluster-flag-input {
    margin-top: 16px;
    padding: 12px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.cluster-flag-header {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.cluster-flag-input label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    user-select: none;
}

.cluster-flag-input input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3b82f6;
}

.cluster-flag-input:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.cluster-flag-hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #9ca3af;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

.btn-cancel {
    padding: 10px 16px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #f3f4f6;
}

.btn-primary {
    padding: 10px 16px;
    background: #3b82f6;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: #2563eb;
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Divider with OR */
.divider-or {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.divider-or::before,
.divider-or::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #d1d5db;
}

.divider-or span {
    padding: 0 16px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Upload Transcript Button */
.upload-transcript-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px dashed #60a5fa;
    border-radius: 8px;
    color: #2563eb;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.upload-transcript-btn:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #3b82f6;
    color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.upload-transcript-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.upload-transcript-btn svg {
    color: currentColor;
    flex-shrink: 0;
}

/* Transcript Input Area */
.transcript-input-area {
    margin-bottom: 20px;
}

.transcript-input-area label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.transcript-input-area textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
}

.transcript-input-area textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.transcript-input-area textarea::placeholder {
    color: #9ca3af;
}

.char-count {
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    text-align: right;
}

.upload-options {
    margin-top: 20px;
}

/* Upload Mode Tabs */
.upload-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.upload-tab {
    padding: 8px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-tab:hover {
    color: #374151;
}

.upload-tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.input-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 8px;
    padding: 10px 12px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.5;
}

.input-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #9ca3af;
}

/* Webcast Input Mode */
.webcast-search-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1f2937;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.webcast-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.webcast-search-input::placeholder {
    color: #9ca3af;
}

.webcast-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
}

.webcast-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.webcast-analysed-badge {
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 4px;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.webcast-item:hover {
    background-color: #eff6ff;
}

.webcast-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
}

.webcast-empty {
    padding: 16px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

.webcast-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    margin-bottom: 12px;
}

.webcast-selected-label {
    font-size: 12px;
    font-weight: 600;
    color: #3b82f6;
    text-transform: uppercase;
}

.webcast-selected-name {
    font-size: 14px;
    color: #1e40af;
    flex: 1;
}

.webcast-clear-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 0 4px;
}

.webcast-clear-btn:hover {
    color: #ef4444;
}

@media (max-width: 540px) {
    .modal {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}
/* ============================================================================
   CLUSTERING TAB STYLES
   ============================================================================ */

.clustering-content {
    padding: 16px 20px;
    background: #f8fafc;
    min-height: calc(100vh - 200px);
}

.clustering-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.clustering-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
}

.clustering-description {
    color: #64748b;
    margin: 4px 0 0 0;
    font-size: 13px;
}

.clustering-info {
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.clustering-info p {
    margin: 4px 0;
    font-size: 13px;
    color: #475569;
}

.clustering-info span {
    font-weight: 600;
    color: #1e293b;
}

.clustering-status-container {
    min-height: 200px;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    margin-top: 0;
}

.theme-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.theme-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.theme-card.status-ready {
    border-left: 3px solid #059669;
    background: #ffffff;
}

.theme-card.status-recent {
    border-left: 3px solid #3b82f6;
    background: #ffffff;
}

.theme-card.status-insufficient {
    border-left: 3px solid #d97706;
    background: #ffffff;
}

.theme-card.status-unknown {
    border-left: 3px solid #64748b;
    background: #ffffff;
}

.theme-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 10px;
}

.theme-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    flex: 1;
}

.theme-status-badge {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.theme-status-badge.status-ready {
    background: #ecfdf5;
    color: #059669;
}

.theme-status-badge.status-recent {
    background: #eff6ff;
    color: #3b82f6;
}

.theme-status-badge.status-insufficient {
    background: #fffbeb;
    color: #d97706;
}

.theme-status-badge.status-unknown {
    background: #f1f5f9;
    color: #64748b;
}

.theme-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.stat-item {
    text-align: center;
    padding: 8px 6px;
    background: #f8fafc;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.stat-label {
    display: block;
    font-size: 10px;
    color: #64748b;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.theme-last-run {
    background: #f8fafc;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
}

.theme-last-run strong {
    display: block;
    margin-bottom: 8px;
    color: #1e293b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.last-run-details {
    font-size: 13px;
    color: #64748b;
}

.last-run-details div {
    margin: 4px 0;
}

.theme-never-run {
    text-align: center;
    padding: 12px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 13px;
    color: #d97706;
}

.theme-reason {
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
    min-height: 40px;
}

.theme-cluster-btn {
    width: 100%;
    padding: 10px 16px;
    font-weight: 500;
    font-size: 13px;
    background: #f8fafc;
    color: #1e293b;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-cluster-btn:hover:not(:disabled) {
    background: #1e293b;
    color: #ffffff;
    border-color: #1e293b;
}

.theme-cluster-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Clustering Progress Bar */
.clustering-progress-container {
    margin-top: 12px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.clustering-progress-message {
    font-size: 12px;
    color: #475569;
    margin-bottom: 8px;
    font-weight: 500;
}

.clustering-progress-bar-container {
    width: 100%;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.clustering-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.clustering-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

.clustering-progress-percent {
    font-size: 11px;
    color: #64748b;
    margin-top: 6px;
    text-align: right;
    font-weight: 500;
}

/* Clustering Result Messages */
.clustering-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.clustering-result-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.clustering-result-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.clustering-result .result-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.clustering-result .result-content {
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
}

.clustering-result .result-content strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.loading-message,
.error-message,
.info-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
    color: #64748b;
}

.error-message {
    color: #dc2626;
}

.error-message p {
    margin-bottom: 15px;
}

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

    .clustering-header {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ============================================================================
   APPROVALS PAGE STYLES
   ============================================================================ */

body:has(.approvals-container) {
    height: auto;
    overflow: auto;
}

.approvals-container {
    min-height: calc(100vh - 44px);
    background: #f1f5f9;
    padding: 0;
}

.approvals-header {
    background: #ffffff;
    padding: 20px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.approvals-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
}

.header-description {
    color: #64748b;
    font-size: 13px;
    margin: 4px 0 0 0;
}

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

.group-filter,
.theme-filter {
    padding: 9px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 180px;
}

.group-filter:hover,
.theme-filter:hover {
    border-color: #cbd5e1;
}

.group-filter:focus,
.theme-filter:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-secondary {
    padding: 9px 16px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* Approvals Stats */
.approvals-stats {
    display: flex;
    gap: 24px;
    padding: 20px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.stat-group {
    flex: 1;
    min-width: 300px;
}

.stat-group-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-left: 4px;
}

.stat-group-cards {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.approvals-stats .stat-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px 20px;
    text-align: center;
    min-width: 100px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.15s ease;
}

.approvals-stats .stat-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.approvals-stats .stat-card .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.approvals-stats .stat-card .stat-label {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.approvals-stats .stat-card.approved {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-color: #a7f3d0;
}

.approvals-stats .stat-card.approved .stat-value {
    color: #047857;
}

.approvals-stats .stat-card.approved .stat-label {
    color: #059669;
}

.approvals-stats .stat-card.pending {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

.approvals-stats .stat-card.pending .stat-value {
    color: #b45309;
}

.approvals-stats .stat-card.pending .stat-label {
    color: #d97706;
}

.approvals-stats .stat-card.denied {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.approvals-stats .stat-card.denied .stat-value {
    color: #b91c1c;
}

.approvals-stats .stat-card.denied .stat-label {
    color: #dc2626;
}

.approvals-stats .stat-card.with-images {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
}

.approvals-stats .stat-card.with-images .stat-value {
    color: #1d4ed8;
}

.approvals-stats .stat-card.with-images .stat-label {
    color: #2563eb;
}

/* Approvals Content */
.approvals-content {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.loading-state,
.error-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.loading-state .loading-spinner {
    margin: 0 auto 16px;
}

.error-state {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}

.empty-state h3 {
    color: #1e293b;
    margin-bottom: 8px;
}

/* Approval Card */
.approval-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.approval-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.approval-card.status-approved {
    border-left: 4px solid #10b981;
}

.approval-card.status-denied {
    border-left: 4px solid #ef4444;
}

.approval-card.status-pending {
    border-left: 4px solid #f59e0b;
}

.approval-card.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.approval-card.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid #e2e8f0;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.approval-card-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #ffffff;
}

.topic-info {
    display: flex;
    gap: 14px;
    flex: 1;
    align-items: flex-start;
}

.topic-rank {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.topic-details {
    flex: 1;
}

.macro-topic-name {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.topic-meta-info {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.theme-badge {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1d4ed8;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #bfdbfe;
}

.micro-count {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.interest-rank {
    color: #64748b;
    font-size: 12px;
    background: #f8fafc;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.topic-description {
    color: #475569;
    font-size: 14px;
    margin: 8px 0 0 0;
    line-height: 1.5;
}

/* Approval Actions */
.approval-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.small {
    padding: 3px 8px;
    font-size: 9px;
}

.status-badge.status-approved {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
    border: 1px solid #a7f3d0;
}

.status-badge.status-denied {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.status-badge.status-pending {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #b45309;
    border: 1px solid #fde68a;
}

.action-buttons {
    display: flex;
    gap: 6px;
}

.btn-approve {
    background: #ffffff;
    color: #059669;
    border: 1px solid #d1d5db;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-approve:hover:not(:disabled) {
    background: #10b981;
    color: white;
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

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

.btn-deny {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #d1d5db;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-deny:hover:not(:disabled) {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

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

.btn-edit {
    background: #ffffff;
    color: #64748b;
    border: 1px solid #d1d5db;
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-edit:hover {
    background: #475569;
    color: white;
    border-color: #475569;
    box-shadow: 0 2px 8px rgba(71, 85, 105, 0.3);
}

.btn-icon {
    padding: 6px;
    min-width: auto;
}

/* Micro Topics Section */
.micro-topics-section {
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #f1f5f9;
}

.micro-topics-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.micro-topics-header h4 {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bulk-actions {
    display: flex;
    gap: 6px;
}

.btn-small {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease;
}

.btn-approve-all {
    background: #ffffff;
    color: #059669;
    border: 1px solid #d1d5db;
}

.btn-approve-all:hover {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.btn-deny-all {
    background: #ffffff;
    color: #dc2626;
    border: 1px solid #d1d5db;
}

.btn-deny-all:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

/* Micro Topics List */
.micro-topics-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.micro-topics-list::-webkit-scrollbar {
    width: 6px;
}

.micro-topics-list::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 3px;
}

.micro-topics-list::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

.micro-topics-list::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.micro-topic-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    gap: 12px;
    transition: all 0.15s ease;
    position: relative;
}

.status-badge.corner {
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 8px;
    padding: 1px 5px;
    letter-spacing: 0.3px;
    z-index: 1;
    opacity: 0.8;
}

.micro-topic-item > .micro-topic-content {
    flex: 1;
    min-width: 0;
}

.micro-topic-item > .micro-topic-actions {
    flex-shrink: 0;
}

.micro-topic-item > .micro-topic-images {
    flex-basis: 100%;
    margin-top: 4px;
    min-width: 0;
    max-width: 100%;
}

.micro-topic-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.micro-topic-item.status-approved {
    background: #ffffff;
    border-left: 3px solid #10b981;
}

.micro-topic-item.status-denied {
    background: #ffffff;
    border-left: 3px solid #ef4444;
}

.micro-topic-item.status-pending {
    background: #ffffff;
    border-left: 3px solid #f59e0b;
}

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

.micro-topic-name {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    line-height: 1.4;
}

.micro-topic-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.micro-topic-session {
    font-size: 10px;
    color: #3b82f6;
    padding: 2px 6px;
    background: #eff6ff;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.micro-topic-timestamp {
    font-size: 10px;
    color: #059669;
    padding: 2px 6px;
    background: #ecfdf5;
    border-radius: 4px;
    font-weight: 500;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, Consolas, monospace;
}

.micro-topic-summary {
    font-size: 11px;
    color: #64748b;
    margin: 2px 0 0 0;
    line-height: 1.4;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
}

.micro-topic-summary.empty {
    color: #94a3b8;
    font-style: italic;
}

.micro-topic-name {
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 4px;
    display: block;
}

/* Editable fields - click to edit */
.micro-topic-name.editable,
.micro-topic-summary.editable {
    cursor: text;
}

.micro-topic-name.editable:hover,
.micro-topic-summary.editable:hover {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.inline-edit-input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #1f2937;
    background: white;
    box-sizing: border-box;
}

.inline-edit-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.inline-edit-textarea {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    font-size: 11px;
    font-family: inherit;
    line-height: 1.4;
    color: #1f2937;
    background: white;
    box-sizing: border-box;
    resize: vertical;
    min-height: 50px;
}

.inline-edit-textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.micro-topic-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Image search button */
.btn-search-images {
    background: #8b5cf6;
    color: white;
}

.btn-search-images:hover {
    background: #7c3aed;
}

/* Search Photos button - light blue text */
.search-photos-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.btn-search-photos {
    background: transparent;
    color: #0ea5e9;
    border: none;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
    border-radius: 4px;
}

.btn-search-photos:hover {
    color: #0284c7;
    background: #f0f9ff;
}

/* Micro topic images gallery */
.micro-topic-images {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    width: 100%;
}

.images-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    color: #64748b;
    font-size: 13px;
}

.loading-spinner.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.no-images,
.images-error {
    padding: 12px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

.images-error {
    color: #ef4444;
}

.images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #64748b;
}

.group-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.group-filter-toggle:has(input:checked) {
    color: #64748b;
}

.group-filter-toggle input[type="checkbox"] {
    cursor: pointer;
    width: 12px;
    height: 12px;
    margin: 0;
}

.group-filter-toggle span {
    line-height: 1;
}

.btn-close-images {
    background: transparent;
    color: #64748b;
}

.btn-close-images:hover {
    background: #f1f5f9;
    color: #1f2937;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
}

.image-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Images Carousel */
.images-carousel-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.carousel-btn {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.carousel-btn:hover {
    background: #f1f5f9;
    color: #1f2937;
    border-color: #cbd5e1;
}

.images-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 4px 0;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.images-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-image-item {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.carousel-image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fallback notice when using macro topic instead of session name */
.fallback-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #92400e;
}

.fallback-notice svg {
    flex-shrink: 0;
    color: #f59e0b;
}

/* URL input for manual image entry */
.url-input-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
}

.url-input-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.url-input-form {
    display: flex;
    gap: 8px;
}

.url-input-field {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input-field:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.url-input-field::placeholder {
    color: #94a3b8;
}

.url-preview-container {
    margin-top: 12px;
    text-align: center;
}

.url-preview-image {
    max-width: 200px;
    max-height: 150px;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    object-fit: contain;
}

.btn-enter-url {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-enter-url:hover {
    background: #e2e8f0;
    color: #334155;
}

/* Image selection state */
.carousel-image-item.selected {
    outline: 3px solid #3b82f6;
    outline-offset: -3px;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Image lightbox */
.image-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    cursor: pointer;
    animation: lightboxFadeIn 0.2s ease;
}

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

.image-lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
}

.image-lightbox-img {
    max-width: calc(100% - 320px);
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    flex-shrink: 1;
}

.image-lightbox-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

.image-lightbox-close:hover {
    background: #555;
}

/* Lightbox metadata panel */
.image-lightbox-meta {
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 20px;
    border-radius: 8px;
    width: 280px;
    max-height: 85vh;
    overflow-y: auto;
    flex-shrink: 0;
}

.lightbox-meta-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.lightbox-meta-date {
    font-size: 13px;
    color: #a0a0a0;
    margin-bottom: 8px;
}

.lightbox-meta-desc {
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.lightbox-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.lightbox-tag {
    background: #3b82f6;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* Make preview image clickable */
.selected-image-preview {
    cursor: pointer;
}

.selected-image-preview:hover {
    opacity: 0.9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Saved image thumbnail */
.micro-topic-image-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.micro-topic-saved-image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #10b981;
}

.micro-topic-saved-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image selection actions bar */
.image-selection-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 10px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}

.selected-image-label {
    font-size: 12px;
    color: #0369a1;
    font-weight: 500;
}

.selected-image-preview {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #7dd3fc;
}

.btn-save-image {
    background: #10b981;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save-image:hover {
    background: #059669;
}

.btn-cancel-selection {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-selection:hover {
    background: #e2e8f0;
    color: #475569;
}

/* Inline editing styles */
.editable {
    cursor: text;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 4px;
    transition: background-color 0.15s;
}

.editable:hover {
    background: #f1f5f9;
}

.inline-edit-input {
    width: 100%;
    padding: 4px 8px;
    border: 1px solid #3b82f6;
    border-radius: 4px;
    font-size: inherit;
    font-weight: inherit;
    font-family: inherit;
    color: #1e293b;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: none;
}

.macro-topic-name .inline-edit-input {
    font-size: 14px;
    font-weight: 600;
}

.micro-topic-name .inline-edit-input {
    font-size: 13px;
    font-weight: 500;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #1f2937;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Approvals */
@media (max-width: 768px) {
    .approvals-header {
        padding: 16px;
        position: relative;
    }

    .approvals-header h1 {
        font-size: 18px;
    }

    .approvals-stats {
        padding: 16px;
        justify-content: flex-start;
        gap: 10px;
    }

    .approvals-stats .stat-card {
        padding: 10px 14px;
        min-width: 70px;
        flex: 1;
    }

    .approvals-stats .stat-card .stat-value {
        font-size: 20px;
    }

    .approvals-content {
        padding: 16px;
    }

    .approval-card-header {
        flex-direction: column;
        padding: 14px;
    }

    .topic-info {
        flex-direction: row;
        gap: 12px;
    }

    .topic-rank {
        min-width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .approval-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding-top: 10px;
        border-top: 1px solid #f1f5f9;
        margin-top: 4px;
    }

    .action-buttons {
        flex-wrap: wrap;
        gap: 6px;
    }

    .micro-topics-section {
        padding: 12px 14px;
    }

    .micro-topics-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .bulk-actions {
        width: 100%;
    }

    .micro-topic-item {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .micro-topic-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Inline URL input (within search results) */
.url-input-inline {
    margin-top: 12px;
}

.url-input-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 12px 0;
    color: #64748b;
    font-size: 12px;
}

.url-input-divider::before,
.url-input-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.btn-save-url {
    background: #8b5cf6;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.btn-save-url:hover {
    background: #7c3aed;
}

/* No images container styling */
.no-images-container {
    padding: 12px;
}

.no-images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.no-images-header span {
    color: #64748b;
    font-size: 13px;
}

/* Saved image action buttons */
.saved-image-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.saved-image-actions .btn-icon {
    width: 22px;
    height: 22px;
    padding: 0;
    min-width: auto;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.saved-image-actions .btn-position-image {
    background: #e0e7ff;
    color: #3b82f6;
}

.saved-image-actions .btn-position-image:hover {
    background: #3b82f6;
    color: white;
}

.saved-image-actions .btn-remove-image {
    background: #fee2e2;
    color: #ef4444;
}

.saved-image-actions .btn-remove-image:hover {
    background: #ef4444;
    color: white;
}

/* Position Editor Overlay */
.position-editor-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.position-editor-container {
    background: #1e293b;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.position-editor-header {
    padding: 16px 20px;
    border-bottom: 1px solid #334155;
    position: relative;
}

.position-editor-header h3 {
    margin: 0 0 4px 0;
    color: #f1f5f9;
    font-size: 18px;
}

.position-editor-header p {
    margin: 0;
    color: #94a3b8;
    font-size: 13px;
}

.position-editor-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 24px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.position-editor-close:hover {
    background: #334155;
    color: #f1f5f9;
}

.position-editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.position-editor-container.with-meta {
    max-width: 1100px;
}

.position-editor-container.with-meta .position-editor-content {
    flex: 1;
}

.position-editor-content {
    padding: 20px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.position-editor-meta {
    width: 280px;
    padding: 20px;
    border-left: 1px solid #334155;
    overflow-y: auto;
    background: #1a2536;
}

.position-meta-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    margin-bottom: 8px;
    line-height: 1.3;
}

.position-meta-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 12px;
}

.position-meta-desc {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.5;
    margin-bottom: 16px;
}

.position-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.position-meta-tag {
    display: inline-block;
    background: #334155;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.position-editor-preview {
    width: 100%;
    max-width: 800px;
    aspect-ratio: 16 / 9;
    background: #0f172a;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    border: 2px dashed #475569;
}

.position-editor-preview img {
    position: absolute;
    top: 0;
    left: 0;
    user-select: none;
    -webkit-user-drag: none;
}

.position-editor-controls {
    padding: 16px 20px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.position-editor-info {
    display: flex;
    gap: 24px;
    align-items: center;
}

.position-display {
    color: #94a3b8;
    font-size: 13px;
    font-family: monospace;
}

.position-display span {
    color: #3b82f6;
    font-weight: 600;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    font-size: 13px;
}

.zoom-controls label {
    font-weight: 500;
}

.zoom-controls span {
    min-width: 40px;
    text-align: center;
    color: #3b82f6;
    font-weight: 600;
    font-family: monospace;
}

.btn-zoom {
    width: 28px;
    height: 28px;
    padding: 0;
    background: #475569;
    color: #f1f5f9;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-zoom:hover {
    background: #64748b;
}

.btn-zoom:active {
    background: #334155;
}

.position-editor-buttons {
    display: flex;
    gap: 10px;
}

.btn-reset-position {
    background: #475569;
    color: #f1f5f9;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-reset-position:hover {
    background: #64748b;
}

.btn-cancel-position {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #475569;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel-position:hover {
    background: #334155;
    color: #f1f5f9;
}

.btn-save-position {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-save-position:hover {
    background: #059669;
}

/* Progress Overlay for Video Analysis */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-in-out;
}

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

.progress-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 32px;
    min-width: 480px;
    max-width: 600px;
    animation: slideUp 0.3s ease-out;
}

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

.progress-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.progress-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

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

.progress-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.progress-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.progress-message {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    min-height: 21px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-percent {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Manage Themes Modal */
.manage-themes-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.manage-themes-list .loading-message {
    padding: 24px;
    text-align: center;
    color: #6b7280;
    font-size: 13px;
}

.manage-themes-list .empty-message {
    padding: 24px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.manage-theme-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
}

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

.manage-theme-item .theme-name {
    font-size: 13px;
    color: #1f2937;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.theme-cluster-checkbox {
    width: 14px;
    height: 14px;
    margin-right: 8px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #8b5cf6;
}

.delete-theme-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s, color 0.2s;
}

.delete-theme-btn:hover {
    background: #fef2f2;
    color: #ef4444;
}

.add-theme-form {
    border-top: 1px solid #e5e7eb;
    padding-top: 16px;
}

.add-theme-form label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.add-theme-input-row {
    display: flex;
    gap: 8px;
}

.add-theme-input-row .modal-input {
    flex: 1;
}

.add-theme-input-row .btn {
    flex-shrink: 0;
}

.voiceprints-hint {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 12px 0;
    line-height: 1.4;
}

.voiceprint-phrase {
    margin: 12px 0;
    padding: 12px;
    background: #f9fafb;
    border-left: 3px solid #6366f1;
    border-radius: 4px;
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.voiceprint-status {
    font-size: 13px;
    color: #6b7280;
    align-self: center;
}

.voiceprint-transcript {
    margin-top: 10px;
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    min-height: 56px;
    max-height: 160px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.5;
    color: #1f2937;
}

.voiceprint-transcript-final {
    margin: 0 0 4px 0;
}

.voiceprint-transcript-interim {
    color: #9ca3af;
    font-style: italic;
    min-height: 1.5em;
}

/* Stacked suggestion toasts — non-blocking, bottom-right of viewport. */
.speaker-suggestion-toasts {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: column-reverse; /* newest at bottom, older floats above */
    gap: 8px;
    z-index: 1000;
    pointer-events: none; /* container is click-through; toasts re-enable below */
    max-width: 360px;
}

.speaker-suggestion-toast {
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 3px solid #6366f1;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 12px 14px;
    font-size: 13px;
    color: #1f2937;
    animation: speaker-suggestion-slide-in 180ms ease-out;
}

@keyframes speaker-suggestion-slide-in {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

.speaker-suggestion-toast-body {
    margin-bottom: 8px;
    line-height: 1.4;
}

.speaker-suggestion-toast-score {
    color: #6b7280;
    font-size: 11px;
    margin-left: 4px;
}

.speaker-suggestion-toast-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.speaker-suggestion-toast-actions .btn {
    padding: 4px 10px;
    font-size: 12px;
}

/* Session Infographic */
.infographic-section {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

.infographic-header {
    padding: 0 24px 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.infographic-header h3 {
    color: #1f2937;
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 600;
}

.infographic-description {
    color: #6b7280;
    margin: 0;
    font-size: 14px;
}

.infographic-notice {
    margin: 8px 0 0 0;
    padding: 6px 10px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 6px;
    color: #92400e;
    font-size: 12px;
    line-height: 1.4;
}

.infographic-body {
    padding: 0 24px 24px 24px;
}

/* Placeholder (empty) state */
.infographic-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 32px;
    background: linear-gradient(135deg, #faf5ff 0%, #eff6ff 100%);
    border: 1px dashed #c7d2fe;
    border-radius: 12px;
}

.infographic-placeholder-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.infographic-placeholder h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.infographic-placeholder p {
    color: #6b7280;
    font-size: 14px;
    margin: 0 0 20px 0;
}

.infographic-hint {
    margin-top: 16px !important;
    color: #9ca3af !important;
    font-size: 12px !important;
}

/* Loading state */
.infographic-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 64px 32px;
    background: linear-gradient(135deg, #faf5ff 0%, #eff6ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
}

.infographic-loading-content {
    text-align: center;
    max-width: 360px;
}

.infographic-loading h4 {
    color: #1f2937;
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.infographic-loading p {
    color: #6b7280;
    font-size: 14px;
    margin: 0;
}

/* Result card */
.infographic-result {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.infographic-image-wrap {
    position: relative;
    background:
        linear-gradient(45deg, #f9fafb 25%, transparent 25%),
        linear-gradient(-45deg, #f9fafb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f9fafb 75%),
        linear-gradient(-45deg, transparent 75%, #f9fafb 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    display: flex;
    justify-content: center;
    padding: 16px;
}

.infographic-image-wrap img {
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    cursor: zoom-in;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.infographic-image-wrap img:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.infographic-actions {
    padding: 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.infographic-action-btn {
    color: #374151;
    font-weight: 500;
    text-decoration: none;
}

/* Error state */
.infographic-error {
    padding: 24px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    text-align: center;
}

.infographic-error-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.infographic-error h4 {
    color: #991b1b;
    margin: 0 0 6px 0;
    font-size: 16px;
}

.infographic-error p {
    color: #b91c1c;
    margin: 0 0 16px 0;
    font-size: 14px;
}

/* Image lightbox */
.infographic-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    cursor: zoom-out;
    padding: 32px;
}

.infographic-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* Improve Transcript — in-transcript review */
.improve-transcript-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    font-size: 13px;
    color: #92400e;
    position: sticky;
    top: 0;
    z-index: 5;
}

.improve-transcript-bar .improve-bar-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: #92400e;
    cursor: pointer;
    padding: 0 4px;
}

.improve-transcript-bar .improve-bar-close:hover {
    color: #78350f;
}

.speaker-segment.under-review {
    background: #fef9c3;
    border-color: #fcd34d;
    box-shadow: 0 0 0 2px rgba(252, 211, 77, 0.35);
}

.suggestion-removed {
    text-decoration: line-through;
    color: #b91c1c;
    background: #fee2e2;
    padding: 0 2px;
    border-radius: 3px;
    text-decoration-thickness: 1.5px;
}

.suggestion-added {
    text-decoration: none;
    color: #065f46;
    background: #d1fae5;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

.suggestion-controls {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.suggestion-controls button {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.suggestion-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.suggestion-accept {
    background: #d1fae5;
    color: #047857;
}

.suggestion-accept:hover:not(:disabled) {
    background: #a7f3d0;
    border-color: #34d399;
}

.suggestion-skip {
    background: #fee2e2;
    color: #b91c1c;
}

.suggestion-skip:hover:not(:disabled) {
    background: #fecaca;
    border-color: #f87171;
}

.suggestion-reason-inline {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6b7280;
    font-style: italic;
}
