/* Pizzaholic — tema claro con identidad de marca
   Verde #0f7a4f (Pantone 3298 C aprox) · Dorado #e0a11f / swoosh #eda624 */
:root {
  --bg: #f1f4f0; --card: #ffffff; --card2: #f6f9f5;
  --txt: #16241d; --muted: #6b7b71; --line: #e2e8e2;
  --green: #0f7a4f; --green-d: #0b5d3c; --green-dark: #103527;
  --gold: #e0a11f; --gold-soft: #f6c454; --swoosh: #eda624;
  --ok: #169a59; --bad: #d6453f; --blue: #2f8fd6; --purple: #7d5fd0;
  --shadow: 0 4px 18px rgba(20,45,32,.07);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--txt);
  font-family: 'Inter', -apple-system, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--green); }

/* marca / wordmark */
.brandmark { font-family: 'Montserrat', sans-serif; font-weight: 800; color: var(--green);
  letter-spacing: -.4px; position: relative; display: inline-block; line-height: 1; }
.brandmark::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 5px;
  border-radius: 6px; background: var(--swoosh);
  -webkit-mask: radial-gradient(14px 9px at 50% -3px, transparent 96%, #000 100%); mask: radial-gradient(14px 9px at 50% -3px, transparent 96%, #000 100%); }
.brand-img { width: 162px; max-width: 100%; height: auto; display: block; }
.login-logo-img { width: 240px; max-width: 84%; height: auto; }

/* ---------- LOGIN ---------- */
.login-body { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 560px at 50% -8%, #e4f0e8 0%, var(--bg) 60%); padding: 20px; }
.login-card { width: 100%; max-width: 384px; background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 38px 34px; box-shadow: var(--shadow); text-align: center; }
.login-card .brandmark { font-size: 30px; margin-bottom: 4px; }
.login-sub { margin: 14px 0 24px; color: var(--muted); font-size: 14px; }
.login-card form { text-align: left; display: grid; gap: 14px; }
.login-card label { font-size: 13px; color: var(--muted); display: grid; gap: 6px; font-weight: 500; }
.login-card input { background: #fff; border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 12px 14px; font-size: 15px; outline: none; transition: border-color .15s; }
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,122,79,.12); }
.login-card button { margin-top: 6px; background: var(--green); color: #fff; border: 0; border-radius: 10px;
  padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background .15s; }
.login-card button:hover { background: var(--green-d); }
.login-card button:disabled { opacity: .6; cursor: default; }
.login-error { color: var(--bad); font-size: 13px; min-height: 16px; }
.login-foot { margin-top: 22px; color: var(--muted); font-size: 11px; }

/* ---------- LAYOUT ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 18px 14px;
  display: flex; flex-direction: column; gap: 3px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 6px 10px 22px; }
.brand .brandmark { font-size: 21px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px;
  color: var(--muted); cursor: pointer; font-size: 14.5px; text-decoration: none; font-weight: 500; }
.nav-item:hover { background: var(--card2); color: var(--txt); }
.nav-item.active { background: var(--green); color: #fff; box-shadow: 0 4px 12px rgba(15,122,79,.25); }
.nav-item .ic { width: 18px; text-align: center; }
.sidebar .spacer { flex: 1; }
.logout { color: var(--muted); font-size: 13px; cursor: pointer; padding: 11px 12px; border-radius: 10px; }
.logout:hover { background: #fbecec; color: var(--bad); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(241,244,240,.92);
  backdrop-filter: blur(6px); z-index: 5; flex-wrap: wrap; }
.topbar h2 { margin: 0; font-size: 19px; font-family: 'Montserrat', sans-serif; font-weight: 700; }
.topbar .estado { font-size: 12px; color: var(--muted); }
.sync-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.sync-dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,154,89,.15); }
.sync-dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(244,166,35,.15); }
.sync-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(214,69,63,.15); }
.ranges { display: flex; gap: 6px; flex-wrap: wrap; }
.range-btn { background: #fff; border: 1px solid var(--line); color: var(--muted); border-radius: 8px;
  padding: 7px 12px; font-size: 13px; cursor: pointer; font-weight: 500; }
.range-btn:hover { color: var(--txt); border-color: #cfd8cf; }
.range-btn.active { background: var(--green); color: #fff; border-color: var(--green); }
.content { padding: 24px; max-width: 1240px; }

/* ---------- COMPONENTES ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow); }
.card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.card .valor { font-size: 28px; font-weight: 700; margin-top: 8px; font-family: 'Montserrat', sans-serif; }
.card .sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.delta.up { color: var(--ok); font-weight: 600; } .delta.down { color: var(--bad); font-weight: 600; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-top: 18px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 14px; font-size: 13px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
canvas { width: 100% !important; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; }
tbody tr:hover { background: var(--card2); }
.bar-cell { position: relative; }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(15,122,79,.12); border-radius: 4px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; }
.pill.ok { background: rgba(22,154,89,.14); color: var(--ok); }
.pill.bad { background: rgba(214,69,63,.14); color: var(--bad); }
.muted { color: var(--muted); }
.loading { color: var(--muted); padding: 40px; text-align: center; }
.heat-table { border-collapse: collapse; }
.heat-table td { width: 30px; height: 26px; text-align: center; padding: 0; font-size: 10px; border: 2px solid #fff; border-radius: 4px; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -240px; transition: left .2s; z-index: 30; box-shadow: 2px 0 20px rgba(0,0,0,.15); }
  .sidebar.open { left: 0; }
  .menu-btn { display: inline-flex !important; }
}
.menu-btn { display: none; background: #fff; border: 1px solid var(--line); color: var(--txt);
  border-radius: 8px; padding: 7px 11px; cursor: pointer; font-size: 16px; }
