/* =============================================================
   Hudson Bread — Portal — mismos tokens visuales que usa HV 2.0
   (tomados de hv20/_layout_header.php y hv20/login.php)
   Incluye modo oscuro (toggle en el dashboard, se recuerda por navegador).
   ============================================================= */

:root {
  --hb-blue:        #2563eb;
  --hb-blue-dark:   #1d4ed8;
  --hb-main-bg:     #f8fafc;
  --hb-card:        #ffffff;
  --hb-card-border: #e2e8f0;
  --hb-text-dark:   #1e293b;
  --hb-text-muted:  #64748b;
  --hb-danger-bg:   #fee2e2;
  --hb-danger-text: #991b1b;
  --hb-success-bg:  #dcfce7;
  --hb-success-text:#166534;
  --hb-icon-bg:     #eff6ff;
  --hb-tooltip-bg:  #1e293b;
}

/* Modo oscuro — se activa agregando la clase "dark" al <html> (ver script en dashboard.php) */
html.dark {
  --hb-blue:        #3b82f6;
  --hb-blue-dark:   #60a5fa;
  --hb-main-bg:     #0f172a;
  --hb-card:        #1e293b;
  --hb-card-border: #334155;
  --hb-text-dark:   #f1f5f9;
  --hb-text-muted:  #94a3b8;
  --hb-danger-bg:   #451a1a;
  --hb-danger-text: #fca5a5;
  --hb-success-bg:  #14532d;
  --hb-success-text:#86efac;
  --hb-icon-bg:     #1e3a8a55;
  --hb-tooltip-bg:  #0f172a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--hb-main-bg);
  color: var(--hb-text-dark);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  transition: background-color .2s, color .2s;
}

/* --- Header / dashboard --- */
.hb-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 32px; border-bottom: 1px solid var(--hb-card-border);
  background: var(--hb-card);
}
.hb-logo { height: 40px; display: block; }
.hb-header-right { display: flex; align-items: center; gap: 20px; }
.hb-user { color: var(--hb-text-muted); font-size: 13px; font-weight: 500; }
.hb-header a.hb-link { color: var(--hb-blue); text-decoration: none; font-size: 13px; font-weight: 700; }
.hb-header a.hb-link:hover { color: var(--hb-blue-dark); }

.hb-theme-toggle {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--hb-card-border);
  background: var(--hb-main-bg); color: var(--hb-text-muted); font-size: 15px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  padding: 0;
}
.hb-theme-toggle:hover { border-color: var(--hb-blue); color: var(--hb-blue); }

main.hb-main { max-width: 900px; margin: 40px auto; padding: 0 20px; }
main.hb-main h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 28px; }

.hb-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.hb-mod {
  background: var(--hb-card); border: 1px solid var(--hb-card-border); border-radius: 16px;
  padding: 26px 22px; text-decoration: none; color: var(--hb-text-dark);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  display: flex; flex-direction: column; gap: 14px;
  position: relative; transition: box-shadow .2s, transform .2s, border-color .2s, background-color .2s;
}
.hb-mod:hover { box-shadow: 0 10px 15px -3px rgba(37,99,235,0.15); transform: translateY(-2px); border-color: var(--hb-blue); }
.hb-mod-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--hb-icon-bg); color: var(--hb-blue);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.hb-mod h3 { margin: 0; font-size: 15px; font-weight: 700; }

.hb-mod.disabled { opacity: .5; cursor: not-allowed; }
.hb-mod.disabled:hover { transform: none; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border-color: var(--hb-card-border); }
.hb-mod.disabled .hb-mod-icon { background: var(--hb-main-bg); color: var(--hb-text-muted); }
.hb-mod.disabled:hover::after {
  content: attr(data-tooltip);
  position: absolute; top: -34px; left: 0;
  background: var(--hb-tooltip-bg); color: #fff;
  font-size: 12px; padding: 6px 10px; border-radius: 6px;
  white-space: nowrap; z-index: 10;
}

/* --- Login --- */
.hb-login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  padding: 20px;
}
.hb-card {
  width: 100%; max-width: 400px; background: #fff; border-radius: 24px; padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
}
.hb-card img.hb-logo-login { display: block; margin: 0 auto 20px; height: 46px; }
.hb-card h1 { font-size: 22px; font-weight: 800; text-align: center; letter-spacing: -0.5px; margin: 0 0 4px; color: #1e293b; }
.hb-card p.sub { text-align: center; color: var(--hb-text-muted); font-size: 13px; margin: 0 0 28px; font-weight: 500; }

label { font-size: 11px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 6px; }
input {
  width: 100%; border-radius: 12px; padding: 12px 15px; border: 1px solid var(--hb-card-border);
  background: var(--hb-main-bg); font-weight: 500; font-size: 15px; color: var(--hb-text-dark);
  margin-bottom: 18px;
}
input:focus { outline: none; border-color: var(--hb-blue); box-shadow: 0 0 0 4px rgba(37,99,235,0.1); background: var(--hb-card); }

button, .hb-btn {
  width: 100%; background: var(--hb-blue); border: none; border-radius: 12px; color: #fff;
  padding: 14px; font-weight: 700; font-size: 15px; cursor: pointer;
  box-shadow: 0 4px 6px -1px rgba(37,99,235,0.2); transition: .2s;
}
button:hover, .hb-btn:hover { background: var(--hb-blue-dark); transform: translateY(-1px); }

.hb-error { background: var(--hb-danger-bg); color: var(--hb-danger-text); border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.hb-success { background: var(--hb-success-bg); color: var(--hb-success-text); border-radius: 12px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
