/**
 * GG Editorial Manager - Modern CSS
 * Clean and professional design with sticky columns
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    background: var(--bg-white);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
}

.badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.record-count {
    font-size: 14px;
    color: var(--text-light);
    font-weight: 500;
}

/* Toolbar */
.toolbar {
    background: var(--bg-white);
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    margin-left: auto;
    min-width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-info {
    background: #0ea5e9;
    color: white;
}

.btn-info:hover {
    background: #0284c7;
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-edit {
    background: var(--warning);
    color: white;
    padding: 6px 12px;
    font-size: 13px;
}

.btn-edit:hover {
    background: #d97706;
}

/* Table */
.table-wrapper {
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f1f5f9;
}

.data-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    background: #f1f5f9;
}

/* Sticky Columns */
.sticky-col {
    position: sticky;
    left: 0;
    z-index: 11;
    background: #f1f5f9;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

.sticky-col-2 {
    position: sticky;
    left: 0;
    z-index: 11;
    background: #f1f5f9;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
    min-width: 150px;
}

.data-table tbody .sticky-col,
.data-table tbody .sticky-col-2 {
    position: sticky;
    left: 0;
    z-index: 9;
    background: var(--bg-white);
}

.data-table tbody tr:hover .sticky-col,
.data-table tbody tr:hover .sticky-col-2 {
    background: #f8fafc;
}

.actions-col {
    position: sticky;
    right: 0;
    background: #f1f5f9;
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
}

.data-table tbody .actions-col {
    background: var(--bg-white);
}

.data-table tbody tr:hover .actions-col {
    background: #f8fafc;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

/* Status badges in table */
.status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    white-space: nowrap;
}

/* Content Status Badges */
.content-not-started {
    background: #f3f4f6;
    color: #6b7280;
}

.content-generate {
    background: #fef3c7;
    color: #92400e;
}

.content-complete {
    background: #d1fae5;
    color: #065f46;
}

/* SEO Status Badges */
.seo-not-started {
    background: #f3f4f6;
    color: #6b7280;
}

.seo-in-progress {
    background: #dbeafe;
    color: #1e40af;
}

.seo-submitted {
    background: #e0e7ff;
    color: #3730a3;
}

.seo-to-pay {
    background: #fed7aa;
    color: #9a3412;
}

.seo-complete {
    background: #d1fae5;
    color: #065f46;
}

.seo-paid {
    background: #a7f3d0;
    color: #047857;
}

.seo-to-dispute {
    background: #fecaca;
    color: #991b1b;
}

.seo-disputed {
    background: #fca5a5;
    color: #7f1d1d;
}

/* Language Badges */
.lang-en-ca {
    background: #fee2e2;
    color: #991b1b;
}

.lang-en-uk {
    background: #dbeafe;
    color: #1e40af;
}

.lang-es-419 {
    background: #fed7aa;
    color: #9a3412;
}

.lang-fr-ca {
    background: #e0e7ff;
    color: #3730a3;
}

.lang-nl {
    background: #ffedd5;
    color: #c2410c;
}

.lang-pt-br {
    background: #d1fae5;
    color: #065f46;
}

.lang-uk-ua {
    background: #fef3c7;
    color: #92400e;
}

.lang-en-us {
    background: #dbeafe;
    color: #1e3a8a;
}

/* Dofollow Status Badges */
.dofollow-yes {
    background: #d1fae5;
    color: #065f46;
}

.dofollow-no {
    background: #fee2e2;
    color: #991b1b;
}

.dofollow-other {
    background: #f3f4f6;
    color: #6b7280;
}

/* Domain Warning Styles */
.warning-complete {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    color: #92400e;
}

.warning-incomplete {
    background: #dbeafe;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

/* Loading Discreto */
.loading-indicator {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 1000;
    display: none;
}

.spinner-small {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error */
.error {
    background: #fef2f2;
    color: #991b1b;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--danger);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-dialog {
    position: relative;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1001;
}

.modal-wide {
    max-width: 1200px;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-main);
    color: var(--text-dark);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
}

/* Cell editing */
.editable {
    cursor: pointer;
    position: relative;
}

.editable:hover {
    background: #f1f5f9;
}

.editable input,
.editable select {
    padding: 4px 8px;
    border: 2px solid var(--primary);
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

/* Select expandido con size */
.editable select[size] {
    padding: 0;
    background: white;
    max-height: 150px;
    overflow-y: auto;
}

.editable select[size] option {
    padding: 8px 12px;
    cursor: pointer;
}

.editable select[size] option:hover {
    background: #eff6ff !important;
}

.editable select[size] option:checked {
    background: #dbeafe !important;
    color: #1e40af;
    font-weight: 600;
}

/* Details View */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.details-section {
    background: var(--bg-main);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.details-section.full-width {
    grid-column: span 2;
}

.details-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.detail-item {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item.full-width {
    grid-column: span 2;
    grid-template-columns: 180px 1fr;
}

.detail-item label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.detail-item span {
    color: var(--text-light);
    font-size: 14px;
    word-break: break-word;
}

.detail-item span strong {
    color: var(--text-dark);
    font-size: 16px;
}

.detail-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.detail-item a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .details-section.full-width {
        grid-column: span 1;
    }
    
    .detail-item {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .detail-item.full-width {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .toolbar {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
}

/* ==================== GLOBAL HEADER & FOOTER STYLES ==================== */

/* Header Styles */
header {
    background-color: #052460;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo img {
    height: 45px;
}

.header-bottom {
    padding: 1rem 2rem;
}

.header-bottom-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

header h1 {
    color: #FFFFFF;
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0;
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: #FFFFFF;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    transition: color 0.3s ease;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-nav a:hover {
    color: #F47B3D;
}

.main-nav a.active {
    color: #F47B3D;
    border-bottom: 2px solid #F47B3D;
}

.external-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.external-links a {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.external-links a:hover {
    color: #F47B3D;
}

.logout-link i {
    margin-right: 0.5rem;
}

/* Footer Styles */
footer {
    background-color: #052460;
    padding: 1.5rem;
    text-align: center;
    color: #FFFFFF;
    margin-top: 2rem;
}

.footer-logo {
    height: 45px;
    margin-bottom: 1rem;
}

.footer-description {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.copyright {
    font-size: 0.8rem;
}

.copyright a {
    color: #FFFFFF;
    text-decoration: none;
}

.copyright a:hover {
    color: #F47B3D;
}

/* ==================== CONFIGURATION PAGE STYLES ==================== */

.config-container {
    width: 100%;
    background: var(--bg-white);
    border-radius: 4px;
    box-shadow: var(--shadow);
    padding: 1rem;
}

.action-panel {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    color: #FFFFFF;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.backup-btn {
    background-color: #4CAF50;
}

.reset-btn {
    background-color: #f44336;
}

.action-btn:hover {
    opacity: 0.9;
}

.table-section {
    margin-bottom: 2rem;
}

.table-section h2 {
    color: #052460;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.table-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.control-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.control-btn:hover {
    background-color: #052460;
    color: white;
}

/* Config Table Specific Styles */
#configTable {
    table-layout: auto;
    min-width: 1400px;
}

#configTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #052460;
}

#configTable thead th {
    background: #052460;
    color: #FFFFFF;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #F47B3D;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    text-align: center;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#configTable thead th:last-child {
    border-right: none;
}

#configTable th,
#configTable td {
    min-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Specific column widths for config table */
#configTable th:nth-child(1), #configTable td:nth-child(1) { min-width: 120px; }
#configTable th:nth-child(2), #configTable td:nth-child(2) { min-width: 80px; }
#configTable th:nth-child(3), #configTable td:nth-child(3) { min-width: 200px; }
#configTable th:nth-child(4), #configTable td:nth-child(4) { min-width: 150px; }
#configTable th:nth-child(5), #configTable td:nth-child(5) { min-width: 120px; }
#configTable th:nth-child(6), #configTable td:nth-child(6) { min-width: 200px; }
#configTable th:nth-child(7), #configTable td:nth-child(7) { min-width: 90px; }
#configTable th:nth-child(8), #configTable td:nth-child(8) { min-width: 90px; }
#configTable th:nth-child(9), #configTable td:nth-child(9) { min-width: 80px; }
#configTable th:nth-child(10), #configTable td:nth-child(10) { min-width: 120px; }
#configTable th:nth-child(11), #configTable td:nth-child(11) { min-width: 120px; }
#configTable th:nth-child(12), #configTable td:nth-child(12) { min-width: 120px; }

/* API Key cell styling */
.api-key-cell {
    font-family: monospace;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
}

.api-key-cell:hover {
    background-color: #e9ecef;
    cursor: pointer;
}

/* Prompts table wrapper for horizontal scroll */
.prompts-table-wrapper {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#promptsTable {
    table-layout: auto;
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#promptsTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #052460;
}

#promptsTable thead th {
    background: #052460;
    color: #FFFFFF;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #F47B3D;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    text-align: center;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#promptsTable thead th:last-child {
    border-right: none;
}

#promptsTable tbody tr {
    border-bottom: 1px solid var(--border);
}

#promptsTable tbody tr:hover {
    background-color: rgba(5, 36, 96, 0.05);
}

#promptsTable td {
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    vertical-align: top;
    position: relative;
    max-width: 350px;
    min-width: 250px;
}

#promptsTable td:last-child {
    border-right: none;
    min-width: 120px;
    max-width: 120px;
}

/* ID column - Sticky */
#promptsTable th:first-child,
#promptsTable td:first-child {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    text-align: center;
    font-weight: 600;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    padding: 0.5rem;
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
    background: var(--bg-white) !important;
    border-right: 2px solid #052460 !important;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1) !important;
}

#promptsTable th:first-child {
    background: #052460 !important;
    color: #FFFFFF !important;
    z-index: 15 !important;
    border-right: 2px solid #F47B3D !important;
}

