:root {
  color-scheme: dark;
  --bg: #090d1b;
  --bg-soft: #0f1428;
  --surface: #141a32;
  --surface-soft: #19203d;
  --surface-strong: #20294d;
  --surface-hover: #1d2546;
  --panel-card-bg: rgba(20, 26, 50, .82);
  --panel-card-hover: rgba(29, 37, 70, .92);
  --panel-stats-bg: rgba(6, 9, 20, .42);
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .17);
  --text: #f6f7ff;
  --muted: #98a2c2;
  --purple: #7869f6;
  --purple-light: #a69dff;
  --teal: #43dfcf;
  --blue: #5aa9ff;
  --green: #4ade9b;
  --red: #ff697d;
  --amber: #ffc56b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 0%, rgba(120, 105, 246, .15), transparent 27rem),
    radial-gradient(circle at 88% 20%, rgba(67, 223, 207, .08), transparent 25rem),
    var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fill-icon {
  fill: currentColor;
  stroke: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #a9fff6;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--teal);
}

.admin-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.admin-brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #897afb, #5e49dc);
  box-shadow: 0 14px 35px rgba(94, 73, 220, .35);
}

.admin-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.admin-brand strong {
  font-size: 16px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.admin-brand small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  font-weight: 780;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #0b1520;
  background: linear-gradient(135deg, #6cebdd, var(--teal));
  box-shadow: 0 13px 32px rgba(67, 223, 207, .18);
}

.button-primary:hover {
  box-shadow: 0 16px 38px rgba(67, 223, 207, .28);
}

.button-secondary {
  border-color: var(--line);
  color: #e8ebfa;
  background: rgba(255, 255, 255, .045);
}

.button-secondary:hover {
  border-color: rgba(120, 105, 246, .5);
  background: rgba(120, 105, 246, .11);
}

.button-danger {
  border-color: rgba(255, 105, 125, .24);
  color: #ffb4be;
  background: rgba(255, 105, 125, .08);
}

.button-danger:hover {
  border-color: rgba(255, 105, 125, .5);
  background: rgba(255, 105, 125, .14);
}

.button-small {
  min-height: 37px;
  padding: 0 12px;
  font-size: 12px;
}

.button-block {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: #c8cee5;
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
}

.icon-button:hover {
  color: #fff;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, .07);
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span:first-child {
  color: #dfe3f4;
  font-size: 12px;
  font-weight: 720;
}

.field input,
.field select,
.field textarea,
.search-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: rgba(6, 9, 20, .58);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field input {
  height: 48px;
  padding: 0 14px;
}

.field select {
  height: 48px;
  padding: 0 38px 0 14px;
  color-scheme: dark;
}

.field textarea {
  min-height: 180px;
  padding: 14px;
  resize: vertical;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus {
  border-color: rgba(67, 223, 207, .7);
  background: rgba(8, 12, 25, .8);
  box-shadow: 0 0 0 4px rgba(67, 223, 207, .1);
}

.field small {
  color: #7f89a9;
  font-size: 11px;
  line-height: 1.5;
}

.form-stack {
  display: grid;
  gap: 18px;
}

.alert {
  padding: 13px 15px;
  border: 1px solid;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.alert-error {
  border-color: rgba(255, 105, 125, .3);
  color: #ffc2ca;
  background: rgba(255, 105, 125, .1);
}

.alert-success {
  border-color: rgba(74, 222, 155, .28);
  color: #aff9d0;
  background: rgba(74, 222, 155, .09);
}

/* Login */
.login-page {
  overflow-x: hidden;
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(430px, .85fr);
  min-height: 100vh;
}

.login-brand {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(34px, 5vw, 70px);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(rgba(120, 105, 246, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 105, 246, .1) 1px, transparent 1px),
    radial-gradient(circle at 24% 45%, rgba(120, 105, 246, .35), transparent 23rem),
    radial-gradient(circle at 85% 78%, rgba(67, 223, 207, .16), transparent 20rem),
    linear-gradient(150deg, #111632, #090d1b 76%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

.login-brand::after {
  content: "";
  position: absolute;
  right: -100px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(120, 105, 246, .035), 0 0 0 140px rgba(67, 223, 207, .018);
}

.login-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
  padding: 80px 0;
}

.login-copy h1 {
  max-width: 680px;
  margin: 20px 0 24px;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 850;
  line-height: .98;
  letter-spacing: -.055em;
  background: linear-gradient(110deg, #fff 0%, #c6c0ff 45%, #7aece0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-copy p {
  max-width: 580px;
  margin: 0;
  color: #aab3d0;
  font-size: 18px;
  line-height: 1.7;
}

.login-feature-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 13px 24px;
  color: #c8cfe6;
  font-size: 12px;
  font-weight: 650;
}

.login-feature-row span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-feature-row .icon {
  width: 17px;
  height: 17px;
  color: var(--teal);
}

.login-card-wrap {
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(7, 10, 21, .72);
}

.login-card {
  width: min(420px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(20, 26, 50, .86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card-heading {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.mobile-login-logo {
  display: none;
}

.login-card h2 {
  margin: 8px 0 7px;
  font-size: 27px;
  letter-spacing: -.035em;
}

.login-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.login-card .alert {
  margin-bottom: 18px;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 78px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 9px;
  padding: 6px 7px;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 10px;
  font-weight: 780;
  cursor: pointer;
  transform: translateY(-50%);
}

.login-security {
  margin: 20px 0 0;
  color: #76809f;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

/* App shell */
.admin-app {
  display: grid;
  grid-template-columns: 254px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  width: 254px;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(12, 16, 32, .96);
  backdrop-filter: blur(20px);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-close,
.mobile-menu {
  display: none;
}

.sidebar-nav {
  display: grid;
  align-content: start;
  gap: 5px;
  flex: 1;
  padding: 23px 14px;
}

.nav-label {
  margin: 16px 11px 7px;
  color: #646f90;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 45px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #9da7c6;
  background: transparent;
  font-size: 12px;
  font-weight: 680;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover {
  color: #eef0ff;
  background: rgba(255, 255, 255, .04);
}

.nav-item.is-active {
  border-color: rgba(120, 105, 246, .25);
  color: #fff;
  background: linear-gradient(90deg, rgba(120, 105, 246, .2), rgba(120, 105, 246, .07));
}

.nav-item.is-active .icon {
  color: var(--purple-light);
}

.nav-button {
  appearance: none;
}

.sidebar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 17px 15px;
  border-top: 1px solid var(--line);
}

.user-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
}

.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #dcd8ff;
  background: rgba(120, 105, 246, .17);
  font-size: 10px;
  font-weight: 850;
}

.user-chip > span:last-child {
  display: grid;
  min-width: 0;
}

.user-chip strong,
.user-chip small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 11px;
}

.user-chip small {
  margin-top: 3px;
  color: #7781a0;
  font-size: 9px;
}

.main-content {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 clamp(20px, 3.5vw, 52px);
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 27, .82);
  backdrop-filter: blur(18px);
}

.topbar-context {
  display: grid;
  gap: 2px;
}

.topbar-context strong {
  font-size: 13px;
}

.topbar-label {
  color: #737d9d;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topbar-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #aeb7d2;
  font-size: 10px;
  font-weight: 680;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-switcher {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg-soft);
}

.theme-switcher button {
  min-width: 66px;
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 760;
  cursor: pointer;
}

.theme-switcher button:hover {
  color: var(--text);
}

.theme-switcher button.is-active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
}

.login-theme-switcher {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 20;
}

.live-dot,
.online-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(74, 222, 155, .7);
}

.content-wrap {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px);
}

.content-wrap > .alert {
  margin-bottom: 22px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.page-heading h1 {
  margin: 10px 0 8px;
  font-size: clamp(30px, 3.3vw, 46px);
  line-height: 1.05;
  letter-spacing: -.045em;
}

.page-heading p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 38px;
}

.metric-card {
  position: relative;
  display: flex;
  overflow: hidden;
  min-height: 142px;
  align-items: flex-start;
  gap: 14px;
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(24, 31, 60, .88), rgba(16, 21, 42, .88));
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -35px;
  bottom: -50px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--metric-glow);
  filter: blur(15px);
  opacity: .22;
}

.metric-purple { --metric-color: var(--purple-light); --metric-glow: var(--purple); }
.metric-teal { --metric-color: var(--teal); --metric-glow: var(--teal); }
.metric-blue { --metric-color: var(--blue); --metric-glow: var(--blue); }
.metric-green { --metric-color: var(--green); --metric-glow: var(--green); }

.metric-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--metric-color) 34%, transparent);
  border-radius: 11px;
  color: var(--metric-color);
  background: color-mix(in srgb, var(--metric-color) 11%, transparent);
}

