/* =========================================================
   SMARTTRACKING - STYLE.CSS LIMPO E PADRONIZADO
   Tema verde + fundo institucional + layout responsivo
========================================================= */

* {
    box-sizing: border-box;
}

:root {
    --green-50: #f0fdf4;
    --green-100: #dcfce7;
    --green-200: #bbf7d0;
    --green-300: #86efac;
    --green-400: #4ade80;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --green-700: #15803d;
    --green-800: #166534;
    --green-900: #14532d;

    --sidebar-bg-1: #0f3d26;
    --sidebar-bg-2: #14532d;

    --text-main: #1f2937;
    --text-dark: #0f172a;
    --text-soft: #64748b;

    --danger: #dc2626;
    --danger-dark: #b91c1c;
    --warning: #f59e0b;

    --bg-main: #eef6f0;
    --white: #ffffff;

    --shadow-soft: 0 8px 28px rgba(15, 23, 42, 0.10);
    --shadow-medium: 0 14px 35px rgba(15, 23, 42, 0.14);
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);
    background: var(--bg-main);
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

img {
    max-width: 100%;
}

/* =========================================================
   BOTÕES
========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 0;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--green-600);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--green-700);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.btn-danger {
    background: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger-dark);
}

.btn-small {
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 12px;
}

.btn-disabled {
    background: #e5e7eb !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* =========================================================
   ALERTAS / BADGES
========================================================= */

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 700;
}

.alert-error {
    background: rgba(254, 226, 226, 0.86);
    color: #991b1b;
    border: 1px solid rgba(248, 113, 113, 0.35);
}

.alert-success {
    background: rgba(220, 252, 231, 0.82);
    color: #166534;
    border: 1px solid rgba(34, 197, 94, 0.30);
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.badge.success,
.badge-perfil,
.status-ativo {
    background: #dcfce7;
    color: #166534;
}

.badge.warning,
.status-manutencao {
    background: #fef3c7;
    color: #92400e;
}

.status-inativo {
    background: #e5e7eb;
    color: #374151;
}

.status-sinistro {
    background: #fee2e2;
    color: #991b1b;
}

/* =========================================================
   LOGIN / TELA INICIAL
========================================================= */

.login-page {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(180deg, #0b1f17 0%, #102a1e 100%);
}

.login-layout-v2 {
    min-height: 100vh;
    padding: 24px;
}

.login-stage {
    max-width: 1380px;
    margin: 0 auto;
}

.login-stage-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.75fr;
    min-height: 700px;
    overflow: hidden;
    border-radius: 42px;
    background: #0f172a;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
}

.login-left-panel {
    position: relative;
    min-height: 700px;
    overflow: hidden;
    background:
        linear-gradient(rgba(5, 36, 22, 0.52), rgba(5, 36, 22, 0.62)),
        url('../img/bg-smarttracking.jpg') center center / cover no-repeat;
}

.login-left-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(74, 222, 128, 0.20), transparent 28%),
        radial-gradient(circle at 80% 20%, rgba(34, 197, 94, 0.12), transparent 25%),
        radial-gradient(circle at 70% 75%, rgba(74, 222, 128, 0.12), transparent 20%);
    pointer-events: none;
}

.login-left-content {
    position: relative;
    z-index: 2;
    padding: 34px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-brand-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.login-brand-logo {
    width: 180px;
    height: auto;
    display: block;
}

.login-hero-copy {
    max-width: 620px;
    color: #ffffff;
    margin-top: 40px;
}

.login-hero-copy h1 {
    margin: 0 0 20px;
    font-size: 48px;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-hero-copy h1 span {
    color: var(--green-400);
}

.login-hero-copy p {
    margin: 0;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255,255,255,0.88);
    max-width: 560px;
}

.login-hero-line {
    width: 56px;
    height: 3px;
    background: var(--green-500);
    border-radius: 999px;
    margin: 26px 0 28px;
}

.login-feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.login-feature-item {
    color: #ffffff;
}

.login-feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(74, 222, 128, 0.45);
    background: rgba(15, 61, 38, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    margin-bottom: 10px;
    color: var(--green-300);
}

.login-feature-item strong {
    display: block;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 6px;
}

.login-feature-item span {
    display: block;
    font-size: 12px;
    line-height: 1.55;
    color: rgba(255,255,255,0.76);
}

.login-right-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(245, 247, 250, 0.96), rgba(241, 245, 249, 0.98));
    padding: 34px;
}

