/* LIT Nutrition – Design System
   Aesthetic: Industrial luxury – negro profundo + verde lima eléctrico + oro
   Tipografía: Bebas Neue (display) + DM Sans (body)
   css/main.css
*/

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=DM+Sans:wght@300;400;500;600&display=swap');

/* Variables */
:root {
  --bg:          #0a0a0a;
  --bg-2:        #111111;
  --bg-3:        #181818;
  --border:      #2a2a2a;
  --border-lite: #1e1e1e;

  --accent:      #b5f23d;   /* verde lima eléctrico */
  --accent-dim:  #8ac42d;
  --gold:        #d4a843;
  --red:         #e85555;
  --blue:        #4a9eff;

  --text:        #b5f23d;
  --text-2:      #ffffff;
  --text-3:      #c6c6c6;
  --text-4:      #b5f23d;

  --font-display: 'Bebas Neue', sans-serif;
  --font-body:    'DM Sans', sans-serif;

  --radius:   8px;
  --radius-lg: 14px;
  --shadow:   0 4px 24px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 24px rgba(181,242,61,0.15);

  --sidebar-w: 240px;
  --header-h:  64px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dim); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* Layout App */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--header-h) 1fr;
  min-height: 100vh;
}

.app-header {
  grid-column: 1 / -1;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.logo span { color: var(--text-2); font-size: 0.9rem; font-family: var(--font-body); margin-left: 8px; vertical-align: middle; }

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-2);
}
.header-user .code-badge {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  color: var(--accent);
  font-size: 1rem;
}

/* Sidebar */
.app-sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.sidebar-section {
  padding: 8px 16px 4px;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-2);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  border-left: 3px solid transparent;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: var(--bg-3); }
.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(181,242,61,0.06);
}
.nav-item .icon { font-size: 1.1rem; width: 20px; text-align: center; }

/* Main Content */
.app-main {
  padding: 32px;
  overflow-y: auto;
}

/* Cards */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.06em;
  color: var(--text);
}

/* Stat Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover { border-color: var(--accent); }
.stat-card:hover::before { opacity: 1; }

.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  letter-spacing: 0.04em;
  color: var(--text);
  line-height: 1;
}
.stat-value.green { color: var(--accent); }
.stat-value.gold  { color: var(--gold); }
.stat-value.blue  { color: var(--blue); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: var(--accent-dim); transform: translateY(-1px); box-shadow: var(--shadow-accent); }

.btn-secondary {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: var(--red); color: #fff; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* Inputs / Forms */
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  transition: border-color 0.15s;
  outline: none;
}
.form-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,242,61,0.1); }
.form-input::placeholder { color: var(--text-3); }

select.form-input { cursor: pointer; }
select.form-input option { background: var(--bg-3); }

/* Table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  padding: 10px 14px;
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-3);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-lite);
  color: var(--text-2);
}
tbody tr:hover td { background: var(--bg-3); color: var(--text); }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.badge-green  { background: rgba(181,242,61,0.15); color: var(--accent); }
.badge-red    { background: rgba(232,85,85,0.15); color: var(--red); }
.badge-gold   { background: rgba(212,168,67,0.15); color: var(--gold); }
.badge-blue   { background: rgba(74,158,255,0.15); color: var(--blue); }
.badge-gray   { background: rgba(136,136,136,0.12); color: var(--text-3); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Scrollbar invisible reutilizable */
.scroll-hidden {
  overflow-y: auto;
  scrollbar-width: none;       /* Firefox */
  -ms-overflow-style: none;    /* IE/Edge */
}
.scroll-hidden::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 480px;
  transform: translateY(16px);
  transition: transform 0.2s;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 20px;
  color: var(--accent);
}
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 20px;
  font-size: 0.88rem;
  min-width: 260px;
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

@keyframes toastIn { from { opacity:0; transform: translateX(20px); } to { opacity:1; transform:none; } }

/* Auth Page */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(181,242,61,0.07) 0%, transparent 70%);
  pointer-events: none;
}
.auth-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 48px 40px;
  width: 90%;
  max-width: 420px;
  position: relative;
}
.auth-logo {
  font-family: var(--font-display);
  font-size: 2.8rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.auth-subtitle {
  color: var(--text-3);
  font-size: 0.85rem;
  margin-bottom: 32px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 3px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-3);
  transition: all 0.15s;
}
.auth-tab.active { background: var(--bg-2); color: var(--accent); }

/* Page Title */
.page-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.page-sub {
  color: var(--text-2);
  font-size: 0.88rem;
  margin-bottom: 28px;
}

/* Grid helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.flex   { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }

/* Loader */
.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  color: var(--text-3);
  gap: 12px;
}

/* Empty state */
.empty {
  text-align: center;
  padding: 48px;
  color: var(--text-3);
}
.empty .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty p { font-size: 0.9rem; }

/* Product card */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card .product-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-lite);
}
.price-row:last-of-type { border-bottom: none; }
.price-label { color: var(--text-3); }
.price-val { font-weight: 600; color: var(--text); }
.price-val.accent { color: var(--accent); }
.price-val.gold   { color: var(--gold); }

/* Network tree */
.network-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s;
}
.network-card:hover { border-color: var(--accent); }
.network-code { font-family: var(--font-display); font-size: 1.1rem; color: var(--accent); }
.network-name { font-size: 0.85rem; color: var(--text-2); }

/* Responsive */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-h) auto 1fr;
  }
  .app-sidebar {
    display: none;
  }
  .app-main { padding: 16px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}