@import url('https://fonts.googleapis.com/css2?family=Google+Sans:ital,opsz,wght@0,17..18,400..700;1,17..18,400..700&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Google Sans", sans-serif;
}
:root{
    --color-principal: hsl(203, 47%, 40%);
    --color-white: hsl(0, 0%, 100%);
    --black-color: hsl(220, 24%, 12%);
    --black-color-light: hsl(220, 24%, 15%);
    --black-color-lighten: hsl(220, 20%, 18%);
    --primary: #2563eb;
    --success: #16a34a;
    --danger: #dc2626;
    --dark: #111827;
    --gray: #6b7280;
    --bg: #f8fafc;
    --white: #ffffff;
    --border: #e5e7eb;
}
.html{
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    font-family: 'Segoe UI', Tahoma, sans-serif;
    color: var(--dark);
}

.body-login{
    width: 100%;
    background-image: url(/img/fondo\ dalvo\ system2.svg);
    background-position: center;
    background-size: cover;
}
.login{
    width: 100%;
    padding: 1.2rem 1.5rem;
    height: 100vh;
    align-items: center;
    justify-content: center;
    display: flex;
}
.login-container{
    width: 350px;
    max-width: 600px;
    height: 480px;
    display: flex;
    margin: auto;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-color: #ffffff6c;
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 20px;

}
.form-login{
    width: 100%;
}
.form-login .imagen-login{
    width: 100%;
    max-width: 600px;
}
.form-login .imagen-login p{
    margin-top: 2rem;
}
.form-login .imagen-login img{
    width: 100%;
}
.form-login .inputs{
    display: flex;
    flex-direction: column;
    text-align: start;
    margin-top: 3rem;
}
.form-login .inputs input{
    margin-top: 1rem;
    margin-bottom: 1rem;
    border-top: none;
    border-left: none;
    border-bottom: 2px solid var(--color-principal);
    border-right: 2px solid var(--color-principal);
    text-align: center;
    height: 2rem;
    padding: .5em;
    outline: none;
    transition: .3s;
    background: transparent;
    font-size: 1rem;
}
.form-login .inputs input:focus{
     box-shadow: 0 0 5px var(--color-principal)
}
.btn-login{
    background: transparent;
    padding: 1rem;
    text-align: center;
    align-items: center;
    justify-content: center;
    display: flex;
    width: 100%;
    border: 2px solid var(--color-principal);
    cursor: pointer;
    border-radius: 20px;
    font-size: 1rem;
    transition: 1s;
    z-index: 1;
    overflow: hidden;
    position: relative;
    color: var(--color-principal);
}
.btn-login:hover{
    background-color: var(--color-principal);
    color: #fff;
}
.btn-login::before{
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--color-principal);
    z-index: -1;
    transition: .5s;
}
.btn-login:hover::before{
    width: 100%;
}

a{
    text-decoration: none;
}
ul{
    list-style-type: none;
}