.login-card-v2 {
    width: 100%;
    max-width: 410px;
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 28px 24px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid #e5e7eb;
}

.login-card-logo-area {
    text-align: center;
    margin-bottom: 12px;
}

.login-card-logo {
    width: 210px;
    max-width: 100%;
    height: auto;
}

.login-card-head {
    text-align: center;
    margin-bottom: 22px;
}

.login-card-head h2 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--green-600);
    font-weight: 800;
}

.login-card-head p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.login-form-v2 {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-form-v2 .form-group label {
    font-size: 13px;
}

.btn-login-v2 {
    width: 100%;
    height: 46px;
    border-radius: 8px;
    margin-top: 6px;
    font-size: 14px;
}

.login-card-divider {
    position: relative;
    text-align: center;
    margin: 18px 0 14px;
}

.login-card-divider::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: #e5e7eb;
}

.login-card-divider span {
    position: relative;
    z-index: 2;
    background: #ffffff;
    padding: 0 10px;
    font-size: 12px;
    color: #94a3b8;
}

.login-card-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 12px;
}

/* =========================================================
   LAYOUT INTERNO
========================================================= */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background: var(--bg-main);
}

.sidebar {
    width: 270px;
    min-width: 270px;
    max-width: 270px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    background: linear-gradient(180deg, var(--sidebar-bg-1) 0%, var(--sidebar-bg-2) 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 24px rgba(0, 0, 0, 0.16);
    overflow: hidden;
}

.sidebar-brand {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 112px;
}

.sidebar-logo {
    width: 205px;
    max-width: 205px;
    height: auto;
    display: block;
    object-fit: contain;
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.sidebar-nav a {
    display: block;
    color: #ecfdf5;
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 700;
    transition: 0.2s ease;
}

.sidebar-nav a:hover {
    background: rgba(34, 197, 94, 0.24);
    color: #ffffff;
    transform: translateX(2px);
}

.nav-section {
    color: var(--green-200);
    text-transform: uppercase;
    font-size: 11px;
    font-weight: 900;
    margin: 18px 0 8px;
    letter-spacing: 0.10em;
}

.logout-link {
    background: rgba(220, 38, 38, 0.18);
    color: #fecaca !important;
}

.sidebar-user {
    padding: 16px 22px;
    border-top: 1px solid rgba(255,255,255,0.10);
}

.sidebar-user small,
.sidebar-user span {
    display: block;
    color: var(--green-200);
    font-size: 12px;
}

.sidebar-user strong {
    display: block;
    margin: 5px 0;
    color: #ffffff;
    font-size: 15px;
}

.main-content {
    margin-left: 270px;
    width: calc(100% - 270px);
    min-height: 100vh;
    padding: 26px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: transparent;
}

/* Fundo institucional interno com imagem mais visível */
.main-content::before {
    content: "";
    position: fixed;
    top: 0;
    left: 270px;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(
            rgba(230, 238, 232, 0.45),
            rgba(230, 238, 232, 0.54)
        ),
        url('../img/bg-smarttracking.jpg') center center / cover no-repeat;
    z-index: -2;
}

.main-content::after {
    content: "";
    position: fixed;
    top: 0;
    left: 270px;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at top right, rgba(22, 163, 74, 0.13), transparent 28%),
        radial-gradient(circle at bottom left, rgba(15, 61, 38, 0.10), transparent 30%);
    z-index: -1;
}

.main-content > * {
    position: relative;
    z-index: 1;
}

.mobile-menu-btn {
    display: none;
    background: var(--sidebar-bg-1);
    color: #ffffff;
    border: 0;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 800;
    margin-bottom: 16px;
    cursor: pointer;
}

/* =========================================================
   CABEÇALHOS, PAINÉIS E ESTRUTURA DE PÁGINA
========================================================= */

.page-header,
.panel {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin-bottom: 22px;
}

.page-header h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.1;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.page-header p {
    margin: 0 0 16px;
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.5;
}

.page-header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.table-header h2 {
    margin: 0;
    font-size: 26px;
    color: var(--text-dark);
}

.table-header span {
    color: var(--text-dark);
    font-weight: 700;
}

/* =========================================================
   TABELAS
========================================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: auto;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 6px;
    background: transparent;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    font-size: 15px;
    border: none;
    color: var(--text-dark);
}

.table th {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    font-weight: 900;
}

.table td {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.32);
}

.table tbody tr td:first-child,
.table thead tr th:first-child {
    border-radius: 12px 0 0 12px;
}

.table tbody tr td:last-child,
.table thead tr th:last-child {
    border-radius: 0 12px 12px 0;
}

.text-right {
    text-align: right !important;
}

.actions-cell {
    white-space: nowrap;
}

.empty-state {
    text-align: center;
    padding: 30px !important;
    color: var(--text-soft);
    font-weight: 700;
}

/* =========================================================
   FORMULÁRIOS
========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    max-width: 980px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-group label {
    font-weight: 800;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.38);
    border-radius: 12px;
    padding: 13px;
    font-size: 15px;
    outline: none;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
    background: rgba(255, 255, 255, 0.78);
}

.form-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

/* =========================================================
   CARDS GENÉRICOS / LISTAS
========================================================= */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
    margin-bottom: 24px;
}

