:root {
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #6b7280;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-input: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --radius: 8px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.navbar {
    background: var(--bg-card);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.nav-brand a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand a:hover {
    text-decoration: none;
}

.nav-logo {
    height: 24px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.breadcrumb {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

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

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    height: 40px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1;
}

.btn:hover {
    text-decoration: none;
}

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

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

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
}

.btn-secondary:hover {
    background: #475569;
}

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

.btn-warning {
    background: var(--warning);
    color: #1e293b;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

.btn-info:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-icon-white {
    color: white;
}

.btn-icon-white:hover {
    color: var(--primary);
    text-decoration: none;
}

.project-navigation {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.nav-tab {
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

.nav-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.project-grid, .topics-grid, .tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card, .topic-card, .table-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.project-header, .topic-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.project-header h3 a, .topic-card h3 a {
    color: var(--text);
    font-size: 1.25rem;
}

.project-description, .topic-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.project-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
}

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

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

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.empty-icon i {
    font-size: inherit;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.document-list, .topic-list {
    list-style: none;
}

.document-list li, .topic-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.document-list li:last-child, .topic-list li:last-child {
    border-bottom: none;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

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

.badge-warning {
    background: var(--warning);
    color: #1e293b;
}

.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.link-more {
    display: block;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.quick-actions {
    margin-top: 2rem;
}

.quick-actions h3 {
    margin-bottom: 1rem;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.2s;
}

.action-btn:hover {
    border-color: var(--primary);
    text-decoration: none;
}

.action-icon {
    font-size: 2rem;
}

.form-container {
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-hint {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.danger-zone {
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
}

.danger-zone h3 {
    color: var(--danger);
    margin-bottom: 0.5rem;
}

.danger-zone p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.dropzone-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.upload-results {
    margin-top: 1rem;
}

.upload-success {
    color: var(--success);
    padding: 0.5rem;
}

.upload-error {
    color: var(--danger);
    padding: 0.5rem;
}

.pseudonym-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.pseudonym-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.category-list {
    list-style: none;
    margin-bottom: 1rem;
}

.category-item {
    padding: 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.category-item:hover, .category-item.active {
    background: var(--bg-input);
}

.category-count {
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.mapping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mapping-table table {
    width: 100%;
    border-collapse: collapse;
}

.mapping-table th,
.mapping-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.mapping-table th {
    color: var(--text-muted);
    font-weight: 500;
}

.mapping-table code {
    background: var(--warning);
    color: #1e293b;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
}

.apply-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.modal {
    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: 1000;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-lg {
    max-width: 800px;
}

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

.modal-close {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.input-with-button {
    display: flex;
    gap: 0.5rem;
}

.input-with-button input {
    flex: 1;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

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

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

.suggestion-item {
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.suggestion-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.suggestion-name {
    font-weight: 600;
}

.suggestion-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
}

.suggestion-quotes {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.5rem;
    margin-left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.suggestion-quotes.has-quotes {
    color: var(--success);
}

.suggestion-quotes i {
    font-size: 0.875rem;
}

#quoteSearchProgress {
    text-align: center;
    padding: 2rem;
}

#quoteSearchProgress .progress-bar {
    max-width: 400px;
    margin: 1rem auto;
    height: 12px;
}

#quoteProgressText {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.ref-link,
.reference-link {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85em;
    border: 1px solid rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.ref-link:hover,
.reference-link:hover {
    background: var(--success);
    color: white;
    transform: scale(1.05);
    text-decoration: none;
    border-color: var(--success);
}

.ref-link.ref-unlinked {
    background: rgba(107, 114, 128, 0.2);
    color: var(--text-muted);
    border-color: rgba(107, 114, 128, 0.3);
    cursor: default;
}

.summary-content .ref-link,
.summary-content .reference-link {
    margin: 0 0.1rem;
}

.ref-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    background: var(--bg-input);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.document-view {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
}

.document-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

.quote-sidebar-list {
    list-style: none;
}

.quote-item {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.quote-topic {
    font-weight: 500;
    color: var(--primary);
    font-size: 0.875rem;
}

.quote-preview {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.content-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
}

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

.markdown-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.topic-detail {
    max-width: 900px;
}

.editable-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    min-height: 100px;
}

.editable-content:focus {
    outline: none;
    border-color: var(--primary);
}

.topic-description-textarea {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.6;
    resize: vertical;
    width: 100%;
}

.topic-description-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.topic-description-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.topic-description-wrapper .topic-description {
    flex: 1;
    margin-bottom: 0;
}

.edit-description-btn {
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.topic-card:hover .edit-description-btn {
    opacity: 1;
}

.topic-summary-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.summary-content {
    line-height: 1.8;
}

.topic-quotes-section {
    margin-top: 2rem;
}

.document-quotes {
    margin-bottom: 1.5rem;
}

.document-title {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.quotes-list .quote-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.quote-content {
    display: flex;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.quote-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.quote-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.quote-item:hover .quote-actions .btn-icon {
    opacity: 1;
}

.ref-badge {
    background: var(--success);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.quote-text {
    font-style: italic;
    color: var(--text-muted);
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin: 0;
}

.selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.selection-column h3 {
    margin-bottom: 1rem;
}

.selection-list {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

.selection-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
}

.selection-item:hover {
    background: var(--bg-input);
    border-radius: 4px;
}

.table-controls {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.control-group select {
    padding: 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
}

.summary-table-container {
    overflow-x: auto;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
}

.summary-table th,
.summary-table td {
    border: 1px solid var(--border);
    padding: 1rem;
    text-align: left;
    vertical-align: top;
}

.summary-table th {
    background: var(--bg);
    font-weight: 500;
    min-width: 200px;
}

.summary-table .doc-column {
    width: 150px;
    min-width: 150px;
}

.summary-table .doc-name {
    font-weight: 600;
    background: var(--bg);
}

.summary-table .cell {
    min-width: 250px;
    min-height: 100px;
}

.cell-content {
    font-size: 0.875rem;
    line-height: 1.6;
}

.generate-cell-btn {
    background: var(--bg-input);
    border: 1px dashed var(--border);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 100%;
}

.generate-cell-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.error-page {
    text-align: center;
    padding: 4rem;
}

.error-page h1 {
    font-size: 6rem;
    color: var(--primary);
}

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

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

/* Data Table Styles */
.documents-table-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.doc-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.doc-link i {
    color: var(--text-muted);
}

.action-btns {
    display: flex;
    gap: 0.5rem;
}

/* Inline Pseudonym Styles */
.pseudonym-inline-form {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.pseudonym-inline-form.active {
    display: block;
}

.pseudonym-inline-form h4 {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.pseudonym-inline-form .form-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.pseudonym-inline-form .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.pseudonym-inline-form .form-row .form-group label {
    font-size: 0.75rem;
}

.selection-highlight {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 2px;
}

.pseudonym-highlight {
    background: rgba(245, 158, 11, 0.4);
    border-radius: 3px;
    padding: 0 2px;
    cursor: help;
    position: relative;
    border-bottom: 2px solid rgba(245, 158, 11, 0.8);
}

.pseudonym-highlight:hover {
    background: rgba(245, 158, 11, 0.6);
}

.pseudonym-highlight::after {
    content: attr(data-pseudonym);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--primary);
    color: var(--text);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.pseudonym-highlight:hover::after {
    opacity: 1;
    visibility: visible;
}

.text-selectable {
    user-select: text;
    cursor: text;
}

.selection-info {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.selection-info i {
    color: var(--primary);
}

.paragraph-number {
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
}

.paragraph-number:hover {
    background: var(--success);
    color: white;
    transform: scale(1.05);
}

.success-message,
.error-message,
.info-message {
    text-align: center;
    padding: 1.5rem;
}

.success-message h4,
.error-message h4,
.info-message h4 {
    margin: 1rem 0 0.5rem 0;
}

.success-message p,
.error-message p,
.info-message p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.topic-hypotheses-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.topic-hypotheses-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.topic-hypotheses-section h3 {
    margin: 0;
}

.hypothesis-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    transition: background 0.2s;
}

.hypothesis-item:hover {
    background: rgba(99, 102, 241, 0.1);
}

.hypothesis-item.falsified {
    background: rgba(239, 68, 68, 0.1);
    opacity: 0.7;
}

.hypothesis-item.falsified .hypothesis-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.hypothesis-content {
    flex: 1;
}

.hypothesis-badge {
    display: inline-block;
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    background: var(--primary);
    color: white;
    border-radius: 3px;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hypothesis-item.falsified .hypothesis-badge {
    background: var(--danger);
}

.hypothesis-text {
    margin: 0;
    line-height: 1.5;
}

.falsified-reason {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--danger);
    font-style: italic;
}

.hypothesis-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-self: flex-start;
}

.hypothesis-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.hypothesis-item:hover .hypothesis-actions .btn-icon {
    opacity: 1;
}

.btn-warning {
    background: #f59e0b;
    color: white;
    border: none;
}

.btn-warning:hover {
    background: #d97706;
}

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

.btn-success:hover {
    background: #059669;
}

.no-hypotheses {
    padding: 1rem;
    text-align: center;
}

.markdown-content {
    line-height: 1.7;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--text);
}

.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
    margin-top: 0;
}

.markdown-content p {
    margin-bottom: 1em;
}

.markdown-content ul,
.markdown-content ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
}

.markdown-content li {
    margin-bottom: 0.5em;
}

.markdown-content strong {
    color: var(--text);
    font-weight: 600;
}

.markdown-content em {
    font-style: italic;
}

.markdown-content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
    margin: 1em 0;
    color: var(--text-muted);
    font-style: italic;
}

.markdown-content code {
    background: var(--bg-input);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: var(--bg-input);
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1em;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
}

.markdown-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5em 0;
}

/* Projects Layout with Folders */
.projects-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

.folder-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.folder-sidebar h3 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

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

.folder-tree .folder-tree {
    padding-left: 1.5rem;
    margin-top: 0.25rem;
}

.folder-item {
    margin-bottom: 0.25rem;
}

.folder-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s;
}

.folder-row:hover {
    background: var(--bg-input);
}

.folder-row i {
    color: var(--primary);
}

.folder-name {
    flex: 1;
}

.folder-actions {
    display: flex;
    gap: 0.25rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.folder-row:hover .folder-actions {
    opacity: 1;
}

.folder-actions .btn-icon {
    width: 24px;
    height: 24px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 4px;
}

.folder-actions .btn-icon:hover {
    background: var(--bg-card);
    color: var(--text);
}

.folder-actions .btn-icon.text-danger:hover {
    color: var(--danger);
}

.folder-item.shared .folder-row {
    opacity: 0.8;
}

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

.no-folders {
    color: var(--text-muted);
    font-style: italic;
    padding: 0.5rem;
}

.projects-content {
    min-width: 0;
}

.section-title {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
}

.section-title.mt-2 {
    margin-top: 2rem;
}

.project-card.shared {
    border-left: 3px solid var(--primary);
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

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

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    margin: 0;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

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

.modal-content form {
    padding: 1.5rem;
}

/* Share List */
.current-shares {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.current-shares h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.share-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}

.share-list li:last-child {
    border-bottom: none;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
    background: var(--bg-input);
}

.data-table .actions {
    display: flex;
    gap: 0.5rem;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.badge-secondary {
    background: var(--bg-input);
    color: var(--text-muted);
}

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

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-info {
    background: #3b82f6;
    color: white;
}

/* Inline form */
.inline-form {
    display: inline;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* 403 Error Page */
.error-page {
    text-align: center;
    padding: 4rem 2rem;
}

.error-page h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--danger);
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Export Section */
.export-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border);
}

.export-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.export-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.export-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.export-actions {
    display: flex;
    gap: 0.5rem;
}

.export-actions .btn i {
    margin-right: 0.25rem;
}

/* Utility classes */
.mt-2 {
    margin-top: 2rem;
}

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

.text-danger {
    color: var(--danger);
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .page-header {
        flex-direction: column;
        gap: 1rem;
    }

    .project-navigation {
        overflow-x: auto;
    }

    .pseudonym-layout {
        grid-template-columns: 1fr;
    }

    .document-view {
        grid-template-columns: 1fr;
    }

    .selection-grid {
        grid-template-columns: 1fr;
    }
    
    .hypothesis-item {
        flex-direction: column;
    }
    
    .hypothesis-actions {
        align-self: flex-end;
    }

    .projects-layout {
        grid-template-columns: 1fr;
    }

    .folder-sidebar {
        order: 2;
    }
}

.profile-menu {
    position: relative;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    text-transform: uppercase;
}

.profile-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.3);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

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

.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.dropdown-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.dropdown-email {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-input);
    text-decoration: none;
}

.dropdown-item i {
    font-size: 1rem;
    color: var(--text-muted);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger i {
    color: var(--danger);
}

.dropdown-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

.activity-log {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.log-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.log-item.log-error {
    border-left: 3px solid var(--danger);
}

.log-item.log-warning {
    border-left: 3px solid var(--warning);
}

.log-item.log-info {
    border-left: 3px solid var(--primary);
}

.log-icon {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
}

.log-item.log-error .log-icon {
    color: var(--danger);
}

.log-item.log-warning .log-icon {
    color: var(--warning);
}

.log-item.log-info .log-icon {
    color: var(--primary);
}

.log-content {
    flex: 1;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.log-action {
    font-weight: 600;
    color: var(--text);
}

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

.log-description {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

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

.log-user i {
    margin-right: 0.25rem;
}

.activity-filters {
    margin-bottom: 1.5rem;
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-buttons .btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-buttons .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.log-category {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 0.5rem;
}

.log-category i {
    margin-right: 0.25rem;
}

.log-category-crud {
    background: var(--info);
    color: white;
}

.log-category-llm {
    background: var(--success);
    color: white;
}

.log-category-ml {
    background: var(--warning);
    color: var(--dark);
}

.log-category-system {
    background: var(--text-muted);
    color: white;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

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

.unlink-btn i {
    position: relative;
}

.unlink-btn i::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(-45deg);
}

.sentiment-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.sentiment-info-card h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.method-description p {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.method-description strong {
    color: var(--text);
}

.lexicon-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.sentiment-results {
    margin-top: 2rem;
}

.sentiment-results h3 {
    margin-bottom: 1rem;
}

.sentiment-chart-section {
    margin-top: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.chart-container {
    position: relative;
    height: 300px;
}

.sentiment-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.sentiment-stats-card,
.sentiment-interpretation-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

.method-note {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.method-note h4 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.method-note p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

.sentiment-paragraph-section,
.sentiment-matches-section {
    margin-top: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.word-matches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.word-match-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    font-size: 0.75rem;
}

.word-match-item.positive {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.word-match-item.negative {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.word-match-item .word {
    font-weight: 600;
}

.word-match-item .values {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.loading-spinner-sm {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.ai-usage-section {
    margin-bottom: 2rem;
}

.ai-usage-section h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.ai-usage-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.usage-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
}

.usage-card.usage-cost {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.1);
}

.usage-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
}

.usage-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.ai-usage-breakdown,
.ai-usage-recent {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.ai-usage-breakdown h3,
.ai-usage-recent h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.recent-usage-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recent-usage-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-input);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.usage-provider {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
}

.usage-provider.openai {
    background: rgba(16, 163, 127, 0.2);
    color: #10a37f;
}

.usage-provider.gemini {
    background: rgba(66, 133, 244, 0.2);
    color: #4285f4;
}

.usage-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.usage-model {
    font-weight: 500;
}

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

.usage-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.usage-tokens {
    font-weight: 500;
}

.usage-cost-small {
    font-size: 0.75rem;
    color: var(--primary);
}

.usage-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 70px;
    text-align: right;
}

.section-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2rem 0;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.admin-stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.admin-stat-value.highlight {
    color: var(--primary);
}

.tenant-usage-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tenant-usage-section h3 {
    margin-bottom: 1rem;
}

.provider-breakdown {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.provider-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-input);
    border-radius: var(--radius);
}

/* Click Overlay - Prevents double clicks */
.click-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.click-overlay.active {
    opacity: 1;
    visibility: visible;
}

.click-overlay-content {
    background: var(--bg-card);
    padding: 2rem 3rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

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

.click-overlay-text {
    color: var(--text);
    font-size: 1rem;
}

/* Button loading state */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Toast Notification System */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-hide {
    opacity: 0;
    transform: translateX(100%);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-success i:first-child {
    color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-error i:first-child {
    color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-warning i:first-child {
    color: var(--warning);
}

.toast-info {
    border-left-color: var(--primary);
}

.toast-info i:first-child {
    color: var(--primary);
}

.toast i:first-child {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}
