:root {
  --bg: #0b0b0b; --fg: #ffffff; --muted: #9aa0a6; --line: #222; --accent: #1f6feb;
}

html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

/* Safe area (notch iOS) */
.safe-area {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}
.topbar {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px);
}
.brand { display:flex; align-items:center; gap:.5rem; }
.badge { font-size: .75rem; color: #111; background: #ffd54f; border-radius: 999px; padding: .15rem .5rem; }
.actions { display:flex; gap:.5rem; flex-wrap: wrap; }
input[type="search"], input[type="password"], input[type="text"] {
  flex: 1; min-width: 160px; padding: .6rem .7rem; border-radius: .75rem; border: 1px solid var(--line);
  background: #111; color: var(--fg);
}
.btn { padding: .55rem .8rem; border-radius: .75rem; border: 1px solid var(--line); background: #111; color: var(--fg); cursor: pointer; }
.btn-secondary { opacity: .8; }
.btn-accent { border-color: var(--accent); }

.app-layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 58px); }
.sidebar { border-right: 1px solid var(--line); padding: 1rem; }
.sidebar nav { display: grid; gap: .5rem; }
.nav-btn {
  display:flex; align-items:center; justify-content: space-between; gap:.75rem;
  width: 100%; text-align: left; padding: .6rem .8rem;
  border:1px solid var(--line); border-radius: .75rem; background:#111; color: var(--fg); cursor:pointer;
}
.nav-btn.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pill { font-size: .75rem; background:#222; padding:.1rem .45rem; border-radius:999px; color:var(--muted); }
.meta { margin-top: 1rem; font-size: .85rem; }
.tip { margin-top: .75rem; font-size: .85rem; color: var(--muted); }

.container { max-width: 1100px; margin: 0 auto; padding: 1rem; }
.toolbar { display:flex; gap: 1rem; align-items:center; justify-content: space-between; margin-bottom: .75rem; }

.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.card { border:1px solid var(--line); border-radius: 1rem; padding: .75rem; background:#121212; }

.line1 { display:flex; justify-content: space-between; align-items: baseline; gap:.5rem; }
.name { font-weight: 600; }
.price { font-variant-numeric: tabular-nums; }
.line2 { display:flex; justify-content: space-between; gap:.5rem; margin-top: .25rem; }
.muted { color: var(--muted); }

.hidden { display: none; }

.footer {
  border-top: 1px solid var(--line); padding: .75rem 1rem;
  text-align: center; color: var(--muted);
  padding-bottom: calc(.75rem + env(safe-area-inset-bottom));
}

/* --- Responsive móvil --- */
@media (max-width: 880px) {
  .app-layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .list { grid-template-columns: 1fr; }
  .actions { width: 100%; }
}
/* Snackbar básico para fallback en móviles */
.snackbar {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: 90%;
  padding: .75rem 1rem;
  border-radius: .75rem;
  background: #222;
  color: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.snackbar.show {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}
/* ===== Notificaciones in-app (bocadillo) ===== */
.notif-container {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: grid;
  gap: .5rem;
  padding: 0 12px;
  z-index: 9999;
  pointer-events: none; /* deja pasar clics salvo en cada tarjeta */
}

.notif {
  pointer-events: auto;
  margin: 0 auto;
  max-width: 560px;
  width: calc(100% - 24px);
  background: #111;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .75rem .9rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .5rem .75rem;
  position: relative;
  transform: translateY(8px);
  opacity: 0;
  transition: transform .18s ease, opacity .18s ease, border-color .2s ease;
}

/* “pico” del bocadillo */
.notif::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: -8px;
  border-width: 8px 8px 0 0;
  border-style: solid;
  border-color: var(--line) transparent transparent transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.2));
}
.notif::before {
  content: "";
  position: absolute;
  left: 23px;
  bottom: -6px;
  border-width: 7px 7px 0 0;
  border-style: solid;
  border-color: #111 transparent transparent transparent;
}

.notif.show { transform: translateY(0); opacity: 1; }
.notif .title { font-weight: 600; }
.notif .msg { color: var(--muted); }
.notif .actions { display: flex; gap: .5rem; align-items: center; }
.notif .btn-mini {
  border: 1px solid var(--line); background: #181818; color: var(--fg);
  padding: .2rem .5rem; border-radius: .5rem; cursor: pointer; font-size: .85rem;
}
.notif .close {
  all: unset; cursor: pointer; color: var(--muted); padding: .25rem; line-height: 1;
}

/* Tipos */
.notif.info    { border-color: #376df1; }
.notif.success { border-color: #22c55e; }
.notif.warn    { border-color: #f59e0b; }
.notif.error   { border-color: #ef4444; }

/* Responsive móvil: una sola columna de lista */
@media (max-width: 480px) {
  .notif { padding: .7rem .85rem; }
}