.dashboard{
    width: 100%;
    /* padding: 1.2rem 1.5rem; */
}
.header-dashboard{
    width: 100%;
    position: relative;
    top: 0;
    left: 0;
    justify-content: space-between;
    display: flex;
    align-items: center;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--color-principal);
}
.header-dashboard a{
    color: var(--color-principal);
}
.imagen-logo{
    width: 200px;
}
.imagen-logo img{
    width: 100%;
}
.cerrar-sesion{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.btn-cerrar-sesion{
    border: 2px solid var(--color-principal);
    background: transparent;
    color: var(--color-principal);
    border-radius: 10px;
    padding: .5rem;
    width: 150px;
    cursor: pointer;
    transition: 1s;
}
.btn-cerrar-sesion:hover{
    background: var(--color-principal);
    color: var(--color-white);
}

.container {
    display: flex;
    height: calc(100vh - 60px);
}


/* 📚 SIDEBAR */
.sidebar {
    width: 220px;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 20px 10px;
}

.sidebar button {
    background: transparent;
    border: none;
    color: #cbd5f5;
    text-align: left;
    padding: 12px 15px;
    margin-bottom: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-size: 15px;
}

.sidebar button:hover {
    background: #1e293b;
    color: white;
}


/* 🧩 CONTENIDO */
.contenido {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}


/* 📄 SECCIONES */
main section {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

main h2 {
    margin-bottom: 15px;
}


/* 🧾 FORMULARIOS */
input, select {
    padding: 8px;
    margin: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
}

button {
    padding: 8px 12px;
    border: none;
    background: #2563eb;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #1d4ed8;
}


/* 📋 LISTAS */
ul {
    list-style: none;
    margin-top: 15px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

li {
    background: #f1f5f9;
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


/* ❌ BOTÓN ELIMINAR */
li button {
    background: #ef4444;
}

.acciones{
    display: flex;
    gap: 10px;
}
.editar-btn{
    background-color: var(--color-principal);
}

li button:hover {
    background: #dc2626;
}

/* 🔹 CONTENEDOR GENERAL */
#modulo-ordenes {
    padding: 20px;
    background: #f5f7fb;
}

/* 🔹 HEADER */
.header-ordenes {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.header-ordenes h2 {
    margin: 0;
}

.header-ordenes-controles {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-ordenes-controles input {
    width: min(360px, 100%);
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
}

.header-ordenes button {
    background: #2563eb;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
}

.header-ordenes button:hover {
    background: #1d4ed8;
}

/* 🔹 TABLA LISTADO */
.tabla-ordenes {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    /* overflow: hidden; */
}

.tabla-ordenes th {
    background: #111827;
    color: white;
    padding: 12px;
    text-align: left;
    font-size: 14px;
}

.tabla-ordenes td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.tabla-ordenes tr:hover {
    background: #f1f5f9;
}

#modulo-clientes {
    padding: 20px;
}

.clientes-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.clientes-filtros {
    flex: 1;
}

.clientes-filtros input {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--white);
}

#btnNuevoCliente,
#btnGuardarCliente,
.cliente-archivo-item button {
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
}

#listaClientes {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cliente-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

.cliente-card-info {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.cliente-card-info strong {
    display: block;
    margin-bottom: 6px;
}

.cliente-card-meta {
    color: var(--gray);
    font-size: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.cliente-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-cliente {
    position: fixed;
    inset: 0;
    z-index: 3000;
}

.modal-cliente-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 0;
}

.modal-cliente-dialog,
.modal-cliente-content {
    position: relative;
    z-index: 1;
    width: min(960px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 16px auto;
    background: var(--white);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
}

.modal-cliente-header,
.modal-cliente-footer {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-cliente-footer {
    border-bottom: none;
    border-top: 1px solid var(--border);
    justify-content: flex-end;
}

.modal-cliente-body {
    padding: 22px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.modal-cliente-cerrar {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--gray);
}

.cliente-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.cliente-form-grid input,
#notasCliente,
.cliente-archivo-item input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
}

#notasCliente {
    min-height: 110px;
    resize: vertical;
}

.cliente-archivos-panel {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    background: #f8fafc;
}

.cliente-archivo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.cliente-archivo-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

/* 🔹 FORMULARIO */
#vistaFormularioOrden {
    background: white;
    padding: 20px;
    border-radius: 12px;
}

/* 🔹 TABLAS INTERNAS */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
}

table th {
    background: #374151;
    color: white;
    padding: 8px;
    font-size: 13px;
}

table td {
    padding: 6px;
    border: 1px solid #ddd;
}

table input {
    width: 100%;
    padding: 5px;
    border: none;
    outline: none;
}

#tablaOCProveedor {
    min-width: 900px;
}

#bloqueOCProveedor {
    overflow-x: auto;
}

#tablaOCProveedor input,
#tablaOCProveedor select {
    width: 100%;
    min-width: 92px;
    padding: 6px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
}

#tablaOCProveedor .descripcion {
    min-width: 180px;
}

#tablaOCProveedor .proveedor {
    min-width: 170px;
}

.oc-valor-fijo {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #f6fbfd;
    color: #142229;
    font-weight: 700;
    text-align: center;
}

.dias-faltantes-pago {
    text-align: center !important;
    font-weight: 700;
}

