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

:root {
    --bg: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --text: #e0e0e0;
    --text-muted: #888;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: #333;
    --hit: #fbbf24;
    --hit-bg: rgba(251, 191, 36, 0.15);
    --topic-bg: #1e3a5f;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-weight: 600;
    color: var(--text);
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: var(--bg-tertiary);
}

.nav-link.active {
    color: var(--accent);
    background: rgba(59, 130, 246, 0.1);
}

.main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
}

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

.count {
    color: var(--text-muted);
    font-size: 13px;
}

.select, .input {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
}

.select:focus, .input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s;
}

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

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

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

.transcription-list {
    display: flex;
    flex-direction: column;
}

.transcription-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.transcription-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
    font-size: 12px;
}

.filename {
    color: var(--text-muted);
    font-family: monospace;
}

.path {
    color: var(--accent);
    text-decoration: none;
}

.path:hover {
    text-decoration: underline;
}

.time, .date {
    color: var(--text-muted);
    margin-left: auto;
}

.date {
    margin-left: 0;
}

.transcription-text {
    color: var(--text);
    line-height: 1.5;
}

.transcription-text .transcription-hit {
    background: var(--hit-bg);
    color: var(--hit);
    padding: 1px 3px;
    border-radius: 2px;
}

.topics {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.topic {
    background: var(--topic-bg);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.page-info {
    color: var(--text-muted);
    font-size: 13px;
}

.empty {
    text-align: center;
    color: var(--text-muted);
    padding: 32px;
}

/* Subfolders */
.subfolders {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 16px;
}

.subfolder-header {
    color: var(--text-muted);
    font-size: 12px;
    margin-bottom: 8px;
}

.subfolder-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.subfolder-link {
    color: var(--accent);
    padding: 6px 0;
    text-decoration: none;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
}

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

.subfolder-link:last-child {
    border-bottom: none;
}

/* Search page */
.search-form {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.form-group .input {
    width: 100%;
}

.folder-select {
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 8px;
}

.folder-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px;
    cursor: pointer;
}

.folder-option:hover {
    background: var(--bg-tertiary);
}

.folder-path {
    flex: 1;
    font-family: monospace;
    font-size: 12px;
}

.folder-count {
    color: var(--text-muted);
    font-size: 11px;
}

.folder-search {
    margin-bottom: 8px;
}

.results-header {
    margin-bottom: 8px;
}

/* Folders page */
.folder-search-bar {
    position: relative;
    width: 300px;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    margin-top: 4px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 50;
}

.suggestion-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
}

.suggestion-item:hover {
    background: var(--bg-tertiary);
}

.folder-tree {
    background: var(--bg-secondary);
    border-radius: 6px;
    padding: 12px;
}

.folder-node {
    display: flex;
    align-items: center;
    padding: 4px 0;
}

.folder-toggle {
    width: 16px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
}

.folder-spacer {
    width: 16px;
}

.folder-link {
    color: var(--accent);
    text-decoration: none;
}

.folder-link:hover {
    text-decoration: underline;
}

.folder-name {
    color: var(--text);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumb .sep {
    color: var(--text-muted);
}
