:root {
  color-scheme: light;
  --milk: #f4f0e8;
  --paper: #fbf9f4;
  --white: #fffefa;
  --ink: #24302a;
  --muted: #768078;
  --line: #dedbd1;
  --green: #263c32;
  --sage: #dfe9df;
  --sage-deep: #597064;
  --amber: #a66f2c;
  --red: #9c4d45;
  --shadow: 0 24px 70px rgba(48, 55, 47, .09);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--milk); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(255,255,255,.9), transparent 26rem),
    radial-gradient(circle at 95% 100%, rgba(205,221,207,.55), transparent 32rem),
    var(--milk);
  font: 15px/1.5 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(30px, 5vw, 54px); line-height: 1.02; letter-spacing: -.045em; }
h2 { font-size: clamp(22px, 3vw, 32px); line-height: 1.12; letter-spacing: -.025em; }
h3 { font-size: 17px; }

.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); }
.auth-story { position: relative; padding: clamp(32px, 6vw, 88px); display: flex; flex-direction: column; overflow: hidden; }
.auth-story::after {
  content: ""; position: absolute; width: 430px; height: 430px; border-radius: 50%;
  right: -110px; bottom: -150px; border: 1px solid rgba(38,60,50,.14); box-shadow: 0 0 0 70px rgba(38,60,50,.035), 0 0 0 140px rgba(38,60,50,.025);
}
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; font-weight: 720; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 13px; display: block; overflow: hidden; background: #55706d; box-shadow: 0 8px 20px rgba(13,156,143,.16); }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.story-copy { position: relative; z-index: 1; max-width: 650px; margin: auto 0; padding: 70px 0; }
.eyebrow { color: var(--sage-deep); font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
.story-copy p { max-width: 520px; color: var(--muted); font-size: 18px; }
.feature-line { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.feature-pill { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.42); font-size: 13px; }
.auth-panel { display: grid; place-items: center; padding: 28px; background: rgba(255,254,250,.62); backdrop-filter: blur(16px); border-left: 1px solid rgba(222,219,209,.8); }
.auth-card { width: min(440px, 100%); padding: clamp(25px, 5vw, 42px); background: var(--white); border: 1px solid rgba(222,219,209,.8); border-radius: 30px; box-shadow: var(--shadow); }
.auth-card h2 { margin-bottom: 8px; }
.muted { color: var(--muted); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 28px 0 24px; border-radius: 14px; background: var(--milk); }
.tab { border: 0; border-radius: 11px; padding: 9px; background: transparent; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--white); color: var(--ink); box-shadow: 0 2px 12px rgba(35,48,42,.08); }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 7px; }
.field span { color: #4f5c54; font-size: 13px; font-weight: 650; }
.input, .select {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 11px 13px;
  color: var(--ink); background: var(--paper); outline: none; transition: .2s border-color, .2s box-shadow;
}
.input:focus, .select:focus { border-color: #789183; box-shadow: 0 0 0 4px rgba(92,119,104,.12); }
.btn {
  min-height: 44px; border: 0; border-radius: 14px; padding: 10px 16px; display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; font-weight: 700; cursor: pointer; transition: .18s transform, .18s opacity, .18s background; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-primary { color: var(--paper); background: var(--green); }
.btn-secondary { background: var(--sage); color: var(--green); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { color: var(--red); background: #f5e7e4; }
.btn-small { min-height: 36px; padding: 7px 11px; border-radius: 11px; font-size: 13px; }
.btn-wide { width: 100%; margin-top: 4px; }
.error { display: none; padding: 11px 13px; color: var(--red); background: #f7e9e6; border-radius: 12px; font-size: 13px; }
.error.show { display: block; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); background: rgba(251,249,244,.72); backdrop-filter: blur(18px); display: flex; flex-direction: column; z-index: 5; }
.sidebar .brand { margin: 0 10px 40px; }
.nav { display: grid; gap: 6px; }
.nav-btn { border: 0; background: transparent; border-radius: 14px; padding: 12px 13px; text-align: left; cursor: pointer; color: var(--muted); font-weight: 650; }
.nav-btn.active, .nav-btn:hover { color: var(--ink); background: var(--white); }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.account-mini { padding: 13px; background: rgba(255,255,255,.55); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.account-mini strong, .account-mini span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-mini span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.main { min-width: 0; padding: 32px clamp(24px, 5vw, 70px) 64px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 40px; }
.topbar h2 { margin: 0; }
.topbar-meta { color: var(--muted); font-size: 13px; }
.mobile-brand, .mobile-nav { display: none; }
.content { max-width: 1220px; margin: 0 auto; }
.grid { display: grid; gap: 18px; }
.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.card { padding: 23px; border: 1px solid rgba(222,219,209,.88); border-radius: var(--radius); background: rgba(255,254,250,.78); box-shadow: 0 12px 40px rgba(50,57,49,.04); }
.stat-card { min-height: 142px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; font-weight: 740; }
.stat-foot { color: var(--muted); font-size: 12px; }
.accent-card { color: var(--paper); background: var(--green); border-color: var(--green); }
.accent-card .stat-label, .accent-card .stat-foot { color: #c7d2cb; }
.section { margin-top: 34px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.section-head h2, .section-head p { margin-bottom: 0; }
.device-list { display: grid; gap: 10px; }
.device { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 15px; align-items: center; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,254,250,.72); }
.device-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sage); font-size: 18px; }
.device-name { font-weight: 720; }
.device-meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.device-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.status { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-active { color: #3d7056; background: #e2f0e5; }
.status-pending { color: var(--amber); background: #f5ead7; }
.status-blocked, .status-revoked { color: var(--red); background: #f5e5e2; }
.empty { padding: 40px 22px; text-align: center; color: var(--muted); border: 1px dashed #cdc9bd; border-radius: var(--radius); }
.empty strong { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.notice { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; padding: 18px 20px; border-radius: 18px; background: #f3e9d8; color: #704d20; }
.notice p { margin: 2px 0 0; font-size: 13px; }
.guide-grid { grid-template-columns: repeat(3, 1fr); }
.guide-step { position: relative; padding-top: 56px; }
.step-no { position: absolute; top: 0; left: 0; width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: var(--paper); background: var(--green); font-weight: 800; }
.guide-step p { color: var(--muted); margin-bottom: 0; }

.admin-summary { grid-template-columns: repeat(4, minmax(0,1fr)); }
.toolbar { display: flex; gap: 10px; align-items: center; }
.search { max-width: 310px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,254,250,.78); }
.table { width: 100%; border-collapse: collapse; min-width: 760px; }
.table th, .table td { padding: 15px 17px; text-align: left; border-bottom: 1px solid #e8e4da; }
.table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #f8f5ee; }
.table tbody tr:last-child td { border-bottom: 0; }
.user-cell strong, .user-cell span { display: block; }
.user-cell span { color: var(--muted); font-size: 12px; }
.pending-dot { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e5a84f; color: white; font-size: 11px; font-weight: 800; }

.modal-backdrop { position: fixed; inset: 0; z-index: 20; padding: 20px; display: grid; place-items: center; background: rgba(27,35,30,.42); backdrop-filter: blur(5px); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 28px; background: var(--white); border-radius: 26px; box-shadow: 0 30px 100px rgba(25,34,29,.28); }
.modal-wide { width: min(760px, 100%); }
.modal-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.modal-head h2 { margin-bottom: 4px; }
.icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; background: transparent; cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.detail-block { padding: 18px 0; border-top: 1px solid var(--line); }
.detail-block:first-of-type { border-top: 0; padding-top: 0; }
.detail-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-title h3 { margin: 0; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input, .inline-form .select { width: auto; min-height: 40px; }
.settings-card { max-width: 920px; }
.params-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.publish-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 10px; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 26px; max-width: min(440px, calc(100% - 30px)); transform: translate(-50%, 30px); padding: 12px 16px; border-radius: 14px; color: var(--paper); background: var(--green); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: var(--red); }
.spinner { width: 26px; height: 26px; border: 3px solid #d8ddd8; border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; }
.loading-page { min-height: 100vh; display: grid; place-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-story { min-height: 360px; padding: 30px; }
  .story-copy { padding: 70px 0 30px; }
  .auth-panel { border: 0; padding: 20px 20px 50px; }
  .app-shell { display: block; padding-bottom: 76px; }
  .sidebar { display: none; }
  .main { padding: 22px 18px 46px; }
  .mobile-brand { display: inline-flex; }
  .topbar { margin-bottom: 28px; }
  .topbar > div:first-child { display: none; }
  .mobile-nav { position: fixed; z-index: 12; display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); padding: 5px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,254,250,.9); backdrop-filter: blur(18px); box-shadow: 0 14px 45px rgba(34,43,37,.18); }
  .mobile-nav .nav-btn { text-align: center; padding: 10px; }
  .admin-summary { grid-template-columns: repeat(2, 1fr); }
  .params-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .auth-story { min-height: 320px; }
  .auth-story::after { width: 280px; height: 280px; }
  .story-copy h1 { font-size: 38px; }
  .story-copy p { font-size: 15px; }
  .feature-pill:nth-child(3) { display: none; }
  .stats-grid, .guide-grid, .admin-summary { grid-template-columns: 1fr; }
  .stat-card { min-height: 118px; }
  .section-head { align-items: start; flex-direction: column; }
  .toolbar { width: 100%; flex-wrap: wrap; }
  .search { max-width: none; flex: 1; }
  .device { grid-template-columns: auto 1fr; }
  .device-actions { grid-column: 1 / -1; justify-content: stretch; }
  .device-actions .btn { flex: 1; }
  .notice { align-items: stretch; flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .params-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .publish-row { align-items: stretch; flex-direction: column; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 26px 26px 0 0; padding: 23px 18px calc(23px + env(safe-area-inset-bottom)); }
  .inline-form .input, .inline-form .select { width: 100%; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; } }

/* Aurora redesign */
:root {
  color-scheme: dark;
  --milk: #08131c; --paper: #0d1d28; --white: #122936; --ink: #e9fbff; --muted: #8da9b4;
  --line: rgba(143, 205, 218, .16); --green: #38d6b5; --sage: rgba(56, 214, 181, .14); --sage-deep: #70e6d1;
  --amber: #f2bd68; --red: #ff7c86; --shadow: 0 24px 80px rgba(0, 0, 0, .3); --radius: 22px;
}
html, body { background: radial-gradient(circle at 15% 0%, #14364a 0, transparent 35rem), radial-gradient(circle at 100% 100%, #123b3d 0, transparent 32rem), var(--milk); }
body { font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .16; background-image: radial-gradient(rgba(255,255,255,.4) .5px, transparent .5px); background-size: 5px 5px; mix-blend-mode: screen; }
.auth-story, .sidebar { background: rgba(7, 20, 29, .56); border-color: var(--line); }
.auth-panel { background: rgba(8, 19, 28, .35); border-color: var(--line); }
.auth-story::after { border-color: rgba(56,214,181,.22); box-shadow: 0 0 0 70px rgba(56,214,181,.05), 0 0 0 140px rgba(56,214,181,.025); animation: float-ring 12s ease-in-out infinite; }
.brand { color: var(--ink); }
.brand-mark { background: linear-gradient(135deg, #37d7ba, #377cf1); box-shadow: 0 8px 28px rgba(56,214,181,.3); }
.auth-card, .card, .device, .table-wrap, .account-mini { background: linear-gradient(145deg, rgba(18,41,54,.94), rgba(10,28,39,.88)); border-color: var(--line); box-shadow: var(--shadow); }
.auth-card { animation: rise-in .55s cubic-bezier(.2,.8,.2,1); }
.input, .select { color: var(--ink); background: rgba(5,18,27,.65); border-color: var(--line); }
.input:focus, .select:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(56,214,181,.14); }
.btn-primary { color: #041319; background: linear-gradient(135deg, #54e4c5, #39bce0); box-shadow: 0 8px 22px rgba(56,214,181,.2); }
.btn-secondary { color: var(--sage-deep); background: var(--sage); }
.btn-ghost { color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.03); }
.nav-btn { display: flex; align-items: center; gap: 11px; color: var(--muted); transition: .22s ease; }
.nav-btn.active, .nav-btn:hover { color: var(--ink); background: linear-gradient(90deg, rgba(56,214,181,.18), rgba(56,214,181,.03)); transform: translateX(3px); }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--sage-deep); background: rgba(56,214,181,.1); font-size: 17px; }
.mobile-nav .nav-btn { justify-content: center; flex-direction: column; gap: 3px; font-size: 11px; }
.mobile-nav .nav-icon { width: auto; height: auto; background: none; font-size: 18px; }
.topbar { animation: fade-in .5s ease both; }
.section, .stats-grid { animation: rise-in .55s ease both; }
.stats-grid .card:nth-child(2) { animation-delay: .08s; } .stats-grid .card:nth-child(3) { animation-delay: .16s; }
.accent-card { color: #041319; background: linear-gradient(135deg, #4de2c0, #2ba8d0); border-color: transparent; }
.accent-card .stat-label, .accent-card .stat-foot { color: rgba(4,19,25,.68); }
.device:hover { transform: translateY(-3px); border-color: rgba(112,230,209,.44); box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.device { transition: .25s ease; }
.device-icon { color: var(--sage-deep); background: rgba(56,214,181,.13); box-shadow: inset 0 0 0 1px rgba(56,214,181,.14); }
.ping-value { display: flex; align-items: center; gap: 9px; }
.ping-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(56,214,181,.5); animation: ping-pulse 1.8s infinite; }
.notice { background: rgba(242,189,104,.12); color: #f6d79e; border: 1px solid rgba(242,189,104,.2); }
.table tbody tr:hover { background: rgba(56,214,181,.08); }
.modal-backdrop { background: rgba(2,9,14,.72); }
.modal { background: linear-gradient(145deg, #122b39, #0a1c27); border: 1px solid var(--line); animation: rise-in .3s ease both; }
.toast { color: #041319; background: linear-gradient(135deg, #54e4c5, #39bce0); }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes ping-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(56,214,181,.48); } 50% { box-shadow: 0 0 0 8px rgba(56,214,181,0); } }
@keyframes float-ring { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(-12px,-10px) rotate(5deg); } }

.check-row { display:flex; align-items:flex-start; gap:10px; padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:#f8fbfd; cursor:pointer; }
.check-row input { width:16px; height:16px; margin:2px 0 0; accent-color:var(--cyan); }
.check-row span { display:grid; gap:2px; } .check-row strong { color:var(--text); font-size:11px; } .check-row small { color:var(--dim); font-size:9px; }

/* Live client analytics: only values change during polling, not the page. */
.topbar, .section, .stats-grid { animation:none; }
.table th, .table td { border-color:var(--line); }
.table td small { display:block; color:var(--muted); font-size:11px; margin-top:5px; }
.user-link { border:0; background:none; color:var(--ink); font:inherit; font-weight:750; text-align:left; padding:0; cursor:pointer; }
.user-link:hover { color:var(--sage-deep); }
.analytics-section { --rose:#e74c80; }
.analytics-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; }
.analytics-toolbar h2 { margin:4px 0 0; font-size:26px; }
.period-switch { display:flex; gap:4px; padding:4px; border:1px solid var(--line); border-radius:13px; background:#081924; flex-shrink:0; }
.period-switch button, .analytics-tabs button { border:0; cursor:pointer; color:var(--muted); background:transparent; padding:9px 13px; border-radius:9px; font:inherit; font-size:12px; font-weight:700; }
.period-switch .selected, .analytics-tabs .selected { color:var(--sage-deep); background:rgba(56,214,181,.13); }
.collection-info { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:11px; margin:12px 0 18px; }
.collection-info i { width:6px; height:6px; border-radius:50%; background:var(--green); flex-shrink:0; }
.collection-info.is-stale i { background:var(--amber); }
.analytics-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.analytics-metrics article { padding:18px; border-radius:17px; background:rgba(15,36,48,.84); border:1px solid var(--line); display:grid; gap:8px; }
.analytics-metrics span { color:var(--muted); font-size:12px; }
.analytics-metrics strong { font-size:27px; font-variant-numeric:tabular-nums; letter-spacing:-.03em; }
.analytics-metrics strong small { font-size:15px; color:var(--muted); }
.analytics-metrics em { font-size:10px; color:var(--muted); font-style:normal; }
.analytics-metrics .metric-errors { border-top-color:rgba(231,76,128,.6); }
.analytics-charts { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(275px,1fr); gap:16px; }
.analytics-charts .card { padding:20px; box-shadow:none; min-width:0; }
.activity-panel { grid-column:1/-1; }
.chart-title { display:flex; justify-content:space-between; align-items:start; gap:12px; }
.chart-title h3 { font-size:16px; margin:6px 0 12px; }
.chart-title .eyebrow { font-size:9px; }
.chart-unit { color:var(--muted); font-size:10px; }
.chart-legend { display:flex; gap:14px; flex-wrap:wrap; color:var(--muted); font-size:11px; }
.chart-legend span, .donut-legend span { display:flex; gap:7px; align-items:center; }
.dot { display:inline-block; width:7px; height:7px; border-radius:50%; flex-shrink:0; }
.mint, .ring-online { background:var(--green); stroke:var(--green); }
.rose { background:var(--rose); }
.ring-offline { background:#4c748d; stroke:#4c748d; }
.ring-unknown { background:#e4b466; stroke:#e4b466; }
.ring-revoked { background:var(--rose); stroke:var(--rose); }
.traffic-chart, .activity-chart { display:block; width:100%; height:auto; overflow:visible; margin-top:12px; }
.chart-grid { stroke:var(--line); stroke-width:1; }
.axis { fill:var(--muted); font-size:10px; font-family:inherit; }
.chart-mint { stroke:var(--green); }.chart-rose { stroke:var(--rose); }
circle.chart-mint, .bar-mint { fill:var(--green); } circle.chart-rose, .bar-rose { fill:var(--rose); }
.donut-layout { display:flex; align-items:center; justify-content:space-around; gap:12px; flex-wrap:wrap; }
.donut { width:154px; flex-shrink:0; }.donut-track { stroke:rgba(111,162,180,.12); }
.donut-number { font-size:32px; font-weight:750; fill:var(--ink); }
.donut-legend { display:grid; gap:12px; flex:1; min-width:155px; font-size:11px; }
.donut-legend > div { display:flex; justify-content:space-between; gap:10px; }.donut-legend b { font-variant-numeric:tabular-nums; }
.analytics-note { color:var(--muted); font-size:11px; line-height:1.65; margin:14px 0; max-width:960px; }
.analytics-warning { padding:12px 14px; color:#efc384; background:rgba(228,180,102,.08); border-radius:12px; font-size:12px; }
.analytics-empty { display:grid; place-items:center; min-height:150px; text-align:center; padding:25px; color:var(--muted); line-height:1.6; font-size:13px; }
.analytics-tabs { display:flex; gap:6px; border-bottom:1px solid var(--line); padding-bottom:8px; margin:24px 0 14px; }
.analytics-tabs button span { color:#ff95b7; margin-left:4px; }
.analytics-history .table { font-size:12px; }.analytics-history .table tr { cursor:default; }
.analytics-history .table th, .analytics-history .table td { padding:13px; }
.analytics-history { max-height:430px; overflow:auto; scrollbar-gutter:stable; }
.analytics-history thead { position:sticky; top:0; background:#102633; z-index:1; }
.connection-state { font-size:11px; }.connection-state.online { color:var(--sage-deep); }.connection-state.unknown { color:var(--amber); }
.error-count { color:#ff95b7 !important; }
.error-list { display:grid; gap:10px; }
.error-report { border:1px solid rgba(231,76,128,.23); border-radius:15px; background:rgba(231,76,128,.035); }
.error-report summary { display:flex; align-items:center; gap:12px; padding:16px; cursor:pointer; }
.error-marker { border-radius:10px; display:grid; place-items:center; width:28px; height:30px; background:rgba(231,76,128,.14); color:#ff95b7; flex-shrink:0; }
.error-report summary > span:nth-child(2) { flex:1; min-width:0; }.error-report b { display:block; font-size:13px; overflow-wrap:anywhere; }
.error-report small { display:block; font-size:11px; color:var(--muted); margin-top:6px; }.report-version { font-size:11px; color:var(--muted); }
.diagnostic-fields { border-top:1px solid var(--line); margin:0 16px; padding:16px 0; display:grid; grid-template-columns:135px minmax(0,1fr); gap:10px; font-size:12px; }
.diagnostic-fields dt { color:var(--muted); }.diagnostic-fields dd { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.analytics-pager { display:flex; align-items:center; justify-content:flex-end; gap:14px; margin-top:12px; color:var(--muted); font-size:12px; }
.modal-wide { width:min(1120px,100%); }.modal .loading-page { min-height:200px; }
.client-head { position:sticky; top:-28px; z-index:2; padding:15px 0; background:#122b39; border-bottom:1px solid var(--line); }
.client-head .icon-btn { color:var(--ink); flex-shrink:0; font-size:22px; }
.client-head p { margin-bottom:0; }.client-facts { display:flex; flex-wrap:wrap; gap:24px; font-size:11px; color:var(--muted); margin-bottom:24px; }
.client-facts b { display:block; color:var(--ink); font-size:12px; margin-top:4px; }
.modal .analytics-section { margin-bottom:28px; }.check-row { background:rgba(56,214,181,.05); }
@media(max-width:1150px) { .analytics-charts { grid-template-columns:minmax(0,1fr); }.activity-panel { grid-column:auto; }.donut-layout { flex-wrap:nowrap; }.donut-legend { max-width:270px; } }
@media(max-width:650px) { .analytics-toolbar { flex-wrap:wrap; }.analytics-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }.analytics-metrics article { padding:12px; }.analytics-metrics strong { font-size:23px; }.analytics-charts .card { padding:14px; }.analytics-toolbar h2 { font-size:22px; }.donut { width:126px; }.donut-layout { gap:5px; }.client-head { top:-23px; }.diagnostic-fields { grid-template-columns:1fr; gap:4px; }.diagnostic-fields dd { margin-bottom:10px; }.analytics-history .table { min-width:730px; } }
@media(prefers-reduced-motion:reduce) { .analytics-section *, .client-head { transition:none; animation:none; } }

