/* =====================================================================
   Proyectos360 · familia 360 de Zatarra (paleta verde agua)
     principal #14A38B → botones, menú activo, enlaces
     oscuro    #0F5C55 → títulos, hover
     acento    #4FD1B5 → enlaces y menú activo en modo oscuro
     suave     #CFF5EC → fondos suaves
   ===================================================================== */
:root,
[data-bs-theme=dark] {
    --ms-principal: #14A38B;
    --ms-principal-oscuro: #0F5C55;
    --ms-acento: #4FD1B5;
    --bs-primary: #14A38B;
    --bs-primary-rgb: 20, 163, 139;
    --bs-primary-bg-subtle: #CFF5EC;
    --bs-primary-border-subtle: rgba(20, 163, 139, .35);
    --bs-primary-text-emphasis: #0F5C55;
    --bs-link-color: #14A38B;
    --bs-link-color-rgb: 20, 163, 139;
    --bs-link-hover-color: #0F5C55;
    --bs-link-hover-color-rgb: 15, 92, 85;
    --bs-focus-ring-color: rgba(20, 163, 139, .25);
}

[data-bs-theme=dark] {
    --bs-primary-bg-subtle: rgba(20, 163, 139, .18);
    --bs-primary-text-emphasis: #CFF5EC;
    --bs-link-color: #4FD1B5;
    --bs-link-color-rgb: 79, 209, 181;
    --bs-link-hover-color: #CFF5EC;
}

[data-bs-theme=dark] #sidebar-menu ul li.mm-active > a,
[data-bs-theme=dark] #sidebar-menu ul li a.active,
[data-bs-theme=dark] #sidebar-menu ul li.mm-active > a i,
[data-bs-theme=dark] #sidebar-menu ul li a.active i { color: var(--ms-acento) !important; }

#sidebar-menu ul li.mm-active > a, #sidebar-menu ul li a.active,
#sidebar-menu ul li.mm-active > a i, #sidebar-menu ul li a.active i { color: var(--bs-primary) !important; }

