/* Call Analyzer - CSS Styles */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: #4a90d9;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.navbar {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-brand a {
    color: #fff;
    font-size: 1.4rem;
    font-weight: bold;
    padding: 1rem 0;
    display: block;
}

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

.nav-links {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    padding: 1rem 1.2rem;
    display: block;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-bottom-color: #4a90d9;
    text-decoration: none;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #4a90d9;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.table tr:hover {
    background: #f8f9fa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-type {
    background: #e8f4fd;
    color: #4a90d9;
}

.badge-info {
    background: #e8f4fd;
    color: #4a90d9;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-processed {
    background: #d4edda;
    color: #155724;
}

.badge-error {
    background: #f8d7da;
    color: #721c24;
}

.badge-category {
    background: #e9ecef;
    color: #495057;
}

.badge-contact { background: #cce5ff; color: #004085; }
.badge-question { background: #d4edda; color: #155724; }
.badge-answer { background: #d1ecf1; color: #0c5460; }
.badge-problem { background: #f8d7da; color: #721c24; }
.badge-solution { background: #d4edda; color: #155724; }
.badge-agreement { background: #fff3cd; color: #856404; }
.badge-product { background: #e2d5f1; color: #6f42c1; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
    background: #e9ecef;
    color: #495057;
}

.btn:hover {
    background: #dee2e6;
    text-decoration: none;
}

.btn-primary {
    background: #4a90d9;
    color: #fff;
}

.btn-primary:hover {
    background: #3a7fc8;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

.btn.active {
    background: #4a90d9;
    color: #fff;
}

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

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

.form-group select,
.form-group input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.help-text {
    display: block;
    margin-top: 0.5rem;
    color: #666;
    font-size: 0.85rem;
}

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

/* Filters */
.filters {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.filter-form {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

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

.filter-group label {
    font-weight: 500;
    color: #666;
}

.filter-group select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.result-count {
    color: #666;
    font-size: 0.9rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.page-info {
    color: #666;
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    color: #333;
}

.category-item:hover {
    background: #e9ecef;
    text-decoration: none;
}

.category-count {
    font-weight: bold;
    color: #4a90d9;
}

/* FAQ List */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

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

.faq-question {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.faq-meta {
    font-size: 0.8rem;
    color: #888;
}

/* FAQ Cards */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.faq-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.faq-question-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.faq-question-header:hover {
    background: #f8f9fa;
}

.faq-question-header h3 {
    font-size: 1rem;
    color: #333;
    margin: 0;
    flex: 1;
}

.times-asked {
    background: #e8f4fd;
    color: #4a90d9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 1rem;
}

.toggle-icon {
    font-size: 1.5rem;
    color: #999;
    width: 24px;
    text-align: center;
}

.faq-answer {
    padding: 0 1.5rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-card.open .faq-answer {
    padding: 1rem 1.5rem;
    max-height: 500px;
    border-top: 1px solid #eee;
}

.faq-footer {
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eee;
    color: #888;
}

/* Category Filter */
.category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

/* Search */
.search-container {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 1rem;
}

.search-input-large {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.search-input-large:focus {
    outline: none;
    border-color: #4a90d9;
}

.search-box {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.search-results {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.result-section h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4a90d9;
}

.result-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-item {
    background: #fff;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.result-title {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.result-content {
    color: #666;
    margin-bottom: 0.5rem;
}

.result-meta {
    font-size: 0.85rem;
    color: #888;
}

.search-tips {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-tips h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.search-tips ul {
    padding-left: 1.5rem;
}

.search-tips li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Upload */
.upload-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .upload-container {
        grid-template-columns: 1fr;
    }
}

.drop-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: #4a90d9;
    background: #f8fbff;
}

.drop-zone.has-file {
    border-color: #5cb85c;
    background: #f0fff0;
}

.drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.drop-zone-text {
    color: #888;
}

.drop-zone-text p:first-child {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.file-info {
    display: none;
    margin-top: 1rem;
    color: #333;
}

.tips {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tip h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 0.5rem;
}

.tip p {
    color: #666;
    font-size: 0.9rem;
}

/* Document Detail */
.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

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

.meta-label {
    font-size: 0.85rem;
    color: #888;
}

.meta-value {
    font-weight: 500;
    color: #333;
}

.content-preview {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Fact Value */
.fact-value {
    max-width: 400px;
    word-break: break-word;
}

/* Legend */
.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.legend-item span:last-child {
    color: #666;
    font-size: 0.9rem;
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Quick Actions */
.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #888;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: #666;
}

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

.error-page h1 {
    font-size: 3rem;
    color: #d9534f;
    margin-bottom: 1rem;
}

.error-message {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* Footer */
.footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.6);
    padding: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 1rem;
    }

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

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

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

    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        flex-direction: column;
    }
}

/* Processing Banner */
.processing-banner {
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}

.processing-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

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

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

/* Quick Actions Bar */
.quick-actions-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.status-text {
    color: #666;
    font-size: 0.9rem;
    margin-left: auto;
}

/* Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-success {
    background: #28a745;
    color: white;
}

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

/* Stat Card Colors */
.stat-card.stat-processed .stat-value {
    color: #28a745;
}

.stat-card.stat-pending .stat-value {
    color: #ffc107;
}

.stat-card.stat-error .stat-value {
    color: #dc3545;
}

/* ==================== V2.0 NEW STYLES ==================== */

/* Version Badge in Navbar */
.nav-brand .version {
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 0.5rem;
}

/* Solution Cards */
.solutions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.solution-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.solution-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.solution-question {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
}

.solution-question:hover {
    color: #4a90d9;
    text-decoration: none;
}

.solution-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.answer-count {
    color: #666;
    font-size: 0.9rem;
}

/* Resolution & Satisfaction Badges */
.badge-resolved { background: #d4edda; color: #155724; }
.badge-partial { background: #fff3cd; color: #856404; }
.badge-unresolved { background: #f8d7da; color: #721c24; }
.badge-unknown { background: #e9ecef; color: #495057; }
.badge-positive { background: #d4edda; color: #155724; }
.badge-neutral { background: #e9ecef; color: #495057; }
.badge-negative { background: #f8d7da; color: #721c24; }

/* Answer Cards */
.answers-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.answer-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    position: relative;
}

.answer-card.recommended {
    background: #e8f5e9;
    border: 2px solid #4caf50;
}

.recommended-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: #4caf50;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

.answer-content {
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1rem;
    white-space: pre-wrap;
}

.answer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.answer-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.effectiveness {
    font-weight: bold;
}

.answer-source {
    color: #888;
    font-size: 0.85rem;
}

.feedback-buttons {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #666;
    font-size: 0.9rem;
}

/* Question Variants */
.variants-section {
    margin-top: 1rem;
}

.variants-section h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

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

.variants-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
    color: #555;
    font-style: italic;
}

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

/* Semantic Search Results */
.semantic-result {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.similarity-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    background: conic-gradient(
        #4a90d9 calc(var(--score) * 1%),
        #e9ecef calc(var(--score) * 1%)
    );
    position: relative;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
}

.score-label {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

.result-content-area {
    flex: 1;
}

.result-content-area .result-title {
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Search Type Select */
.search-type-select {
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    min-width: 180px;
}

/* Analysis Section */
.analysis-grid {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.analysis-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analysis-label {
    font-weight: 500;
    color: #666;
}

.analysis-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.analysis-section h4 {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.analysis-section p {
    color: #333;
    line-height: 1.6;
}

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

/* Knowledge Base Styles */
.knowledge-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.knowledge-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

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

.knowledge-header h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
}

.knowledge-content {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
}

.knowledge-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    color: #888;
    font-size: 0.85rem;
}

/* Result Description */
.result-description {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* Page Description */
.page-description {
    color: #666;
    margin-bottom: 1.5rem;
}

/* ==================== KNOWLEDGE HUB STYLES ==================== */

/* Header Actions */
.header-actions {
    display: flex;
    gap: 1rem;
}

/* Clusters Grid */
.clusters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.cluster-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cluster-card:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    text-decoration: none;
}

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

.cluster-info {
    flex: 1;
}

.cluster-name {
    font-weight: 600;
    color: #333;
}

.cluster-stats {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    gap: 1rem;
}

.cluster-stats .resolved {
    color: #28a745;
}

/* Grid 2 columns */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

/* Question List */
.question-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.question-list li {
    margin-bottom: 0.5rem;
}

.question-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.question-list li a:hover {
    background: #e9ecef;
}

.cluster-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-size: 0.85rem;
    min-width: 30px;
}

.question-text {
    flex: 1;
    color: #333;
}

.question-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.times-asked {
    background: #e8f4fd;
    color: #4a90d9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Status Badges */
.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.status-resolved {
    background: #d4edda;
    color: #155724;
}

.status-needs_work {
    background: #fff3cd;
    color: #856404;
}

.status-no_answer {
    background: #e9ecef;
    color: #495057;
}

/* Stat Card Warning Color */
.stat-card.stat-warning .stat-value {
    color: #ffc107;
}

/* ==================== V3 SCRIPT STYLES ==================== */

/* Script Cards */
.script-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    position: relative;
}

.script-card.best {
    background: #d4edda;
    border-color: #28a745;
    border-width: 2px;
}

.script-card .best-badge {
    color: #28a745;
    font-weight: bold;
    margin-bottom: 12px;
    font-size: 1rem;
    position: static;
    background: none;
    padding: 0;
}

.effectiveness-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    background: #6c757d;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

.script-text {
    font-size: 16px;
    line-height: 1.6;
    padding: 16px;
    background: white;
    border-radius: 6px;
    margin: 8px 0;
    white-space: pre-wrap;
    border: 1px solid #e9ecef;
}

.script-card.best .script-text {
    background: #f8fff8;
    border-color: #c3e6cb;
}

.script-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
    font-size: 0.85rem;
}

.script-type {
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    text-transform: capitalize;
}

.type-instruction { background: #cce5ff; color: #004085; }
.type-explanation { background: #d4edda; color: #155724; }
.type-promise { background: #fff3cd; color: #856404; }
.type-apology { background: #f8d7da; color: #721c24; }
.type-info { background: #e2e3e5; color: #383d41; }

.has-steps {
    color: #28a745;
    font-weight: 500;
}

.script-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
}

.btn-copy {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: #0056b3;
}

.btn-up {
    background: #28a745;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-up:hover {
    background: #1e7e34;
}

.btn-down {
    background: #dc3545;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.btn-down:hover {
    background: #c82333;
}

/* Best Script Preview in Search */
.best-script-preview {
    background: #f0fff0;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
}

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

.best-label {
    color: #28a745;
    font-weight: bold;
    font-size: 0.85rem;
}

.btn-copy-small {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-copy-small:hover {
    background: #0056b3;
}

.script-preview-text {
    color: #333;
    line-height: 1.5;
    font-size: 0.95rem;
    white-space: pre-wrap;
}

.script-count {
    color: #28a745;
    font-weight: 500;
    font-size: 0.85rem;
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
}

/* Scripts stat card */
.stat-card.stat-scripts .stat-value {
    color: #007bff;
}

/* ==================== V3.1 REDESIGN STYLES ==================== */

/* Search Hero */
.search-hero {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 2rem;
}

.search-hero h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: white;
}

.hero-subtitle {
    opacity: 0.9;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero-search-form {
    max-width: 700px;
    margin: 0 auto;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.hero-search-input {
    width: 100%;
    padding: 1.2rem 1.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.hero-search-input:focus {
    outline: none;
    box-shadow: 0 4px 25px rgba(0,0,0,0.3);
}

.hero-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #3498db;
    color: white;
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.hero-search-btn:hover {
    background: #2980b9;
}

.search-examples {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.search-examples a {
    color: white;
    background: rgba(255,255,255,0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    margin: 0 0.25rem;
    text-decoration: none;
    transition: background 0.2s;
}

.search-examples a:hover {
    background: rgba(255,255,255,0.3);
    text-decoration: none;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: none;
    z-index: 100;
    margin-top: 4px;
    overflow: hidden;
}

.autocomplete-item {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    color: #333;
    text-align: left;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

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

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
}

.stat-text {
    font-size: 0.85rem;
    color: #888;
}

/* Section */
.section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

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

.section-header h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
}

.link-all {
    color: #3498db;
    font-size: 0.9rem;
}

/* Clusters Grid (Updated) */
.clusters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.cluster-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    border: none;
}

.cluster-card:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    text-decoration: none;
}

.cluster-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.5rem;
}

/* Two Columns Layout */
.two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

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

/* Question List (Updated) */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s;
}

.question-item:hover {
    background: #e9ecef;
}

.question-item.needs-work {
    border-left: 3px solid #ffc107;
}

.question-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0.5rem;
}

.question-badge {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: white;
    font-size: 0.9rem;
}

.question-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.85rem;
    margin-left: 40px;
}

.quick-copy {
    margin-top: 0.5rem;
    margin-left: 40px;
}

.btn-copy-inline {
    background: #3498db;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.btn-copy-inline:hover {
    background: #2980b9;
}

/* Admin Section */
.admin-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.btn-outline {
    background: transparent;
    border: 2px solid #3498db;
    color: #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

.pending-badge {
    background: #fff3cd;
    color: #856404;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Empty State */
.empty-state.success {
    color: #28a745;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #888;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #ccc;
}

.breadcrumb .current {
    color: #333;
}

/* Cluster Header */
.cluster-header {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    border-left: 4px solid;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cluster-icon-large {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 2rem;
}

.cluster-header-info h1 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.cluster-header-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.cluster-header-stats .stat {
    font-size: 0.9rem;
    color: #666;
}

/* Subcategories Grid */
.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.subcategory-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.25rem;
    transition: background 0.2s;
}

.subcategory-card:hover {
    background: #e9ecef;
}

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

.subcategory-name {
    font-weight: 600;
    color: #333;
    text-decoration: none;
    font-size: 1.05rem;
}

.subcategory-name:hover {
    color: #3498db;
}

.subcategory-count {
    font-size: 0.8rem;
    color: #888;
    background: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
}

.top-questions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.top-question:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.top-question .times-asked {
    font-size: 0.75rem;
}

.no-questions {
    color: #888;
    font-size: 0.9rem;
    padding: 0.5rem 0;
}

.view-all-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    color: #3498db;
    font-size: 0.9rem;
    text-decoration: none;
}

.view-all-link:hover {
    text-decoration: underline;
}

/* Subcategory Detail */
.subcategory-badge {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1.5rem;
}

.subcategory-parent {
    color: #888;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #e9ecef;
    text-decoration: none;
}

.filter-btn.active {
    background: #3498db;
    color: white;
}

.total-count {
    color: #888;
    font-size: 0.9rem;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-card {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.question-card .question-main {
    display: block;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.question-card .question-main:hover {
    color: #3498db;
}

/* Question Detail Header */
.question-header {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.question-badge-large {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.75rem;
}

.question-header-content h1 {
    margin: 0 0 0.75rem 0;
    font-size: 1.4rem;
    line-height: 1.4;
}

.cluster-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.subcategory-tag {
    background: #e9ecef;
    color: #666;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

/* Best Script Section */
.best-script-section {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 2px solid #28a745;
}

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

.best-script-header .best-label {
    font-size: 1rem;
    font-weight: bold;
    color: #155724;
}

.effectiveness-score {
    background: #28a745;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.best-script-content {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
}

.script-text-large {
    font-size: 1.05rem;
    line-height: 1.7;
    white-space: pre-wrap;
    margin-bottom: 1rem;
}

.btn-copy-large {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.2s;
}

.btn-copy-large:hover {
    background: #218838;
}

.btn-helpful {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-helpful:hover {
    background: #218838;
}

.btn-not-helpful {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s;
}

.btn-not-helpful:hover {
    background: #c82333;
}

/* Scripts Grid */
.scripts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.scripts-grid .script-card {
    margin: 0;
}

.script-effectiveness {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #6c757d;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
}

/* Empty Scripts */
.empty-scripts-section {
    text-align: center;
    padding: 3rem;
    background: #f8f9fa;
    border-radius: 12px;
    color: #888;
}

.empty-scripts-section h3 {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Variants Section */
.variants-section {
    margin-top: 0;
}

.variants-section h2 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.variants-section .variants-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variant-item {
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    color: #555;
    font-style: italic;
}

/* Search Results Page */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.results-count {
    color: #888;
    font-size: 0.9rem;
}

.results-hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.result-card.semantic {
    display: flex;
    gap: 1.25rem;
}

.similarity-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.similarity-value {
    font-size: 1.25rem;
    font-weight: bold;
    color: #3498db;
}

.similarity-label {
    font-size: 0.75rem;
    color: #888;
}

.result-content {
    flex: 1;
}

.result-content .result-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 0.75rem;
}

.result-content .result-title:hover {
    color: #3498db;
}

.result-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.best-script-card {
    background: #f0fff0;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

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

.script-badge {
    color: #28a745;
    font-weight: 600;
    font-size: 0.85rem;
}

.script-preview {
    color: #333;
    line-height: 1.5;
    white-space: pre-wrap;
}

.empty-results {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
}

.empty-results h3 {
    color: #666;
    margin-bottom: 0.5rem;
}

/* Search Tips Section */
.search-tips-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.search-tips-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tip-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
}

.tip-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: white;
    border-radius: 8px;
    font-weight: bold;
    margin-bottom: 1rem;
}

.tip-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.tip-card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
}

.tip-card code {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Button Large */
.btn-lg {
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
}

/* ==================== ADMIN PANEL STYLES ==================== */

/* Admin Container */
.admin-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Admin Navigation */
.admin-nav {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.75rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    flex-wrap: wrap;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.2s;
}

.admin-nav-item:hover {
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
}

.admin-nav-item.active {
    background: #3498db;
    color: white;
}

.admin-badge {
    background: #dc3545;
    color: white;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    margin-left: 0.25rem;
}

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.admin-stat-card {
    background: white;
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.admin-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #3498db;
}

.admin-stat-label {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.admin-stat-card.stat-pending .admin-stat-value {
    color: #f39c12;
}

.admin-stat-card.stat-approved .admin-stat-value {
    color: #27ae60;
}

.admin-stat-card.stat-rejected .admin-stat-value {
    color: #e74c3c;
}

/* Admin Grid 2 columns */
.admin-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 900px) {
    .admin-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Admin Question List */
.admin-question-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-question-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.admin-question-text {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.admin-question-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.admin-question-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Admin Log List */
.admin-log-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.admin-log-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.log-action {
    min-width: 80px;
}

.action-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    background: #e9ecef;
    color: #666;
}

.action-badge.approved { background: #d4edda; color: #155724; }
.action-badge.rejected { background: #f8d7da; color: #721c24; }
.action-badge.deleted { background: #f8d7da; color: #721c24; }
.action-badge.merged { background: #cce5ff; color: #004085; }
.action-badge.edited { background: #fff3cd; color: #856404; }
.action-badge.script { background: #d1ecf1; color: #0c5460; }
.action-badge.variant { background: #e2e3e5; color: #383d41; }
.action-badge.cluster { background: #e9ecef; color: #495057; }

.log-details {
    flex: 1;
}

.log-question {
    color: #333;
    font-weight: 500;
}

.log-time {
    color: #888;
    font-size: 0.8rem;
}

/* Admin Actions */
.admin-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Moderation Tabs */
.moderation-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mod-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.2s;
}

.mod-tab:hover {
    background: #f8f9fa;
    text-decoration: none;
}

.mod-tab.active {
    background: #3498db;
    color: white;
}

.tab-count {
    background: rgba(0,0,0,0.1);
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
    font-size: 0.85rem;
}

.mod-tab.active .tab-count {
    background: rgba(255,255,255,0.2);
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #2c3e50;
    color: white;
    border-radius: 8px;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.selected-count {
    font-weight: 600;
}

/* Moderation List */
.moderation-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.moderation-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: flex-start;
}

.mod-checkbox {
    padding-top: 0.25rem;
}

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

.mod-question-text {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.mod-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.mod-script-preview {
    padding: 0.75rem;
    background: #e8f5e9;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.5rem;
}

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

.source-file {
    color: #888;
    font-size: 0.8rem;
    font-style: italic;
}

/* Button Colors */
.btn-approve {
    background: #27ae60;
    color: white;
}

.btn-approve:hover {
    background: #219a52;
}

.btn-reject {
    background: #e67e22;
    color: white;
}

.btn-reject:hover {
    background: #d35400;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Select All Label */
.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

/* Rules Page */
.rule-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

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

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.rule-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: center;
}

.rule-item.inactive {
    opacity: 0.5;
}

.rule-toggle {
    flex-shrink: 0;
}

.rule-content {
    flex: 1;
}

.rule-condition {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.rule-type {
    background: #e9ecef;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.rule-value {
    color: #333;
    font-weight: 500;
}

.rule-arrow {
    color: #888;
}

.rule-action {
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.rule-action.action-auto_reject {
    background: #f8d7da;
    color: #721c24;
}

.rule-action.action-auto_approve {
    background: #d4edda;
    color: #155724;
}

.rule-action.action-mark_pending {
    background: #fff3cd;
    color: #856404;
}

.rule-description {
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.rule-actions {
    flex-shrink: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #27ae60;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Help Grid */
.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.help-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.help-item strong {
    display: block;
    color: #333;
    margin-bottom: 0.25rem;
}

.help-item p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.help-item code {
    display: block;
    padding: 0.5rem;
    background: #e9ecef;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #555;
}

/* Merge Page */
.merge-source-card {
    border-left: 4px solid #e74c3c;
}

.merge-question-display {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.merge-question-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.75rem;
}

.merge-question-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: #666;
}

.merge-candidates {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.merge-candidate {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: center;
    cursor: pointer;
    transition: background 0.2s;
}

.merge-candidate:hover {
    background: #e9ecef;
}

.similarity-badge {
    background: #3498db;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    min-width: 50px;
    text-align: center;
}

.candidate-content {
    flex: 1;
}

.candidate-text {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.25rem;
}

.candidate-meta {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    gap: 1rem;
}

.merge-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: #e9ecef;
    text-decoration: none;
}

.result-text {
    flex: 1;
    color: #333;
}

.result-meta {
    font-size: 0.85rem;
    color: #888;
    display: flex;
    gap: 1rem;
}

.no-results {
    color: #888;
    font-style: italic;
    padding: 1rem;
}

.merge-preview-content {
    text-align: center;
}

.preview-section {
    text-align: left;
    margin-bottom: 1.5rem;
}

.preview-section ul {
    padding-left: 1.5rem;
    color: #555;
}

.preview-warning {
    background: #fff3cd;
    color: #856404;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Question Edit Page */
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    resize: vertical;
    font-family: inherit;
}

.variants-edit-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.variant-edit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.variant-text {
    color: #555;
    font-style: italic;
}

.scripts-edit-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.script-edit-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.script-edit-item.is-best {
    background: #d4edda;
    border: 2px solid #28a745;
}

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

.script-edit-text {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}

.script-edit-item.is-best .script-edit-text {
    border-color: #28a745;
}

.script-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.danger-zone {
    border: 2px solid #e74c3c;
}

.danger-zone .card-header {
    background: #f8d7da;
}

.danger-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.empty-text {
    color: #888;
    font-style: italic;
}

/* Log Table */
.log-table-container {
    overflow-x: auto;
}

.log-table {
    min-width: 800px;
}

.log-table .log-time {
    white-space: nowrap;
    font-size: 0.85rem;
}

.log-table .log-details {
    font-size: 0.85rem;
}

.log-question-link {
    color: #3498db;
}

.deleted-ref {
    color: #888;
    font-style: italic;
}

.log-reason {
    color: #666;
    font-style: italic;
}

.log-change {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.old-value {
    text-decoration: line-through;
    color: #888;
}

.arrow {
    color: #888;
}

.new-value {
    color: #333;
    font-weight: 500;
}

.log-old {
    color: #888;
}

.log-admin {
    color: #888;
    font-size: 0.85rem;
}
