:root {
  --black: #111111;
  --orange: #FC6D09;
  --orange-light: #FF9A47;
  --white: #ffffff;
  --grey-bg: #f4f5f7;
  --grey-border: #e2e5ea;
  --grey-text: #5b6779;
  --danger: #c0392b;
  --ok: #1e8a4c;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--grey-bg);
  color: var(--black);
}
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  background: linear-gradient(135deg, #000000 0%, #1a1a1a 55%, var(--orange) 130%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
}
.topbar .brand { font-weight: 800; font-size: 16px; letter-spacing: 0.3px; }
.topbar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.topbar nav a {
  color: #f0f0f0;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 6px;
}
.topbar nav a.active, .topbar nav a:hover { background: rgba(255,255,255,0.15); text-decoration: none; }
.topbar form { margin: 0; }
.topbar button.linklike {
  background: none; border: none; color: #f0f0f0; font-size: 13px; cursor: pointer; padding: 7px 12px;
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

h1 { font-size: 22px; margin: 0 0 16px 0; }
h2 { font-size: 16px; margin: 24px 0 10px 0; color: var(--black); }

.card {
  background: #fff;
  border: 1px solid var(--grey-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 18px;
}

.btn {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #e26108; text-decoration: none; color: #fff; }
.btn.secondary { background: var(--black); }
.btn.secondary:hover { background: #000; }
.btn.outline { background: #fff; color: var(--black); border: 1px solid var(--grey-border); }
.btn.outline:hover { background: var(--grey-bg); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.danger { background: var(--danger); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--grey-border); text-align: left; }
th { background: var(--black); color: #fff; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; }
tr:hover td { background: #fafafa; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge.borrador { background: #e2e5ea; color: #333; }
.badge.enviada { background: #fde3c8; color: #8a4b00; }
.badge.aprobada { background: #d8e9ff; color: #0a4a8a; }
.badge.impresa { background: #fff1c2; color: #8a6d00; }
.badge.lista_para_entrega { background: #d6f5e0; color: #0e6b34; }
.badge.cancelada { background: #fcdada; color: #8a1c1c; }
.badge.nueva { background: #e2e5ea; color: #333; }
.badge.cotizar { background: #d8e9ff; color: #0a4a8a; }
.badge.en_espera { background: #fde3c8; color: #8a4b00; }
.badge.terminado { background: #d6f5e0; color: #0e6b34; }
.badge.pendiente { background: #fcdada; color: #8a1c1c; }
.badge.con_anticipo { background: #fde3c8; color: #8a4b00; }
.badge.completada { background: #d6f5e0; color: #0e6b34; }

label { display: block; font-size: 12.5px; font-weight: 600; margin: 10px 0 4px 0; color: #333; }
input, select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  font-size: 13.5px;
  font-family: inherit;
}
textarea { resize: vertical; }
.row { display: flex; gap: 16px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 160px; }

.item-row {
  border: 1px solid var(--grey-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.item-row .precio-preview { font-weight: 800; color: var(--black); padding-top: 8px; }
.item-row-header {
  display: grid;
  grid-template-columns: 2fr 0.8fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.filamentos-subcontainer { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.filamento-sub-row {
  display: grid;
  grid-template-columns: 2fr 1fr auto;
  gap: 10px;
  align-items: end;
  background: #fff;
  border: 1px solid var(--grey-border);
  border-radius: 6px;
  padding: 8px 10px;
}

.totals-box { max-width: 320px; margin-left: auto; }
.totals-box .row2 { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.totals-box .row2.total { border-top: 2px solid var(--black); margin-top: 6px; padding-top: 8px; font-size: 18px; font-weight: 800; }

.notice {
  background: #fff7ed; border-left: 4px solid var(--orange); padding: 10px 14px; border-radius: 6px;
  font-size: 13px; color: #7a4a17; margin: 14px 0;
}
.alert.ok { background: #d6f5e0; color: #0e6b34; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13.5px; }
.alert.error { background: #fcdada; color: #8a1c1c; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 13.5px; }

.muted { color: var(--grey-text); font-size: 12.5px; }
.searchbar { display: flex; gap: 10px; margin-bottom: 14px; }
.searchbar input { flex: 1; }

.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { width: 320px; }

.capture-preview { max-width: 100%; max-height: 260px; border-radius: 8px; border: 1px solid var(--grey-border); margin-top: 8px; display: block; }

.kpis { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.kpi { flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--grey-border); border-radius: 10px; padding: 14px 16px; }
.kpi .lbl { font-size: 11.5px; text-transform: uppercase; color: var(--grey-text); letter-spacing: 0.4px; }
.kpi .val { font-size: 22px; font-weight: 800; margin-top: 4px; }
.kpi.orange .val { color: var(--orange); }
