/* VetHEAP - Professional Dashboard Styles */

:root {
    --primary: #1a7f64;
    --primary-dark: #156b54;
    --primary-hover: #156b54;
    --primary-light: #e8f5f1;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --danger-light: #fef2f2;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --sidebar-width: 280px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Dark Theme - Dark Blue Aesthetic */
[data-theme="dark"] {
    --primary: #3b9eff;
    --primary-dark: #2563eb;
    --primary-hover: #2563eb;
    --primary-light: #1e3a5f;
    --secondary: #94a3b8;
    --success: #4ade80;
    --danger: #f87171;
    --danger-light: #3b1a1a;
    --warning: #fbbf24;
    --background: #0c1222;
    --surface: #131d2e;
    --surface-hover: #1a2942;
    --border: #1e3048;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* App Layout */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
}

.sidebar.collapsed .sidebar-brand {
    position: absolute;
    left: 0;
    top: 0;
    padding: 20px;
    border-bottom: none;
    background: transparent;
    width: max-content;
    z-index: 10;
}

/* Sidebar Brand */
.sidebar-brand {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

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

.brand-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

.sidebar.collapsed .brand-text {
    display: block;
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    background: var(--background);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    flex-shrink: 0;
}

.sidebar-toggle:hover {
    background: var(--surface);
    color: var(--text);
    border-color: var(--text-muted);
}

.sidebar-toggle .expand-icon {
    display: none;
}

.sidebar-toggle .collapse-icon {
    display: block;
}

.sidebar.collapsed .sidebar-toggle .expand-icon {
    display: block;
}

.sidebar.collapsed .sidebar-toggle .collapse-icon {
    display: none;
}

/* Hide toggle on mobile */
@media (max-width: 900px) {
    .sidebar-toggle {
        display: none;
    }

    /* On mobile, show brand in header when sidebar is collapsed */
    .sidebar.collapsed .sidebar-brand {
        left: 70px;
        padding: 18px 20px;
    }
}

/* Theme Toggle - in top bar */
.theme-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface);
    color: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Sidebar Section */
.sidebar-section {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    opacity: 1;
    transition: opacity 0.15s ease 0.15s;
}

.sidebar.collapsed .sidebar-section {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Recordings Sections */
.recordings-section {
    margin-bottom: 16px;
}

.recordings-section:last-of-type {
    margin-bottom: 0;
}

/* Recordings Label */
.recordings-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: background-color 0.15s, color 0.15s;
    user-select: none;
}

.recordings-label:hover {
    background: var(--hover);
    color: var(--text);
}

.section-chevron {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.recordings-section.collapsed .section-chevron {
    transform: rotate(-90deg);
}

.recordings-section.collapsed .recordings-list {
    display: none;
}

/* Sidebar Search */
.sidebar-search {
    position: relative;
}

.sidebar-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    background: var(--background);
    color: var(--text);
    transition: all 0.2s;
}

.sidebar-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.sidebar-search input::placeholder {
    color: var(--text-muted);
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    opacity: 1;
    transition: opacity 0.15s ease 0.15s;
}

.sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* Recordings List */
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.no-recordings {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.no-recordings svg {
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-recordings p {
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.no-recordings span {
    font-size: 0.8rem;
}

.recording-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.recording-item:hover {
    background: var(--background);
}

.recording-item.active {
    background: var(--primary-light);
    border-color: var(--primary);
}

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

.recording-patient {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-date {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-date.has-patient {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 2px;
}

.recording-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.recording-delete {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    opacity: 0;
    transition: all 0.2s;
}

.recording-item:hover .recording-delete {
    opacity: 1;
}

.recording-delete:hover {
    background: var(--danger-light);
    color: var(--danger);
}

/* Recording Processing State */
.recording-item.processing {
    opacity: 0.8;
}

.recording-processing {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.recording-processing .spin {
    animation: spin 1s linear infinite;
}

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

/* Recording Error State */
.recording-error {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--warning);
}

/* Active Recording Indicator */
.recording-item.active-recording {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

.recording-item.active-recording .recording-patient {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--danger);
    font-weight: 500;
}

.recording-pulse {
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Active Processing Indicator */
.recording-item.active-processing {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--primary);
}

.recording-item.active-processing .recording-patient {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 500;
}

.processing-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    opacity: 1;
    transition: opacity 0.15s ease 0.15s;
}

.sidebar.collapsed .sidebar-footer {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.btn-new {
    width: 100%;
    padding: 12px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-new:hover {
    background: var(--primary-dark);
}

/* Top Bar with Account Menu */
.top-bar {
    position: fixed;
    top: 12px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
}

.top-bar .version-number {
    position: static;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    opacity: 0.6;
}

.account-menu {
    position: relative;
}

.account-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    box-shadow: var(--shadow);
}

.account-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.account-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 100;
}

.account-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.account-email {
    padding: 12px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    transition: all 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
}

.account-link:hover {
    background: var(--surface-hover);
}

.account-link svg {
    color: var(--text-secondary);
}

.account-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border-top: 1px solid var(--border);
}

.account-logout:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.account-logout svg {
    color: inherit;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 44px;
    height: 44px;
    border: none;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text);
}

/* Hamburger icon */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    position: relative;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 1px;
    position: absolute;
    transition: all 0.3s ease;
}

.hamburger-line:nth-child(1) {
    top: 4px;
}

.hamburger-line:nth-child(2) {
    top: 9px;
}

.hamburger-line:nth-child(3) {
    top: 14px;
}

/* Hamburger to X animation */
.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    top: 9px;
    transform: rotate(45deg);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    top: 9px;
    transform: rotate(-45deg);
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-x: hidden;
}

.main-content.expanded {
    margin-left: 0 !important;
}

/* version-number is now styled within .top-bar */

.content-container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
    overflow-x: hidden;
}

