/* =====================================================
   FRETE+
===================================================== */

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

body {
    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #08111f;
    color: #1e293b;
}

button,
input,
select,
textarea {
    font-family: inherit;
}


/* =====================================================
   ESTRUTURA
===================================================== */

.app {
    display: flex;
    min-height: 100vh;
}

.main {
    flex: 1;
    min-width: 0;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    width: 240px;
    background: #0f172a;
    color: white;

    display: flex;
    flex-direction: column;

    padding: 20px 14px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 24px;
    font-weight: bold;

    padding: 0 10px 30px;
}

.logo-plus {
    color: #38bdf8;
}

nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.menu-item {
    width: 100%;

    border: 0;
    background: transparent;
    color: #cbd5e1;

    padding: 13px;

    border-radius: 8px;

    display: flex;
    align-items: center;
    gap: 12px;

    font-size: 15px;

    cursor: pointer;
    text-align: left;
}

.menu-item:hover {
    background: #1e293b;
    color: white;
}

.menu-item.active {
    background: #0284c7;
    color: white;
}

.sidebar-bottom {
    margin-top: auto;
}


/* =====================================================
   TOPO
===================================================== */

.topbar {
    min-height: 90px;

    background: #15243a;

    border-bottom:
        1px solid #e5e7eb;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 20px 35px;
}

.topbar h1 {
    font-size: 25px;
    margin-bottom: 5px;
}

.topbar p {
    color: #94a3b8;
    font-size: 14px;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 42px;
    height: 42px;

    border-radius: 50%;

    background: #0284c7;
    color: white;

    display: flex;
    align-items: center;
    justify-content: center;

    font-weight: bold;
}

.user small {
    display: block;

    color: #94a3b8;

    margin-top: 3px;
}


/* =====================================================
   CONTEÚDO
===================================================== */

.content {
    padding: 30px 35px;
}


/* =====================================================
   CARDS
===================================================== */

.cards {
    display: grid;

    grid-template-columns:
        repeat(5, 1fr);

    gap: 20px;

    margin-bottom: 35px;
}

.card {
    background: #15243a;

    border-radius: 12px;

    padding: 22px;

    display: flex;
    align-items: center;

    gap: 15px;

    box-shadow:
        0 2px 8px
        rgba(15,23,42,.05);
}

.card-icon {
    width: 50px;
    height: 50px;

    border-radius: 10px;

    background: rgba(56,189,248,.13);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
}

.card p {
    color: #94a3b8;

    font-size: 13px;

    margin-bottom: 5px;
}

.card h2 {
    font-size: 26px;
}


/* =====================================================
   SEÇÕES
===================================================== */

.section-header {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 15px;

    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 20px;

    margin-bottom: 4px;
}

.section-header p {
    color: #94a3b8;

    font-size: 14px;
}


/* =====================================================
   BOTÕES
===================================================== */

.btn-primary {
    border: 0;

    background: #0284c7;

    color: white;

    padding: 11px 18px;

    border-radius: 8px;

    cursor: pointer;

    font-weight: bold;
}

.btn-primary:hover {
    background: #0369a1;
}

.btn-primary:disabled {
    opacity: .6;
    cursor: wait;
}

.btn-secondary {
    border: 0;

    background: #17263a;

    color: #cbd5e1;

    padding: 11px 18px;

    border-radius: 8px;

    cursor: pointer;

    font-weight: bold;
}

.btn-secondary:hover {
    background: #21344b;
}

.btn-abrir {
    border: none;

    background: rgba(56,189,248,.13);
    color: #0369a1;

    padding: 8px 12px;

    border-radius: 7px;

    cursor: pointer;

    font-weight: 700;
}

.btn-abrir:hover {
    background: #bae6fd;
}


/* =====================================================
   TABELAS
===================================================== */

.table-container {
    background: #15243a;

    border-radius: 12px;

    overflow-x: auto;

    box-shadow:
        0 2px 8px
        rgba(15,23,42,.05);
}

table {
    width: 100%;

    min-width: 700px;

    border-collapse: collapse;
}

th {
    padding: 15px 18px;

    background: #101c2d;

    color: #94a3b8;

    font-size: 13px;

    text-align: left;

    border-bottom:
        1px solid #e5e7eb;
}

td {
    padding: 17px 18px;

    font-size: 14px;

    border-bottom:
        1px solid #f1f5f9;
}

tbody tr:hover {
    background: #101c2d;
}


/* =====================================================
   STATUS
===================================================== */

.status {
    display: inline-block;

    padding: 5px 10px;

    border-radius: 20px;

    font-size: 12px;

    font-weight: bold;

    white-space: nowrap;
}