.btn-primary { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    filter: brightness(.9);
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}
.btn-outline-primary { color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-outline-primary:hover { color: #fff; background-color: var(--bs-primary); border-color: var(--bs-primary); }
.btn-soft-primary { color: var(--bs-primary); background-color: rgba(var(--bs-primary-rgb), .1); border-color: transparent; }
.btn-soft-primary:hover { color: #fff !important; background-color: var(--bs-primary) !important; }
.bg-primary { background-color: var(--bs-primary) !important; }
.text-primary { color: var(--bs-primary) !important; }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.form-control:focus, .form-select:focus { border-color: var(--bs-primary); box-shadow: 0 0 0 .15rem var(--bs-focus-ring-color); }
a { color: var(--bs-link-color); }
a:hover { color: var(--bs-link-hover-color); }

.logo-txt { white-space: nowrap; font-weight: 700; vertical-align: middle; }
.navbar-brand-box .logo img { object-fit: contain; }

/* ---------- Login ---------- */
.auth-plano { position: relative; align-items: flex-end; }
.auth-plano-texto { position: relative; color: #fff; max-width: 560px; padding: 2rem; }
.auth-plano-texto h2 { color: #fff; font-weight: 700; }
.auth-plano::before {
    content: ""; position: absolute; inset: 0; opacity: .18;
    background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ---------- Tablas y tarjetas ---------- */
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla-compacta td, .tabla-compacta th { padding: .45rem .6rem; }
.tarjeta-dato { border-left: 3px solid var(--bs-primary); }
.tarjeta-dato .valor { font-size: 1.4rem; font-weight: 700; }

.estatus-Borrador { background: #eef1f4; color: #5b6b73; }
.estatus-Enviado { background: #e2eefc; color: #2a6fdb; }
.estatus-Aprobado { background: #dcf5ec; color: #0f7a5f; }
.estatus-Rechazado { background: #fde4e4; color: #c4122f; }
.estatus-Cancelado { background: #f1f1f1; color: #888; text-decoration: line-through; }

/* ---------- Planos (lista) ---------- */
.plano-card .miniatura {
    aspect-ratio: 16 / 10; background: #f3f6f7 center / contain no-repeat; border-bottom: 1px solid var(--bs-border-color);
    display: flex; align-items: center; justify-content: center; color: #9aa9b0;
}

/* ---------- Editor de presupuesto ---------- */
/* Totales: el total grande arriba y lo demás en rejilla de 2 columnas */
.tarjeta-totales .total-grande { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: .75rem; margin-bottom: .75rem; border-bottom: 1px solid var(--bs-border-color); }
.tarjeta-totales .total-grande span { font-size: 1rem; color: var(--bs-secondary-color); }
.tarjeta-totales .total-grande strong { font-size: 1.9rem; font-weight: 700; color: var(--bs-primary-text-emphasis); font-variant-numeric: tabular-nums; }
.totales-rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1.5rem; }
.totales-rejilla div { display: flex; justify-content: space-between; gap: .5rem; border-bottom: 1px dashed var(--bs-border-color); padding-bottom: .35rem; }
.totales-rejilla span { color: var(--bs-secondary-color); }
.totales-rejilla b { font-variant-numeric: tabular-nums; }

/* Encabezado de sección */
.seccion-cab { display: flex; align-items: center; gap: .6rem; padding: .6rem 1.25rem; background: rgba(var(--bs-primary-rgb), .08); border-top: 1px solid var(--bs-border-color); font-weight: 600; }
.seccion-cab i { color: var(--bs-primary); font-size: 1.15rem; }
.seccion-cab input { max-width: 320px; font-weight: 600; background: transparent; border-color: transparent; }
.seccion-cab input:hover, .seccion-cab input:focus { background: var(--bs-body-bg); border-color: var(--bs-border-color); }

/* Cada partida: número | descripción y datos | importe y acciones */
.partida { display: grid; grid-template-columns: 34px minmax(0, 1fr) 190px; gap: 1rem; padding: 1rem 1.25rem; border-top: 1px solid var(--bs-border-color); }
.partida:hover { background: rgba(var(--bs-primary-rgb), .03); }
.p-num { width: 30px; height: 30px; border-radius: 50%; background: var(--bs-tertiary-bg); color: var(--bs-secondary-color); display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.p-cuerpo textarea { resize: none; overflow: hidden; min-height: 42px; }
.p-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .6rem .75rem; margin-top: .65rem; }
.p-campo { margin: 0; }
.p-campo span { display: block; font-size: .75rem; color: var(--bs-secondary-color); margin-bottom: .15rem; }
.p-lado { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.p-lado > span { font-size: .75rem; color: var(--bs-secondary-color); }
.p-lado b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.p-acciones { display: flex; gap: .25rem; margin-top: auto; padding-top: .5rem; }
.p-acciones .btn { padding: .15rem .4rem; }
.partidas-pie { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; gap: .5rem 1rem; padding: .75rem 1.25rem; background: var(--bs-body-bg); border-top: 2px solid var(--bs-primary); border-radius: 0 0 .25rem .25rem; }
.partidas-pie b { font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
    .partida { grid-template-columns: minmax(0, 1fr); }
    .p-num { display: none; }
    .p-lado { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
    .p-acciones { margin-top: 0; padding-top: 0; }
}
.lista-productos { max-height: 55vh; overflow: auto; }

/* Cómo lo ve el cliente */
.opcion-modo { flex: 1 1 260px; display: flex; gap: .75rem; align-items: flex-start; padding: .85rem 1rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; cursor: pointer; margin: 0; }
.opcion-modo input { margin-top: .2rem; flex: none; }
.opcion-modo span { display: flex; flex-direction: column; }
.opcion-modo small { color: var(--bs-secondary-color); }
.opcion-modo.activa { border-color: var(--bs-primary); background: rgba(var(--bs-primary-rgb), .06); box-shadow: inset 3px 0 0 var(--bs-primary); }
.vista-concepto { border: 1px dashed var(--bs-border-color); border-radius: .5rem; padding: .75rem; background: var(--bs-tertiary-bg); }
