:root { --brand: #1e40af; --side: #0f172a; }
body { background: #f4f6fa; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.app { display: flex; min-height: 100vh; }
.sidebar { width: 250px; background: var(--side); color: #fff; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 1030; transition: transform .2s; }
.sidebar .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1rem; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar .brand img { max-height: 34px; max-width: 60px; background: #fff; border-radius: 6px; padding: 2px; }
.sidebar .brand i { font-size: 1.6rem; color: var(--brand); filter: brightness(1.6); }
.sidebar .nav-link { color: rgba(255,255,255,.75); padding: .6rem 1rem; border-radius: .5rem; margin: 2px .5rem; }
.sidebar .nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar .nav-link.active { background: var(--brand); color: #fff; }
.sidebar .nav-link i { margin-right: .5rem; }
.sidebar-foot { margin-top: auto; padding: 1rem .5rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .small { padding: 0 1rem .4rem; }
.content { margin-left: 250px; flex: 1; padding: 1.5rem; min-width: 0; }
.topbar { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; }
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .content { margin-left: 0; padding: 1rem; }
}
.card { border: 0; box-shadow: 0 1px 3px rgba(15,23,42,.08); border-radius: .75rem; }
.stat .val { font-size: 1.6rem; font-weight: 700; }
.stat .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; font-size: 1.3rem; background: color-mix(in srgb, var(--brand) 12%, white); color: var(--brand); }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { filter: brightness(.9); color: #fff; }
.page-head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.4rem; margin: 0; font-weight: 700; }
.table td, .table th { vertical-align: middle; }
#partidas td { padding: .35rem; }
#partidas input, #partidas textarea { font-size: .9rem; }
.totales td { padding: .3rem .6rem; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #0f172a, #1e40af); padding: 1rem; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .card { padding: 1.5rem; }
.suggest { position: absolute; z-index: 20; background: #fff; border: 1px solid #ddd; border-radius: .4rem; max-height: 240px; overflow: auto; width: 100%; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.suggest div { padding: .4rem .6rem; cursor: pointer; font-size: .88rem; }
.suggest div:hover { background: #f1f5f9; }

/* ===== Documento de cotización (vista, impresión y enlace público) ===== */
.doc { background: #fff; max-width: 900px; margin: 0 auto; padding: 2.2rem; border-radius: .5rem; box-shadow: 0 1px 4px rgba(0,0,0,.08); color: #1f2937; font-size: .92rem; }
.doc .doc-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 3px solid var(--brand); padding-bottom: 1rem; margin-bottom: 1.2rem; }
.doc .doc-head img { max-height: 80px; max-width: 220px; }
.doc .doc-title { color: var(--brand); font-weight: 800; font-size: 1.5rem; letter-spacing: .5px; }
.doc table.items thead th { background: var(--brand); color: #fff; font-weight: 600; font-size: .82rem; }
.doc table.items td { font-size: .88rem; }
.doc .tot-box { min-width: 280px; }
.doc .tot-box .grand { background: var(--brand); color: #fff; font-weight: 700; font-size: 1.05rem; }
.doc .muted { color: #6b7280; }
.doc .sec-title { font-weight: 700; color: var(--brand); font-size: .85rem; text-transform: uppercase; margin-top: 1rem; }
@media print {
  body { background: #fff !important; }
  .no-print, .sidebar, .topbar, .alert { display: none !important; }
  .content { margin: 0 !important; padding: 0 !important; }
  .doc { box-shadow: none; padding: 0; max-width: 100%; }
  .doc table.items thead th, .doc .tot-box .grand { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 12mm; }
}
