/*
 * CIMA · Ventas — Panel de Ventas
 * Archivo: app/style/app.css
 * Estilos del login y del shell del panel. Tema oscuro sobrio, wallpaper + overlay
 * (sin degradados de color de fondo).
 */

:root {
  --primary: #1d4ed8;
  --primary-2: #3b82f6;
  --accent: #38bdf8;

  --bg: #070b16;
  --surface: rgba(20, 26, 46, 0.82);
  --surface-hover: rgba(30, 38, 66, 0.92);
  --border: rgba(255, 255, 255, 0.10);
  --text: #eef3fb;
  --text-muted: rgba(238, 243, 251, 0.62);
  --text-faint: rgba(238, 243, 251, 0.38);
  --shadow: 0 18px 56px rgba(0, 0, 0, 0.55);
  --danger: #f87171;
  --ok: #34d399;
  --radius: 14px;
  --radius-sm: 10px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ───────────────────── Wallpaper + overlay (sin degradados de color) ───────────────────── */
.vw-wallpaper {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?q=80&w=2400&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  filter: saturate(0.85) brightness(0.55);
}

.vw-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: rgba(5, 8, 16, 0.62);
  backdrop-filter: blur(2px);
}

/* ───────────────────── Login ───────────────────── */
.vw-login-wrap {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vw-login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px 32px;
  backdrop-filter: blur(18px);
}

.vw-wordmark {
  text-align: center;
  margin-bottom: 32px;
}

.vw-wordmark .vw-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.vw-wordmark .vw-brand span {
  color: var(--accent);
}

.vw-wordmark .vw-tag {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.vw-field {
  margin-bottom: 16px;
}

.vw-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.vw-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.vw-field input::placeholder {
  color: var(--text-faint);
}

.vw-field input:focus {
  border-color: var(--primary-2);
  background: rgba(255, 255, 255, 0.06);
}

.vw-submit {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.vw-submit:hover { background: var(--primary-2); }
.vw-submit:active { transform: translateY(1px); }
.vw-submit:disabled { opacity: 0.6; cursor: default; }

.vw-error {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.30);
  color: var(--danger);
  font-size: 13px;
  display: none;
}

.vw-error.is-visible { display: block; }

/* ───────────────────── Shell del panel ───────────────────── */
.vw-shell {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.vw-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}

.vw-topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.vw-topbar-title span {
  color: var(--accent);
}

.vw-topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vw-user-name {
  font-size: 13.5px;
  color: var(--text-muted);
}

.vw-logout-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.vw-logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.vw-content {
  flex: 1;
  padding: 40px 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.vw-welcome {
  margin-bottom: 32px;
}

.vw-welcome h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.vw-welcome p {
  font-size: 14px;
  color: var(--text-muted);
}

.vw-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.vw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.vw-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.14);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
}

.vw-card h2 {
  font-size: 15.5px;
  font-weight: 600;
}

.vw-card p {
  font-size: 13px;
  color: var(--text-muted);
}

/* ───────────────────── Toast (reemplaza alert/confirm nativos) ───────────────────── */
.vw-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  z-index: 50;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: rgba(15, 20, 36, 0.92);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.vw-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.vw-toast.is-error {
  border-color: rgba(248, 113, 113, 0.35);
}

/* ───────────────────── Responsive ───────────────────── */
@media (max-width: 640px) {
  .vw-login-card { padding: 32px 22px 26px; }
  .vw-topbar { padding: 12px 16px; }
  .vw-content { padding: 28px 16px; }
  .vw-cards { grid-template-columns: 1fr; }
}