.card {
    background: rgba(255, 255, 255, 0.26);
    border-radius: 18px;
    padding: 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 4px solid var(--green-600);
}

.card-warning {
    border-bottom-color: var(--warning);
}

.card-danger {
    border-bottom-color: var(--danger);
}

.card span {
    color: var(--text-soft);
    font-weight: 700;
}

.card strong {
    display: block;
    font-size: 34px;
    margin: 10px 0;
    color: var(--text-dark);
}

.card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

/* =========================================================
   DASHBOARD
========================================================= */

.dashboard-hero {
    background:
        linear-gradient(135deg, rgba(15, 61, 38, 0.96), rgba(20, 83, 45, 0.92)),
        radial-gradient(circle at top right, rgba(74, 222, 128, 0.35), transparent 32%);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 22px;
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 61, 38, 0.18);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.dashboard-hero::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -70px;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: rgba(134, 239, 172, 0.13);
}

.dashboard-eyebrow {
    display: inline-block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--green-200);
    margin-bottom: 10px;
}

.dashboard-hero h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.1;
    color: #ffffff;
}

.dashboard-hero p {
    max-width: 760px;
    margin: 0;
    color: rgba(255,255,255,0.88);
    line-height: 1.6;
}

.dashboard-hero-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.dashboard-kpi-card {
    background: rgba(255, 255, 255, 0.34);
    border-radius: 20px;
    padding: 18px;
    box-shadow: var(--shadow-soft);
    display: flex;
    gap: 14px;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-bottom: 4px solid var(--green-600);
    min-height: 112px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dashboard-kpi-card.warning {
    border-bottom-color: var(--warning);
}

.dashboard-kpi-card.danger {
    border-bottom-color: var(--danger);
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.kpi-icon.green {
    background: #dcfce7;
    color: #166534;
}

.kpi-icon.dark {
    background: #d1fae5;
    color: #0f3d26;
}

.kpi-icon.blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.kpi-icon.warning {
    background: #fef3c7;
    color: #92400e;
}

.kpi-icon.danger {
    background: #fee2e2;
    color: #991b1b;
}

.dashboard-kpi-card span {
    display: block;
    font-size: 12px;
    color: var(--text-soft);
    font-weight: 800;
}

.dashboard-kpi-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.1;
    color: var(--text-dark);
    margin: 4px 0;
}

.dashboard-kpi-card small {
    color: var(--text-soft);
    font-size: 12px;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-tables-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.dashboard-panel {
    background: rgba(255, 255, 255, 0.24);
    border-radius: 22px;
    padding: 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.dashboard-panel-header h2 {
    margin: 0 0 6px;
    color: var(--text-dark);
    font-size: 20px;
}

.dashboard-panel-header p {
    margin: 0;
    color: var(--text-soft);
    font-size: 14px;
}

.operation-map-card {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 20px;
    align-items: center;
}

.map-radar {
    min-height: 330px;
    border-radius: 22px;
    background:
        radial-gradient(circle at center, rgba(34, 197, 94, 0.16), transparent 20%),
        linear-gradient(135deg, #062d1c, #14532d);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(22, 163, 74, 0.28);
}

.map-radar::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(134, 239, 172, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(134, 239, 172, 0.08) 1px, transparent 1px);
    background-size: 34px 34px;
}

.radar-circle {
    position: absolute;
    border: 1px solid rgba(134, 239, 172, 0.35);
    border-radius: 999px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.circle-1 {
    width: 90px;
    height: 90px;
}

.circle-2 {
    width: 170px;
    height: 170px;
}

.circle-3 {
    width: 250px;
    height: 250px;
}

.radar-line {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 180px;
    height: 2px;
    background: linear-gradient(90deg, #4ade80, transparent);
    transform-origin: left center;
    opacity: 0.8;
}

.line-1 {
    transform: rotate(28deg);
}

.line-2 {
    transform: rotate(145deg);
}

.radar-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 8px rgba(74, 222, 128, 0.15);
}

.dot-1 {
    left: 22%;
    top: 30%;
}

.dot-2 {
    right: 24%;
    top: 35%;
}

.dot-3 {
    left: 58%;
    bottom: 24%;
}

.radar-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 74px;
    height: 74px;
    border-radius: 22px;
    transform: translate(-50%, -50%);
    background: #ffffff;
    color: #166534;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
}

.radar-center strong {
    font-size: 22px;
}

.radar-center small {
    font-size: 11px;
    color: var(--green-600);
    font-weight: 800;
}

.operation-status-list,
.dashboard-flow-list,
.dashboard-list {
    display: grid;
    gap: 12px;
}

.operation-status-list div,
.dashboard-flow-list div,
.dashboard-list-item {
    background: rgba(255, 255, 255, 0.24);
    border-radius: 16px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.operation-status-list span,
.dashboard-list-item span {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 800;
}

.operation-status-list strong {
    display: block;
    font-size: 28px;
    color: #166534;
    margin-top: 4px;
}

.dashboard-flow-list div {
    display: grid;
    grid-template-columns: 38px 1fr;
    column-gap: 12px;
}

.dashboard-flow-list span {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #dcfce7;
    color: #166534;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    grid-row: span 2;
}

.dashboard-flow-list strong,
.dashboard-list-item strong {
    display: block;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.dashboard-flow-list p {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
}

.dashboard-list-item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.dashboard-list-item small {
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 999px;
    background: #e5e7eb;
    color: #374151;
    font-weight: 800;
    font-size: 11px;
}

.dashboard-empty {
    padding: 22px;
    text-align: center;
    color: var(--text-soft);
    background: rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    border: 1px dashed rgba(203, 213, 225, 0.70);
}

/* =========================================================
   NÍVEIS / PRIORIDADES
========================================================= */

.level-baixo,
.priority-baixa {
    background: #dcfce7 !important;
    color: #166534 !important;
}

.level-medio,
.priority-media {
    background: #fef3c7 !important;
    color: #92400e !important;
}

.level-alto,
.priority-alta {
    background: #ffedd5 !important;
    color: #9a3412 !important;
}

.level-critico,
.priority-critica {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 1300px) {
    .cards-grid,
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-main-grid,
    .dashboard-tables-grid {
        grid-template-columns: 1fr;
    }

    .login-stage-grid {
        grid-template-columns: 1fr;
    }

    .login-left-panel {
        min-height: auto;
    }

    .login-feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 760px) {
    .login-layout-v2 {
        padding: 14px;
    }

    .login-stage-grid {
        border-radius: 28px;
    }

    .login-left-content {
        padding: 24px 20px;
    }

    .login-right-panel {
        padding: 20px;
    }

    .login-card-v2 {
        padding: 24px 18px 20px;
    }

    .login-hero-copy h1 {
        font-size: 32px;
    }

    .login-hero-copy p {
        font-size: 14px;
    }

    .login-feature-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .app-layout {
        display: block;
    }

    .sidebar {
        width: 280px;
        min-width: 280px;
        max-width: 280px;
        transform: translateX(-100%);
        transition: 0.25s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 18px;
    }

    .main-content::before,
    .main-content::after {
        left: 0;
    }

    .mobile-menu-btn {
        display: inline-flex;
    }

    .page-header-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    .cards-grid,
    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 24px;
    }

    .dashboard-hero h1 {
        font-size: 28px;
    }

    .dashboard-hero-actions {
        width: 100%;
        flex-direction: column;
    }

    .dashboard-hero-actions .btn {
        width: 100%;
    }

    .operation-map-card {
        grid-template-columns: 1fr;
    }

    .map-radar {
        min-height: 260px;
    }

    .dashboard-panel-header {
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn {
        width: 100%;
    }

    .table {
        min-width: 760px;
    }
}
/* =========================================================
   RASTREADORES
========================================================= */

.status-rastreador-ativo {
    background: #dcfce7;
    color: #166534;
}

.status-rastreador-inativo {
    background: #e5e7eb;
    color: #374151;
}

.status-rastreador-sem_sinal {
    background: #fee2e2;
    color: #991b1b;
}
/* =========================================================
   MAPA OPERACIONAL / HISTÓRICO DE ROTA
========================================================= */

.map-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 18px;
}

.map-kpi-card {
    background: rgba(255, 255, 255, 0.28);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255,255,255,0.30);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 4px solid var(--green-600);
}

.map-kpi-card.danger {
    border-bottom-color: var(--danger);
}

.map-kpi-card span {
    display: block;
    color: var(--text-dark);
    font-weight: 800;
    font-size: 13px;
}

.map-kpi-card strong {
    display: block;
    color: var(--text-dark);
    font-size: 32px;
    margin-top: 6px;
}

.map-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 18px;
    align-items: stretch;
}

.route-map-layout {
    margin-top: 18px;
}

.map-box {
    background: rgba(255,255,255,0.20);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 22px;
    padding: 10px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    min-height: 640px;
}

#mapa-operacional,
#mapa-historico {
    width: 100%;
    height: 620px;
    border-radius: 18px;
    overflow: hidden;
}

.map-side-panel {
    background: rgba(255,255,255,0.24);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 22px;
    padding: 18px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    max-height: 640px;
    overflow-y: auto;
}

.map-side-header h2 {
    margin: 0 0 6px;
    color: var(--text-dark);
    font-size: 22px;
}

.map-side-header p {
    margin: 0 0 16px;
    color: var(--text-soft);
    font-size: 14px;
}

.map-position-list {
    display: grid;
    gap: 10px;
}

.map-position-item {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.32);
    background: rgba(255,255,255,0.30);
    border-radius: 16px;
    padding: 13px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: 0.2s ease;
}

