/* ============================================
   RESET E BASE
============================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f2f5;
    padding-top: 50px;
    padding-bottom: 50px;
}

/* ============================================
   BARRA SUPERIOR FIXA (50px)
============================================ */
.top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 50px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.top-bar .brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 600; }
.top-bar .brand i { color: #ff6b6b; }
.top-bar .brand .version { font-size: 11px; opacity: 0.6; font-weight: 400; }

.top-bar .stats { display: flex; align-items: center; gap: 15px; font-size: 13px; }
.top-bar .stats .stat-item { display: flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 20px; background: rgba(255,255,255,0.08); }
.top-bar .stats .stat-item .number { font-weight: 700; font-size: 14px; }
.top-bar .stats .stat-item.total .number { color: #4dabf7; }
.top-bar .stats .stat-item.fatal .number { color: #ff6b6b; }
.top-bar .stats .stat-item.warning .number { color: #ffd43b; }
.top-bar .stats .stat-item.notice .number { color: #69db7c; }

.top-bar .user-info { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.top-bar .user-info .ip { color: #adb5bd; font-family: monospace; font-size: 12px; }

/* ============================================
   BARRA INFERIOR FIXA (50px)
============================================ */
.bottom-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 50px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
}

.bottom-bar .info { display: flex; align-items: center; gap: 20px; font-size: 13px; color: #adb5bd; }
.bottom-bar .info .system-info { color: #6c757d; font-size: 11px; }

.bottom-bar .actions { display: flex; align-items: center; gap: 10px; }
.bottom-bar .actions .btn {
    padding: 4px 14px; font-size: 12px; border-radius: 6px; border: none;
    cursor: pointer; transition: all 0.3s ease;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.bottom-bar .actions .btn-refresh { background: #4dabf7; color: white; }
.bottom-bar .actions .btn-refresh:hover { background: #339af0; }
.bottom-bar .actions .btn-export { background: #69db7c; color: #212529; }
.bottom-bar .actions .btn-export:hover { background: #51cf66; }
.bottom-bar .actions .btn-clear { background: #ff6b6b; color: white; }
.bottom-bar .actions .btn-clear:hover { background: #fa5252; }

/* ============================================
   CONTEÚDO PRINCIPAL
============================================ */
.main-content { padding: 20px; max-width: 1400px; margin: 0 auto; }

/* ============================================
   FILTROS
============================================ */
.filter-section {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.filter-group { display: flex; align-items: center; gap: 6px; }
.filter-group input, .filter-group select {
    padding: 5px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
}
.filter-group input:focus, .filter-group select:focus {
    outline: none; border-color: #4dabf7; box-shadow: 0 0 0 3px rgba(77,171,247,0.1);
}
.filter-group input { min-width: 150px; }
.filter-group select { min-width: 120px; }

.btn-filter {
    padding: 5px 16px;
    background: #4dabf7;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
}
.btn-filter:hover { background: #339af0; }

.btn-clear-filters {
    padding: 5px 16px;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex; align-items: center; gap: 6px;
    text-decoration: none;
}
.btn-clear-filters:hover { background: #e9ecef; }

.filter-count {
    font-size: 12px;
    color: #6c757d;
    margin-left: auto;
}

/* ============================================
   TABELA
============================================ */
.table-container {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.table-container .table { margin-bottom: 0; font-size: 13px; }
.table-container .table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}
.table-container .table thead th {
    padding: 10px 14px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: #495057;
    position: sticky;
    top: 0;
    background: #f8f9fa;
}
.table-container .table tbody td { padding: 8px 14px; vertical-align: middle; border-bottom: 1px solid #f0f0f0; }
.table-container .table tbody tr { cursor: pointer; transition: background 0.15s; }
.table-container .table tbody tr:hover { background: #f8f9fa; }
.table-container .table tbody tr:last-child td { border-bottom: none; }

.level-badge {
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.level-badge.fatal { background: #ff6b6b; color: white; }
.level-badge.warning { background: #ffd43b; color: #212529; }
.level-badge.notice { background: #69db7c; color: #212529; }
.level-badge.deprecated { background: #da77f2; color: white; }
.level-badge.error { background: #fd7e14; color: white; }
.level-badge.unknown { background: #adb5bd; color: white; }

.message-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-view {
    padding: 2px 10px;
    background: none;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #495057;
}
.btn-view:hover { background: #4dabf7; border-color: #4dabf7; color: white; }

/* ============================================
   PAGINAÇÃO
============================================ */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    font-size: 13px;
}

.pagination-container .pagination { margin: 0; gap: 4px; }
.pagination-container .pagination .page-link {
    padding: 4px 12px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    color: #495057;
    transition: all 0.2s;
}
.pagination-container .pagination .page-link:hover { background: #e9ecef; }
.pagination-container .pagination .active .page-link { background: #4dabf7; border-color: #4dabf7; color: white; }
.pagination-container .pagination .disabled .page-link { opacity: 0.5; pointer-events: none; }

/* ============================================
   ESTADOS VAZIOS
============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}
.empty-state i { font-size: 48px; margin-bottom: 16px; }
.empty-state h5 { margin-top: 16px; }

/* ============================================
   ANIMAÇÕES
============================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.error-row { animation: fadeIn 0.3s ease-out; }

/* ============================================
   SCROLLBAR
============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }

/* ============================================
   RESPONSIVIDADE
============================================ */
@media (max-width: 768px) {
    .top-bar .stats { display: none; }
    .top-bar .user-info .ip { display: none; }
    .filter-form { flex-direction: column; align-items: stretch; }
    .filter-group { flex-wrap: wrap; }
    .filter-group input, .filter-group select { min-width: 100%; }
    .bottom-bar .info { font-size: 11px; gap: 10px; }
    .bottom-bar .info .system-info { display: none; }
    .bottom-bar .actions .btn { font-size: 11px; padding: 3px 10px; }
    .table-container .table thead th,
    .table-container .table tbody td { padding: 6px 10px; font-size: 12px; }
    .message-cell { max-width: 120px; }
    .pagination-container { flex-direction: column; gap: 8px; align-items: center; }
}

@media (max-width: 576px) {
    .top-bar .brand { font-size: 14px; }
    .top-bar .user-info .role { display: none; }
    .table-container .table thead th:nth-child(3),
    .table-container .table tbody td:nth-child(3) { display: none; }
}