.dashboard .tabla-ordenes .dias-faltantes-pago {
    text-align: center !important;
}

.menu-badge {
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 7px;
    border-radius: 999px;
    background: #187396;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(24, 115, 150, 0.28);
}

/* 🔹 BOTONES */
button {
    cursor: pointer;
}

button:hover {
    opacity: 0.9;
}

/* 🔹 BOTÓN ELIMINAR */
button[onclick*="eliminarFila"] {
    background: #ef4444;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
}

/* 🔹 TOTALES */
p {
    font-weight: bold;
    margin: 5px 0 15px;
}

/* 🔹 BOTÓN GUARDAR */
button[onclick="guardarOrden()"] {
    background: #16a34a;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    margin-top: 20px;
}

/* 💰 RESUMEN FINANCIERO */
h3 {
    margin-top: 25px;
    margin-bottom: 10px;
    font-size: 18px;
    color: var(--color-principal);
}

/* CONTENEDOR DE BLOQUES */
.bloque {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    background: #f5f7fb;
    border: 1px solid #f5f7fb;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
}

/* LABELS */
.bloque label {
    font-size: 12px;
    color: #334155;
    margin-bottom: 4px;
    display: block;
}

.tituloPresupuesto{
    margin: 2rem 0;
}

/* INPUTS */
.bloque input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #334155;
    background: #f5f7fb;
    color: #334155;
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}

/* INPUT FOCUS */
.bloque input:focus {
    border-color: #3b82f6;
}

/* INPUTS SOLO LECTURA */
.bloque input[readonly] {
    background: #f5f7fb;
    color: #334155;
    font-weight: bold;
    border: 1px dashed #334155;
}

/* EFECTO HOVER */
.bloque:hover {
    border-color: #3b82f6;
    transition: 0.2s;
}

.titulo-financiero {
    margin-top: 28px;
    color: #0f172a;
}

.bloqueFinanciero,
.bloqueAdminFinanciero {
    gap: 12px;
    background: #ffffff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.bloqueFinanciero {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.bloqueAdminFinanciero {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.bloqueFin {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    padding: 0;
    gap: 6px;
}

.bloqueFinAdmin {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    flex: 1 1 170px;
    min-width: 170px;
    padding: .5rem;
    gap: 6px;
}

.bloqueFinAdmin label {
    width: 100%;
    text-align: center;
}

.bloqueFinanciero label,
.bloqueAdminFinanciero label {
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.bloqueFinanciero input,
.bloqueAdminFinanciero input {
    width: 100%;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 700;
    text-align: center;
}

.bloqueFinanciero input[readonly],
.bloqueAdminFinanciero input[readonly] {
    border-style: solid;
    background: #eef6ff;
}

#totalVenta,
#totalFinal {
    color: #0f766e;
    background: #ecfdf5;
    border-color: #99f6e4;
}

.estatus-orden {
    font-weight: 700;
    font-size: 16px;
    color: #007bff;
    margin: 10px 0;
}

.total-cotizacion-cliente {
    text-align: right;
    margin-top: 10px;
}

