:root {
  --bg: #f2f5f9;
  --ink: #1c2733;
  --muted: #5c6b7a;
  --line: #dbe3ec;
  --accent: #0b5ed7;
  --sidebar: #12263f;
  --sidebar-ink: #c8d6e5;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--sidebar), #1d3a5f 70%);
}
.login-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  text-align: center;
}
.login-logo {
  width: 64px; height: 64px;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 14px;
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.btn-google:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--sidebar);
  color: var(--sidebar-ink);
  padding: 18px 0;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1040;
  transition: transform .2s;
}
.sidebar .brand {
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  padding: 4px 20px 16px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.sidebar .brand .mini {
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}
.sidebar a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 20px;
  color: var(--sidebar-ink);
  text-decoration: none;
  font-size: 14px;
}
.sidebar a i { width: 18px; text-align: center; }
.sidebar a:hover { color: #fff; }
.sidebar a.active {
  background: rgba(255, 255, 255, .08);
  color: #fff;
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}
.main { flex: 1; margin-left: 240px; display: flex; flex-direction: column; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.topbar .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.content { padding: 22px; }

.stat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.stat-card .num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.panel .panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.panel .panel-head h5 { margin: 0; }
.table thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.pill-role { background: rgba(11, 94, 215, .12); color: var(--accent); }
.pill-on { background: rgba(24, 133, 84, .12); color: #188554; }
.pill-off { background: rgba(180, 35, 24, .12); color: #b42318; }

/* ---------- Mobile: bottom navigation bar (phone-app style) ---------- */
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
  .sidebar {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0;
    transition: none;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .18);
  }
  .sidebar .brand { display: none; }
  .sidebar nav {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar a {
    flex: 1 1 0;
    min-width: 68px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    font-size: 10.5px;
    text-align: center;
    white-space: nowrap;
    border-top: 3px solid transparent;
  }
  .sidebar a i { width: auto; font-size: 17px; }
  .sidebar a.active {
    background: rgba(255, 255, 255, .08);
    color: #fff;
    border-left: 0;
    border-top: 3px solid var(--accent);
    padding-left: 4px;
  }
  .main { margin-left: 0; }
  /* keep page content clear of the bottom bar */
  .content { padding-bottom: 90px; }
}
