/* ========================================
   DRAWER: DETALHES DO PEDIDO
   ======================================== */

.drawer-detalhes {
    width: 600px;
    max-width: 90vw;
}

/* Header Customizado */
.drawer-header-detalhes {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 16px;
    border-bottom: 1px solid #E7E9E9;
    background: #FFFFFF;
}

.drawer-header-info {
    flex: 1;
}

.drawer-title-empresa {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #18191A;
    margin: 0 0 4px 0;
}

.drawer-subtitle {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pedido-id-drawer {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #0068AB;
}

.pedido-codigo-drawer {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #697282;
}

.separator {
    color: #D1D5DB;
    font-size: 12px;
}

.badge-drawer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.badge-recebido-drawer {
    background: #EFF6FF;
    color: #1E40AF;
}

.badge-recebido-drawer::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 100px;
    background: #1E40AF;
}

.badge-parcial-drawer {
    background: #FEF3C7;
    color: #92400E;
}

.badge-parcial-drawer::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 100px;
    background: #92400E;
}

.badge-transito-drawer {
    background: #E0E7FF;
    color: #3730A3;
}

.badge-transito-drawer::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 100px;
    background: #3730A3;
}

.drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.badge-faturado-drawer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    background: rgba(26, 147, 56, 0.10);
    color: #0C451B;
}

.badge-faturado-drawer::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 100px;
    background: #0C451B;
}

/* Tabs */
.drawer-detalhes .drawer-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #E7E9E9;
    margin: 0;
    padding: 0;
}

.drawer-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #61666A;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.drawer-tab:hover {
    color: #0068AB;
    background: rgba(0, 104, 171, 0.05);
}

.drawer-tab.active {
    color: #0068AB;
    border-bottom-color: #0068AB;
}

.drawer-tab i {
    width: 14px;
    height: 14px;
}

/* Body */
.drawer-body-detalhes {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    background: #F7F7F8;
}

.drawer-tab-content {
    display: none;
}

.drawer-tab-content.active {
    display: block;
}

/* Info Section */
.info-section {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 8px;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #18191A;
    margin: 0 0 8px 0;
}

.info-section-title i {
    width: 16px;
    height: 16px;
    color: #697282;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-item-full {
    grid-column: 1 / -1;
}

.info-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #697282;
}

.info-value {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #18191A;
}

/* Items Table */
.pedido-items-table {
    overflow-x: auto;
}

.items-table {
    width: 100%;
    border-collapse: collapse;
}

.items-table thead {
    background: #F7F7F8;
}

.items-table th {
    padding: 6px 8px;
    text-align: left;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: #61676B;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.items-table td {
    padding: 6px 8px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    color: #18191A;
    border-top: 1px solid #E7E9E9;
}

.produto-codigo {
    font-size: 10px;
    color: #697282;
}

.row-planejado {
    background: #F9FAFA;
}

.btn-planejar {
    padding: 5px 10px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #FFFFFF;
    background: #0068AB;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 200ms ease;
}

.btn-planejar:hover {
    background: #005A94;
}

.checkbox-planejado {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.checkbox-planejado input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.checkbox-planejado span {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #00A03B;
}

/* Resumo Grid */
.resumo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.resumo-item {
    display: flex;
    gap: 6px;
    align-items: flex-start;
}

.resumo-item-full {
    grid-column: 1 / -1;
}

.resumo-icon {
    width: 16px;
    height: 16px;
    color: #697282;
    flex-shrink: 0;
    margin-top: 2px;
}

.resumo-label {
    display: block;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: #697282;
    margin-bottom: 2px;
}

.resumo-value {
    display: block;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 400;
    color: #18191A;
}

.resumo-value-destaque {
    font-size: 13px;
    font-weight: 600;
    color: #00A03B;
}

.btn-gerar-termo {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #0068AB;
    background: #FFFFFF;
    border: 1px solid #0068AB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-gerar-termo:hover {
    background: #F0F7FB;
}

.btn-gerar-termo i {
    width: 16px;
    height: 16px;
}

/* Footer */
.drawer-footer-detalhes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-top: 1px solid #E7E9E9;
    background: #FFFFFF;
}

.drawer-footer-right {
    display: flex;
    gap: 8px;
}

.btn-cancelar-pedido {
    padding: 6px 12px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #DC2626;
    background: #FFFFFF;
    border: 1px solid #DC2626;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-cancelar-pedido:hover {
    background: #FEF2F2;
}