/* Recording Card */
.recording-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.recording-card.is-recording {
    background: var(--danger);
    border-color: var(--danger);
    animation: pulse-recording 2s ease-in-out infinite;
    padding: 24px;
    text-align: left;
}

.recording-card.is-recording .card-header {
    display: none;
}

.recording-card.is-recording .recording-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.recording-card.is-recording .timer-display {
    margin-bottom: 0;
}

.recording-card.is-recording .timer {
    font-size: 2.5rem;
    color: white;
}

.recording-card.is-recording .controls {
    justify-content: flex-end;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: var(--danger);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2), var(--shadow);
    }
    50% {
        border-color: #f87171;
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.1), var(--shadow);
    }
}

@keyframes pulse-recording {
    0%, 100% {
        background: var(--danger);
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3), var(--shadow);
    }
    50% {
        background: #dc2626;
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0.15), var(--shadow);
    }
}

.card-header {
    margin-bottom: 32px;
    transition: opacity 0.2s ease;
}

.card-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.card-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Recording content wrapper */
.recording-content {
    transition: all 0.3s ease;
}

/* Timer */
.timer-display {
    margin-bottom: 32px;
    transition: margin 0.3s ease;
}

.timer {
    font-size: 4rem;
    font-weight: 300;
    font-family: 'Onest', monospace;
    color: var(--text);
    letter-spacing: 0.05em;
    font-variant-numeric: tabular-nums;
    transition: font-size 0.3s ease;
}

.timer.recording {
    color: var(--danger);
}

.timer.paused {
    color: var(--warning);
}

/* Controls */
.controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    transition: justify-content 0.3s ease;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

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

.btn-record,
.btn-stop,
.btn-pause {
    border-radius: 50px;
    padding: 14px 32px;
}

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

.btn-record:hover:not(:disabled) {
    background: #dc2626;
    transform: scale(1.02);
}

[data-theme="dark"] .btn-record {
    background: #ef4444;
}

[data-theme="dark"] .btn-record:hover:not(:disabled) {
    background: #f87171;
}

.btn-record.recording {
    background: rgba(255, 255, 255, 0.9);
    color: var(--danger);
    animation: none;
}

.btn-record.recording .record-text {
    display: none;
}

.btn-record.recording .recording-text {
    display: inline !important;
}

.dots {
    display: inline-block;
    width: 1.2em;
    text-align: left;
}

.dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}

.btn-stop {
    background: var(--success);
    color: white;
}

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

.btn-pause {
    background: var(--warning);
    color: white;
}

.btn-pause:hover:not(:disabled) {
    background: #d97706;
}

.btn-process {
    background: var(--primary);
    color: white;
    margin-top: 20px;
}

.btn-process:hover:not(:disabled) {
    background: var(--primary-dark);
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: var(--border);
    color: var(--text);
}

