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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    padding: 0;
    position: relative;
}

/* Notification Container */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: white;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease-out;
    border-left: 4px solid;
    min-width: 300px;
}

.notification.warning {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.notification.success {
    border-left-color: #28a745;
    background: #f0fff4;
}

.notification.error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.notification.info {
    border-left-color: #17a2b8;
    background: #f0f9ff;
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.notification.warning .notification-icon {
    color: #ffc107;
}

.notification.success .notification-icon {
    color: #28a745;
}

.notification.error .notification-icon {
    color: #dc3545;
}

.notification.info .notification-icon {
    color: #17a2b8;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 4px;
}

.notification-message {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.2s;
}

.notification-close:hover {
    color: #212529;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Left Sidebar */
.sidebar {
    width: 320px;
    min-width: 320px;
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    background: #1e40af;
    color: white;
}

.sidebar-header button {
    transition: all 0.2s;
}

.sidebar-header button:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: rotate(180deg);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 0.85rem;
    opacity: 0.9;
}

.sidebar-search {
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-search input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.sidebar-search input:focus {
    outline: none;
    border-color: #2563eb;
}

.rcs-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.rcs-item {
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.rcs-item:hover {
    background: #f8f9fa;
    border-left-color: #2563eb;
}

.rcs-item.active {
    background: #e7f0ff;
    border-left-color: #2563eb;
    font-weight: 600;
}

.rcs-item.all {
    background: #f8f9fa;
    font-weight: 600;
    margin-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 15px;
}

.rcs-item.all.active {
    background: #e7f0ff;
}

.rcs-number {
    font-size: 0.95rem;
    color: #212529;
    margin-bottom: 3px;
}

.rcs-name {
    font-size: 0.8rem;
    color: #6c757d;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rcs-meta {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 3px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: white;
    overflow: hidden;
}

.header {
    background: #1e40af;
    color: white;
    text-align: center;
    padding: 15px;
}

.header h1 {
    font-size: 1.75rem;
    margin-bottom: 5px;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Scraping and Parsing Controls */
.scraping-controls {
    background: white;
    border-bottom: 2px solid #e9ecef;
    padding: 20px 30px;
    margin-bottom: 0;
}

.scraping-header {
    margin-bottom: 15px;
}

.scraping-header h3 {
    font-size: 1.1rem;
    color: #212529;
    margin-bottom: 5px;
    font-weight: 600;
}

.scraping-header p {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

.scraping-input-group {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.input-with-icon-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.scraping-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.file-icon-inside-input {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s;
    z-index: 1;
}

.file-icon-inside-input:hover {
    transform: translateY(-50%) scale(1.1);
}

.file-icon-inside-input.clear-icon {
    font-size: 1.4rem;
    color: #dc3545;
    font-weight: bold;
}

.file-icon-inside-input.clear-icon:hover {
    color: #c82333;
}

.scraping-input:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
    color: #495057;
    font-weight: 500;
}

.scraping-input:disabled.error {
    background-color: #fff5f5;
    border-color: #dc3545;
    color: #dc3545;
    opacity: 1;
}

.scraping-input:focus {
    outline: none;
    border-color: #2563eb;
}

.scraping-input:invalid,
.scraping-input.error {
    border-color: #dc3545;
    background-color: #fff5f5;
}

.validation-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 5px;
    padding: 8px 12px;
    background: #fff5f5;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    display: none;
}

.scraping-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.scraping-btn {
    padding: 12px 10px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.scraping-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.scraping-btn:hover::before {
    width: 300px;
    height: 300px;
}

.scraping-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.scraping-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.scraping-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.scraping-btn .btn-icon {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-block;
    transition: transform 0.3s;
}

.scraping-btn:hover .btn-icon:not(:disabled) {
    transform: scale(1.1);
}

.scraping-btn .btn-text {
    position: relative;
    z-index: 1;
}

.parsing-btn {
    background: #10b981;
    color: white;
}

.parsing-btn:hover:not(:disabled) {
    background: #059669;
}

.scraping-only-btn {
    background: #f59e0b;
    color: white;
}

.scraping-only-btn:hover:not(:disabled) {
    background: #d97706;
}

.scraping-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #2563eb;
}

/* Dynamic border colors based on operation type */
.scraping-progress.parsing-only {
    border-left-color: #10b981;
}

.scraping-progress.scraping-only {
    border-left-color: #f59e0b;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.progress-label{
    padding: 0px 0px 10px 7px;
}

#progressStatus {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
}

.progress-cancel {
    color: #dc3545;
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}

.progress-cancel:hover {
    color: #c82333;
}

.progress-close {
    color: #6c757d;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
}

.progress-close:hover {
    color: #212529;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-toggle {
    color: #6c757d;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    user-select: none;
    display: inline-block;
}

.progress-toggle:hover {
    color: #212529;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    background: #2563eb;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Parsing progress bar - green to match parsing button */
.progress-bar.parsing-bar {
    background: #10b981;
}

.progress-bar.parsing-bar:hover {
    background: #059669;
}

/* Scraping progress bar - orange to match scraping-only button */
.progress-bar.scraping-bar {
    background: #f59e0b;
}

.progress-bar.scraping-bar:hover {
    background: #d97706;
}

.progress-details {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.progress-details .detail-item {
    margin: 5px 0;
    padding: 4px 0;
    transition: color 0.3s;
}

.progress-details .detail-item strong {
    color: #212529;
}

.progress-details .detail-item:first-child {
    margin-top: 0;
}

.progress-details::-webkit-scrollbar {
    width: 6px;
}

.progress-details::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.progress-details::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.progress-details::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.tabs-container {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    overflow-x: auto;
    scrollbar-width: thin;
    position: sticky;
    top: 0;
    z-index: 50;
}

.tab {
    padding: 14px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    text-transform: capitalize;
}

.tab:hover {
    background: #e9ecef;
    color: #495057;
}

.tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    background: white;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    min-height: 400px;
    width: 100%;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.error {
    background: #fee;
    color: #c33;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #c33;
    margin: 20px 0;
}

.info-header {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #2563eb;
}

.info-header h2 {
    color: #212529;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.info-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

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

.info-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1rem;
    color: #212529;
    font-weight: 500;
}

.entities-list {
    display: grid;
    gap: 20px;
}

.entity-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 24px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.entity-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.entity-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.entity-badge {
    background: #2563eb;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.entity-badge.rcs-badge {
    background: #28a745;
    margin-left: 8px;
}

.entity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.field-group {
    display: flex;
    flex-direction: column;
}

.field-label {
    font-size: 1rem;
    color: #6c5ce7 ;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: capitalize;
    font-family: Bold;
}

.field-value {
    font-size: 0.95rem;
    color: #212529;
    word-break: break-word;
}

.field-value:empty::before {
    content: '—';
    color: #adb5bd;
    font-style: italic;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Hamburger Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.hamburger-btn span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Hide hamburger button when sidebar is active (opened) */
.sidebar.active ~ .sidebar-overlay ~ .main-content .hamburger-btn,
.sidebar.active ~ .main-content .hamburger-btn {
    display: none !important;
}

/* Close Sidebar Button (Mobile) */
.close-sidebar-btn {
    display: none;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
}

.close-sidebar-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Show close sidebar button on the right when sidebar is active (opened) */
.sidebar.active .close-sidebar-btn {
    display: flex !important;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Header adjustments for mobile */
.header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 {
    flex: 1;
}

@media (max-width: 1200px) {
    .sidebar {
        min-width: 250px !important ;
        width: 250px !important;
    }
    .scraping-btn{
        padding: 10px 7px !important;
    }

    .scraping-controls{
        padding: 20px 9px !important;
    }
}
/* Responsive */
@media (max-width: 980px) {
    .hamburger-btn {
        display: flex;
    }

    .close-sidebar-btn {
        display: flex;
    }

    .app-container {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 70%;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
        overflow-y: auto;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar-header {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .sidebar-header > div {
        flex-wrap: nowrap;
        gap: 10px;
    }

    .sidebar-header > div > div:first-child {
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .sidebar-header > div > div:last-child {
        flex: 0 0 auto;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        align-items: center;
    }

    .sidebar-header h2 {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-header p {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-header button {
        flex-shrink: 0;
        min-width: 32px;
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    #refreshRcsBtn {
        flex: 0 0 auto;
    }

    .close-sidebar-btn {
        flex: 0 0 auto;
        width: 32px;
        height: 32px;
        padding: 0;
        font-size: 1.3rem;
    }

    /* Show close sidebar button on the right when sidebar is active (opened) */
    .sidebar.active .close-sidebar-btn {
        display: flex !important;
    }

    .sidebar-overlay {
        display: none;
        pointer-events: none;
    }

    .sidebar-overlay.active {
        display: block;
        pointer-events: auto;
    }

    .main-content {
        width: 100%;
    }

    .header {
        padding: 15px 20px;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .header p {
        font-size: 0.8rem;
    }

    .scraping-controls {
        padding: 15px 20px;
    }

    .scraping-input-group {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .scraping-input {
        flex: 1;
        min-width: 0;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .scraping-buttons {
        flex-direction: row;
        width: auto;
        flex-shrink: 0;
        gap: 6px;
        flex-wrap: nowrap;
    }

    .scraping-btn {
        width: auto;
        min-width: 44px;
        padding: 0;
        display: inline-flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 0;
        font-size: 0.8rem;
        aspect-ratio: 1;
    }

    .scraping-btn .btn-icon {
        font-size: 1.3rem;
        flex-shrink: 0;
        margin: 0;
    }

    .scraping-btn .btn-text {
        display: none;
    }

    .content-area {
        padding: 15px;
    }

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

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

    .entities-table {
        font-size: 0.8rem;
    }

    .entities-table th,
    .entities-table td {
        padding: 8px 10px;
    }
}

/* Table Styles */
.table-container {
    overflow-y: visible;
    margin-top: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
}

.entities-table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    table-layout: auto;
}

.entities-table thead {
    background: #1e40af;
    color: white;
    position: sticky;
    top: 0;
    z-index: 10;
}

.entities-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
    width: auto;
    background: #1e40af;
}

.entities-table .filter-row {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.entities-table .filter-header {
    padding: 6px 8px;
    background: #f8f9fa !important;
    border-right: 1px solid #dee2e6;
    position: sticky;
    top: 48px;
    z-index: 9;
    vertical-align: middle;
}

.entities-table th[data-column="row_number"].filter-header {
    background: #f8f9fa !important;
    position: sticky;
    top: 48px;
    left: 0;
    z-index: 14;
    width: 60px;
    min-width: 60px;
}

.column-filter {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
    color: #212529;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.column-filter:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.column-filter::placeholder {
    color: #adb5bd;
    font-size: 0.75rem;
}

.entities-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s;
}

.entities-table tbody tr:hover {
    background-color: #f8f9fa;
}

.entities-table td {
    padding: 5px 9px;
    color: #212529;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.entities-table td:first-child {
    font-weight: 600;
    color: #2563eb;
}

.entities-table td.row-number {
    font-weight: 600;
    color: #2563eb;
    text-align: center;
    width: 60px;
    min-width: 60px;
    background-color: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 5;
}

.entities-table th[data-column="row_number"] {
    font-weight: 600;
    color: white;
    text-align: center;
    width: 60px;
    min-width: 60px;
    background: #1e40af;
    position: sticky;
    top: 0;
    left: 0;
    z-index: 15;
}

.entities-table td[data-column="rcs_number"] {
    background-color: #f8f9fa;
    position: sticky;
    left: 60px;
    z-index: 4;
    font-weight: 600;
    min-width: 120px;
}

.entities-table th[data-column="rcs_number"] {
    background: #1e40af;
    position: sticky;
    top: 0;
    left: 60px;
    z-index: 14;
    min-width: 120px;
}

.entities-table th[data-column="rcs_number"].filter-header {
    background: #f8f9fa !important;
    position: sticky;
    top: 48px;
    left: 60px;
    z-index: 13;
    min-width: 120px;
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #6c757d;
    color: white;
}

.status-badge.success {
    background: #28a745;
}

/* Fixed width columns with ellipsis */
.entities-table th[data-column="legal_name"],
.entities-table td[data-column="legal_name"],
.entities-table th[data-column="legal_form"],
.entities-table td[data-column="legal_form"],
.entities-table th[data-column="address"],
.entities-table td[data-column="address"],
.entities-table th[data-column="description"],
.entities-table td[data-column="description"] {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Social Object - display in one line */
.field-value.social-object,
.entities-table td.social-object {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* For table cells, ensure social_object column displays in one line */
.entities-table td[data-column="social_object"] {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

/* Editable fields with contenteditable */
.editable-cell,
.editable-field {
    cursor: text;
    transition: background-color 0.2s;
    outline: none;
}

.editable-cell:hover,
.editable-field:hover {
    background-color: #f0f4ff;
}

.editable-cell:focus,
.editable-field:focus {
    background-color: #fff;
    border: 1px solid #2563eb;
    border-radius: 4px;
    padding: 4px 8px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    z-index: 1000;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Expand editable columns when focused */
.entities-table td.editable-cell:focus {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    width: auto;
    min-width: 300px;
    max-width: 600px;
}

.entities-table td[data-column="legal_name"].editable-cell:focus,
.entities-table td[data-column="legal_form"].editable-cell:focus,
.entities-table td[data-column="address"].editable-cell:focus,
.entities-table td[data-column="description"].editable-cell:focus {
    width: auto;
    min-width: 400px;
    max-width: 600px;
}

.entities-table td.social-object.editable-cell:focus {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    max-width: none;
    min-width: 300px;
}