#promptsTable td:first-child {
    vertical-align: middle;
    background: #ffffff !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
}

/* Ensure sticky ID column stays on top when hovering rows */
#promptsTable tbody tr:hover td:first-child {
    background: #f8f9fa !important;
    position: sticky !important;
    left: 0 !important;
    z-index: 5 !important;
}

/* Force white background for all ID cells */
#promptsTable tbody tr td:first-child {
    background-color: #ffffff !important;
}

#promptsTable tbody tr:nth-child(even) td:first-child {
    background-color: #ffffff !important;
}

/* Content preview for prompt cells */
#promptsTable td.editable {
    position: relative;
    overflow: hidden;
}

.content-preview {
    max-height: 120px;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #e9ecef;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.view-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: #052460 !important;
    color: white !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 11px !important;
    z-index: 2;
    opacity: 0.9;
    transition: all 0.2s ease;
    font-weight: 600;
}

.view-btn:hover {
    opacity: 1;
    background: #F47B3D !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* AI Prompts Table */
.ai-prompts-table-wrapper {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#aiPromptsTable {
    table-layout: auto;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#aiPromptsTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #052460;
}

#aiPromptsTable thead th {
    background: #052460;
    color: #FFFFFF;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #F47B3D;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    text-align: center;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#aiPromptsTable thead th:last-child {
    border-right: none;
}