.status-grande {
    padding: 8px 14px;

    font-size: 13px;
}

.status-aguardando,
.status-aguardando_fechamento {
    background: #17263a;
    color: #cbd5e1;
}

.status-aguardando_carregamento {
    background: rgba(249,115,22,.12);
    color: #c2410c;
}

.status-carregando {
    background: rgba(245,158,11,.14);
    color: #b45309;
}

.status-carregado {
    background: rgba(139,92,246,.13);
    color: #6d28d9;
}

.status-transito,
.status-em_transito {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-entregue,
.entregue {
    background: #dcfce7;
    color: #15803d;
}

.status-problema,
.status-cancelado,
.cancelado {
    background: rgba(239,68,68,.13);
    color: #b91c1c;
}


/* =====================================================
   MODAL
===================================================== */

.modal-overlay {
    position: fixed;

    inset: 0;

    z-index: 1000;

    background:
        rgba(15,23,42,.65);

    display: flex;

    justify-content: center;
    align-items: center;

    padding: 20px;
}

.modal {
    width: 100%;

    max-width: 900px;
    max-height: 92vh;

    background: #15243a;

    border-radius: 14px;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    box-shadow:
        0 20px 50px
        rgba(0,0,0,.25);
}

.modal-menor {
    max-width: 700px;
}

.modal-header {
    padding: 22px 28px;

    border-bottom:
        1px solid #e5e7eb;

    display: flex;

    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    margin-bottom: 5px;
}

.modal-header p {
    color: #94a3b8;

    font-size: 14px;
}

.btn-fechar {
    border: 0;

    background: transparent;

    font-size: 30px;

    color: #94a3b8;

    cursor: pointer;
}

.modal-body {
    padding: 25px 28px;

    overflow-y: auto;
}

.modal-footer {
    padding: 18px 28px;

    display: flex;

    justify-content: flex-end;

    gap: 10px;

    border-top:
        1px solid #e5e7eb;
}


/* =====================================================
   FORMULÁRIOS
===================================================== */

.form-section {
    margin-bottom: 28px;

    padding-bottom: 25px;

    border-bottom:
        1px solid #e5e7eb;
}

.form-section:last-child {
    border-bottom: 0;
}

.form-section h3 {
    font-size: 16px;

    margin-bottom: 18px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 18px;
}

.campo {
    display: flex;

    flex-direction: column;

    gap: 7px;

    margin-bottom: 18px;
}

.campo-grande {
    grid-column: 1 / -1;
}

.campo label {
    color: #cbd5e1;

    font-size: 13px;

    font-weight: 600;
}

.campo input,
.campo select,
.campo textarea {
    width: 100%;

    border:
        1px solid #cbd5e1;

    border-radius: 8px;

    background: #15243a;

    outline: none;

    font-size: 14px;
}

.campo input,
.campo select {
    height: 44px;

    padding: 0 12px;
}

.campo textarea {
    padding: 12px;

    resize: vertical;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
    border-color: #0284c7;

    box-shadow:
        0 0 0 3px
        rgba(2,132,199,.1);
}

.campo input[readonly] {
    background: #17263a;

    color: #cbd5e1;
}


/* =====================================================
   ENTREGAS
===================================================== */

.delivery-title {
    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;
}

.delivery-title p {
    color: #94a3b8;

    font-size: 13px;
}

.btn-add-delivery {
    border: 0;

    background: #0284c7;

    color: white;

    border-radius: 8px;

    padding: 10px 14px;

    cursor: pointer;

    font-weight: bold;
}

.entrega-card {
    padding: 20px;

    margin-bottom: 18px;

    background: #101c2d;

    border:
        1px solid #e2e8f0;

    border-radius: 10px;
}

.entrega-header {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 18px;
}

.entrega-header strong {
    display: block;
}

.entrega-header span {
    display: block;

    margin-top: 4px;

    color: #94a3b8;

    font-size: 12px;
}

.btn-remover-entrega {
    border: 0;

    background: rgba(239,68,68,.13);

    color: #b91c1c;

    padding: 8px 10px;

    border-radius: 7px;

    cursor: pointer;
}


/* =====================================================
   MAPAS
===================================================== */

.rota-frete-acoes {
    display: flex;

    justify-content: flex-end;

    margin-top: 18px;
}

.btn-route {
    border: none;

    background: #0f172a;

    color: white;

    padding: 11px 16px;

    border-radius: 8px;

    cursor: pointer;

    font-weight: 700;
}

.btn-route:hover {
    background: #1e293b;
}

.btn-map {
    border:
        1px solid #bae6fd;

    background: rgba(59,130,246,.11);

    color: #0369a1;

    border-radius: 8px;

    padding: 10px 14px;

    cursor: pointer;

    font-weight: 600;
}

.btn-map:hover {
    background: rgba(56,189,248,.13);
}


/* =====================================================
   AÇÕES
===================================================== */

.acoes {
    display: flex;

    gap: 6px;
}

.btn-acao {
    border: none;

    width: 34px;
    height: 34px;

    border-radius: 7px;

    cursor: pointer;

    font-size: 14px;
}

.btn-acao.editar {
    background: rgba(56,189,248,.13);
}

.btn-acao.editar:hover {
    background: #bae6fd;
}

.btn-acao.inativar {
    background: rgba(239,68,68,.13);
}

.btn-acao.inativar:hover {
    background: rgba(239,68,68,.20);
}

.btn-acao.mapa {
    background: #dcfce7;
}

.btn-acao.mapa:hover {
    background: #bbf7d0;
}


/* =====================================================
   CENTRAL DO FRETE
===================================================== */

.central-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(320px, 1fr);

    gap: 22px;

    align-items: start;
}