.btn-icon.copied {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-copy {
    padding: 8px 16px;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.btn-copy:hover {
    background: var(--border);
    color: var(--text);
}

.btn-copy.copied {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

/* Audio Preview */
.audio-preview {
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.audio-preview h3 {
    margin-bottom: 20px;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Custom Audio Player */
.custom-audio-player {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--background);
    padding: 16px 20px;
    border-radius: 50px;
    max-width: 420px;
    margin: 0 auto 20px;
}

.player-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.player-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.player-btn svg {
    width: 20px;
    height: 20px;
}

.player-btn .play-icon {
    margin-left: 3px;
}

.player-progress {
    flex: 1;
}

.player-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.player-progress-bar:hover {
    height: 8px;
}

.player-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.player-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 80px;
    text-align: right;
}

.processing-notice {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
    animation: pulse-text 2s infinite;
}

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

/* Patient Details Card */
.patient-details-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-top: 20px;
    margin-bottom: 24px;
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
}

.patient-details-card.collapsed {
    max-height: 0;
    opacity: 0;
    padding: 0 24px;
    margin-top: 0;
    margin-bottom: 0;
}

.edit-patient-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.btn-edit-patient {
    padding: 8px 16px;
    background: var(--background);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.btn-edit-patient:hover {
    background: var(--border);
    color: var(--text);
}

.patient-details-form .form-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.patient-details-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.patient-details-form .form-group-button {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
}

.patient-details-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.patient-details-form input,
.patient-details-form select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--background);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.patient-details-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-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'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.patient-details-form input:focus,
.patient-details-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-save-patient {
    padding: 10px 24px;
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    white-space: nowrap;
}

.btn-save-patient:hover {
    background: #16a34a;
    color: white;
}

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

@media (max-width: 768px) {
    .patient-details-form .form-row {
        flex-wrap: wrap;
    }

    .patient-details-form .form-group {
        flex: 1 1 calc(50% - 8px);
        min-width: 150px;
    }

    .patient-details-form .form-group-button {
        flex: 1 1 100%;
    }
}

@media (max-width: 480px) {
    .patient-details-form .form-group {
        flex: 1 1 100%;
    }
}

/* Status Card */
.status-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 48px 40px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 24px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.status-text {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 24px;
}

.progress-bar {
    background: var(--background);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    max-width: 320px;
    margin: 0 auto;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 3px;
}

/* Results Patient Heading */
.results-patient-heading {
    text-align: center;
    margin-top: 24px;
    margin-bottom: -8px;
}

.results-patient-heading .patient-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.results-patient-heading .patient-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Results Card */
.results-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-top: 24px;
}

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

.results-title {
    font-weight: 600;
    color: var(--text);
    font-size: 1rem;
}

.btn-delete:hover {
    background: var(--danger-light) !important;
    border-color: var(--danger) !important;
    color: var(--danger) !important;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--background);
}

.tab {
    flex: 1;
    padding: 16px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    transition: all 0.2s;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    background: var(--surface);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

/* Tab Content */
.tab-content {
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: height 0.3s ease;
}

.tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

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

.tab-pane.visible {
    opacity: 1;
}

.tab-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    gap: 16px;
}

.summary-item {
    padding: 16px;
    background: var(--background);
    border-radius: var(--radius-sm);
}

.summary-item h4 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-bottom: 8px;
}

.summary-item p {
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
}

/* Wide summary item - spans full width */
.summary-item-wide {
    grid-column: 1 / -1;
}

/* Tags Container */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tag-pill:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* Patient reference tag - no delete button, full pill shape */
.tag-pill.ref-tag {
    border-radius: 50px;
    padding-right: 14px;
    border-right: 1px solid var(--primary);
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.tag-pill.ref-tag:hover {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary);
}

.no-tags {
    color: var(--text-muted);
    font-style: italic;
}

/* Tag pill with delete button */
.tag-pill-wrapper {
    display: inline-flex;
    align-items: stretch;
    position: relative;
}

.tag-pill-wrapper .tag-pill {
    border-radius: 50px 0 0 50px;
    padding-right: 10px;
    border-right: none;
}

.tag-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    background: var(--primary-light);
    color: var(--text-muted);
    border: 1px solid var(--primary);
    border-left: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tag-delete:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.tag-delete svg {
    display: block;
}

/* Add tag input - inline with tags */
.tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.summary-tags .tags-container {
    display: contents;
}

