/* Variáveis Globais SAP Style */
:root {
    --sap-primary: #0054a6; /* Azul Marinho SAP */
    --sap-secondary: #556b82;
    --sap-success: #2b7d2b;
    --sap-warning: #e9730c;
    --sap-danger: #bb0000;
    --sap-bg-light: #f7f9fc;
    --sap-border: #d8dee6;
    --sap-text: #32363a;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--sap-bg-light);
    color: var(--sap-text);
    font-family: var(--font-main);
    margin-bottom: 60px; /* Espaço para a legenda fixa */
}

/* Tipografia séria */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    color: #1d2d3e;
}

.small, small {
    font-size: 0.85rem;
}

.container-fluid {
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Navbar SAP Style */
.navbar {
    background-color: #1d2d3e !important; /* Azul Profundo SAP */
    border-bottom: 2px solid #0054a6;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 800;
    color: #fff !important;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-link {
    color: #cbd5e0 !important;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.5rem 1.25rem !important;
    text-transform: uppercase;
}

.nav-link:hover, .nav-link.active {
    color: #fff !important;
}

/* User Profile Badge */
.user-badge {
    background: rgba(255,255,255,0.1);
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-right: 15px;
}

.btn-logout {
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 5px 15px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: #fff;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* SAP Cards & Containers */
.card {
    background: #fff;
    border: 1px solid var(--sap-border);
    border-radius: 4px; /* Cantos menos arredondados SAP */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid var(--sap-border);
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    color: var(--sap-text);
}

/* SAP Legend Footer */
.status-legend-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-top: 1px solid var(--sap-border);
    padding: 10px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 25px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #556b82;
    text-transform: uppercase;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    margin-right: 8px;
}

/* SAP Tiles for Dashboard */
.tile-sap {
    background: #fff;
    border: 1px solid var(--sap-border);
    border-radius: 4px;
    height: 140px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.tile-sap:hover {
    border-color: var(--sap-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.tile-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: #6a7683;
    text-transform: uppercase;
}

.tile-body {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.tile-number {
    font-size: 2rem;
    font-weight: 800;
    color: #32363a;
}

.tile-unit {
    font-size: 0.8rem;
    color: #6a7683;
    margin-left: 5px;
}

.tile-footer {
    font-size: 0.7rem;
    color: #6a7683;
    font-weight: 600;
    text-align: right;
}

/* Bordas coloridas SAP */
.blue-border { border-left: 4px solid var(--sap-primary); }
.yellow-border { border-left: 4px solid var(--sap-warning); }
.green-border { border-left: 4px solid var(--sap-success); }

/* Tables SAP Style */
.table {
    font-size: 0.85rem;
}

.table thead th {
    background-color: #f2f5f8;
    color: #556b82;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    border-bottom: 2px solid var(--sap-border);
    padding: 12px 8px;
}

/* ─── Sortable column headers ─── */
.sort-header {
    color: #556b82;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s ease;
}

.sort-header i {
    font-size: 0.65rem;
    opacity: 0.35;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.sort-header:hover {
    color: var(--sap-primary);
}

.sort-header:hover i {
    opacity: 0.8;
}

.sort-header.sort-active {
    color: var(--sap-primary);
}

.sort-header.sort-active i {
    opacity: 1;
    color: var(--sap-primary);
}

.table tbody td {
    padding: 12px 8px;
    vertical-align: middle;
    border-bottom: 1px solid var(--sap-border);
}

/* Badge Styles */
.badge {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 5px 10px;
    border-radius: 2px;
}

/* ─── Border color variants (SAP tiles) ─── */
.grey-border { border-left: 4px solid var(--sap-secondary); }
.red-border   { border-left: 4px solid var(--sap-danger); }

/* ─── Typography utilities ─── */
.x-small-sap-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #6c757d;
    letter-spacing: 0.3px;
    display: block;
    margin-bottom: 4px;
}

.x-small { font-size: 0.7rem; }
.text-dim { color: #6a7683; }
.text-sap-blue { color: var(--sap-primary) !important; }

/* ─── Dot indicator ─── */
.dot-sap {
    width: 8px;
    height: 8px;
    background: var(--sap-primary);
    border-radius: 50%;
    opacity: 0.6;
    flex-shrink: 0;
}

/* ─── Soft background fills ─── */
.bg-primary-soft  { background-color: rgba(0, 84, 166, 0.08); }
.bg-success-soft  { background-color: rgba(43, 125, 43, 0.08); }
.bg-danger-soft   { background-color: rgba(187, 0, 0, 0.08); }
.bg-dark-soft     { background-color: rgba(29, 45, 62, 0.08); }
.bg-warning-soft  { background-color: rgba(233, 115, 12, 0.08); }

/* ─── Utility buttons ─── */
.btn-white { background: #fff; color: #333; border-color: #dee2e6; }
.btn-white:hover { background: #f8f9fa; color: #333; }

/* ─── Avatar small ─── */
.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

/* ─── Estilos de filtro (apenas em card-body bg-light) ─── */
.card-body.bg-light .form-select,
.card-body.bg-light .form-control {
    background-color: #fff;
    border: 2px solid #d8dee6;
    font-weight: 600;
    color: #32363a;
    transition: all 0.25s ease;
}

.card-body.bg-light .form-select:hover,
.card-body.bg-light .form-control:hover {
    border-color: #0054a6;
    background-color: #f8fbff;
    box-shadow: 0 2px 6px rgba(0, 84, 166, 0.1);
}

.card-body.bg-light .form-select:focus,
.card-body.bg-light .form-control:focus {
    background-color: #1d2d3e !important;
    color: #fff !important;
    border-color: #0054a6;
    box-shadow: 0 0 0 4px rgba(0, 84, 166, 0.2);
    font-weight: 700;
}

.card-body.bg-light .form-select:focus option {
    background-color: #fff;
    color: #32363a;
}

/* Estilo para opções selecionadas no dropdown */
.card-body.bg-light .form-select option:checked {
    background-color: #0054a6;
    color: #fff;
    font-weight: 700;
}

/* ─── Nav tabs - Active state enhancement ─── */
.nav-tabs .nav-link {
    border: 1px solid transparent;
    border-radius: 4px 4px 0 0;
    color: #6c757d;
    background-color: #f8f9fa;
    font-weight: 600;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    border-color: #d8dee6 #d8dee6 #fff;
    background-color: #e9ecef;
    color: #0054a6;
    font-weight: 700;
}

.nav-tabs .nav-link.active {
    background-color: #1d2d3e !important;
    color: #fff !important;
    border-color: #1d2d3e #1d2d3e #fff;
    font-weight: 700;
}

.nav-tabs .nav-link.active .badge {
    background-color: #0054a6 !important;
    color: #fff !important;
    font-weight: 800;
}

.nav-tabs .nav-link .badge {
    transition: all 0.2s ease;
}

/* ─── Form icons ─── */
.sap-icon-circle {
    width: 44px;
    height: 44px;
    background: #e8f0fe;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

/* ─── Misc ─── */
.border-dashed { border-style: dashed !important; }
.shadow-xs { box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.btn-xs { padding: 2px 6px; font-size: 0.7rem; }

/* ─── Print (oculta navegação e filtros) ─── */
@media print {
    .navbar, .status-legend-footer, nav.nav, .card:has(form), .btn-group { display: none !important; }
    .table-responsive { overflow: visible !important; }
}