* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #f5f5f7;
  color: #1d1d1f;
}

/* ===== Login (card) ===== */
.card {
  max-width: 480px;
  margin: 48px auto;
  padding: 28px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}
h1 { font-size: 20px; margin: 0 0 8px; }
.muted { color: #6e6e73; font-size: 14px; }
.err { color: #c0392b; min-height: 1.2em; font-size: 14px; }
ul { margin: 8px 0; padding-left: 18px; }
li { font-size: 14px; color: #6e6e73; margin: 2px 0; }
button {
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
button:hover { background: #f5f5f7; }
button.link { margin-top: 0; border: 0; background: transparent; color: #0071e3; padding: 0; }
#g_btn { min-height: 40px; }

/* ===== Backoffice shell ===== */
.bo {
  display: flex;
  min-height: 100vh;
}
.side {
  width: 232px;
  flex-shrink: 0;
  background: #1d1d1f;
  color: #f5f5f7;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
}
.brand {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2px;
  padding: 4px 8px 16px;
}
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: block;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #d2d2d7;
  text-decoration: none;
  cursor: pointer;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: #2c2c2e; color: #fff; }
.side-foot {
  border-top: 1px solid #2c2c2e;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.side-foot .muted { color: #8e8e93; font-size: 12px; word-break: break-word; }
.side-foot .link { color: #8e8e93; }
.side-foot .link:hover { color: #fff; background: transparent; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.view {
  flex: 1;
  padding: 28px 32px;
  overflow: auto;
}
.view h1 { font-size: 22px; margin-bottom: 4px; }
.view h2 { font-size: 16px; margin: 22px 0 8px; }

.form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.form input, .form select {
  padding: 8px 10px;
  border: 1px solid #d2d2d7;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}
.form button { margin-top: 0; }

/* topbar mobile + burger */
.badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; }
.badge {
  background: #fff; border-radius: 10px; padding: 10px 14px; text-align: center;
  flex: 1 1 100px; font-size: 13px; color: #6e6e73; border: 1px solid #ececf0;
}
.badge b { display: block; font-size: 20px; color: #1d1d1f; }
.bar { background: #ececf0; border-radius: 99px; height: 8px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: #0071e3; }
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tabs button { margin-top: 0; }
.tabs button.on { background: #1d1d1f; color: #fff; border-color: #1d1d1f; }

@media (max-width: 720px) {
  .bo { flex-direction: column; }
  .side {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: 250px;
    transform: translateX(-100%); transition: transform .22s ease; flex-wrap: nowrap;
  }
  .side.open { transform: translateX(0); box-shadow: 0 0 30px rgba(0,0,0,.35); }
  .scrim {
    position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .main { flex: 1; display: flex; flex-direction: column; min-width: 0; flex-basis: auto; }
  .topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 10px;
    background: #fff; border-bottom: 1px solid #ececf0; padding: 10px 14px;
  }
  .topbar-title { font-weight: 600; font-size: 16px; }
  .burger { margin-top: 0; font-size: 18px; padding: 4px 10px; }
  .view { padding: 18px 14px; }
  body.lock { overflow: hidden; }
}

@media (min-width: 721px) {
  .topbar { display: none; }
}
