@charset "UTF-8";
:root {
  --ink: #14110c;
  --ink-2: #1d1913;
  --ink-3: #2a241a;
  --ink-4: #353018;
  --paper: #f4ede0;
  --paper-dim: #b8ad99;
  --amber: #f0a830;
  --amber-deep: #c97f1a;
  --line: #3a3225;
  --ok: #8fb86a;
  --err: #e07070;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  background: #14110c;
  color: #f4ede0;
  font-family: "JetBrains Mono", monospace;
  line-height: 1.6;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(240,168,48,.025) 39px, rgba(240,168,48,.025) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(240,168,48,.025) 39px, rgba(240,168,48,.025) 40px);
}
.serif { font-family: "Instrument Serif", serif; font-weight: 400; }
button { font-family: inherit; cursor: pointer; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid #3a3225;
  background: #1d1913;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-sep { color: #3a3225; font-size: 18px; }
.topbar-spacer { flex: 1; }
.crumb { font-size: 12px; color: #b8ad99; }
.crumb b { color: #f4ede0; }
.logo { font-size: 20px; letter-spacing: -0.5px; text-decoration: none; color: #f4ede0; }
.logo .serif { font-size: 25px; font-style: italic; color: #f0a830; }
.topbar-link {
  color: #b8ad99; text-decoration: none; font-size: .8rem;
  transition: color .15s;
}
.topbar-link:hover { color: #f0a830; }
.keyfield { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #b8ad99; }
.keyfield input {
  background: #14110c; border: 1px solid #3a3225; color: #f4ede0;
  padding: 6px 10px; border-radius: 3px; font-family: inherit;
  font-size: 11px; width: 220px; outline: none;
}
.keyfield input:focus { border-color: #c97f1a; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #b8ad99; flex-shrink: 0; }
.dot.on  { background: #8fb86a; }
.dot.off { background: #e07070; }

/* ── Content ── */
.content { max-width: 1000px; margin: 0 auto; padding: 48px 28px 80px; flex: 1; width: 100%; }
.page-header { margin-bottom: 36px; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -1px; }
.page-title .serif { font-style: italic; color: #f0a830; font-weight: 400; }

/* ── States ── */
.state-box { text-align: center; padding: 80px 20px; color: #b8ad99; font-size: 14px; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid #3a3225; border-top-color: #f0a830;
  border-radius: 50%; animation: spin .7s linear infinite;
  margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state .serif { font-size: 42px; font-style: italic; color: #f0a830; display: block; margin-bottom: 14px; }
.empty-state p { font-size: 14px; color: #b8ad99; margin-bottom: 28px; }
.btn-new {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 12px 22px; background: #f0a830; color: #14110c;
  border: 1px solid #f0a830; border-radius: 3px; cursor: pointer;
  text-decoration: none; display: inline-block;
  box-shadow: 3px 3px 0 #c97f1a; transition: transform .12s, box-shadow .15s;
}
.btn-new:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #c97f1a; }

/* ── Tabla ── */
.inv-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.inv-table thead th {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #b8ad99;
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid #3a3225;
  white-space: nowrap;
}
.inv-table thead th.r { text-align: right; }
.inv-table tbody tr { border-bottom: 1px solid #2a241a; transition: background .1s; }
.inv-table tbody tr:hover { background: #1d1913; }
.inv-table tbody td {
  padding: 14px 14px;
  vertical-align: middle;
  color: #f4ede0;
}
.inv-table tbody td.r { text-align: right; }
.inv-table tbody td.dim { color: #b8ad99; font-size: 12px; }
.inv-table tbody td.mono { font-family: "JetBrains Mono", monospace; font-size: 11px; color: #c97f1a; }
.inv-table tbody td .desc { font-weight: 700; }
.credits-chip {
  display: inline-block;
  background: #2a241a;
  border: 1px solid #3a3225;
  color: #b8ad99;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
}
.amount { font-weight: 700; color: #f0a830; }

/* ── Botones de acción ── */
.inv-actions { display: flex; gap: 6px; justify-content: flex-end; }
.btn-inv {
  font-family: inherit; font-size: 11px; padding: 6px 12px;
  border-radius: 3px; cursor: pointer; text-decoration: none;
  display: inline-block; transition: all .12s; white-space: nowrap;
}
.btn-inv.html {
  background: transparent; color: #b8ad99; border: 1px solid #3a3225;
}
.btn-inv.html:hover { border-color: #f0a830; color: #f0a830; }
.btn-inv.pdf {
  background: transparent; color: #f0a830; border: 1px solid #c97f1a;
}
.btn-inv.pdf:hover { background: rgba(240,168,48,.08); }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 22px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #353018; border: 1px solid #c97f1a;
  color: #f4ede0; padding: 11px 20px; border-radius: 4px;
  font-size: 13px; transition: transform .25s; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.err  { border-color: #e07070; }
