/**
 * Estilos do Tracking System
 * Pasta: /assets/css/style.css
 */

:root {
    --primary-color: #0d6efd;
    --sidebar-width: 0px;
    --header-height: 56px;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f0f2f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Login */
.login-page {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 50%, #084298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    border: none;
    border-radius: 1rem;
}

.login-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #0d6efd, #0a58ca);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}

/* Layout principal */
.main-content {
    margin-top: var(--header-height);
    flex: 1;
    padding-bottom: 2rem;
}

.navbar-brand {
    font-size: 1.1rem;
}

.navbar-nav .nav-link {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    white-space: nowrap;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.navbar-nav .dropdown-menu .dropdown-item.active {
    background-color: #0d6efd;
    color: #fff;
}

.navbar-nav .dropdown-menu .dropdown-item i {
    width: 1.25rem;
}

/* Pontos de atenção no dashboard */
.atencao-item {
    transition: background-color 0.2s;
}

.atencao-item:hover {
    background-color: rgba(255, 193, 7, 0.06);
}

/* Cards do dashboard */
.stat-card {
    border: none;
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabelas */
.table-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.table thead th {
    background-color: #f8f9fa;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.table tbody td {
    vertical-align: middle;
    font-size: 0.9rem;
}

.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.6rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem;
    top: 0.3rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.timeline-item.entregue::before {
    background: #198754;
    box-shadow: 0 0 0 2px #198754;
}

/* Filtros */
.filter-bar {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
}

/* XML viewer */
.xml-viewer {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 0.5rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Footer */
.footer {
    margin-top: auto;
}

/* Mobile - aparência de app */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: #0a58ca;
        padding: 0.5rem;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
    }

    .navbar-nav .nav-link {
        padding: 0.6rem 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .stat-card .stat-value {
        font-size: 1.4rem;
    }

    .table-responsive {
        font-size: 0.85rem;
    }

    .btn-group-sm .btn {
        padding: 0.2rem 0.4rem;
    }
}

/* Gráficos */
.chart-container {
    position: relative;
    height: 300px;
}

/* Badges customizados */
.badge-sla-ok { background-color: #198754; }
.badge-sla-warn { background-color: #ffc107; color: #000; }
.badge-sla-bad { background-color: #dc3545; }

/* Ações da tabela */
.acoes-btns {
    white-space: nowrap;
    width: 1%;
}

.acoes-btns .btn {
    padding: 0.25rem 0.45rem;
    margin: 0 1px;
}

/* Células empilhadas (menos colunas, mais espaço) */
.cell-stack {
    line-height: 1.25;
    min-width: 140px;
}

.cell-stack .cell-primary {
    font-weight: 600;
    color: #212529;
}

.cell-stack .cell-secondary {
    display: block;
    font-size: 0.78rem;
    color: #6c757d;
    margin-top: 0.15rem;
}

/* Ordenação */
th.sortable {
    cursor: pointer;
    user-select: none;
}

th.sortable .sort-icon {
    font-size: 0.75rem;
    opacity: 0.35;
    margin-left: 0.2rem;
}

th.sortable.sort-active .sort-icon,
th.sortable:hover .sort-icon {
    opacity: 1;
    color: #0d6efd;
}

.paginacao-bar {
    padding: 0.65rem 1rem;
}

.acoes-massa-bar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.55rem 0.85rem;
}

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

.page-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.page-header .breadcrumb {
    margin-bottom: 0;
    font-size: 0.85rem;
}

/* Form cards */
.form-card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