.btn-cancelar {
    padding: 6px 12px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #697282;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-cancelar:hover {
    background: #F7F7F8;
    border-color: #9CA3AF;
}

.btn-planejar-pedido {
    padding: 6px 12px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: #FFFFFF;
    background: #0068AB;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 200ms ease;
}

.btn-planejar-pedido:hover {
    background: #005A94;
}

/* Histórico - Timeline */
.historico-section {
    padding: 0;
}

.historico-title {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #18191A;
    margin: 0 0 24px 0;
}

.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 16px;
    padding-bottom: 24px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:not(:last-child)::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: #E7E9E9;
}

.timeline-marker {
    width: 16px;
    height: 16px;
    border-radius: 100px;
    flex-shrink: 0;
    margin-top: 4px;
    z-index: 1;
    position: relative;
}

.timeline-marker-success {
    background: #00A03B;
}

.timeline-marker-operation {
    background: #0068AB;
}

.timeline-marker-movement {
    background: #0068AB;
}

.timeline-marker-production {
    background: #00A03B;
}

.timeline-marker-planning {
    background: #0068AB;
}

.timeline-marker-start {
    background: #697282;
}

.timeline-content {
    flex: 1;
    background: #FFFFFF;
    border: 1px solid #E7E9E9;
    border-radius: 8px;
    padding: 16px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 12px;
}

.timeline-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.timeline-event-title {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #18191A;
    margin: 0;
}

.timeline-date {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #697282;
}

.timeline-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.timeline-badge-success {
    background: rgba(26, 147, 56, 0.10);
    color: #0C451B;
}

.timeline-badge-operation {
    background: #E0F2FE;
    color: #075985;
}

.timeline-badge-movement {
    background: #E0F2FE;
    color: #075985;
}

.timeline-badge-production {
    background: rgba(26, 147, 56, 0.10);
    color: #0C451B;
}

.timeline-badge-planning {
    background: #E0F2FE;
    color: #075985;
}

.timeline-badge-start {
    background: #F3F4F6;
    color: #4B5563;
}

.timeline-description {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #697282;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.timeline-responsible {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.timeline-responsible i {
    width: 14px;
    height: 14px;
    color: #697282;
}

.timeline-responsible-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #697282;
}

.timeline-responsible-name {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #18191A;
}

.timeline-separator {
    color: #D1D5DB;
    font-size: 12px;
}

/* Planejamento */
.planejamento-section {
    padding: 0;
}

.planejamento-title {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #18191A;
    margin: 0 0 8px 0;
}

.planejamento-subtitle {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #697282;
    margin: 0 0 24px 0;
}

/* Cards de Resumo */
.planejamento-resumo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.planejamento-resumo-card {
    background: #F7F7F8;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.planejamento-resumo-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #697282;
}

.planejamento-resumo-value {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #18191A;
}

.planejamento-resumo-value-blue {
    color: #0068AB;
}

.planejamento-resumo-value-orange {
    color: #F59E0B;
}

/* Planejamentos Realizados */
.planejamentos-realizados {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.planejamentos-realizados-title {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #18191A;
    margin: 0;
}

.planejamento-card {
    background: #FFFFFF;
    border: 1px solid #E7E9E9;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.planejamento-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.planejamento-card-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.planejamento-date {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #697282;
}

.planejamento-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.planejamento-status-concluido {
    background: rgba(26, 147, 56, 0.10);
    color: #0C451B;
}

.planejamento-status-andamento {
    background: #E0F2FE;
    color: #075985;
}

.planejamento-status-pendente {
    background: #FEF3C7;
    color: #92400E;
}

.planejamento-quantidade {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #0068AB;
    flex-shrink: 0;
}

.planejamento-produto-nome {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #18191A;
    margin: 0;
}

.planejamento-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.planejamento-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.planejamento-info-label {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #697282;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.planejamento-info-value {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #18191A;
}

.planejamento-observacao {
    font-family: 'Archivo', -apple-system, sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #697282;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid #E7E9E9;
}

/* Responsivo */
@media (max-width: 768px) {
    .drawer-detalhes {
        width: 100%;
        max-width: 100vw;
    }

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

    .drawer-tabs {
        overflow-x: auto;
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-badge {
        align-self: flex-start;
    }

    .planejamento-resumo {
        grid-template-columns: 1fr;
    }

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

    .planejamento-card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .planejamento-quantidade {
        align-self: flex-start;
    }
}