.oc-cliente-upload,
.selector-partidas-oc {
    margin: 15px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.oc-cliente-upload label {
    display: block;
    margin: 10px 0 8px;
    font-weight: 500;
}

.oc-cliente-upload label:first-child {
    margin-top: 0;
}

.oc-cliente-upload input {
    margin-bottom: 10px;
}

.selector-partidas-oc-controles,
.acciones-oc-proveedor {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.lista-partidas-disponibles {
    margin-top: 12px;
}

.historial-oc-proveedor {
    margin-top: 20px;
    border-top: 2px solid #ddd;
    padding-top: 15px;
}

.tabla-con-margen {
    margin-top: 15px;
}

.tabla-con-margen-lg {
    margin-top: 20px;
}

.tabla-mensaje {
    text-align: center;
}

.tabla-mensaje-error {
    color: #b91c1c;
}

.tabla-mensaje-muted,
.texto-vacio {
    color: #6b7280;
}

.fila-clickable {
    cursor: pointer;
}

.archivo-item-inline {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.control-inline {
    margin-right: 10px;
}

.btn-eliminar-inline {
    margin-left: 5px;
    color: red;
}

.historial-titulo {
    margin-top: 20px;
    margin-bottom: 10px;
}

.historial-card {
    border: 1px solid #ddd;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 5px;
    background: #f9f9f9;
}

.historial-card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.historial-card-main {
    flex: 1;
}

.historial-acciones {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.btn-mini {
    padding: 6px 12px;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.btn-mini-primary {
    background: #007bff;
}

.btn-mini-dark {
    background: #374151;
}

.btn-mini-approve {
    background: #0f766e;
}

.btn-mini-success {
    background: #28a745;
}

.partidas-empty {
    color: #777;
    margin: 0;
}

.partidas-grid {
    display: grid;
    gap: 6px;
}

.partida-option {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
}

.partida-desc {
    flex: 1;
}

.pago-proveedor-seccion {
    margin: 16px 0;
    padding: 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
}

.pago-proveedor-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.tabla-pago-proveedor {
    margin-top: 12px;
}

.leyenda-amarillo {
    background: #f59e0b;
}

.leyenda-verde {
    background: #16a34a;
}

.leyenda-azul {
    background: #2563eb;
}

.leyenda-rojo {
    background: #ef4444;
}

.leyenda-cyan {
    background: #0891b2;
}

.leyenda-naranja {
    background: #f97316;
}

.leyenda-verde-claro {
    background: #22c55e;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .bloque {
        grid-template-columns: 1fr;
    }
}

.badge {
    padding: 5px 10px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
}

.abierta {
    background-color: orange;
    display: flex;
    margin: auto;
    justify-content: center;
    margin: auto;
    width: 100px;
}

.cerrada {
    background-color: green;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px;
}

.btn-eliminarOrden{
    background-color: red;
    display: flex;
    margin: auto;
}

.estatus {
    padding: 5px 10px;
    border-radius: 8px;
    color: white;
    font-size: 12px;
}

.no_aprobada {
    background-color: red;
    display: flex;
    margin: auto;
    justify-content: center;
    margin: 20px auto;
    width: 100px;
}

.acciones-orden{
    display: flex;
    gap: 20px;
    margin: 1rem 0;
}
.en_proceso {
    background-color: orange;
    display: flex;
    margin: auto;
    justify-content: center;
    margin: 20px auto;
    width: 100px;
}

.aprobada {
    background-color: green;
    display: flex;
    margin: auto;
    justify-content: center;
    margin: 20px auto;
    width: 100px;
}

.cotizacion_cliente_generada {
    background-color: #2563eb;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 160px;
}

.oc_cliente_cargada {
    background-color: #0891b2;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 160px;
}

.cliente_aprobado {
    background-color: #0f766e;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 160px;
}

.documentos_completos {
    background-color: #4f46e5;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 170px;
}

.oc_proveedor_generada {
    background-color: #7c3aed;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 170px;
}

.resumen-presupuestos {
    margin: 24px 0;
    padding: 18px;
    border: 1px solid #dbe4ef;
    border-radius: 16px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef6f3 100%);
}

.resumen-presupuestos h3,
.resumen-presupuestos h4 {
    margin: 0 0 14px;
    color: #123047;
}

.resumen-presupuestos-oc {
    margin-top: 12px;
}

.presupuestos-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
}

.presupuesto-card {
    padding: 14px;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 10px 25px rgba(18, 48, 71, 0.08);
}

.presupuesto-card span {
    display: block;
    margin-bottom: 8px;
    color: #526273;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.presupuesto-card strong {
    color: #0f766e;
    font-size: 20px;
}

.total-oc-proveedor {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #123047;
    color: #ffffff;
    text-align: right;
}

.transferir-presupuesto {
    margin-top: 16px;
    padding: 16px;
    border: 1px dashed #93a9bd;
    border-radius: 14px;
    background: #f6faf9;
}

.transferir-presupuesto h4 {
    margin: 0 0 12px;
    color: #123047;
}

.transferir-presupuesto select,
.transferir-presupuesto input {
    min-width: 180px;
    margin: 0 8px 8px 0;
    padding: 9px 10px;
    border: 1px solid #c9d6df;
    border-radius: 10px;
}

.transferir-presupuesto button {
    padding: 10px 14px;
    border: none;
    border-radius: 10px;
    background: #0f766e;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 900px) {
    .presupuestos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .presupuestos-grid {
        grid-template-columns: 1fr;
    }
}

.listo_facturar {
    background-color: #c2410c;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 150px;
}

.facturada {
    background-color: #b45309;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 120px;
}

.pagada {
    background-color: #15803d;
    display: flex;
    margin: 20px auto;
    justify-content: center;
    width: 120px;
}

.cerrada {
    background-color: green;
}

.bloque_archivos {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.upload-box {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.tabla-archivos {
    width: 100%;
    border-collapse: collapse;
}

/* Indicador de flujo de la orden */
.paso-flujo {
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    background: #e9ecef;
    color: #6c757d;
    border: 2px solid #dee2e6;
    transition: all 0.3s ease;
}

.paso-flujo.activo {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.paso-flujo.completado {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.tabla-archivos th, 
.tabla-archivos td {
    border-bottom: 1px solid #eee;
    padding: 10px;
}

.btn-ver {
    background: #3498db;
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
}

.btn-ver:hover {
    background: #2980b9;
}

.inicio-graficas {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.inicio-graficas-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.inicio-graficas-header h3 {
    margin: 0;
}

#alcanceGraficasInicio {
    color: #4b5563;
    font-size: 14px;
}

.graficas-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 16px;
}

.grafica-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
}

.grafica-card h4 {
    margin: 0 0 12px;
    color: #111827;
}

.grafica-card canvas {
    width: 100%;
    max-width: 100%;
}

.grafica-card-wide {
    grid-column: 1 / -1;
}

.grafica-leyenda,
.ventas-resumen {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
    color: #374151;
    font-size: 14px;
}

.grafica-leyenda span,
.ventas-resumen span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: #f3f4f6;
    border-radius: 8px;
}

.leyenda-color {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.reportes-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
}

.reportes-toolbar select,
.reportes-toolbar input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--white);
}

.reportes-toolbar button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
}

