/* ─────────────────────────────────────────────────────────────────────────────
   BitALCER Wallet — Shared Stylesheet v1.0
   Fuente: Space Grotesk (Google Fonts) — incluida en cada HTML con <link>
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Design Tokens ── */
:root {
  --bg:      #030712;
  --card:    rgba(9, 18, 44, 0.92);
  --panel:   rgba(8, 16, 38, 0.72);
  --accent:  #22d3ee;
  --accent2: #6366f1;
  --text:    #ecf3ff;
  --muted:   #a6b6d3;
  --border:  rgba(166, 184, 226, 0.25);
  --danger:  #f43f5e;
  --success: #22c55e;
  --warn:    #f59e0b;

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;

  --shadow-card: 0 18px 44px rgba(0, 6, 24, 0.46);
  --shadow-float: 0 22px 56px rgba(0, 6, 24, 0.52);

  --font: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --nav-height: 78px;
}

/* ── Reset base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%,  rgba(56, 189, 248, 0.20) 0%, transparent 35%),
    radial-gradient(circle at 90% 0%,  rgba(99, 102, 241, 0.18) 0%, transparent 34%),
    linear-gradient(160deg, #030712 0%, #06102a 50%, #071535 100%);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.shell {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 14px calc(var(--nav-height) + 8px);
  display: grid;
  gap: 14px;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── Brand pill ── */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.30);
  background: rgba(14, 165, 233, 0.12);
  color: #d8f7ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ── Tipografía ── */
h1, h2, h3 { margin: 0 0 6px; line-height: 1.1; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.2px; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 600; }
p  { margin: 0 0 14px; }

.muted      { color: var(--muted); font-size: 13px; }
.text-sm    { font-size: 13px; }
.text-xs    { font-size: 11px; }
.font-bold  { font-weight: 700; }

/* ── Formularios ── */
label {
  display: block;
  font-size: 13px;
  color: #c1d2f0;
  margin-bottom: 5px;
}

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(8, 16, 38, 0.8);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  min-height: 44px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18);
}
input::placeholder { color: var(--muted); opacity: 0.65; }

/* ── Botones ── */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: filter 0.15s, transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
button:hover, .btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
button:active, .btn:active { transform: scale(0.97); filter: none; transition-duration: 0.06s; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #052233;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.22);
}
.btn-secondary {
  background: rgba(8, 16, 38, 0.85);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-danger {
  background: linear-gradient(135deg, #fb7185, var(--danger));
  color: #fff;
}
.btn-full  { width: 100%; }
.btn-sm    { min-height: 38px; padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }

/* ── Mensajes de estado ── */
.msg { margin-top: 10px; font-size: 14px; border-radius: var(--radius-sm); padding: 9px 12px; }
.msg-error   { background: rgba(244, 63, 94, 0.12);  border: 1px solid rgba(244, 63, 94, 0.35);  color: #fda4af; }
.msg-success { background: rgba(34, 197, 94, 0.12);  border: 1px solid rgba(34, 197, 94, 0.35);  color: #86efac; }
.msg-info    { background: rgba(34, 211, 238, 0.10); border: 1px solid rgba(34, 211, 238, 0.30); color: #a5f3fc; }

/* ── Badges / chips ── */
.badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
}
.badge-accent  { color: var(--accent);  background: rgba(34,211,238,0.12); border: 1px solid rgba(34,211,238,0.30); }
.badge-success { color: #34d399; background: rgba(34,197,94,0.12);  border: 1px solid rgba(34,197,94,0.30); }
.badge-danger  { color: #fb7185; background: rgba(244,63,94,0.12);  border: 1px solid rgba(244,63,94,0.30); }
.badge-warn    { color: #fcd34d; background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.30); }
.badge-muted   { color: var(--muted); background: rgba(166,184,226,0.08); border: 1px solid var(--border); }

/* ── Header de página (título + acción) ── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.page-header h1 { font-size: 26px; margin: 0; }

/* ── Grid helpers ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 400px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Section title ── */
.section-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ── Spinner de carga ── */
.spinner {
  display: inline-block;
  width: 22px; height: 22px;
  border: 2.5px solid rgba(34, 211, 238, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ── Skeleton pulse ── */
.skeleton {
  background: linear-gradient(90deg,
    rgba(166,184,226,0.07) 25%,
    rgba(166,184,226,0.16) 50%,
    rgba(166,184,226,0.07) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.4s ease infinite;
  border-radius: 8px;
}
.skeleton-line  { height: 14px; border-radius: 6px; margin-bottom: 8px; }
.skeleton-title { height: 22px; border-radius: 6px; width: 55%; margin-bottom: 10px; }
.skeleton-block { height: 64px; border-radius: var(--radius-md); margin-bottom: 10px; }
@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Bottom Navigation ── */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  padding: 10px 12px 14px;
  background: linear-gradient(to top, rgba(3,7,18,0.98), rgba(3,7,18,0.62));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.bottom-nav-inner {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.nav-btn {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  padding: 10px 6px;
  min-height: 54px;
  background: rgba(8, 16, 38, 0.8);
  font-family: var(--font);
  font-weight: 600;
  font-size: 12px;
  display: grid;
  gap: 3px;
  justify-items: center;
  align-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.nav-btn:hover    { background: rgba(34, 211, 238, 0.07); border-color: rgba(34,211,238,0.35); }
.nav-btn.active   { border-color: rgba(125,211,252,0.55); box-shadow: inset 0 0 0 1px rgba(125,211,252,0.22); }
.nav-icon { font-size: 17px; line-height: 1; }

/* ── Side Drawer ── */
.side-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 320px; max-width: 92vw;
  height: 100vh;
  background: rgba(7, 16, 42, 0.98);
  border-left: 1px solid var(--border);
  padding: 18px;
  z-index: 40;
  transition: right 0.24s ease;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.side-drawer.open   { right: 0; }
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 4, 18, 0.55);
  z-index: 39;
  backdrop-filter: blur(2px);
}
.drawer-overlay.open { display: block; }
.drawer-link {
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 16, 38, 0.8);
  font-weight: 600;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s;
}
.drawer-link:hover { border-color: rgba(34,211,238,0.4); background: rgba(34,211,238,0.07); }
.drawer-link .dl-icon { font-size: 18px; flex-shrink: 0; }

/* ── Icon button (header) ── */
.icon-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(8, 16, 38, 0.8);
  color: var(--text);
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: rgba(34,211,238,0.07); border-color: rgba(34,211,238,0.38); }

/* ── Row item (listas de movimientos, etc.) ── */
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.row-item:last-child { border-bottom: none; }
.row-item-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: rgba(8,16,38,0.7);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.row-item-body { flex: 1; min-width: 0; }
.row-item-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item-sub   { font-size: 12px; color: var(--muted); margin-top: 2px; }
.row-item-amount { font-weight: 700; font-size: 15px; text-align: right; white-space: nowrap; flex-shrink: 0; }
.amount-pos { color: #34d399; }
.amount-neg { color: #ecf3ff; }

/* ── Back button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.back-btn:hover { color: var(--text); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 36px 16px;
  color: var(--muted);
}
.empty-state-icon { font-size: 38px; margin-bottom: 10px; }
.empty-state-title { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state-sub   { font-size: 13px; }

/* ── Responsive ── */
@media (max-width: 520px) {
  .shell   { padding-left: 12px; padding-right: 12px; }
  .card    { padding: 14px; }
  h1       { font-size: 22px; }
}