.metric-card > div {
  position: relative;
  z-index: 1;
  display: grid;
  min-width: 0;
}

.metric-card span:not(.metric-icon) {
  color: #9da6c3;
  font-size: 10px;
  font-weight: 680;
}

.metric-card strong {
  margin: 8px 0 5px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.04em;
}

.metric-card small {
  color: #6e7898;
  font-size: 9px;
  line-height: 1.4;
}

.presence-map-card {
  overflow: hidden;
  margin-bottom: 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-card-bg);
  box-shadow: var(--shadow);
}

.presence-map-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.presence-map-heading > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.map-heading-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(67, 223, 207, .25);
  border-radius: 12px;
  color: var(--teal);
  background: rgba(67, 223, 207, .08);
}

.presence-map-heading h2 {
  margin: 0 0 4px;
  font-size: 18px;
  letter-spacing: -.025em;
}

.presence-map-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

.map-live-count {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  border: 1px solid rgba(74, 222, 155, .2);
  border-radius: 999px;
  color: var(--green);
  background: rgba(74, 222, 155, .07);
  font-size: 9px;
  white-space: nowrap;
}

.map-live-count strong {
  font-size: 12px;
}

.presence-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  min-height: 330px;
}

.world-map {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(rgba(120, 105, 246, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 105, 246, .04) 1px, transparent 1px),
    radial-gradient(circle at 50% 42%, rgba(67, 223, 207, .09), transparent 48%);
  background-size: 40px 40px, 40px 40px, auto;
}

.world-map-shape {
  position: absolute;
  inset: 7% 4%;
  width: 92%;
  height: 86%;
}

.world-map-shape path {
  fill: rgba(120, 105, 246, .12);
  stroke: rgba(166, 157, 255, .32);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.world-map-label {
  position: absolute;
  z-index: 1;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .08em;
  opacity: .62;
  text-transform: uppercase;
  pointer-events: none;
}

.label-americas { left: 16%; top: 31%; }
.label-europe { left: 49%; top: 23%; }
.label-africa { left: 52%; top: 52%; }
.label-asia { left: 72%; top: 31%; }
.label-oceania { left: 85%; top: 73%; }

.world-map-points {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.world-map-point {
  position: absolute;
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  transform: translate(-50%, -50%);
  place-items: center;
  border: 2px solid rgba(9, 13, 27, .8);
  border-radius: 50%;
  color: #07121b;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(67, 223, 207, .13), 0 8px 22px rgba(0, 0, 0, .3);
  cursor: pointer;
}

.world-map-point strong {
  position: relative;
  z-index: 2;
  font-size: 10px;
}

.world-map-point-pulse {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(67, 223, 207, .55);
  border-radius: 50%;
  opacity: 0;
}

.world-map-point.is-active {
  color: #101026;
  background: var(--purple-light);
  box-shadow: 0 0 0 7px rgba(120, 105, 246, .18), 0 10px 25px rgba(0, 0, 0, .35);
}

.world-map-point.is-active .world-map-point-pulse {
  animation: map-pulse 1.7s ease-out infinite;
}

@keyframes map-pulse {
  0% { transform: scale(.65); opacity: .8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.world-map-empty {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 22px;
  max-width: calc(100% - 32px);
  padding: 9px 12px;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--bg-soft);
  font-size: 9px;
  text-align: center;
}

.map-location-panel {
  display: grid;
  min-width: 0;
  align-content: start;
  border-left: 1px solid var(--line);
  background: var(--panel-stats-bg);
}

.map-location-summary {
  display: grid;
  gap: 5px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.map-location-summary > span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.map-location-summary > strong {
  font-size: 28px;
  letter-spacing: -.04em;
}

.map-location-summary > small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.map-location-list {
  display: grid;
  max-height: 235px;
  overflow: auto;
  padding: 10px;
  gap: 6px;
}

.map-location-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.map-location-row:hover,
.map-location-row.is-active {
  border-color: rgba(120, 105, 246, .25);
  background: rgba(120, 105, 246, .09);
}

.map-location-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 9px rgba(67, 223, 207, .65);
}

.map-location-row > span:last-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.map-location-row strong,
.map-location-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-location-row strong {
  font-size: 10px;
}

.map-location-row small {
  color: var(--muted);
  font-size: 8px;
}

.panel-section {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0 0 5px;
  font-size: 19px;
  letter-spacing: -.025em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.search-field {
  width: min(280px, 100%);
}

.search-field input {
  height: 40px;
  padding: 0 13px;
  font-size: 11px;
}

.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.panel-card {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel-card-bg);
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}

.panel-card:hover {
  border-color: rgba(120, 105, 246, .32);
  background: var(--panel-card-hover);
  transform: translateY(-2px);
}

.panel-card-top,
.panel-card-title,
.panel-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(120, 105, 246, .28);
  border-radius: 11px;
  color: #c7c0ff;
  background: rgba(120, 105, 246, .1);
}

.status-pill {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 780;
  white-space: nowrap;
}

.status-pill > span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.status-active {
  border-color: rgba(74, 222, 155, .26);
  color: #73ebb0;
  background: rgba(74, 222, 155, .08);
}

.status-error {
  border-color: rgba(255, 105, 125, .25);
  color: #ff91a0;
  background: rgba(255, 105, 125, .08);
}

.panel-card-title h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.025em;
}

.panel-card-title > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.panel-code {
  color: #8075e9;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 8px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.panel-card-title a {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #8791b1;
}

.panel-card-title a:hover {
  color: var(--teal);
  background: rgba(67, 223, 207, .08);
}

.panel-card-title .icon {
  width: 16px;
  height: 16px;
}

.panel-url {
  overflow: hidden;
  margin: -7px 0 0;
  color: #6f7998;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-customer-meta {
  display: grid;
  gap: 7px;
  margin-top: -4px;
}

.panel-customer-meta > span {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #919ab8;
  font-size: 9px;
}

.panel-customer-meta .icon {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  color: var(--teal);
}

.panel-customer-meta > span > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-stats-bg);
}

.panel-card-stats > div {
  display: grid;
  min-width: 0;
  min-height: 66px;
  align-content: center;
  justify-items: center;
  padding: 8px;
  text-align: center;
}

.panel-card-stats > div + div {
  border-left: 1px solid var(--line);
}

.panel-card-stats strong {
  font-size: 17px;
}

.panel-card-stats small {
  margin-top: 4px;
  color: #7882a1;
  font-size: 8px;
}

.panel-card-stats .online-indicator {
  position: absolute;
  margin: 5px 0 0 -26px;
  width: 5px;
  height: 5px;
}