.painel {
    background: #15243a;

    border-radius: 14px;

    padding: 24px;

    margin-bottom: 22px;

    box-shadow:
        0 2px 10px
        rgba(15,23,42,.05);
}

.painel-titulo {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    margin-bottom: 22px;
}

.painel-titulo h2 {
    font-size: 18px;

    margin-bottom: 4px;
}

.painel-titulo p {
    color: #94a3b8;

    font-size: 13px;
}

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 14px;
}

.info-item {
    background: #101c2d;

    border:
        1px solid #e2e8f0;

    border-radius: 9px;

    padding: 14px;
}

.info-item span {
    display: block;

    color: #94a3b8;

    font-size: 12px;

    margin-bottom: 5px;
}

.info-item strong {
    font-size: 14px;

    line-height: 1.4;
}

.observacao-box {
    margin-top: 18px;

    padding: 15px;

    border-radius: 9px;

    background: rgba(245,158,11,.11);

    border:
        1px solid #fde68a;
}

.observacao-box p {
    margin-top: 7px;

    font-size: 14px;

    line-height: 1.5;
}

.titulo-com-voltar {
    display: flex;

    align-items: center;

    gap: 12px;
}

.btn-voltar {
    border: none;

    width: 38px;
    height: 38px;

    border-radius: 8px;

    background: #17263a;

    color: #cbd5e1;

    cursor: pointer;

    font-size: 21px;
}

.btn-voltar:hover {
    background: #21344b;
}


/* =====================================================
   ENTREGAS CENTRAL
===================================================== */

.lista-entregas {
    display: flex;

    flex-direction: column;

    gap: 10px;
}

.entrega-central {
    display: flex;

    align-items: center;

    gap: 14px;

    background: #101c2d;

    border:
        1px solid #e2e8f0;

    border-radius: 10px;

    padding: 14px;
}

.entrega-numero {
    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    border-radius: 50%;

    background: #0284c7;

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-weight: bold;
}

.entrega-central-conteudo {
    flex: 1;

    display: flex;

    flex-direction: column;

    gap: 4px;

    min-width: 0;
}

.entrega-central-conteudo strong {
    font-size: 14px;
}

.entrega-central-conteudo span {
    color: #cbd5e1;

    font-size: 13px;

    line-height: 1.4;
}

.entrega-central-conteudo small {
    color: #94a3b8;
}

.btn-mini-map {
    border: none;

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    border-radius: 8px;

    background: #dcfce7;

    cursor: pointer;
}


/* =====================================================
   STATUS CENTRAL
===================================================== */

.status-atual-box {
    padding: 15px;

    margin-bottom: 20px;

    border-radius: 10px;

    background: #101c2d;

    border:
        1px solid #e2e8f0;
}

.status-atual-box > span {
    display: block;

    color: #94a3b8;

    font-size: 12px;

    margin-bottom: 8px;
}

.btn-status {
    width: 100%;

    border: none;

    background: #0284c7;

    color: white;

    border-radius: 8px;

    padding: 12px 15px;

    cursor: pointer;

    font-weight: 700;
}

.btn-status:hover {
    background: #0369a1;
}

.btn-status:disabled {
    opacity: .6;

    cursor: wait;
}


/* =====================================================
   TIMELINE
===================================================== */

.timeline {
    position: relative;

    display: flex;

    flex-direction: column;

    gap: 0;
}

.timeline-item {
    position: relative;

    display: grid;

    grid-template-columns:
        20px 1fr;

    gap: 10px;

    padding-bottom: 22px;
}

