/* Parental monitoring dashboard — rich left drawer + icon UI */
:root {
  --db-bg: #e8eef4;
  --db-sidebar: #17232e;
  --db-accent: #2f7eb8;
  --db-accent-2: #45a4e0;
  --db-green: #2f9e6b;
  --db-orange: #e39a3c;
  --db-pink: #d45d7c;
  --db-purple: #6b6fd4;
  --db-ink: #1e2a33;
  --db-muted: #667683;
  --db-line: #d7e0e8;
  --db-white: #ffffff;
  --db-font: "Nunito", "Segoe UI", sans-serif;
  --db-display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.dashboard-body {
  font-family: var(--db-font);
  background:
    radial-gradient(800px 300px at 100% 0%, rgba(47,126,184,.08), transparent 50%),
    var(--db-bg);
  color: var(--db-ink);
  min-height: 100vh;
}

.db-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

/* ===== LEFT DRAWER ===== */
.db-sidebar {
  background: linear-gradient(185deg, #1a2835 0%, #121c26 100%);
  color: #b8c5d1;
  padding: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.04);
  z-index: 30;
}
.db-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1rem .8rem 1.2rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.db-brand {
  display: flex; align-items: center; gap: .7rem;
  color: #fff; text-decoration: none;
  padding: 1.15rem 1rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  background: rgba(0,0,0,.15);
}
.db-brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, var(--db-accent-2), var(--db-accent));
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 18px rgba(47,126,184,.35);
  flex-shrink: 0;
}
.db-brand-mark svg { width: 21px; height: 21px; }
.db-brand strong { display: block; font-size: 1.02rem; line-height: 1.15; }
.db-brand small { color: #8093a4; font-size: .7rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }

.db-device-chip {
  margin: .9rem .2rem 1rem;
  padding: .75rem .8rem;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: .7rem;
}
.db-device-avatar {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(145deg, #3d8ec4, #2a6a96);
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
}
.db-device-avatar svg { width: 18px; height: 18px; }
.db-device-chip strong { display: block; color: #fff; font-size: .92rem; }
.db-device-chip span { color: #8496a7; font-size: 12px; font-weight: 700; }
.db-device-chip .online {
  margin-left: auto;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--db-green);
  box-shadow: 0 0 0 3px rgba(47,158,107,.25);
}

.db-nav { display: grid; gap: .15rem; }
.nav-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: #6d8091; padding: .95rem .7rem .4rem; font-weight: 800;
}
.db-nav a {
  display: flex; align-items: center; gap: .75rem;
  padding: .62rem .65rem;
  border-radius: 12px;
  color: #c2ced8;
  text-decoration: none;
  font-weight: 700;
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  position: relative;
}
.db-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.db-nav a.is-active {
  background: linear-gradient(90deg, rgba(47,126,184,.4), rgba(47,126,184,.12));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--db-accent-2);
}
.nav-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.06);
  color: #9eb0c0;
  flex-shrink: 0;
  transition: background .15s, color .15s, transform .15s;
}
.nav-ico svg { width: 17px; height: 17px; }
.db-nav a:hover .nav-ico,
.db-nav a.is-active .nav-ico {
  transform: scale(1.04);
  color: #fff;
}
.db-nav a.is-active .nav-ico { background: rgba(69,164,224,.28); color: #9fd4ff; }

/* per-item accent colors */
.nav-ico.c-blue { background: rgba(47,126,184,.18); color: #7ec4f0; }
.nav-ico.c-green { background: rgba(47,158,107,.18); color: #7ed9af; }
.nav-ico.c-orange { background: rgba(227,154,60,.18); color: #f0c27a; }
.nav-ico.c-pink { background: rgba(212,93,124,.18); color: #f0a0b5; }
.nav-ico.c-purple { background: rgba(107,111,212,.18); color: #b0b3f0; }
.nav-ico.c-teal { background: rgba(45,160,150,.18); color: #7eddd4; }
.nav-ico.c-slate { background: rgba(255,255,255,.08); color: #b0c0ce; }

.nav-count {
  margin-left: auto;
  min-width: 22px; height: 22px; padding: 0 .4rem;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #d5e0ea;
  font-size: 11px; font-weight: 800;
  display: grid; place-items: center;
}
.db-nav a.is-active .nav-count { background: rgba(255,255,255,.18); color: #fff; }

.db-sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: .85rem .9rem 1rem;
  display: grid; gap: .35rem;
  background: rgba(0,0,0,.18);
}
.db-sidebar-foot a {
  display: flex; align-items: center; gap: .55rem;
  color: #9aadbcc; color: #9aadc0; text-decoration: none;
  font-size: 13px; font-weight: 700;
  padding: .5rem .6rem; border-radius: 10px;
}
.db-sidebar-foot a:hover { color: #fff; background: rgba(255,255,255,.05); }
.db-sidebar-foot svg { width: 16px; height: 16px; }

/* ===== MAIN ===== */
.db-main { display: flex; flex-direction: column; min-width: 0; }
.db-topbar {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--db-line);
  padding: .8rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  position: sticky; top: 0; z-index: 20;
}
.db-top-left { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.db-top-left h1 {
  margin: 0; font-family: var(--db-display); font-size: 1.3rem; font-weight: 600;
}
.demo-pill {
  display: inline-flex; align-items: center; gap: .35rem;
  background: #fff4e0; color: #9a6410; border: 1px solid #f0d49a;
  font-size: 11px; font-weight: 800; padding: .3rem .7rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.db-device-select {
  display: flex; align-items: center; gap: .5rem;
  background: #f2f6fa; border: 1px solid var(--db-line);
  border-radius: 12px; padding: .4rem .6rem .4rem .8rem;
  font-weight: 700; font-size: 13px; color: var(--db-muted);
}
.db-device-select select {
  border: 0; background: transparent; font: inherit; font-weight: 800;
  color: var(--db-ink); outline: none; max-width: 220px;
}
.db-top-actions { display: flex; gap: .5rem; align-items: center; }
.db-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem .95rem; border-radius: 999px; border: 1px solid var(--db-line);
  background: #fff; color: var(--db-ink); text-decoration: none;
  font-weight: 800; font-size: 13px; cursor: pointer;
  transition: transform .15s, background .15s;
}
.db-btn:hover { transform: translateY(-1px); background: #f7f9fb; }
.db-btn svg { width: 15px; height: 15px; }
.db-btn-primary { background: var(--db-accent); border-color: var(--db-accent); color: #fff; }
.db-btn-primary:hover { background: #256897; color: #fff; }

.db-content { padding: 1.25rem; }

.db-banner {
  background: linear-gradient(120deg, #e7f3fc, #e9f8f1 55%, #fff6e9);
  border: 1px solid #d0e4f2;
  border-radius: 18px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.2rem;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap;
  box-shadow: 0 8px 24px rgba(31,45,58,.04);
}
.db-banner-ico {
  width: 48px; height: 48px; border-radius: 14px;
  background: #fff; color: var(--db-accent);
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(47,126,184,.12);
  flex-shrink: 0;
}
.db-banner-ico svg { width: 22px; height: 22px; }
.db-banner-text { display: flex; gap: .9rem; align-items: center; }
.db-banner p { margin: .15rem 0 0; color: var(--db-muted); font-weight: 600; font-size: 14px; }
.db-banner strong { color: var(--db-ink); font-size: 1.05rem; }

/* Quick tiles */
.quick-tiles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .75rem;
  margin-bottom: 1.2rem;
}
.quick-tile {
  background: var(--db-white);
  border: 1px solid var(--db-line);
  border-radius: 16px;
  padding: 1rem .75rem;
  text-align: center;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 14px rgba(31,45,58,.04);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.quick-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(31,45,58,.08);
  border-color: #b9d4ea;
  color: inherit;
}
.quick-tile .tile-ico {
  width: 46px; height: 46px; margin: 0 auto .55rem;
  border-radius: 14px; display: grid; place-items: center;
}
.quick-tile .tile-ico svg { width: 22px; height: 22px; }
.quick-tile .tile-ico.blue { background: #e5f2fb; color: #2f7eb8; }
.quick-tile .tile-ico.green { background: #e4f7ee; color: #2f9e6b; }
.quick-tile .tile-ico.orange { background: #fff2e0; color: #c98420; }
.quick-tile .tile-ico.pink { background: #fde8ef; color: #c24b6c; }
.quick-tile .tile-ico.purple { background: #eceefc; color: #5b60c8; }
.quick-tile .tile-ico.teal { background: #e4f6f4; color: #2a9a90; }
.quick-tile strong { display: block; font-size: 13px; font-weight: 800; }
.quick-tile span { display: block; color: var(--db-muted); font-size: 12px; font-weight: 700; margin-top: .15rem; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .85rem;
  margin-bottom: 1.15rem;
}
.stat-card {
  background: var(--db-white);
  border: 1px solid var(--db-line);
  border-radius: 16px;
  padding: 1.05rem 1.15rem;
  box-shadow: 0 4px 14px rgba(31,45,58,.04);
  display: flex; align-items: center; gap: .85rem;
}
.stat-card .ico {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; flex-shrink: 0;
}
.stat-card .ico svg { width: 22px; height: 22px; }
.stat-card .ico.blue { background: #e5f2fb; color: #2f7eb8; }
.stat-card .ico.green { background: #e4f7ee; color: #2f9e6b; }
.stat-card .ico.orange { background: #fff2e0; color: #c98420; }
.stat-card .ico.pink { background: #fde8ef; color: #c24b6c; }
.stat-card .label { color: var(--db-muted); font-size: 13px; font-weight: 800; }
.stat-card .value {
  font-family: var(--db-display);
  font-size: 1.85rem; font-weight: 600; line-height: 1.1; margin-top: .1rem;
}

.db-panel {
  background: var(--db-white);
  border: 1px solid var(--db-line);
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(31,45,58,.04);
  overflow: hidden;
}
.db-panel-head {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.15rem; border-bottom: 1px solid var(--db-line);
  background: linear-gradient(180deg, #fcfdfe, #f7f9fb);
}
.db-panel-head h2 {
  margin: 0; font-size: 1.08rem; font-family: var(--db-display); font-weight: 600;
  display: flex; align-items: center; gap: .55rem;
}
.head-ico {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: #e5f2fb; color: var(--db-accent);
}
.head-ico svg { width: 17px; height: 17px; }
.db-filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.db-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .38rem .75rem; border-radius: 999px;
  border: 1px solid var(--db-line); background: #fff;
  color: var(--db-muted); text-decoration: none; font-size: 12px; font-weight: 800;
}
.db-chip svg { width: 13px; height: 13px; }
.db-chip.is-active, .db-chip:hover { background: var(--db-accent); border-color: var(--db-accent); color: #fff; }

.db-table-wrap { overflow-x: auto; }
.db-table { width: 100%; border-collapse: collapse; }
.db-table th, .db-table td {
  text-align: left; padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--db-line); font-size: 14px;
  vertical-align: middle;
}
.db-table th {
  background: #f5f8fb; color: var(--db-muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 800;
}
.db-table tr:hover td { background: #fafcfe; }
.db-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--db-muted); font-weight: 600; }
.db-empty svg { width: 36px; height: 36px; opacity: .45; margin-bottom: .5rem; }

.row-avatar {
  width: 36px; height: 36px; border-radius: 11px;
  display: grid; place-items: center; flex-shrink: 0;
  background: #eef4f9; color: var(--db-accent);
}
.row-avatar svg { width: 16px; height: 16px; }
.row-avatar.green { background: #e4f7ee; color: #2f9e6b; }
.row-avatar.orange { background: #fff2e0; color: #c98420; }
.row-avatar.pink { background: #fde8ef; color: #c24b6c; }
.contact-cell { display: flex; align-items: center; gap: .7rem; }
.contact-cell strong { display: block; font-size: 14px; }
.contact-cell small { color: var(--db-muted); font-weight: 700; font-size: 12px; }

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .2rem .55rem; border-radius: 999px;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
}
.badge svg { width: 11px; height: 11px; }
.badge-incoming { background: #d9f5e7; color: #176b45; }
.badge-outgoing { background: #dceeff; color: #1a5278; }
.badge-missed { background: #fde2e2; color: #9b2c2c; }
.badge-inbox { background: #e8f4ff; color: #1d5f8a; }
.badge-sent { background: #eee8ff; color: #4c3d8f; }

.device-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; padding: 1.15rem;
}
.device-card {
  border: 1px solid var(--db-line); border-radius: 16px; padding: 1.15rem;
  text-decoration: none; color: inherit; background: #fff;
  transition: box-shadow .15s, transform .15s, border-color .15s;
  display: flex; gap: .9rem; align-items: flex-start;
}
.device-card:hover {
  transform: translateY(-2px);
  border-color: #b9d4ea;
  box-shadow: 0 12px 28px rgba(31,45,58,.08);
  color: inherit;
}
.device-card .dev-ico {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(145deg, #e5f2fb, #d6eaf8);
  color: var(--db-accent);
  display: grid; place-items: center; flex-shrink: 0;
}
.device-card .dev-ico svg { width: 22px; height: 22px; }
.device-card h3 { margin: 0 0 .25rem; font-family: var(--db-display); font-size: 1.15rem; }
.device-meta { color: var(--db-muted); font-size: 13px; font-weight: 600; margin: .12rem 0; }
.status-dot {
  display: inline-flex; align-items: center; gap: .35rem;
  color: var(--db-green); font-size: 11px; font-weight: 800; text-transform: uppercase;
}
.status-dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--db-green);
  box-shadow: 0 0 0 3px rgba(47,158,107,.18);
}

.overview-grid {
  display: grid; grid-template-columns: 1.35fr .85fr; gap: .9rem;
}
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .85rem 1.1rem; border-bottom: 1px solid var(--db-line);
  font-size: 14px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-list .left { font-weight: 700; display: flex; align-items: center; gap: .65rem; min-width: 0; }
.mini-list .right { color: var(--db-muted); font-weight: 700; white-space: nowrap; font-size: 12px; }

/* Placeholder feature panels */
.feature-placeholder {
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.feature-placeholder .big-ico {
  width: 72px; height: 72px; margin: 0 auto 1rem;
  border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(160deg, #e5f2fb, #d8ebf8);
  color: var(--db-accent);
}
.feature-placeholder .big-ico svg { width: 32px; height: 32px; }
.feature-placeholder h3 { margin: 0 0 .4rem; font-family: var(--db-display); }
.feature-placeholder p { color: var(--db-muted); font-weight: 600; max-width: 420px; margin: 0 auto 1rem; }

.db-mobile-toggle {
  display: none; border: 1px solid var(--db-line); background: #fff;
  border-radius: 12px; width: 42px; height: 42px; cursor: pointer;
  place-items: center;
}
.db-mobile-toggle svg { width: 18px; height: 18px; }
.db-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(15,23,30,.45); z-index: 25;
}

@media (max-width: 1100px) {
  .quick-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1000px) {
  .db-shell { grid-template-columns: 1fr; }
  .db-sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
    transform: translateX(-105%); transition: transform .22s ease;
    width: min(300px, 88vw);
  }
  .db-sidebar.is-open { transform: none; box-shadow: 24px 0 50px rgba(0,0,0,.35); }
  .db-backdrop.is-open { display: block; }
  .db-mobile-toggle { display: inline-grid; }
  .stat-cards, .device-grid, .overview-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .stat-cards, .device-grid, .overview-grid, .quick-tiles { grid-template-columns: 1fr 1fr; }
  .db-content { padding: .85rem; }
  .db-topbar { padding: .75rem; }
}