.panel-card-foot {
  padding-top: 2px;
  border-top: 1px solid var(--line);
}

.panel-card-foot > span {
  min-width: 0;
  color: #727c9b;
  font-size: 8px;
  line-height: 1.4;
}

.panel-card-foot > span strong {
  color: #aeb6d0;
  font-weight: 680;
}

.panel-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.panel-card-actions form {
  display: contents;
}

.panel-card-actions .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 10px;
}

.panel-card-actions .icon {
  width: 15px;
  height: 15px;
}

.clone-source-summary {
  padding: 11px 13px;
  border: 1px solid rgba(120, 105, 246, .2);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(120, 105, 246, .06);
  font-size: 10px;
}

.clone-source-summary strong {
  color: var(--text);
}

.empty-state,
.empty-search {
  display: grid;
  min-height: 300px;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 30px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.empty-state .icon {
  width: 38px;
  height: 38px;
  color: var(--purple-light);
}

.empty-state h3 {
  margin: 6px 0 0;
  color: var(--text);
}

.empty-state p {
  margin: 0 0 12px;
  font-size: 12px;
}

.empty-search {
  min-height: 100px;
  font-size: 12px;
}

.empty-search[hidden] {
  display: none;
}

/* Editor */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
  color: #747e9e;
  font-size: 10px;
}

.breadcrumb a {
  color: #aeb6d0;
  text-decoration: none;
}

.breadcrumb .icon {
  width: 12px;
  height: 12px;
}

.editor-heading {
  margin-bottom: 22px;
}

.editor-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.editor-status-grid article {
  display: grid;
  min-height: 82px;
  align-content: center;
  justify-items: start;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(20, 26, 50, .62);
}

.editor-status-grid article > strong {
  overflow: hidden;
  max-width: 100%;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-status-grid small {
  color: #747e9e;
  font-size: 9px;
}

.editor-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: rgba(20, 26, 50, .72);
  box-shadow: 0 20px 55px rgba(0, 0, 0, .16);
}

.editor-tabs {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 23, .34);
}

.editor-tab {
  position: relative;
  display: flex;
  min-height: 82px;
  align-items: center;
  gap: 13px;
  padding: 15px clamp(12px, 1.4vw, 20px);
  border: 0;
  color: #7f89a9;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.editor-tab + .editor-tab {
  border-left: 1px solid var(--line);
}

.editor-tab::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: -1px;
  left: 20px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
}

.editor-tab.is-active {
  color: #fff;
  background: rgba(120, 105, 246, .06);
}

.editor-tab.is-active::after {
  background: var(--purple);
  box-shadow: 0 0 12px rgba(120, 105, 246, .6);
}

.editor-tab > .icon {
  width: 24px;
  height: 24px;
  color: currentColor;
}

.editor-tab > span {
  display: grid;
  gap: 4px;
}

.editor-tab strong {
  font-size: 12px;
}

.editor-tab small {
  color: #697493;
  font-size: 9px;
}

.editor-panel {
  display: none;
}

.editor-panel.is-active {
  display: block;
}

.editor-form {
  padding: clamp(22px, 3vw, 34px);
}

.heading-code {
  color: #a89fff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: .88em;
}

.form-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.form-heading h2 {
  margin: 0 0 7px;
  font-size: 20px;
  letter-spacing: -.03em;
}

.form-heading p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.item-counter {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border: 1px solid rgba(120, 105, 246, .22);
  border-radius: 999px;
  color: #aaa2ff;
  background: rgba(120, 105, 246, .08);
  font-size: 9px;
  font-weight: 650;
  white-space: nowrap;
}

.field-large textarea {
  min-height: 286px;
}

.message-visibility-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 10, 21, .35);
  cursor: pointer;
}

.message-visibility-toggle > input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.switch-control {
  position: relative;
  width: 48px;
  height: 27px;
  flex: 0 0 auto;
  border: 1px solid rgba(145, 154, 185, .35);
  border-radius: 999px;
  background: #252c43;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.switch-control > span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #abb3ca;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  transition: transform .2s ease, background .2s ease;
}

.message-visibility-toggle > input:checked + .switch-control {
  border-color: rgba(73, 222, 204, .66);
  background: rgba(73, 222, 204, .24);
  box-shadow: 0 0 0 3px rgba(73, 222, 204, .07);
}

.message-visibility-toggle > input:checked + .switch-control > span {
  background: #52e4d1;
  transform: translateX(21px);
}

.message-visibility-toggle > input:focus-visible + .switch-control {
  outline: 2px solid #8f82ff;
  outline-offset: 3px;
}

.switch-copy {
  display: grid;
  gap: 4px;
}

.switch-copy strong {
  color: var(--text);
  font-size: 12px;
}

.switch-copy small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.editor-form.messages-off .message-form-grid {
  opacity: .56;
}

.customer-form-grid,
.modal-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 20px;
}

.customer-manager {
  display: grid;
  gap: 22px;
}

.google-address-config-card,
.customer-record-card {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.google-address-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.google-address-config-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.google-address-lookup {
  padding: 14px;
  border: 1px solid rgba(15, 159, 147, .25);
  border-radius: 13px;
  background: rgba(15, 159, 147, .055);
}

.google-address-lookup[hidden] {
  display: none;
}

[data-google-address-widget],
gmp-place-autocomplete {
  display: block;
  width: 100%;
}

gmp-place-autocomplete {
  min-height: 48px;
  color-scheme: light;
  --gmpx-color-surface: #ffffff;
  --gmpx-color-on-surface: #172033;
  --gmpx-color-primary: #6757e8;
  --gmpx-font-family-base: inherit;
  --gmpx-font-size-base: 15px;
}

.pac-container {
  z-index: 100000 !important;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.form-section-title,
.modal-section-title {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border: 1px solid rgba(120, 105, 246, .18);
  border-radius: 12px;
  background: rgba(120, 105, 246, .055);
}

.form-section-title > span,
.modal-section-title > span {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: var(--teal);
  background: rgba(67, 223, 207, .08);
}

.form-section-title .icon,
.modal-section-title .icon {
  width: 17px;
  height: 17px;
}

.form-section-title > div,
.modal-section-title > div {
  display: grid;
  gap: 3px;
}

.form-section-title strong,
.modal-section-title strong {
  font-size: 11px;
}

.form-section-title small,
.modal-section-title small {
  color: var(--muted);
  font-size: 9px;
}

.message-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: start;
}

.interval-field {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(7, 10, 21, .35);
}

.number-suffix {
  position: relative;
  display: block;
}

.number-suffix input {
  padding-right: 75px;
}

.number-suffix small {
  position: absolute;
  top: 50%;
  right: 13px;
  color: #8e98b7;
  font-size: 10px;
  transform: translateY(-50%);
}

.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.editor-actions > span {
  color: #737d9d;
  font-size: 10px;
}

/* Redes sociais e calendário semanal */
.meta-config-card {
  display: grid;
  gap: 18px;
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid rgba(67, 223, 207, .2);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(67, 223, 207, .065), rgba(120, 105, 246, .055));
}

.meta-config-form,
.meta-config-grid {
  display: grid;
  gap: 14px;
}