.timeline-item:not(:last-child)::before {
    content: "";

    position: absolute;

    left: 7px;

    top: 16px;

    bottom: 0;

    width: 2px;

    background: #21344b;
}

.timeline-dot {
    width: 16px;
    height: 16px;

    border-radius: 50%;

    background: #0284c7;

    margin-top: 2px;

    position: relative;

    z-index: 1;

    border:
        3px solid #e0f2fe;
}

.timeline-conteudo {
    display: flex;

    flex-direction: column;

    gap: 4px;
}

.timeline-conteudo strong {
    font-size: 14px;
}

.timeline-conteudo span,
.timeline-conteudo small {
    color: #94a3b8;

    font-size: 12px;
}

.timeline-conteudo p {
    margin-top: 5px;

    padding: 8px 10px;

    background: #101c2d;

    border-radius: 6px;

    font-size: 13px;

    line-height: 1.4;
}


/* =====================================================
   DIVERSOS
===================================================== */

.empty-box,
.loading-box {
    padding: 25px;

    text-align: center;

    color: #94a3b8;

    background: #15243a;

    border-radius: 10px;

    border:
        1px dashed #cbd5e1;
}

.espacador {
    height: 20px;
}

.pagina-vazia {
    min-height: 450px;

    display: flex;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    text-align: center;

    color: #94a3b8;
}

.pagina-vazia-icone {
    font-size: 60px;

    margin-bottom: 15px;
}

.pagina-vazia h2 {
    color: #1e293b;

    margin-bottom: 8px;
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 1050px) {

    .central-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 950px) {

    .cards {
        grid-template-columns:
            repeat(2, 1fr);
    }

}


/* =====================================================
   CELULAR
===================================================== */

@media (max-width: 650px) {

    .sidebar {
        width: 70px;

        padding: 20px 9px;
    }

    .logo {
        justify-content: center;

        padding:
            0 0 30px;
    }

    .logo span {
        display: none;
    }

    .menu-item {
        justify-content: center;
    }

    .menu-item span {
        display: none;
    }

    .topbar {
        padding:
            18px 20px;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .user div:last-child {
        display: none;
    }

    .content {
        padding: 20px;
    }

    .cards {
        grid-template-columns:
            1fr;
    }

    .form-grid,
    .info-grid {
        grid-template-columns:
            1fr;
    }

    .campo-grande {
        grid-column: auto;
    }

    .modal-overlay {
        padding: 0;
    }

    .modal {
        height: 100vh;

        max-height: 100vh;

        border-radius: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .delivery-title {
        flex-direction: column;

        align-items: flex-start;
    }

    .btn-add-delivery {
        width: 100%;
    }

    .rota-frete-acoes {
        justify-content: stretch;
    }

    .btn-route {
        width: 100%;
    }

    .painel {
        padding: 18px;
    }

    .painel-titulo {
        align-items: flex-start;
    }

}

/* =====================================================
   CARD PÓS-VENDA
===================================================== */

.card-pos-venda {
    cursor: pointer;
    transition: 0.2s ease;
}

.card-pos-venda:hover {
    transform: translateY(-3px);
}

.card-pos-venda.tem-pendencia {
    border: 1px solid #fecaca;
    background: #241820;
}

.card-pos-venda.tem-pendencia .card-icon {
    background: rgba(239,68,68,.12);
}

.card-pos-venda.tem-pendencia h2 {
    color: #dc2626;
}

/* =====================================================
   RESPONSIVIDADE DOS CARDS DO DASHBOARD
===================================================== */

@media (max-width: 1400px) {

    .cards {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {

    .cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {

    .cards {
        grid-template-columns:
            1fr;
    }
}

/* =====================================================
   DASHBOARD - LAYOUT FINAL DOS 5 CARDS
===================================================== */

.cards {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 20px;
}

.card-pos-venda {
    grid-column: auto !important;
    width: auto !important;
}


/* MONITORES MENORES */

@media (max-width: 1500px) {

    .cards {
        grid-template-columns:
            repeat(3, minmax(0, 1fr)) !important;
    }
}


/* TABLET */

@media (max-width: 900px) {

    .cards {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }
}


/* CELULAR */

@media (max-width: 600px) {

    .cards {
        grid-template-columns:
            1fr !important;
    }
}
/* ======================================================
   VÍNCULO MOTORISTA x VEÍCULO
====================================================== */
.vinculos-veiculos-box {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px;
  border: 1px solid #d9dee7;
  border-radius: 10px;
  background: #101c2d;
}

.vinculo-veiculo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.vinculo-veiculo-item:hover { background: #f0f3f7; }
.vinculo-veiculo-item input { width: auto; }
.veiculo-info-fechamento { display:block; margin-top:6px; line-height:1.5; }
