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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #dbdbdb;
    min-height: 100vh;
    padding: 20px;
}

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

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.logo {
    height: 60px;
    flex-shrink: 0;
}

.logo img {
    height: 100%;
    object-fit: contain;
}

.header {
    flex: 1;
    color: white;
    padding: 10px 20px;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 5px;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 0.95em;
    opacity: 0.95;
    color: white;
}

.controls {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

.control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.control-group label {
    color: #043249;
    font-weight: 600;
    font-size: 0.9em;
}

.control-group select,
.control-group input {
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s;
}

.control-group select:focus,
.control-group input:focus {
    outline: none;
    border-color: #043249;
}

.control-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.btn-primary {
    background: #043249;
    color: white;
}

.btn-primary:hover {
    background: #0d3b32;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #e0e0e0;
    color: #043249;
}

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

.loading {
    text-align: center;
    color: white;
    font-size: 1.1em;
    display: none;
    padding: 20px;
}

.error {
    background: #d32f2f;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none;
    border-left: 5px solid #b71c1c;
}

.table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    overflow-x: auto; 
}

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

thead {
    background: #043249;
    color: white;
}

th {
    padding: 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}

th:hover {
    background: rgba(255,255,255,0.1);
}

.sort-indicator {
    margin-left: 8px;
    font-size: 0.8em;
}

td {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.95em;
}

tbody tr {
    transition: background-color 0.2s ease;
    cursor: pointer;
}

tbody tr:hover {
    background-color: #f0f7f3;
}

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

.tag {
    display: inline-block;
    background: #043249;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    margin-right: 5px;
    margin-bottom: 5px;
    font-size: 0.85em;
}

.type-badge {
    display: inline-block;
    background: #043249;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
}

.url-cell {
    color: #043249;
    text-decoration: none;
    word-break: break-all;
    max-width: 250px;
    display: inline-block;
    font-weight: 500;
}

.url-cell:hover {
    text-decoration: underline;
    color: #043249;
}

.timestamp {
    color: #999;
    font-size: 0.85em;
}

.empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 1.1em;
}

.resumen-preview {
    color: #666;
    font-style: italic;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.resumen-preview:hover {
    background-color: #e8f5e9;
}

/* MODAL POPUP */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #043249;
    padding-bottom: 15px;
}

.modal-header h2 {
    color: #043249;
    font-size: 1.8em;
    margin: 0;
    word-break: break-word;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #043249;
    transition: transform 0.2s;
    flex-shrink: 0;
    margin-left: 20px;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.modal-section {
    margin-bottom: 20px;
}

.modal-section-title {
    color: #043249;
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-section-content {
    color: #333;
    line-height: 1.6;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 4px solid #2d5f47;
    word-break: break-word;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.modal-tag {
    background: #043249;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
}

.modal-link {
    color: #043249;
    word-break: break-all;
    text-decoration: none;
    font-weight: 500;
}

.modal-link:hover {
    text-decoration: underline;
}

.icon {
    font-size: 1.2em;
    flex-shrink: 0;
}