.meta-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-status {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(245, 158, 11, .25);
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(245, 158, 11, .08);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.meta-status.is-connected {
  border-color: rgba(67, 223, 207, .28);
  color: #86fff2;
  background: rgba(67, 223, 207, .09);
}

.copy-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.meta-config-actions,
.meta-connection-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-config-actions {
  justify-content: space-between;
  padding-top: 2px;
}

.meta-connection {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 15px;
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: 13px;
  color: #d6def3;
  background: rgba(245, 158, 11, .055);
}

.meta-connection[hidden] {
  display: none;
}

.meta-connection.is-connected {
  border-color: rgba(67, 223, 207, .26);
  background: rgba(67, 223, 207, .06);
}

.meta-connection > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.meta-connection strong {
  color: #f8fbff;
  font-size: 11px;
}

.meta-connection small,
.meta-action-hint {
  color: #929dbd;
  font-size: 10px;
  line-height: 1.45;
}

.hidden-form {
  display: none;
}

.social-help {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid rgba(67, 223, 207, .18);
  border-radius: 14px;
  color: #aab4d1;
  background: rgba(67, 223, 207, .055);
  font-size: 11px;
  line-height: 1.55;
}

.social-help strong {
  color: #b8fff7;
}

.social-network-list,
.news-feed-list {
  display: grid;
  gap: 14px;
}

.social-network-row,
.news-feed-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(7, 10, 21, .36);
  transition: opacity .18s ease, border-color .18s ease;
}

.social-network-row.is-disabled,
.news-feed-row.is-disabled {
  opacity: .62;
}

.source-test-result {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding: 13px 15px;
  border: 1px solid rgba(120, 105, 246, .28);
  border-radius: 12px;
  color: #cbd5f0;
  background: rgba(120, 105, 246, .08);
  font-size: 10px;
  line-height: 1.5;
}

.source-test-result[hidden] {
  display: none;
}

.source-test-result strong {
  color: #fff;
  font-size: 11px;
}

.source-test-result small {
  color: #8f9abb;
}

.source-test-result.is-success {
  border-color: rgba(67, 223, 207, .3);
  background: rgba(67, 223, 207, .07);
}

.source-test-result.is-error {
  border-color: rgba(251, 113, 133, .38);
  color: #fecdd3;
  background: rgba(251, 113, 133, .075);
}

.version-footer {
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line);
  color: #65708f;
  background: rgba(7, 10, 21, .42);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
}

.admin-app > .version-footer {
  grid-column: 2;
}

.radio-config-card,
.news-config-card {
  display: grid;
  gap: 18px;
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(7, 10, 21, .36);
}

.source-section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.source-section-heading > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.source-section-heading h3 {
  margin: 0 0 5px;
  font-size: 16px;
}

.source-section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.source-section-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(67, 223, 207, .24);
  border-radius: 12px;
  color: var(--teal);
  background: rgba(67, 223, 207, .08);
}

.radio-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  transition: opacity .18s ease;
}

.radio-fields.is-disabled {
  opacity: .5;
}

.social-row-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}

@media (max-width: 760px) {
  .meta-config-grid {
    grid-template-columns: 1fr;
  }

  .meta-config-grid .field-span-2 {
    grid-column: auto;
  }

  .source-section-heading,
  .meta-connection,
  .meta-config-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .meta-status {
    align-self: flex-start;
  }

  .meta-config-actions .button,
  .meta-connection-actions .button {
    justify-content: center;
  }
}

.social-row-toggle,
.schedule-enabled {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #cbd2e8;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.social-row-toggle input,
.schedule-enabled input,
.source-option input {
  accent-color: var(--teal);
}

.empty-inline {
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: #8993b2;
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.schedule-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.schedule-days {
  display: grid;
  gap: 12px;
}

.schedule-today-notice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 5px 12px;
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid rgba(71, 224, 201, .25);
  border-radius: 13px;
  background: rgba(24, 123, 112, .11);
  color: #dffdf8;
  font-size: 12px;
}

.schedule-today-notice span,
.schedule-today-notice small {
  color: var(--muted);
}

.schedule-today-notice small {
  grid-column: 1 / -1;
}

.schedule-today-notice.is-warning {
  border-color: rgba(246, 180, 75, .35);
  background: rgba(133, 83, 14, .13);
}

.schedule-day {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(7, 10, 21, .36);
}

.schedule-day[open] {
  border-color: rgba(120, 105, 246, .28);
}

.schedule-day.is-today {
  border-color: rgba(71, 224, 201, .45);
  box-shadow: inset 3px 0 0 rgba(71, 224, 201, .82);
}

.schedule-day > summary {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  color: #eef0ff;
  font-size: 12px;
  font-weight: 780;
  cursor: pointer;
  list-style: none;
}

.schedule-day > summary span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.schedule-day > summary em {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(71, 224, 201, .14);
  color: #6df1df;
  font-size: 9px;
  font-style: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.schedule-day > summary::-webkit-details-marker {
  display: none;
}

.schedule-day > summary::after {
  content: "+";
  color: var(--purple-light);
  font-size: 20px;
  font-weight: 400;
}

.schedule-day[open] > summary::after {
  content: "−";
}

.schedule-day-body {
  display: grid;
  gap: 17px;
  padding: 0 18px 18px;
  border-top: 1px solid var(--line);
}

.schedule-day.is-disabled .schedule-day-body {
  opacity: .48;
}

.schedule-time-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding-top: 17px;
}

.schedule-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.source-picker {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 9, 20, .42);
}

fieldset.source-picker {
  min-width: 0;
  margin: 0;
}

.source-picker legend {
  padding: 0 7px;
  color: #dfe3f4;
  font-size: 11px;
  font-weight: 780;
}

.source-picker > strong {
  margin-bottom: 3px;
  color: #dfe3f4;
  font-size: 11px;
}

.source-option {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  color: #aeb7d2;
  background: rgba(255, 255, 255, .025);
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
}

.source-picker > label {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 9px;
  border-radius: 9px;
  color: #aeb7d2;
  background: rgba(255, 255, 255, .025);
  font-size: 10px;
  line-height: 1.4;
  cursor: pointer;
}

.source-picker > label:hover {
  color: #fff;
  background: rgba(120, 105, 246, .09);
}

.source-picker > label input {
  flex: 0 0 auto;
  margin-top: 3px;
  accent-color: var(--teal);
}

.source-picker > label > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.source-picker > label strong,
.source-picker > label small {
  overflow: hidden;
  overflow-wrap: anywhere;
}

.source-picker > label small {
  color: #737d9d;
  font-size: 9px;
}

.compact-toggle {
  margin-top: 17px;
}

.source-option:hover {
  color: #fff;
  background: rgba(120, 105, 246, .09);
}

.source-option span {
  overflow: hidden;
  overflow-wrap: anywhere;
}

.source-empty {
  padding: 12px;
  color: #737d9d;
  font-size: 10px;
  line-height: 1.5;
}

/* Modal */
.modal {
  width: min(780px, calc(100% - 28px));
  max-height: min(92vh, 900px);
  max-width: none;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  color: var(--text);
  background: #151b34;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .56);
  overflow: auto;
}

.modal::backdrop {
  background: rgba(3, 5, 12, .75);
  backdrop-filter: blur(6px);
}

.modal-card {
  padding: 27px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(120, 105, 246, .3);
  border-radius: 13px;
  color: var(--purple-light);
  background: rgba(120, 105, 246, .12);
}

.modal-copy {
  margin: 23px 0 21px;
}

.modal-section-title {
  margin: 21px 0 15px;
}

.modal-copy h2 {
  margin: 9px 0 7px;
  font-size: 26px;
  letter-spacing: -.035em;
}