#aiPromptsTable tbody tr:hover {
    background-color: rgba(5, 36, 96, 0.05);
}

#aiPromptsTable td {
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

#aiPromptsTable td:last-child {
    border-right: none;
}

/* Cell editing styles for configuration */
.editable {
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.editable:hover {
    background-color: #f1f5f9 !important;
}

.editable.editing {
    background-color: #fff3cd !important;
    border: 2px solid #F47B3D !important;
}

/* Save and delete buttons in config tables */
.save-btn, .delete-btn {
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-white);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: all 0.2s ease;
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

.save-btn:hover {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

.delete-btn:hover {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

/* Fields Table Styles */
#fieldsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#fieldsTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #052460;
}

#fieldsTable thead th {
    background: #052460;
    color: #FFFFFF;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #F47B3D;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    text-align: center;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#fieldsTable thead th:last-child {
    border-right: none;
}

#fieldsTable tbody tr:hover {
    background-color: rgba(5, 36, 96, 0.05);
}

#fieldsTable td {
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

#fieldsTable td:last-child {
    border-right: none;
}

/* Anchors Table Styles */
#anchorsTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

#anchorsTable thead {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #052460;
}

#anchorsTable thead th {
    background: #052460;
    color: #FFFFFF;
    font-weight: 600;
    padding: 1rem 0.75rem;
    border-bottom: 2px solid #F47B3D;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    text-align: center;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#anchorsTable thead th:last-child {
    border-right: none;
}

#anchorsTable tbody tr:hover {
    background-color: rgba(5, 36, 96, 0.05);
}

#anchorsTable td {
    padding: 0.75rem;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

#anchorsTable td:last-child {
    border-right: none;
}

/* ==================== UNDO BUTTON STYLES ==================== */

.undo-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    margin-left: 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.6;
    display: inline-block;
    vertical-align: middle;
}

.undo-btn:hover {
    opacity: 1;
    background: #fef3c7;
    transform: scale(1.1);
}

.undo-btn:active {
    transform: scale(0.95);
}

/* Make undo buttons visible only on row hover */
.data-table tbody tr .undo-btn {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.data-table tbody tr:hover .undo-btn {
    opacity: 0.6;
}

.data-table tbody tr:hover .undo-btn:hover {
    opacity: 1;
}

/* ==================== MULTI-SELECT FILTER STYLES ==================== */

/* Filter checkbox container */
.filter-checkbox-container {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px;
    margin-top: 5px;
}

/* Filter actions (All/Clear buttons) */
.filter-actions {
    display: flex;
    gap: 5px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.filter-action-btn {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.filter-action-btn:hover {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    transform: translateY(-1px);
}

.filter-action-btn:active {
    transform: translateY(0);
}

/* Filter checkbox list */
.filter-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

/* Checkbox label */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 13px;
    user-select: none;
}

/* Blank option styling */
.checkbox-label.blank-option {
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    margin-bottom: 6px;
}

.checkbox-label.blank-option:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.checkbox-label:hover {
    background: #eff6ff;
}

.checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: #2563eb;
}

.checkbox-label span {
    flex: 1;
    color: #374151;
}

.checkbox-label input[type="checkbox"]:checked + span {
    font-weight: 600;
    color: #1e40af;
}

/* Selected count indicator */
.selected-count {
    font-size: 11px;
    color: #999;
    font-weight: normal;
    margin-left: 5px;
}

/* Filter chips (active filters display) */
.filter-chip {
    background: #2563eb;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
    white-space: nowrap;
}

.filter-chip:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.filter-chip:active {
    transform: translateY(0);
}

/* Scrollbar styling for long lists */
.filter-checkbox-list::-webkit-scrollbar {
    width: 6px;
}

.filter-checkbox-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.filter-checkbox-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.filter-checkbox-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
