/* ============================================
   ABSA Dataset - Main Stylesheet
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #0ea5e9;
    --success-color: #22c55e;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --neutral-color: #6b7280;

    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --transition: all 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

a:hover {
    color: var(--primary-hover);
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navbar */
.navbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-color);
    margin: 5px 0;
    transition: var(--transition);
}

.navbar-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.5rem;
}

.navbar-menu a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
    margin-left: 0.5rem;
}

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

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 1rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

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

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    width: 100%;
    margin-bottom: 0.5rem;
}

.breadcrumb span {
    opacity: 0.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-block {
    width: 100%;
}

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

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

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

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

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

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

.btn-danger-outline {
    background: transparent;
    border: 1px solid var(--danger-color);
    color: var(--danger-color);
}

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

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.375rem;
    color: var(--text-color);
    font-size: 0.875rem;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

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

/* Alerts/Messages */
.messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.alert-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-card.stat-primary {
    background: linear-gradient(135deg, var(--primary-color), #6366f1);
    color: white;
}

.stat-card.stat-secondary {
    background: linear-gradient(135deg, var(--secondary-color), #06b6d4);
    color: white;
}

.stat-icon {
    opacity: 0.9;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-top: 0.25rem;
}

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

.stats-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.stats-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.stats-chart {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chart-bar-wrapper {
    display: grid;
    grid-template-columns: 60px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
}

.chart-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.chart-bar-container {
    background: var(--bg-color);
    border-radius: var(--radius-sm);
    height: 8px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    border-radius: var(--radius-sm);
    min-width: 4px;
    transition: width 0.5s ease;
}

.bar-primary { background: var(--primary-color); }
.bar-secondary { background: var(--secondary-color); }
.bar-success { background: var(--success-color); }
.bar-danger { background: var(--danger-color); }
.bar-warning { background: var(--warning-color); }
.bar-info { background: var(--info-color); }
.bar-neutral { background: var(--neutral-color); }
.bar-accent { background: #8b5cf6; }

.chart-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: right;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-style: italic;
}

/* Auth */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Search/Filter */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-panel {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

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

.filter-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.columns-settings {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.columns-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 0.75rem;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 50;
    min-width: 160px;
}

.columns-dropdown.show {
    display: block;
}

.columns-dropdown label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.875rem;
    cursor: pointer;
}

.columns-dropdown input[type="checkbox"] {
    width: auto;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Data Table */
.table-responsive {
    overflow-x: auto;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

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

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(79, 70, 229, 0.03);
}

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

.col-id { width: 60px; }
.col-matn { min-width: 250px; max-width: 400px; }
.col-aspekt { min-width: 150px; max-width: 250px; }
.col-polaritet { width: 100px; }
.col-emotsiya { min-width: 100px; max-width: 150px; }
.col-intensity { width: 100px; }
.col-context { width: 100px; }
.col-opinion { min-width: 150px; max-width: 250px; }

.text-truncate {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: help;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-neutral {
    background: #f1f5f9;
    color: #475569;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.page-link {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    color: var(--text-color);
    font-size: 0.875rem;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-current {
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Datasets Grid */
.datasets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.dataset-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: var(--transition);
}

.dataset-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.dataset-icon {
    color: var(--primary-color);
}

.dataset-info {
    flex: 1;
}

.dataset-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dataset-filename {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.dataset-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.dataset-actions {
    display: flex;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

/* Upload */
.upload-container {
    max-width: 600px;
}

.upload-form {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    cursor: pointer;
}

.file-upload-area:hover,
.file-upload-area.highlight {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.03);
}

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

.file-upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.file-upload-content svg {
    color: var(--primary-color);
    opacity: 0.7;
}

.file-hint {
    font-size: 0.75rem;
    opacity: 0.7;
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--text-color);
}

.file-selected svg {
    color: var(--success-color);
}

.btn-remove {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--danger-color);
    cursor: pointer;
    padding: 0.25rem;
}

.info-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-box h4 {
    font-size: 0.9375rem;
    color: #0369a1;
    margin-bottom: 0.75rem;
}

.info-box p {
    font-size: 0.875rem;
    color: #0c4a6e;
    margin-bottom: 0.5rem;
}

.info-box ul {
    margin-left: 1.25rem;
    font-size: 0.8125rem;
    color: #0c4a6e;
}

.info-box li {
    margin-bottom: 0.25rem;
}

.info-box .note {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #bae6fd;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

/* Confirm Delete */
.confirm-container {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
}

.confirm-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
}

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1.5rem;
}

.confirm-icon.danger {
    background: #fee2e2;
    color: var(--danger-color);
}

.confirm-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.confirm-message {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.warning-box {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--radius);
    padding: 1rem;
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #92400e;
}

.warning-box strong {
    display: block;
    margin-bottom: 0.5rem;
}

.warning-box ul {
    margin-left: 1.25rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 1rem;
        gap: 0;
    }

    .navbar-menu.show {
        display: flex;
    }

    .navbar-menu li {
        width: 100%;
    }

    .navbar-menu a {
        display: block;
        width: 100%;
    }

    .user-info {
        padding: 1rem 0 0;
        margin: 1rem 0 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        width: 100%;
        justify-content: space-between;
    }

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

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

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

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

    .filter-actions .btn {
        width: 100%;
    }

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

    .pagination {
        flex-wrap: wrap;
    }

    .data-table {
        font-size: 0.8125rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.625rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .stats-overview {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 1.25rem;
    }

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

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

    .confirm-actions .btn {
        width: 100%;
    }

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

    .page-actions .btn {
        width: 100%;
    }

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

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

/* Chart Label Full (kod + nomi) */
.chart-label-full {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    min-width: 100px;
}

.label-kod {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.label-nomi {
    font-size: 0.6875rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-wrapper {
    display: grid;
    grid-template-columns: 100px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
}

/* Info Section */
.info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.info-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.info-card .info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(79, 70, 229, 0.1);
    border-radius: var(--radius);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.info-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

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

.feature-list li {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.feature-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
}

.feature-list li strong {
    color: var(--text-color);
}

.example-box {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}

.example-box ul {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0;
}

.example-box li {
    padding: 0.25rem 0;
}

/* Tags Legend */
.tags-legend {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.tags-legend h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    text-align: center;
}

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

.legend-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Tags */
.tag {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.tag-success {
    background: #dcfce7;
    color: #166534;
}

.tag-danger {
    background: #fee2e2;
    color: #991b1b;
}

.tag-warning {
    background: #fef3c7;
    color: #92400e;
}

.tag-neutral {
    background: #f1f5f9;
    color: #475569;
}

.tag-info {
    background: #dbeafe;
    color: #1e40af;
}