.reportes-toolbar button:hover {
    background: #1d4ed8;
}

.reporte-resumen {
    margin: 10px 0 16px;
    color: #374151;
    font-weight: 600;
}

.reporte-tabla-wrapper {
    overflow-x: auto;
}

@media (max-width: 900px) {
    .graficas-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Dashboard Premium ERP
   Scopeado a .dashboard para no tocar el login.
   ========================================================================== */

.dashboard {
    --erp-brand: #187396;
    --erp-brand-dark: #0f536d;
    --erp-brand-soft: #e8f4f8;
    --erp-ink: #142229;
    --erp-nav: #132b36;
    --erp-nav-soft: #1b3d4c;
    --erp-ink-soft: #1f2933;
    --erp-muted: #64748b;
    --erp-line: #d9e4ea;
    --erp-line-strong: #b7c9d3;
    --erp-surface: #ffffff;
    --erp-surface-soft: #f5f8fa;
    --erp-surface-raised: #fbfdfe;
    --erp-success: #138a61;
    --erp-danger: #c24141;
    --erp-warning: #b7791f;
    --erp-shadow-sm: 0 1px 2px rgba(5, 5, 5, 0.05);
    --erp-shadow-md: 0 14px 32px rgba(15, 83, 109, 0.11);
    --erp-shadow-lg: 0 24px 70px rgba(5, 5, 5, 0.18);

    min-height: 100vh;
    background: #eef4f7;
    color: var(--erp-ink-soft);
}

.dashboard .header-dashboard {
    min-height: 76px;
    padding: 14px 24px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--erp-line);
    box-shadow: var(--erp-shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard .imagen-logo {
    width: 180px;
}

.dashboard .cerrar-sesion {
    align-items: flex-end;
    gap: 8px;
}

.dashboard #userInfo {
    margin: 0;
    color: var(--erp-muted);
    font-size: 13px;
    font-weight: 700;
}

.dashboard .btn-cerrar-sesion {
    width: auto;
    min-width: 132px;
    border: 1px solid var(--erp-line-strong);
    background: var(--erp-surface);
    color: var(--erp-ink-soft);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.dashboard .btn-cerrar-sesion:hover {
    background: var(--erp-ink);
    border-color: var(--erp-ink);
    color: #fff;
    box-shadow: var(--erp-shadow-md);
}

.dashboard .container {
    height: calc(100vh - 76px);
    background: #eef4f7;
}

.dashboard .sidebar {
    width: 250px;
    padding: 18px 14px;
    background: var(--erp-nav);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 18px 0 42px rgba(19, 43, 54, 0.18);
}

.dashboard .sidebar button {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin-bottom: 6px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: #d8e5ea;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.dashboard .sidebar button:hover {
    background: var(--erp-nav-soft);
    border-color: rgba(24, 115, 150, 0.45);
    color: #ffffff;
    transform: translateX(2px);
}

.dashboard .contenido {
    padding: 22px;
    background: #eef4f7;
}

.dashboard main section {
    background: var(--erp-surface);
    border: 1px solid var(--erp-line);
    border-radius: 14px;
    box-shadow: var(--erp-shadow-md);
    padding: 22px;
}

.dashboard main h2 {
    margin-bottom: 18px;
    color: var(--erp-ink);
    font-size: 22px;
    letter-spacing: 0;
}

.dashboard h3 {
    color: var(--erp-ink);
    font-size: 17px;
    font-weight: 800;
}

.dashboard h4 {
    color: var(--erp-ink-soft);
}

.dashboard input,
.dashboard select,
.dashboard textarea {
    min-height: 38px;
    border: 1px solid var(--erp-line-strong);
    border-radius: 9px;
    background: #ffffff;
    color: var(--erp-ink-soft);
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.dashboard input:focus,
.dashboard select:focus,
.dashboard textarea:focus {
    border-color: var(--erp-brand);
    box-shadow: 0 0 0 3px rgba(24, 115, 150, 0.14);
}

.dashboard input[type="number"] {
    text-align: center;
}

.dashboard table input.cantidad,
.dashboard table input.costo,
.dashboard table input.horas,
.dashboard table input.dias,
.dashboard table input.flete,
.dashboard table input.personas,
.dashboard table input.comidas,
.dashboard table input.costo_hr,
.dashboard table input.costo_comidas,
.dashboard table input.precio,
.dashboard table input.total,
.dashboard table .horas_totales,
.dashboard table .total {
    text-align: center;
}

.dashboard input[readonly],
.dashboard input:disabled,
.dashboard select:disabled,
.dashboard textarea:disabled {
    background: #f1f6f8;
    color: #536672;
}

.dashboard button,
.dashboard .btn-success,
.dashboard .btn-secondary,
.dashboard .btn-agregar,
.dashboard .btn-guardar,
.dashboard .btn-subir {
    border-radius: 9px;
    border: 1px solid transparent;
    font-weight: 800;
    box-shadow: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.dashboard button:hover,
.dashboard .btn-success:hover,
.dashboard .btn-secondary:hover,
.dashboard .btn-agregar:hover,
.dashboard .btn-guardar:hover,
.dashboard .btn-subir:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(5, 5, 5, 0.12);
}

.dashboard button,
.dashboard .btn-success,
.dashboard .btn-agregar,
.dashboard .btn-guardar,
.dashboard .btn-subir,
.dashboard .header-ordenes button,
.dashboard .reportes-toolbar button,
.dashboard #btnNuevoCliente,
.dashboard #btnGuardarCliente,
.dashboard .cliente-archivo-item button {
    background: var(--erp-brand);
    color: #ffffff;
}

.dashboard button:hover,
.dashboard .btn-success:hover,
.dashboard .btn-agregar:hover,
.dashboard .btn-guardar:hover,
.dashboard .btn-subir:hover,
.dashboard .header-ordenes button:hover,
.dashboard .reportes-toolbar button:hover,
.dashboard #btnNuevoCliente:hover,
.dashboard #btnGuardarCliente:hover {
    background: var(--erp-brand-dark);
}

.dashboard .btn-secondary {
    background: #ffffff;
    border-color: var(--erp-line-strong);
    color: var(--erp-ink-soft);
}

.dashboard .btn-secondary:hover {
    background: var(--erp-brand-soft);
    border-color: var(--erp-brand);
    color: var(--erp-brand-dark);
}

.dashboard .btn-delete,
.dashboard .btn-eliminar,
.dashboard .btn-eliminarOrden,
.dashboard button[onclick*="eliminarFila"] {
    background: var(--erp-danger);
    color: #ffffff;
}

.dashboard .btn-delete:hover,
.dashboard .btn-eliminar:hover,
.dashboard .btn-eliminarOrden:hover,
.dashboard button[onclick*="eliminarFila"]:hover {
    background: #991f1f;
}

.dashboard .header-ordenes,
.dashboard .clientes-toolbar,
.dashboard .reportes-toolbar,
.dashboard .inicio-graficas-header {
    background: var(--erp-surface-raised);
    border: 1px solid var(--erp-line);
    border-radius: 12px;
    padding: 14px;
    box-shadow: var(--erp-shadow-sm);
}

.dashboard .header-ordenes h2,
.dashboard .inicio-graficas-header h3 {
    color: var(--erp-ink);
}

.dashboard .tabla-ordenes,
.dashboard table,
.dashboard .tabla-archivos {
    background: var(--erp-surface);
    border: 1px solid var(--erp-line);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--erp-shadow-sm);
}

.dashboard table th,
.dashboard .tabla-ordenes th,
.dashboard .tabla-archivos th {
    background: var(--erp-ink);
    color: #ffffff;
    padding: 11px 10px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    border: none;
}

.dashboard table td,
.dashboard .tabla-ordenes td,
.dashboard .tabla-archivos td {
    padding: 9px 10px;
    border: none;
    border-bottom: 1px solid var(--erp-line);
    color: var(--erp-ink-soft);
}

.dashboard tbody tr:last-child td {
    border-bottom: none;
}

.dashboard tbody tr:hover {
    background: #f4fafc;
}

.dashboard table input,
.dashboard table select {
    margin: 0;
    border: 1px solid transparent;
    background: #f8fbfc;
}

.dashboard table input:focus,
.dashboard table select:focus {
    background: #ffffff;
}

.dashboard .badge,
.dashboard .estatus,
.dashboard .abierta,
.dashboard .cerrada,
.dashboard .cotizacion_cliente_generada,
.dashboard .oc_cliente_cargada,
.dashboard .oc_proveedor_generada,
.dashboard .listo_facturar,
.dashboard .facturada,
.dashboard .pagada {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
}

.dashboard .abierta {
    background: var(--erp-warning);
}

.dashboard .cerrada,
.dashboard .pagada {
    background: var(--erp-success);
}

.dashboard .cotizacion_cliente_generada,
.dashboard .oc_cliente_cargada,
.dashboard .oc_proveedor_generada {
    background: var(--erp-brand);
}

.dashboard .listo_facturar,
.dashboard .facturada {
    background: #7c3f14;
}

.dashboard #vistaFormularioOrden,
.dashboard .bloque,
.dashboard .bloque_archivos,
.dashboard .cliente-card,
.dashboard .cliente-archivos-panel,
.dashboard .grafica-card,
.dashboard .resumen-presupuestos,
.dashboard .selector-partidas-oc,
.dashboard .oc-cliente-upload,
.dashboard .pago-proveedor-seccion,
.dashboard .historial-card {
    background: var(--erp-surface);
    border: 1px solid var(--erp-line);
    border-radius: 14px;
    box-shadow: var(--erp-shadow-sm);
}

.dashboard .bloque {
    padding: 16px;
}

.dashboard .bloque:hover,
.dashboard .historial-card:hover,
.dashboard .cliente-card:hover,
.dashboard .grafica-card:hover {
    border-color: rgba(24, 115, 150, 0.45);
    box-shadow: var(--erp-shadow-md);
}

.dashboard .presupuestos-grid,
.dashboard .graficas-grid {
    gap: 14px;
}

.dashboard .presupuesto-card {
    background: #ffffff;
    border: 1px solid var(--erp-line);
    border-left: 4px solid var(--erp-brand);
    border-radius: 12px;
    box-shadow: var(--erp-shadow-sm);
}

.dashboard .presupuesto-card span {
    color: var(--erp-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.dashboard .presupuesto-card strong {
    color: var(--erp-ink);
    font-size: 20px;
}

.dashboard .titulo-financiero {
    color: var(--erp-ink);
}

.dashboard .bloqueFinanciero,
.dashboard .bloqueAdminFinanciero {
    border: 1px solid rgba(24, 115, 150, 0.24);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: var(--erp-shadow-md);
}

.dashboard .bloqueFinanciero input,
.dashboard .bloqueAdminFinanciero input {
    height: 42px;
    border-color: #c9dbe3;
    background: #f6fbfd;
    color: var(--erp-ink);
    font-size: 14px;
    text-align: center;
}

.dashboard .bloqueFinanciero label,
.dashboard .bloqueAdminFinanciero label {
    color: var(--erp-muted);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0;
}

.dashboard #totalVenta,
.dashboard #totalFinal {
    color: var(--erp-brand-dark);
    background: var(--erp-brand-soft);
    border-color: rgba(24, 115, 150, 0.35);
}

.dashboard .modal-cliente-backdrop {
    background: rgba(5, 5, 5, 0.56);
}

.dashboard .modal-cliente-dialog,
.dashboard .modal-cliente-content {
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 16px;
    box-shadow: var(--erp-shadow-lg);
}

.dashboard .modal-cliente-header,
.dashboard .modal-cliente-footer {
    background: #fbfdfe;
}

.dashboard .modal-cliente-header h3 {
    margin: 0;
}

.dashboard .btn-ver,
.dashboard .btn-mini-primary {
    background: var(--erp-brand);
    color: #ffffff;
}

.dashboard .btn-ver:hover,
.dashboard .btn-mini-primary:hover {
    background: var(--erp-brand-dark);
}

.dashboard .btn-mini-dark {
    background: var(--erp-ink);
}

.dashboard .btn-mini-approve,
.dashboard .btn-mini-success {
    background: var(--erp-success);
}

.dashboard .texto-vacio,
.dashboard .tabla-mensaje-muted {
    color: var(--erp-muted);
}

.dashboard .tabla-mensaje-error {
    color: var(--erp-danger);
}

.dashboard .grafica-leyenda span,
.dashboard .ventas-resumen span {
    background: #edf5f8;
    color: var(--erp-ink-soft);
    border: 1px solid var(--erp-line);
}

.dashboard .leyenda-color {
    border: 1px solid rgba(5, 5, 5, 0.08);
}

.dashboard .paso-flujo {
    background: #edf5f8;
    color: var(--erp-muted);
    border-color: var(--erp-line);
}

.dashboard .paso-flujo.activo {
    background: var(--erp-brand);
    border-color: var(--erp-brand);
    color: #ffffff;
}

.dashboard .paso-flujo.completado {
    background: var(--erp-success);
    border-color: var(--erp-success);
    color: #ffffff;
}

.dashboard .partida-option {
    border-color: var(--erp-line);
    border-radius: 10px;
}

.dashboard .partida-option:hover {
    background: var(--erp-brand-soft);
    border-color: rgba(24, 115, 150, 0.34);
}

.dashboard .upload-box,
.dashboard .acciones,
.dashboard .acciones-cotizacion,
.dashboard .acciones-oc-proveedor {
    flex-wrap: wrap;
}

@media (max-width: 980px) {
    .dashboard .container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh - 76px);
    }

    .dashboard .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 10px;
    }

    .dashboard .sidebar button {
        white-space: nowrap;
        margin-bottom: 0;
    }

    .dashboard .contenido {
        padding: 14px;
    }
}

@media (max-width: 680px) {
    .dashboard .header-dashboard {
        align-items: flex-start;
        gap: 12px;
        flex-direction: column;
    }

    .dashboard .cerrar-sesion {
        align-items: flex-start;
    }

    .dashboard main section {
        padding: 16px;
    }
}
