/* arquivo: /cotacoes/assets/cotacoes.css
   Complementos das telas de cotação da loja (mesma linguagem visual do global.css). */

.cot-empresa {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: #eef3fb;
    border: 1px solid #d5e1f5;
    color: #1e3c72;
    border-radius: 10px;
    padding: 10px 14px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.cot-card {
    background: white;
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
}

.cot-card > h3 {
    margin: 0 0 15px;
    font-size: 1.08rem;
    color: #2a5298;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.cot-card > h3 .cot-acoes {
    margin-left: auto;
}

.cot-acoes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.cot-ajuda {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
    margin: 0 0 12px;
}

/* ---- Campos ---- */
.cot-grade {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

.cot-campo label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.cot-campo input,
.cot-campo select,
.cot-campo textarea,
.cot-tabela input,
.cot-tabela select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 11px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.93rem;
    font-family: inherit;
    background: white;
}

.cot-campo textarea {
    min-height: 80px;
    resize: vertical;
}

.cot-campo input:focus,
.cot-campo select:focus,
.cot-campo textarea:focus,
.cot-tabela input:focus {
    outline: none;
    border-color: #2a5298;
}

.cot-campo small {
    display: block;
    color: #8a929b;
    font-size: 0.78rem;
    margin-top: 4px;
}

.cot-campo input:disabled,
.cot-campo select:disabled,
.cot-campo textarea:disabled,
.cot-tabela input:disabled {
    background: #f8f9fa;
    color: #6c757d;
}

input.invalido,
select.invalido,
textarea.invalido {
    border-color: #dc3545 !important;
    background: #fff6f6 !important;
}

/* ---- Botões pequenos ---- */
.cot-btn {
    border: 1px solid #dee2e6;
    background: white;
    color: #495057;
    border-radius: 7px;
    padding: 7px 12px;
    font-size: 0.84rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.cot-btn:hover {
    border-color: #2a5298;
    color: #2a5298;
}

.cot-btn.primario {
    background: #2a5298;
    border-color: #2a5298;
    color: white;
}

.cot-btn.primario:hover {
    background: #1e3c72;
    color: white;
}

.cot-btn.sucesso {
    background: #198754;
    border-color: #198754;
    color: white;
}

.cot-btn.whats {
    background: #25d366;
    border-color: #25d366;
    color: white;
}

.cot-btn.perigo:hover {
    border-color: #dc3545;
    color: #dc3545;
}

.cot-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.cot-icone-btn {
    border: none;
    background: none;
    color: #adb5bd;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.cot-icone-btn:hover {
    color: #dc3545;
    background: #fdecec;
}

/* ---- Selos ---- */
.cot-selo {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.76rem;
    font-weight: 600;
    white-space: nowrap;
}

.cot-selo.verde { background: #e3f6ea; color: #14622f; }
.cot-selo.azul { background: #eef3fb; color: #1e3c72; }
.cot-selo.laranja { background: #fff3cd; color: #7a5200; }
.cot-selo.vermelho { background: #fdecec; color: #9b1c1c; }
.cot-selo.cinza { background: #f1f3f5; color: #6c757d; }

/* ---- Abas ---- */
.cot-abas {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 20px;
    border-bottom: 2px solid #e9ecef;
}

.cot-aba {
    border: none;
    background: none;
    padding: 11px 16px;
    font-size: 0.93rem;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    font-family: inherit;
}

.cot-aba.ativa {
    color: #2a5298;
    border-bottom-color: #2a5298;
    font-weight: 600;
}

.cot-aba .contador {
    background: #e9ecef;
    color: #495057;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 0.74rem;
}

.cot-aba.ativa .contador {
    background: #2a5298;
    color: white;
}

/* ---- Indicadores ---- */
.cot-indicadores {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.cot-indicador {
    background: white;
    border-radius: 10px;
    padding: 14px 16px;
    border-left: 4px solid #2a5298;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cot-indicador .rot {
    font-size: 0.76rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.cot-indicador .val {
    font-size: 1.45rem;
    font-weight: 700;
    color: #212529;
    margin-top: 3px;
    font-variant-numeric: tabular-nums;
}

.cot-indicador .sub {
    font-size: 0.78rem;
    color: #8a929b;
}

.cot-indicador.verde { border-left-color: #198754; }
.cot-indicador.laranja { border-left-color: #fd7e14; }
.cot-indicador.vermelho { border-left-color: #dc3545; }

/* ---- Tabelas ---- */
.cot-tabela-wrap {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 10px;
}

.cot-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cot-tabela th {
    background: #f8f9fa;
    color: #495057;
    font-weight: 600;
    text-align: left;
    padding: 10px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border-bottom: 2px solid #e9ecef;
}

.cot-tabela td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f3f5;
    vertical-align: middle;
}

.cot-tabela tr:last-child td {
    border-bottom: none;
}

.cot-tabela tfoot td {
    background: #f8f9fa;
    font-weight: 700;
    border-top: 2px solid #e9ecef;
}

.cot-tabela .num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.cot-tabela input.num-in {
    text-align: right;
    min-width: 90px;
}

.cot-tabela small.sub {
    display: block;
    color: #8a929b;
    font-size: 0.78rem;
}

/* ---- Cartões da lista ---- */
.cot-lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.cot-item {
    background: white;
    border-radius: 12px;
    padding: 18px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 4px solid #2a5298;
}

.cot-item.expirada { border-top-color: #fd7e14; }
.cot-item.fechada { border-top-color: #6c757d; }
.cot-item.cancelada { border-top-color: #dc3545; }

.cot-item-topo {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.cot-item h4 {
    margin: 0;
    font-size: 1.05rem;
    color: #212529;
}

.cot-item .meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
    font-size: 0.85rem;
    color: #495057;
}

.cot-item .meta i {
    width: 16px;
    color: #8a929b;
}

.cot-item .obs {
    font-size: 0.83rem;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cot-progresso {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.cot-progresso span {
    display: block;
    height: 100%;
    background: #198754;
}

.cot-item .rodape {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid #f1f3f5;
    margin-top: auto;
}

.cot-item .rodape .cot-btn {
    flex: 1;
    justify-content: center;
}

/* ---- Vazio / carregando ---- */
.cot-vazio {
    text-align: center;
    padding: 40px 15px;
    color: #8a929b;
    grid-column: 1 / -1;
}

.cot-vazio i {
    font-size: 2.3rem;
    display: block;
    margin-bottom: 10px;
    color: #ced4da;
}

.cot-vazio.erro i {
    color: #f0ad4e;
}

.cot-vazio .btn {
    margin-top: 12px;
}

.cot-carregando {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    grid-column: 1 / -1;
}

/* ---- Alertas ---- */
.cot-alerta {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.88rem;
    line-height: 1.45;
    margin-top: 12px;
}

.cot-alerta i { margin-top: 3px; }
.cot-alerta.aviso { background: #fff8e6; border: 1px solid #f5d38a; color: #7a5200; }
.cot-alerta.info { background: #eef3fb; border: 1px solid #d5e1f5; color: #1e3c72; }
.cot-alerta.erro { background: #fdecec; border: 1px solid #f3b7b7; color: #8a1c1c; }
.cot-alerta.ok { background: #e9f7ef; border: 1px solid #b7e1c7; color: #14622f; }

/* ---- Modal ---- */
.cot-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 30, 50, 0.55);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.cot-modal.show {
    display: flex;
}

.cot-modal-caixa {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.cot-modal-topo {
    background: linear-gradient(135deg, #2a5298 0%, #1e3c72 100%);
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cot-modal-topo h3 {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
}

.cot-modal-topo button {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

.cot-modal-corpo {
    padding: 18px 20px;
    overflow: auto;
}

.cot-modal-rodape {
    padding: 12px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #fafbfc;
    flex-wrap: wrap;
}

.cot-link-linha {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.cot-link-linha .topo {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.cot-link-linha input {
    width: 100%;
    box-sizing: border-box;
    margin-top: 8px;
    padding: 7px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #495057;
    background: #f8f9fa;
}

.cot-link-linha .cot-acoes {
    margin-top: 8px;
}

/* ---- Toast ---- */
.cot-toast {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #212529;
    color: white;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s;
    z-index: 4000;
    max-width: calc(100vw - 32px);
    white-space: pre-line;
}

.cot-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.cot-toast.erro { background: #9b1c1c; }
.cot-toast.ok { background: #14622f; }

.positivo { color: #198754; }
.negativo { color: #dc3545; }

@media (max-width: 640px) {
    .cot-lista {
        grid-template-columns: 1fr;
    }

    .cot-card {
        padding: 16px;
    }

    .cot-aba {
        padding: 9px 10px;
        font-size: 0.85rem;
    }
}

@media print {
    .sidebar, .menu-toggle, .header, .breadcrumb, .cot-abas, .cot-acoes, .nao-imprimir, .cot-modal, .cot-toast {
        display: none !important;
    }

    .main-container {
        margin: 0 !important;
        padding: 0 !important;
        max-width: none !important;
    }

    .cot-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}