:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --warning: #f59e0b;
    --indigo: #4f46e5;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}


.header a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.header a:hover {
    color: var(--primary-hover);
    transform: translateX(-3px);
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    color: #1e293b;
    background: #f8fafc;
    box-sizing: border-box;
    transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-group input[readonly] {
    background: #f1f5f9;
    color: #64748b;
    cursor: not-allowed;
}

.partidas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11.5px;
    margin-bottom: 10px;
    table-layout: fixed;
}

.partidas-table th {
    background: #1e40af;
    color: #fff;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: normal;
    text-align: left;
    vertical-align: middle;
}

.partidas-table td {
    padding: 6px 6px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.partidas-table tr:last-child td {
    border-bottom: none;
}

.partidas-table select,
.partidas-table input,
.partidas-table textarea {
    width: 100%;
    padding: 6px 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: #f8fafc;
    color: #1e293b;
    box-sizing: border-box;
    font-family: inherit;
}

.partidas-table select:focus,
.partidas-table input:focus,
.partidas-table textarea:focus {
    border-color: #3b82f6;
    background: #fff;
    outline: none;
}

.partidas-table textarea {
    resize: vertical;
    min-height: 50px;
}

.partidas-table .neto-cell {
    font-weight: 700;
    color: #1e40af;
    white-space: nowrap;
    font-size: 13px;
}

.btn-add-partida {
    background: #10b981;
    color: #fff;
    border: none;
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.btn-add-partida:hover {
    background: #059669;
}

.btn-del-partida {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 12px;
    cursor: pointer;
    transition: background .2s;
}

.btn-del-partida:hover {
    background: #fecaca;
}


.totales-box {
    display: flex;
    justify-content: flex-end;
    gap: 30px;
    padding: 12px 16px;
    background: #f0f9ff;
    border-radius: 0 0 10px 10px;
    border: 1px solid #bae6fd;
    border-top: none;
    font-size: 13px;
}

.totales-box .t-item {
    text-align: right;
}

.totales-box .t-label {
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
}

.totales-box .t-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (min-width: 992px) {
    .partidas-table {
        min-width: 900px;
    }
}

@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
}


.btn-add-partida {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-add-partida:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.35);
    filter: brightness(1.1);
}

.btn-add-partida:active {
    transform: translateY(0);
}

.btn-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
    text-transform: uppercase;
    width: auto;
    min-width: 200px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 30px;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.3);
    background: #1d4ed8;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-table-action {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1.5px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: #f1f5f9;
    color: #475569;
}

.btn-table-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.btn-table-action.btn-edit {
    color: #2563eb;
    background: #eff6ff;
    border-color: #dbeafe;
}

.btn-table-action.btn-edit:hover {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.btn-table-action.btn-pdf {
    color: #059669;
    background: #ecfdf5;
    border-color: #d1fae5;
}

.btn-table-action.btn-pdf:hover {
    background: #059669;
    color: #fff;
    border-color: #059669;
}

.btn-table-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f1f5f9 !important;
    color: #94a3b8 !important;
    border-color: #e2e8f0 !important;
    transform: none !important;
}


.tabs-header {
    background: #fff;
    padding: 8px;
    border-radius: 14px;
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.tab-btn:not(.active):hover {
    background: var(--background);
    color: var(--primary);
}


.form-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.section-title {
    font-size: 14px;
    font-weight: 800;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
}


#tabla_cotizaciones_seguimiento {
    font-size: 11.5px;
    border-collapse: collapse;
    width: 100%;
}

#tabla_cotizaciones_seguimiento th {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    position: sticky;
    top: 0;
    z-index: 2;
    text-align: left;
}

#tabla_cotizaciones_seguimiento td {
    padding: 10px 10px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    word-break: break-word;
}

#tabla_cotizaciones_seguimiento tbody tr:hover td {
    background: #f8fafc;
}

.status-wrapper {
    position: relative;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.status-btn-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.status-select-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.status-wrapper:hover .status-btn-icon {
    transform: scale(1.1);
    filter: brightness(0.95);
}

.status-wrapper.pendiente .status-btn-icon { background: #fef3ce; color: #92400e; }
.status-wrapper.aprobado .status-btn-icon { background: #d1fae5; color: #065f46; }
.status-wrapper.cancelado .status-btn-icon { background: #fee2e2; color: #991b1b; }
.status-wrapper.con_orden .status-btn-icon { background: #dbeafe; color: #1e40af; }

.status-wrapper.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.status-wrapper.disabled .status-select-hidden {
    display: none;
}

#tabla_cotizaciones_seguimiento td.wrap-cell {
    white-space: normal;
    word-break: break-word;
}

.table-responsive {
    width: 100%;
    overflow-x: hidden; 
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #fff;
    margin-top: 15px;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f8fafc;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
    border: 2px solid #f8fafc;
}


.partidas-detail-row td {
    padding: 0 !important;
    background: #f8fafc;
    border-bottom: 2px solid #bae6fd;
}

.partidas-inner {
    padding: 10px 14px;
    font-size: 11px;
}

.partidas-inner table {
    width: 100%;
    border-collapse: collapse;
}

.partidas-inner th {
    background: #e0f2fe;
    color: #0369a1;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.partidas-inner td {
    padding: 4px 8px;
    border-bottom: 1px solid #e2e8f0;
    white-space: normal;
    max-width: none;
}

.btn-toggle {
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.btn-toggle:hover {
    background: #bfdbfe;
}
.action-btn-p {
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.action-btn-p:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}
.action-btn-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #fff;
}
.action-btn-icon:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}
