* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color: #222; background: #f7f7f9; }
.app-header, .app-footer { display:flex; align-items:center; justify-content:space-between; padding: 12px 16px; background: #0f172a; color:#fff; }
.app-header .link, .app-footer .link { color:#c7d2fe; text-decoration:none; margin-right:10px; }
.app-header .link:hover { text-decoration: underline; }

.grid-4 { display:grid; grid-template-columns: repeat(4, 1fr); gap:12px; padding:16px; }

.muted { color:#6b7280; font-size: 0.9rem; }
.status { margin-left:8px; font-weight:600; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e5e7eb; transition: .2s; border-radius: 9999px; }
.slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px; background-color: white; transition: .2s; border-radius: 9999px; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
input:checked + .slider { background-color: #34d399; }
input:checked + .slider:before { transform: translateX(24px); }

/* --- Bootstrap UI additions --- */
.navbar .nav-link + .nav-link { margin-left: .5rem; }
.svg-preview { max-height: none; overflow: visible; background: #fafafa; }
.svg-fluid { width: 100% !important; height: auto !important; display: block; }
.svg-pane { min-height: 240px; display: flex; align-items: center; justify-content: center; }

/* Strip de planchas */
.svg-strip { display: flex; flex-wrap: nowrap; gap: 12px; overflow-x: auto; padding: 8px; }
.svg-card { flex: 0 0 auto; border: 1px solid #e5e7eb; border-radius: 6px; padding: 8px; background: #fff; display: flex; flex-direction: column; align-items: flex-start; }
.svg-holder { height: 320px; width: auto; background: #0f172a; display: inline-block; }
#resultSvg .svg-holder svg { height: 100% !important; width: auto !important; display: block; }
/* Forzar colores de cortes para pruebas rápidas, aplica a SVGs embebidos */
#resultSvg svg rect:first-of-type { fill: #0f172a !important; }
#resultSvg svg [data-trozo] { fill: #38bdf8 !important; stroke: #ffffff !important; }
#resultSvg svg rect[fill="#ffffff"] { fill: #38bdf8 !important; }

@media (max-width: 768px) {
  .svg-preview { max-height: none; }
}

#resultCost ul { padding-left: 1rem; margin-bottom: 0; }