.map-position-item:hover {
    background: rgba(255,255,255,0.46);
    transform: translateY(-1px);
}

.map-position-item strong {
    display: block;
    color: var(--text-dark);
    font-size: 14px;
    margin-bottom: 4px;
}

.map-position-item span,
.map-position-item small {
    display: block;
    color: var(--text-soft);
    font-size: 12px;
    line-height: 1.45;
}

.custom-tracking-marker {
    background: transparent !important;
    border: none !important;
}

.custom-tracking-marker div {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    border: 3px solid #ffffff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.30);
}

.map-popup {
    display: grid;
    gap: 4px;
    min-width: 190px;
}

.map-popup strong {
    color: #0f172a;
    font-size: 15px;
}

.map-popup span {
    display: block;
    color: #475569;
    font-size: 12px;
}

.map-popup-link {
    display: inline-flex;
    justify-content: center;
    margin-top: 8px;
    background: #16a34a;
    color: #ffffff !important;
    padding: 7px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 12px;
}

.route-filter-form {
    display: grid;
    grid-template-columns: minmax(260px, 420px) auto;
    gap: 12px;
    align-items: end;
}

@media (max-width: 1100px) {
    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-side-panel {
        max-height: none;
    }
}

@media (max-width: 760px) {
    .map-kpi-grid {
        grid-template-columns: 1fr;
    }

    .map-box {
        min-height: 460px;
    }

    #mapa-operacional,
    #mapa-historico {
        height: 440px;
    }

    .route-filter-form {
        grid-template-columns: 1fr;
    }
}
/* Rastreador cadastrado, mas sem posição ainda */
.map-position-waiting {
    opacity: 0.75;
    border-style: dashed !important;
}

.map-position-waiting strong {
    color: #475569 !important;
}

.map-position-waiting span {
    color: #92400e !important;
}