.add-tag-wrapper {
    display: inline-flex;
    position: relative;
}

.add-tag-input {
    width: 120px;
    padding: 6px 14px;
    border: 1px dashed var(--border);
    border-radius: 50px;
    font-size: 0.8rem;
    font-family: inherit;
    background: transparent;
    color: var(--text);
    transition: border-color 0.2s, background 0.2s, width 0.2s;
}

.add-tag-input:focus {
    outline: none;
    width: 160px;
    border-color: var(--primary);
    border-style: solid;
    background: var(--background);
}

.add-tag-input::placeholder {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

/* Tag autocomplete dropdown */
.tag-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.tag-autocomplete.visible {
    display: block;
}

.tag-autocomplete-item {
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.tag-autocomplete-item:hover,
.tag-autocomplete-item.selected {
    background: var(--primary-light);
    color: var(--primary);
}

.tag-autocomplete-empty {
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Transcript Content */
.transcript-content {
    background: var(--background);
    padding: 20px;
    border-radius: var(--radius-sm);
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.9rem;
    line-height: 1.8;
    max-height: 400px;
    overflow-y: auto;
    color: var(--text);
}

/* Raw Transcript Section */
.raw-transcript-section {
    margin-top: 24px;
}

.transcript-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0 0 16px 0;
}

.raw-transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.raw-transcript-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-copy-small {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-copy-small svg {
    width: 14px;
    height: 14px;
}

.raw-transcript-content {
    background: var(--surface);
    border: 1px solid var(--border);
    opacity: 0.85;
    font-size: 0.85rem;
}

/* Edit Notes Textarea */
.edit-notes-textarea {
    width: 100%;
    min-height: 400px;
    padding: 20px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.edit-notes-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-save-notes {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
}

.btn-save-notes:hover {
    background: var(--primary-hover) !important;
}

/* Audio Tab Content */
.audio-tab-content {
    padding: 20px;
}

.audio-player-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.audio-player-section .custom-audio-player {
    width: 100%;
    max-width: 500px;
}

.audio-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.audio-retention-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.audio-retention-notice svg {
    flex-shrink: 0;
}

/* Reprocess Section */
.reprocess-section {
    width: 100%;
    max-width: 500px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

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

.reprocess-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.reprocess-remaining {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.reprocess-remaining.limit-reached {
    color: var(--danger);
}

.reprocess-note-type {
    margin-bottom: 16px;
}

.reprocess-note-type > label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.reprocess-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reprocess-type-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.reprocess-type-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.reprocess-type-option span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    background: var(--surface);
    transition: all 0.15s ease;
}

.reprocess-type-option:hover span {
    border-color: var(--primary);
    color: var(--primary);
}

.reprocess-type-option input[type="radio"]:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.reprocess-type-option input[type="radio"]:focus + span {
    box-shadow: 0 0 0 2px var(--primary-light);
}

.reprocess-section .btn-reprocess {
    width: 100%;
}

.reprocess-section .btn-reprocess:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.audio-expired-notice {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    gap: 12px;
}

.audio-expired-notice svg {
    opacity: 0.5;
}

.audio-expired-notice p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 0;
}

.audio-expired-notice span {
    font-size: 0.875rem;
    max-width: 300px;
}

/* Inline Patient Edit Panel */
.inline-patient-edit {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease, margin 0.3s ease;
    padding: 0 24px;
    margin: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.inline-patient-edit.visible {
    max-height: 200px;
    opacity: 1;
    padding: 20px 24px;
    margin-top: 24px;
}

.inline-patient-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-patient-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 140px;
}

.inline-patient-form .form-group-button {
    flex: 0 0 auto;
    min-width: auto;
    display: flex;
    align-items: flex-end;
}

.inline-patient-form label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.inline-patient-form input,
.inline-patient-form select {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--background);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

.inline-patient-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-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'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.inline-patient-form input:focus,
.inline-patient-form select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Results Actions */
.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    background: var(--background);
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        width: 80% !important;
        max-width: 320px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-brand {
        padding: 16px 20px 16px 76px;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .content-container {
        padding: 80px 16px 24px;
    }
}

@media (max-width: 600px) {
    .recording-card {
        padding: 24px;
    }

    .recording-card.is-recording {
        padding: 20px;
    }

    .recording-card.is-recording .recording-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .recording-card.is-recording .timer-display {
        text-align: center;
    }

    .recording-card.is-recording .timer {
        font-size: 2rem;
    }

    .recording-card.is-recording .controls {
        justify-content: center;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 12px;
    }

    .recording-card.is-recording .controls .btn {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .recording-card.is-recording .controls .btn-record {
        width: 100%;
        flex: 0 0 100%;
    }

    .recording-card.is-recording .controls .btn-pause,
    .recording-card.is-recording .controls .btn-stop {
        flex: 1;
        width: auto;
        min-width: 0;
    }

    .card-header h1 {
        font-size: 1.5rem;
    }

    .timer {
        font-size: 2.5rem;
    }

    .controls {
        flex-direction: column;
    }

    .controls .btn {
        width: 100%;
        justify-content: center;
    }

    .tabs {
        overflow-x: auto;
        overflow-y: hidden;
    }

    .tab {
        white-space: nowrap;
        padding: 14px 16px;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Recording blocked toast */
.recording-blocked-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    color: var(--text);
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.recording-blocked-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* General toast notifications */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface);
    color: var(--text);
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.toast.toast-error {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.toast svg {
    flex-shrink: 0;
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.splash-content {
    text-align: center;
}

.splash-logo {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.02em;
}

/* Onboarding Screen */
.onboarding-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.onboarding-screen.visible {
    opacity: 1;
}

.onboarding-card {
    background: var(--surface);
    padding: 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.onboarding-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.onboarding-card p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.onboarding-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--background);
    color: var(--text);
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.onboarding-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.onboarding-input::placeholder {
    color: var(--text-muted);
}

.btn-onboarding {
    width: 100%;
    margin-top: 20px;
    padding: 14px 32px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn-onboarding:hover {
    background: var(--primary-dark);
}

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

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

/* Homescreen */
.homescreen {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    background: var(--background);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.homescreen.visible {
    opacity: 1;
    pointer-events: auto;
}

/* When sidebar is collapsed */
.homescreen.expanded {
    left: 0;
}

@media (max-width: 900px) {
    .homescreen {
        left: 0;
    }
}

.homescreen-content {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.homescreen-greeting {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.homescreen-tagline {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.homescreen-footer {
    padding: 40px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.btn-new-recording {
    padding: 16px 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}

.btn-new-recording:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

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

.btn-new-recording svg {
    color: white;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .splash-logo {
        font-size: 2rem;
    }

    .onboarding-card {
        padding: 32px 24px;
    }

    .homescreen-greeting {
        font-size: 2.25rem;
    }

    .homescreen-footer {
        padding: 24px;
    }

    .btn-new-recording {
        padding: 14px 32px;
        font-size: 0.95rem;
    }
}

/* Install Banner (Add to Home Screen) */
.install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
}

.install-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-banner-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    flex-shrink: 0;
}

.install-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.install-banner-text strong {
    font-size: 0.9rem;
    color: var(--text);
}

.install-banner-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.install-banner-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.install-banner-close:hover {
    background: var(--surface-hover);
    color: var(--text);
}

/* Hide on desktop */
@media (min-width: 768px) {
    .install-banner {
        display: none !important;
    }
}

/* Login Code Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    padding: 20px;
}

.modal-overlay.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    position: relative;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-buttons .btn {
    min-width: 100px;
}

.modal-confirm .modal-description {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.login-code-display {
    background: var(--background);
    border-radius: var(--radius-sm);
    padding: 24px;
    margin-bottom: 16px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.5em;
    color: var(--primary);
}

.login-code-loading {
    font-size: 1rem;
    letter-spacing: normal;
    color: var(--text-muted);
    font-weight: normal;
}

.login-code-timer {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.login-code-timer.expiring {
    color: var(--danger);
    font-weight: 500;
}

.login-code-email {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-secondary:hover {
    background: var(--border);
    border-color: var(--text-muted);
}

/* Recovery Modal */
.recovery-modal {
    max-width: 420px;
    text-align: left;
}

.recovery-modal .modal-header {
    margin-bottom: 16px;
}

.recovery-modal .modal-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.recovery-modal .modal-body {
    margin-bottom: 24px;
}

.recovery-modal .modal-body p {
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.recovery-modal .modal-body p strong {
    color: var(--text);
}

.recovery-warning {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 16px !important;
}

.recovery-modal .modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.recovery-modal .btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.recovery-modal .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
}

.recovery-modal .btn-primary:hover {
    background: var(--primary-dark);
}

.recovery-modal .btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.recovery-modal .btn-secondary:hover {
    background: var(--surface-hover);
    color: var(--text);
}

#recoveryDetails {
    background: var(--background);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

#recoveryDetails p {
    margin-bottom: 8px;
}

#recoveryDetails p:last-child {
    margin-bottom: 0;
}

/* Note Type Selection (inline on new recording page) */
.note-type-selection {
    padding: 32px 24px;
    text-align: center;
}

.note-type-prompt {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.note-type-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

/* Meeting Details Form */
.meeting-details-form {
    padding: 24px;
    max-width: 500px;
    margin: 0 auto;
}

.meeting-details-form .form-group {
    margin-bottom: 20px;
}

.meeting-details-form label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.optional-label,
.meeting-details-form .optional-label {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.meeting-details-form input[type="text"],
.meeting-details-form textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.meeting-details-form input[type="text"]:focus,
.meeting-details-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.meeting-details-form textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.meeting-details-form .form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    margin-bottom: 0;
}

/* Format Options */
.format-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.format-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.format-option:hover {
    border-color: var(--primary-light);
}

.format-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.format-option input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--primary);
}

.format-option .format-label {
    font-weight: 500;
    color: var(--text);
    display: block;
}

.format-option .format-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-top: 2px;
}

/* Simplified format options - inline with left-aligned text */
.format-options-simple {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.format-option-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 4px 0;
}

.format-option-simple input[type="radio"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.format-option-simple .format-label {
    font-weight: 500;
    color: var(--text);
}

.format-option-simple .format-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.format-option-simple .format-desc::before {
    content: "- ";
}

/* Meeting title subtitle in recording header */
.meeting-title-subtitle {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 4px;
}

.meeting-details-form .btn-primary {
    width: 100%;
    margin-top: 24px;
    padding: 14px 24px;
    font-size: 1rem;
}

/* Note Type Selection Modal */
.note-type-modal {
    max-width: 500px;
    text-align: center;
}

.note-type-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 24px;
}

.note-type-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--background);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.note-type-btn:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
}

.note-type-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    color: var(--primary);
    flex-shrink: 0;
}

.note-type-btn:hover .note-type-icon {
    background: var(--primary);
    color: white;
}

.note-type-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.note-type-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Speaker Management Panel */
.speaker-management {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    overflow: hidden;
}

.speaker-management-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--background);
    cursor: pointer;
}

.speaker-management-header h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.speaker-management-header h4 svg {
    color: var(--primary);
}

.btn-toggle-speakers {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: transform 0.2s, color 0.2s;
}

.btn-toggle-speakers:hover {
    color: var(--text);
}

.btn-toggle-speakers .chevron-icon {
    transition: transform 0.2s;
}

.speaker-management.collapsed .btn-toggle-speakers .chevron-icon {
    transform: rotate(-90deg);
}

.speaker-management-content {
    padding: 16px;
    border-top: 1px solid var(--border);
    max-height: 500px;
    overflow-y: auto;
    transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.speaker-management.collapsed .speaker-management-content {
    max-height: 0;
    padding: 0 16px;
    opacity: 0;
    border-top: none;
}

.speaker-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}

.speaker-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.speaker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
    flex-wrap: wrap;
}

.speaker-original {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    flex-shrink: 0;
}

.speaker-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid var(--primary);
}

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

.speaker-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

.speaker-rename-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 150px;
}

.speaker-rename-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.speaker-rename-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.speaker-rename-input::placeholder {
    color: var(--text-muted);
}

.btn-save-single-speaker {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-save-single-speaker:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.btn-save-single-speaker:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.speaker-merge-select {
    padding: 8px 12px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    min-width: 100px;
}

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

.speaker-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-save-speakers,
.btn-apply-speakers {
    padding: 10px 16px;
    font-size: 0.85rem;
}

.btn-save-speakers:disabled,
.btn-apply-speakers:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--hover);
    border-color: var(--text-secondary);
}

.btn-secondary:disabled {
    background: var(--surface);
}

.no-speakers-message {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .speaker-item {
        flex-direction: column;
        align-items: stretch;
    }

    .speaker-original {
        min-width: auto;
        justify-content: space-between;
    }

    .speaker-arrow {
        display: none;
    }

    .speaker-rename-input,
    .speaker-merge-select {
        width: 100%;
    }
}
