:root {
  --bg: #f6f7f9;
  --panel: #fff;
  --border: #e3e6ea;
  --text: #1c2530;
  --muted: #6b7684;
  --accent: #0600ff;
  --red: #c0392b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.app { display: flex; flex-direction: column; height: 100%; }

/* Estados sin sesión. Ocupa la pantalla entera a propósito: dentro del layout de la app
   quedaba un sidebar vacío al costado del mensaje. */
.screen {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(20, 30, 45, 0.06);
}

.card h1 { margin: 18px 0 6px; font-size: 20px; }
.card p { margin: 0 0 24px; font-size: 14px; }

.brand.big {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  font-size: 15px;
}

.topbar {
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
}

.topbar-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 700;
}

.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-email { font-size: 13px; opacity: 0.85; }

.btn-plain {
  border: 0;
  border-radius: 7px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}

.btn-plain:hover { background: rgba(255, 255, 255, 0.28); }

.btn-primary {
  border: 0;
  border-radius: 9px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { filter: brightness(1.15); }

.column { flex-direction: column; gap: 14px; }

.body { flex: 1; display: flex; min-height: 0; }

.sidebar {
  width: 250px;
  flex: 0 0 250px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  overflow-y: auto;
}

.group-label {
  padding: 12px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}

.nav-item:hover { background: #f1f2f6; }
.nav-item.active { background: #ecebff; color: var(--accent); font-weight: 600; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 12px; }

.frame {
  flex: 1;
  width: 100%;
  min-height: 600px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.error {
  display: none;
  margin-bottom: 12px;
  padding: 11px 14px;
  border-radius: 9px;
  background: #fdf0ef;
  color: var(--red);
  font-size: 13px;
}

.center { flex: 1; display: flex; align-items: center; justify-content: center; }
.muted { color: var(--muted); font-size: 14px; }

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-bottom-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 760px) {
  .body { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .nav-item { width: auto; white-space: nowrap; }
  .group-label { display: none; }
}
