:root {
  --bg:           #f0f4f8;
  --bg-panel:     #ffffff;
  --bg-card:      #f7f9fc;
  --border:       #e1e8f0;
  --header-bg:    #1e3a5f;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --green:        #16a34a;
  --yellow:       #d97706;
  --red:          #dc2626;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --shadow:       0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --radius:       8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-size: 14px;
}

/* ============================================================
   HEADER
   ============================================================ */
#header {
  background: var(--header-bg);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 48px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 10;
}

#header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.header-stats {
  display: flex;
  gap: 28px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.65;
}

.stat-value {
  font-size: 15px;
  font-weight: 700;
  color: #fde68a;
}

.stat-value.green { color: #4ade80; }
.stat-value.dim   { color: rgba(255,255,255,0.5); font-size: 13px; }

.header-actions {
  display: flex;
  gap: 8px;
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); }

.btn-danger {
  background: rgba(220,38,38,0.2);
  color: #fca5a5;
  border: 1px solid rgba(220,38,38,0.35);
  padding: 6px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 12px;
  transition: background 0.15s;
}
.btn-danger:hover { background: rgba(220,38,38,0.4); }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
#notifications { flex-shrink: 0; }

#offline-banner {
  background: linear-gradient(135deg, #1e3a5f, #2563eb);
  color: #fff;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  animation: slideDown 0.35s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

.close-banner {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
.close-banner:hover { color: #fff; }

/* ============================================================
   LAYOUT
   ============================================================ */
#game {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ============================================================
   PANEL IZQUIERDO
   ============================================================ */
#panel-left {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

/* ---- Clicker ---- */
#clicker-area {
  padding: 20px 16px;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#desk {
  width: 164px;
  height: 164px;
  background: linear-gradient(135deg, #e8f0fe, #dbeafe);
  border: 2px solid #bfdbfe;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s, box-shadow 0.1s, border-color 0.2s;
  box-shadow: 0 4px 14px rgba(37,99,235,0.18);
}

#desk:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 22px rgba(37,99,235,0.28);
  border-color: #93c5fd;
}

#desk:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}

#desk-icon {
  display: block;
  line-height: 1;
  transition: transform 0.15s;
}
#desk-icon .gi {
  width: 54px;
  height: 54px;
  color: #2563eb;
  stroke-width: 1.5;
}

#desk-icon.bounce {
  animation: iconBounce 0.22s ease;
}

@keyframes iconBounce {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.3) rotate(-10deg); }
  100% { transform: scale(1) rotate(0deg); }
}

#click-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

#click-income {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  margin-top: 3px;
}

/* ---- News ---- */
#news-panel {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

#news-panel h3 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.news-item {
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 8px;
  border-left: 2px solid #bfdbfe;
  margin-bottom: 6px;
  line-height: 1.45;
  animation: newsSlide 0.3s ease;
}

@keyframes newsSlide {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   PANEL DERECHO — tabs internas
   ============================================================ */
#panel-right {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
}

#right-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}

.rtab-btn {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
  position: relative;
}

.rtab-btn:hover {
  color: var(--text);
  background: rgba(37,99,235,.06);
}

.rtab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Badge de notificaciones en la pestaña Empresa */
.rtab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 5px;
  vertical-align: middle;
  line-height: 1;
}

.rtab-pane {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.rtab-pane.active {
  display: flex;
}

#panel-right h2 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ============================================================
   FLOATING MONEY TEXT
   ============================================================ */
.floating-text {
  position: fixed;
  pointer-events: none;
  font-size: 15px;
  font-weight: 800;
  color: #16a34a;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
  z-index: 1000;
  animation: floatUp 0.85s ease-out forwards;
  white-space: nowrap;
}

@keyframes floatUp {
  0%   { transform: translateY(0)     translateX(-50%); opacity: 1; }
  100% { transform: translateY(-65px) translateX(-50%); opacity: 0; }
}

/* ============================================================
   BOTTOM TAB NAV — oculto en desktop
   ============================================================ */
#mobile-tabs { display: none; }

/* ============================================================
   RESPONSIVE — compacto en pantallas medianas
   ============================================================ */
@media (max-width: 900px) {
  .header-stats { gap: 18px; }
  #header h1    { font-size: 15px; }
}

/* ── Header compacto en móvil ── */
@media (max-width: 640px) {
  body { height: 100dvh; overflow: hidden; }

  #header {
    height: auto;
    padding: 6px 12px;
    flex-wrap: wrap;
    gap: 2px 10px;
  }
  #header h1 { font-size: 14px; letter-spacing: 0; }

  .header-stats {
    order: 3;
    width: 100%;
    gap: 0;
    justify-content: space-around;
    padding: 4px 0 2px;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .stat-value     { font-size: 14px; }
  .stat-value.dim { font-size: 12px; }
  .header-actions { gap: 6px; }

  .btn-secondary,
  .btn-danger { padding: 5px 8px; font-size: 11px; }

  .btn-secondary .btn-label,
  .btn-danger    .btn-label { display: none; }
}

/* ── Lucide Icons globales ───────────────────────────────────────────── */
.gi {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  stroke-width: 2;
  flex-shrink: 0;
}
.gi.gi-sm { width: 0.8em;  height: 0.8em;  }
.gi.gi-lg { width: 1.3em;  height: 1.3em;  }