.modal-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.url-preview {
  overflow: hidden;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #7781a0;
  background: rgba(7, 10, 21, .45);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-preview strong {
  color: #aeb6d0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 25px;
}

.sidebar-scrim {
  display: none;
}

:focus-visible {
  outline: 3px solid rgba(67, 223, 207, .65);
  outline-offset: 3px;
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid {
    grid-template-columns: 1fr;
  }

  .presence-map-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .editor-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .editor-tab:nth-child(n + 5) {
    border-top: 1px solid var(--line);
  }

  .editor-tab:nth-child(5) {
    border-left: 0;
  }

  .schedule-settings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .login-layout {
    grid-template-columns: 1fr;
  }

  .login-brand {
    display: none;
  }

  .login-card-wrap {
    min-height: 100vh;
    padding: 24px;
    background:
      radial-gradient(circle at 15% 15%, rgba(120, 105, 246, .25), transparent 22rem),
      radial-gradient(circle at 85% 85%, rgba(67, 223, 207, .12), transparent 20rem),
      var(--bg);
  }

  .mobile-login-logo {
    display: grid;
  }

  .admin-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close,
  .mobile-menu {
    display: inline-grid;
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(2, 4, 10, .66);
    backdrop-filter: blur(3px);
  }

  .sidebar-scrim.is-open {
    display: block;
  }

  .main-content {
    grid-column: 1;
  }

  .admin-app > .version-footer {
    grid-column: 1;
  }

  .topbar {
    justify-content: flex-start;
  }

  .topbar-live {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .content-wrap {
    padding: 24px 15px 42px;
  }

  .topbar {
    min-height: 64px;
    padding: 0 15px;
  }

  .topbar-live {
    font-size: 9px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading .button {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card {
    min-height: 135px;
    flex-direction: column;
    padding: 15px;
  }

  .metric-icon {
    width: 34px;
    height: 34px;
  }

  .metric-icon .icon {
    width: 17px;
    height: 17px;
  }

  .metric-card strong {
    font-size: 25px;
  }

  .presence-map-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .presence-map-layout {
    grid-template-columns: 1fr;
  }

  .world-map {
    min-height: 270px;
  }

  .map-location-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .map-location-summary {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .map-location-summary > small {
    grid-column: 1 / -1;
  }

  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .panel-card {
    padding: 16px;
  }

  .panel-card-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-card-foot .button {
    width: 100%;
  }

  .panel-card-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .editor-status-grid {
    grid-template-columns: 1fr 1fr;
  }

  .editor-tabs {
    grid-template-columns: 1fr;
  }

  .editor-tab + .editor-tab {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .form-heading,
  .editor-actions,
  .source-section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-actions .button {
    width: 100%;
  }

  .source-section-heading .button {
    width: 100%;
  }

  .message-form-grid {
    grid-template-columns: 1fr;
  }

  .social-network-row,
  .news-feed-row,
  .radio-fields,
  .schedule-settings,
  .schedule-time-grid,
  .schedule-source-grid {
    grid-template-columns: 1fr;
  }

  .social-row-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .customer-form-grid,
  .modal-form-grid {
    grid-template-columns: 1fr;
  }

  .field-span-2 {
    grid-column: auto;
  }

  .modal-card {
    padding: 21px;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .login-card-wrap {
    padding: 15px;
  }

  .login-card {
    padding: 25px 20px;
    border-radius: 18px;
  }

  .login-card-heading {
    align-items: center;
  }

  .login-card h2 {
    font-size: 23px;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 108px;
    flex-direction: row;
  }

  .panel-card-stats {
    grid-template-columns: 1fr;
  }

  .panel-card-stats > div {
    min-height: 53px;
    grid-template-columns: auto auto;
    justify-content: space-between;
    justify-items: start;
    text-align: left;
  }

  .panel-card-stats > div + div {
    border-top: 1px solid rgba(255, 255, 255, .065);
    border-left: 0;
  }

  .panel-card-stats small {
    margin: 0;
  }

  .panel-card-stats .online-indicator {
    display: none;
  }

  .editor-status-grid {
    grid-template-columns: 1fr;
  }

  .topbar-context {
    display: none;
  }

  .topbar-live {
    margin-left: auto;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .modal-actions .button-secondary {
    order: 2;
  }
}

.offline-manager {
  display: grid;
  gap: 22px;
}

.offline-manager > .form-heading {
  margin-bottom: 0;
}

.app-control-card,
.offline-library-card {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.app-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.app-control-actions form {
  margin: 0;
}

.control-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.operation-manager {
  display: grid;
  gap: 22px;
}

.operation-manager > .form-heading {
  margin-bottom: 0;
}

.operation-schedule-card,
.usage-report-card {
  display: grid;
  gap: 20px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.operation-actions form,
.operation-actions .button {
  min-width: 0;
}

.operation-enabled {
  margin: 0;
}

.operation-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.operation-days {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.operation-day-row {
  display: grid;
  grid-template-columns: minmax(125px, 1.1fr) repeat(2, minmax(100px, .8fr));
  align-items: end;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-soft);
}

.operation-day-toggle {
  display: flex;
  min-height: 45px;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

.operation-day-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--aqua);
}

.usage-report-list {
  display: grid;
  gap: 9px;
}

.usage-report-list article {
  display: grid;
  grid-template-columns: 90px minmax(120px, 1fr) 76px;
  align-items: center;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
}

.usage-report-list article > div {
  display: grid;
  gap: 3px;
}

.usage-report-list strong,
.usage-report-list span {
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
}

.usage-report-list small {
  color: var(--muted);
  font-size: 9px;
}

.usage-report-list span {
  text-align: right;
}

.usage-report-list progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 99px;
  background: var(--surface-strong);
  accent-color: var(--aqua);
}

.usage-report-list progress::-webkit-progress-bar {
  border-radius: 99px;
  background: var(--surface-strong);
}

.usage-report-list progress::-webkit-progress-value {
  border-radius: 99px;
  background: linear-gradient(90deg, var(--aqua), var(--purple));
}

@media (max-width: 1100px) {
  .operation-days {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .google-address-config-grid {
    grid-template-columns: 1fr;
  }

  .google-address-config-actions {
    justify-content: stretch;
  }

  .google-address-config-actions .button {
    flex: 1 1 100%;
  }

  .operation-settings-grid,
  .operation-day-row {
    grid-template-columns: 1fr;
  }

  .usage-report-list article {
    grid-template-columns: 64px minmax(90px, 1fr) 64px;
    gap: 9px;
  }
}

.offline-upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
}

.offline-orientation-uploads {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.offline-upload-card {
  grid-template-columns: 1fr;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
}

.offline-upload-card .button {
  width: 100%;
}

.offline-file-picker {
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 720;
}

.offline-file-picker input {
  width: 100%;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  background: var(--surface);
}

.offline-file-picker input::file-selector-button {
  min-height: 30px;
  margin-right: 12px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface-strong);
  cursor: pointer;
}

.offline-file-picker small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.offline-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.offline-image-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.offline-image-card > img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 9px;
  background: #060914;
  object-fit: contain;
  object-position: center;
}

.offline-image-card > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.offline-image-card strong {
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-image-card small {
  color: var(--muted);
  font-size: 9px;
}

.offline-image-card form,
.offline-image-card .button {
  width: 100%;
}

.offline-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.offline-empty .icon {
  width: 34px;
  height: 34px;
  color: var(--teal);
}

.offline-empty strong {
  color: var(--text);
  font-size: 13px;
}

.offline-empty span {
  max-width: 520px;
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 1050px) {
  .offline-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .offline-orientation-uploads {
    grid-template-columns: 1fr;
  }

  .offline-upload-form {
    grid-template-columns: 1fr;
  }

  .offline-upload-form .button,
  .app-control-actions form,
  .app-control-actions .button {
    width: 100%;
  }

  .offline-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .offline-gallery {
    grid-template-columns: 1fr;
  }
}

@media (prefers-color-scheme: light) {
  .app-control-card,
  .offline-library-card,
  .offline-image-card {
    background: rgba(255, 255, 255, .78);
  }

  .offline-file-picker input {
    background: #fff;
  }
}

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

/* O gestor acompanha automaticamente o tema definido no celular/computador. */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f7fb;
    --bg-soft: #edf2f8;
    --surface: #ffffff;
    --surface-soft: #f7f9fc;
    --surface-strong: #e9eef6;
    --surface-hover: #eef2ff;
    --panel-card-bg: rgba(255, 255, 255, .96);
    --panel-card-hover: #f8f9ff;
    --panel-stats-bg: #f4f7fb;
    --line: rgba(31, 41, 67, .12);
    --line-strong: rgba(31, 41, 67, .2);
    --text: #172033;
    --muted: #64748b;
    --purple: #6757e8;
    --purple-light: #7667ed;
    --teal: #0f9f93;
    --blue: #287bc2;
    --green: #16895a;
    --red: #d83c57;
    --amber: #a9620b;
    --shadow: 0 22px 58px rgba(39, 51, 82, .12);
  }

  html,
  body {
    background-color: var(--bg);
  }

  body {
    background:
      radial-gradient(circle at 12% 0%, rgba(103, 87, 232, .09), transparent 27rem),
      radial-gradient(circle at 88% 20%, rgba(15, 159, 147, .07), transparent 25rem),
      var(--bg);
  }

  .eyebrow,
  .social-help strong {
    color: #08796f;
  }

  .login-brand {
    background:
      linear-gradient(rgba(103, 87, 232, .055) 1px, transparent 1px),
      linear-gradient(90deg, rgba(103, 87, 232, .055) 1px, transparent 1px),
      radial-gradient(circle at 24% 45%, rgba(103, 87, 232, .15), transparent 23rem),
      radial-gradient(circle at 85% 78%, rgba(15, 159, 147, .1), transparent 20rem),
      linear-gradient(150deg, #f9fbff, #edf2f9 76%);
    background-size: 72px 72px, 72px 72px, auto, auto, auto;
  }

  .login-copy h1 {
    background: linear-gradient(110deg, #172033 0%, #594bc8 48%, #087f76 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  .login-copy p,
  .login-feature-row {
    color: #4b5871;
  }

  .login-card-wrap {
    background: rgba(239, 243, 249, .78);
  }

  .login-card,
  .panel-card,
  .editor-card,
  .modal-card {
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--shadow);
  }

  .panel-card:hover {
    border-color: rgba(103, 87, 232, .3);
    background: var(--panel-card-hover);
  }

  .panel-card-stats,
  .offline-upload-card {
    background: var(--panel-stats-bg);
  }

  .panel-card-stats,
  .panel-card-stats > div + div,
  .panel-card-foot {
    border-color: var(--line);
  }

  .sidebar {
    background: rgba(255, 255, 255, .96);
  }

  .topbar {
    background: rgba(244, 247, 251, .88);
  }

  .nav-label,
  .topbar-label,
  .editor-actions > span,
  .version-footer,
  .breadcrumb,
  .editor-status-grid small {
    color: #6b7690;
  }

  .nav-item,
  .topbar-live,
  .editor-tab {
    color: #59657d;
  }

  .nav-item:hover {
    color: var(--text);
    background: rgba(31, 41, 67, .045);
  }

  .nav-item.is-active,
  .editor-tab.is-active {
    color: #302675;
    background: rgba(103, 87, 232, .09);
  }

  .button-secondary,
  .icon-button {
    color: #334155;
    background: rgba(255, 255, 255, .72);
  }

  .button-secondary:hover,
  .icon-button:hover {
    color: #1e293b;
    background: rgba(103, 87, 232, .08);
  }

  .button-danger {
    color: #b4233e;
  }

  .field > span:first-child,
  .switch-copy strong,
  .source-test-result strong {
    color: #263248;
  }

  .field input,
  .field select,
  .field textarea,
  .search-field input {
    color: var(--text);
    background: #ffffff;
  }

  .field select {
    color-scheme: light;
  }

  .field input:focus,
  .field select:focus,
  .field textarea:focus,
  .search-field input:focus {
    background: #ffffff;
  }

  .editor-status-grid article,
  .metric-card,
  .message-visibility-toggle,
  .interval-field,
  .meta-config-card,
  .social-network-row,
  .news-feed-row,
  .radio-config-card,
  .news-config-card,
  .schedule-day,
  .schedule-day-body,
  .source-picker,
  .source-picker > label {
    background: rgba(255, 255, 255, .78);
  }

  .editor-tabs,
  .version-footer {
    background: rgba(239, 243, 249, .78);
  }

  .social-help,
  .form-section-title,
  .modal-section-title {
    color: #4b5871;
    background: rgba(15, 159, 147, .065);
  }

  .meta-config-card {
    border-color: rgba(15, 159, 147, .2);
    background: linear-gradient(145deg, rgba(15, 159, 147, .055), rgba(103, 87, 232, .045));
  }

  .meta-status {
    color: #8a5108;
    background: #fff8e8;
  }

  .meta-status.is-connected {
    color: #08796f;
    background: #eafaf7;
  }

  .meta-connection {
    color: #475569;
    background: #fffaf0;
  }

  .meta-connection.is-connected {
    background: #effbf8;
  }

  .meta-connection strong {
    color: #263248;
  }

  .meta-connection small,
  .meta-action-hint {
    color: #64748b;
  }

  .source-test-result {
    color: #46536b;
    background: rgba(103, 87, 232, .055);
  }

  .source-test-result.is-error,
  .alert-error {
    color: #a9243e;
    background: rgba(216, 60, 87, .07);
  }

  .alert-success {
    color: #087747;
    background: rgba(22, 137, 90, .07);
  }

  .switch-control {
    background: #d8deea;
  }

  .switch-control > span {
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(39, 51, 82, .22);
  }

  .social-row-toggle,
  .schedule-enabled {
    color: #475569;
  }

  .schedule-today-notice {
    color: #17443f;
    background: #eefcf9;
  }

  .schedule-today-notice span,
  .schedule-today-notice small {
    color: #526276;
  }

  .schedule-day > summary {
    color: #263248;
    background: rgba(248, 250, 252, .92);
  }

  .schedule-day > summary em {
    color: #08796f;
    background: #e5f8f4;
  }

  .schedule-day > summary::after {
    color: #6757e8;
  }

  .schedule-day.is-disabled .schedule-day-body {
    opacity: .72;
  }

  .source-picker legend,
  .source-picker > strong,
  .source-picker > label strong {
    color: #263248;
  }

  .source-picker > label,
  .source-option {
    color: #475569;
    background: #f7f9fc;
  }

  .source-picker > label small {
    color: #64748b;
  }

  .source-picker > label:hover {
    color: #172033;
    background: #eeecff;
  }

  .sidebar-scrim {
    background: rgba(15, 23, 42, .3);
  }
}

/* O seletor do cabeçalho tem prioridade sobre a preferência do dispositivo. */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f7fb;
  --bg-soft: #edf2f8;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --surface-strong: #e9eef6;
  --surface-hover: #eef2ff;
  --panel-card-bg: rgba(255, 255, 255, .96);
  --panel-card-hover: #f8f9ff;
  --panel-stats-bg: #f4f7fb;
  --line: rgba(31, 41, 67, .12);
  --line-strong: rgba(31, 41, 67, .2);
  --text: #172033;
  --muted: #64748b;
  --purple: #6757e8;
  --purple-light: #7667ed;
  --teal: #0f9f93;
  --blue: #287bc2;
  --green: #16895a;
  --red: #d83c57;
  --amber: #a9620b;
  --shadow: 0 22px 58px rgba(39, 51, 82, .12);
  background: var(--bg);
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(103, 87, 232, .09), transparent 27rem),
    radial-gradient(circle at 88% 20%, rgba(15, 159, 147, .07), transparent 25rem),
    var(--bg);
}

html[data-theme="light"] .login-brand {
  background:
    linear-gradient(rgba(103, 87, 232, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 87, 232, .055) 1px, transparent 1px),
    radial-gradient(circle at 24% 45%, rgba(103, 87, 232, .15), transparent 23rem),
    radial-gradient(circle at 85% 78%, rgba(15, 159, 147, .1), transparent 20rem),
    linear-gradient(150deg, #f9fbff, #edf2f9 76%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

html[data-theme="light"] .login-copy h1 {
  background: linear-gradient(110deg, #172033 0%, #594bc8 48%, #087f76 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="light"] .login-copy p,
html[data-theme="light"] .login-feature-row,
html[data-theme="light"] .social-help,
html[data-theme="light"] .form-section-title,
html[data-theme="light"] .modal-section-title {
  color: #4b5871;
}

html[data-theme="light"] .login-card-wrap,
html[data-theme="light"] .editor-tabs,
html[data-theme="light"] .version-footer {
  background: rgba(239, 243, 249, .82);
}

html[data-theme="light"] .login-card,
html[data-theme="light"] .panel-card,
html[data-theme="light"] .editor-card,
html[data-theme="light"] .presence-map-card,
html[data-theme="light"] .modal-card {
  background: var(--panel-card-bg);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .panel-card:hover {
  border-color: rgba(103, 87, 232, .3);
  background: var(--panel-card-hover);
}

html[data-theme="light"] .panel-card-stats,
html[data-theme="light"] .offline-upload-card {
  background: var(--panel-stats-bg);
}

html[data-theme="light"] .panel-card-stats,
html[data-theme="light"] .panel-card-stats > div + div,
html[data-theme="light"] .panel-card-foot {
  border-color: var(--line);
}

html[data-theme="light"] .metric-card,
html[data-theme="light"] .editor-status-grid article,
html[data-theme="light"] .message-visibility-toggle,
html[data-theme="light"] .interval-field,
html[data-theme="light"] .meta-config-card,
html[data-theme="light"] .social-network-row,
html[data-theme="light"] .news-feed-row,
html[data-theme="light"] .radio-config-card,
html[data-theme="light"] .news-config-card,
html[data-theme="light"] .schedule-day,
html[data-theme="light"] .schedule-day-body,
html[data-theme="light"] .source-picker,
html[data-theme="light"] .source-picker > label,
html[data-theme="light"] .app-control-card,
html[data-theme="light"] .offline-library-card,
html[data-theme="light"] .offline-image-card,
html[data-theme="light"] .operation-schedule-card,
html[data-theme="light"] .usage-report-card,
html[data-theme="light"] .operation-day-row,
html[data-theme="light"] .google-address-config-card,
html[data-theme="light"] .customer-record-card {
  background: rgba(255, 255, 255, .9);
}

html[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, .97);
}

html[data-theme="light"] .topbar {
  background: rgba(244, 247, 251, .9);
}

html[data-theme="light"] .nav-item,
html[data-theme="light"] .topbar-live,
html[data-theme="light"] .editor-tab {
  color: #59657d;
}

html[data-theme="light"] .nav-item:hover {
  color: var(--text);
  background: rgba(31, 41, 67, .045);
}

html[data-theme="light"] .nav-item.is-active,
html[data-theme="light"] .editor-tab.is-active {
  color: #302675;
  background: rgba(103, 87, 232, .09);
}

html[data-theme="light"] .button-secondary,
html[data-theme="light"] .icon-button {
  color: #334155;
  background: rgba(255, 255, 255, .78);
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea,
html[data-theme="light"] .search-field input,
html[data-theme="light"] .offline-file-picker input {
  color: var(--text);
  background: #ffffff;
}

html[data-theme="light"] .field select {
  color-scheme: light;
}

html[data-theme="light"] .theme-switcher button.is-active {
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(39, 51, 82, .14);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090d1b;
  --bg-soft: #0f1428;
  --surface: #141a32;
  --surface-soft: #19203d;
  --surface-strong: #20294d;
  --surface-hover: #1d2546;
  --panel-card-bg: rgba(20, 26, 50, .82);
  --panel-card-hover: rgba(29, 37, 70, .92);
  --panel-stats-bg: rgba(6, 9, 20, .42);
  --line: rgba(255, 255, 255, .1);
  --line-strong: rgba(255, 255, 255, .17);
  --text: #f6f7ff;
  --muted: #98a2c2;
  --purple: #7869f6;
  --purple-light: #a69dff;
  --teal: #43dfcf;
  --blue: #5aa9ff;
  --green: #4ade9b;
  --red: #ff697d;
  --amber: #ffc56b;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  background: var(--bg);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(120, 105, 246, .15), transparent 27rem),
    radial-gradient(circle at 88% 20%, rgba(67, 223, 207, .08), transparent 25rem),
    var(--bg);
}

html[data-theme="dark"] .login-brand {
  background:
    linear-gradient(rgba(120, 105, 246, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 105, 246, .055) 1px, transparent 1px),
    radial-gradient(circle at 24% 45%, rgba(120, 105, 246, .2), transparent 23rem),
    radial-gradient(circle at 85% 78%, rgba(67, 223, 207, .12), transparent 20rem),
    linear-gradient(150deg, #0d1224, #090d1b 76%);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

html[data-theme="dark"] .login-copy h1 {
  background: linear-gradient(110deg, #ffffff 0%, #cfcaff 48%, #a9fff6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-theme="dark"] .login-copy p,
html[data-theme="dark"] .login-feature-row {
  color: #aeb7d2;
}

html[data-theme="dark"] .login-card-wrap,
html[data-theme="dark"] .editor-tabs,
html[data-theme="dark"] .version-footer {
  background: rgba(9, 13, 27, .82);
}

html[data-theme="dark"] .login-card,
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .editor-card,
html[data-theme="dark"] .presence-map-card,
html[data-theme="dark"] .modal-card {
  background: var(--panel-card-bg);
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .panel-card:hover {
  border-color: rgba(120, 105, 246, .32);
  background: var(--panel-card-hover);
}

html[data-theme="dark"] .panel-card-stats,
html[data-theme="dark"] .offline-upload-card {
  background: var(--panel-stats-bg);
}

html[data-theme="dark"] .panel-card-stats,
html[data-theme="dark"] .panel-card-stats > div + div,
html[data-theme="dark"] .panel-card-foot {
  border-color: var(--line);
}

html[data-theme="dark"] .metric-card {
  background: linear-gradient(145deg, rgba(24, 31, 60, .88), rgba(16, 21, 42, .88));
}

html[data-theme="dark"] .editor-status-grid article,
html[data-theme="dark"] .message-visibility-toggle,
html[data-theme="dark"] .interval-field,
html[data-theme="dark"] .meta-config-card,
html[data-theme="dark"] .social-network-row,
html[data-theme="dark"] .news-feed-row,
html[data-theme="dark"] .radio-config-card,
html[data-theme="dark"] .news-config-card,
html[data-theme="dark"] .schedule-day,
html[data-theme="dark"] .schedule-day-body,
html[data-theme="dark"] .source-picker,
html[data-theme="dark"] .source-picker > label,
html[data-theme="dark"] .app-control-card,
html[data-theme="dark"] .offline-library-card,
html[data-theme="dark"] .offline-image-card {
  background: var(--surface-soft);
}

html[data-theme="dark"] .sidebar {
  background: rgba(12, 16, 32, .96);
}

html[data-theme="dark"] .topbar {
  background: rgba(9, 13, 27, .88);
}

html[data-theme="dark"] .nav-item,
html[data-theme="dark"] .topbar-live,
html[data-theme="dark"] .editor-tab {
  color: #9da7c6;
}

html[data-theme="dark"] .nav-item:hover {
  color: #eef0ff;
  background: rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .nav-item.is-active,
html[data-theme="dark"] .editor-tab.is-active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(120, 105, 246, .2), rgba(120, 105, 246, .07));
}

html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .icon-button {
  color: var(--text);
  background: rgba(20, 26, 50, .72);
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .search-field input,
html[data-theme="dark"] .offline-file-picker input {
  color: var(--text);
  background: var(--surface);
}

html[data-theme="dark"] .field select {
  color-scheme: dark;
}

@media (max-width: 600px) {
  .topbar-actions .topbar-live {
    display: none;
  }

  .login-theme-switcher {
    top: 12px;
    right: 12px;
  }
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .social-help strong {
  color: #08796f;
}

html[data-theme="light"] .nav-label,
html[data-theme="light"] .topbar-label,
html[data-theme="light"] .editor-actions > span,
html[data-theme="light"] .version-footer,
html[data-theme="light"] .breadcrumb,
html[data-theme="light"] .editor-status-grid small {
  color: #6b7690;
}

html[data-theme="light"] .field > span:first-child,
html[data-theme="light"] .switch-copy strong,
html[data-theme="light"] .source-test-result strong,
html[data-theme="light"] .source-picker legend,
html[data-theme="light"] .source-picker > strong,
html[data-theme="light"] .source-picker > label strong {
  color: #263248;
}

html[data-theme="light"] .metric-card span:not(.metric-icon),
html[data-theme="light"] .panel-customer-meta > span,
html[data-theme="light"] .panel-card-stats small,
html[data-theme="light"] .panel-card-foot > span {
  color: #5f6b84;
}

html[data-theme="light"] .social-help,
html[data-theme="light"] .form-section-title,
html[data-theme="light"] .modal-section-title {
  background: rgba(15, 159, 147, .065);
}

html[data-theme="light"] .meta-status {
  color: #8a5108;
  background: #fff8e8;
}

html[data-theme="light"] .meta-status.is-connected {
  color: #08796f;
  background: #eafaf7;
}

html[data-theme="light"] .meta-connection {
  color: #475569;
  background: #fffaf0;
}

html[data-theme="light"] .meta-connection.is-connected {
  background: #effbf8;
}

html[data-theme="light"] .meta-connection strong {
  color: #263248;
}

html[data-theme="light"] .meta-connection small,
html[data-theme="light"] .meta-action-hint,
html[data-theme="light"] .source-picker > label small {
  color: #64748b;
}

html[data-theme="light"] .source-test-result {
  color: #46536b;
  background: rgba(103, 87, 232, .055);
}

html[data-theme="light"] .source-test-result.is-error,
html[data-theme="light"] .alert-error {
  color: #a9243e;
  background: rgba(216, 60, 87, .07);
}

html[data-theme="light"] .alert-success {
  color: #087747;
  background: rgba(22, 137, 90, .07);
}

html[data-theme="light"] .switch-control {
  background: #d8deea;
}

html[data-theme="light"] .switch-control > span {
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(39, 51, 82, .22);
}

html[data-theme="light"] .social-row-toggle,
html[data-theme="light"] .schedule-enabled {
  color: #475569;
}

html[data-theme="light"] .schedule-today-notice {
  color: #17443f;
  background: #eefcf9;
}

html[data-theme="light"] .schedule-today-notice span,
html[data-theme="light"] .schedule-today-notice small {
  color: #526276;
}

html[data-theme="light"] .schedule-day > summary {
  color: #263248;
  background: rgba(248, 250, 252, .92);
}

html[data-theme="light"] .schedule-day > summary em {
  color: #08796f;
  background: #e5f8f4;
}

html[data-theme="light"] .source-picker > label,
html[data-theme="light"] .source-option {
  color: #475569;
  background: #f7f9fc;
}

html[data-theme="light"] .source-picker > label:hover {
  color: #172033;
  background: #eeecff;
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .social-help strong {
  color: #a9fff6;
}

html[data-theme="dark"] .nav-label,
html[data-theme="dark"] .topbar-label,
html[data-theme="dark"] .editor-actions > span,
html[data-theme="dark"] .version-footer,
html[data-theme="dark"] .breadcrumb,
html[data-theme="dark"] .editor-status-grid small {
  color: #737d9d;
}

html[data-theme="dark"] .field > span:first-child,
html[data-theme="dark"] .switch-copy strong,
html[data-theme="dark"] .source-test-result strong,
html[data-theme="dark"] .source-picker legend,
html[data-theme="dark"] .source-picker > strong,
html[data-theme="dark"] .source-picker > label strong {
  color: #dfe3f4;
}

html[data-theme="dark"] .social-help,
html[data-theme="dark"] .form-section-title,
html[data-theme="dark"] .modal-section-title {
  color: #aab4d1;
  background: rgba(67, 223, 207, .055);
}

html[data-theme="dark"] .meta-config-card {
  border-color: rgba(67, 223, 207, .18);
  background: linear-gradient(145deg, rgba(67, 223, 207, .045), rgba(120, 105, 246, .055));
}

html[data-theme="dark"] .meta-status {
  color: #fbbf24;
  background: rgba(245, 158, 11, .08);
}

html[data-theme="dark"] .meta-status.is-connected {
  color: #86fff2;
  background: rgba(67, 223, 207, .09);
}

html[data-theme="dark"] .meta-connection {
  color: #d6def3;
  background: rgba(245, 158, 11, .055);
}

html[data-theme="dark"] .meta-connection.is-connected {
  background: rgba(67, 223, 207, .06);
}

html[data-theme="dark"] .meta-connection strong {
  color: #f8fbff;
}

html[data-theme="dark"] .meta-connection small,
html[data-theme="dark"] .meta-action-hint {
  color: #929dbd;
}

html[data-theme="dark"] .source-test-result {
  color: #cbd5f0;
  background: rgba(120, 105, 246, .08);
}

html[data-theme="dark"] .source-test-result.is-error,
html[data-theme="dark"] .alert-error {
  color: #fecdd3;
  background: rgba(251, 113, 133, .075);
}

html[data-theme="dark"] .alert-success {
  color: #c6ffe2;
  background: rgba(34, 197, 94, .075);
}

html[data-theme="dark"] .switch-control {
  background: #252c43;
}

html[data-theme="dark"] .switch-control > span {
  background: #abb3ca;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}

html[data-theme="dark"] .social-row-toggle,
html[data-theme="dark"] .schedule-enabled {
  color: #d6def3;
}

html[data-theme="dark"] .schedule-today-notice {
  color: #dffdf8;
  background: rgba(24, 123, 112, .11);
}

html[data-theme="dark"] .schedule-today-notice span,
html[data-theme="dark"] .schedule-today-notice small {
  color: var(--muted);
}

html[data-theme="dark"] .schedule-day > summary {
  color: #eef0ff;
  background: transparent;
}

html[data-theme="dark"] .schedule-day > summary em {
  color: #6df1df;
  background: rgba(71, 224, 201, .14);
}

html[data-theme="dark"] .source-picker > label,
html[data-theme="dark"] .source-option {
  color: #aeb7d2;
  background: rgba(255, 255, 255, .025);
}

html[data-theme="dark"] .source-picker > label small {
  color: #737d9d;
}

html[data-theme="dark"] .source-picker > label:hover {
  color: #ffffff;
  background: rgba(120, 105, 246, .09);
}
