/**
 * =========================================================
 *    NEXUS IPTV — Design System
 *    =========================================================
 *
 * @format
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #05070d;
  --bg-2: #080c16;
  --text: #e9edf8;
  --muted: #8a93a8;
  --muted-2: #6b7386;
  --line: rgba(255, 255, 255, 0.171);
  --line-strong: rgba(255, 255, 255, 0.13);
  --card: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  --card-flat: #0b0f1a;
  --side: rgba(7, 10, 18, 0.72);
  --topbar: rgba(5, 8, 14, 0.72);
  --input: rgba(255, 255, 255, 0.045);
  --hover: rgba(255, 255, 255, 0.05);

  --accent: #B00000;
  --accent-2: #7F0000;
  --accent-soft: rgba(176, 0, 0, 0.16);
  --accent-glow: rgba(176, 0, 0, 0.45);

  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #60a5fa;

  --r-xl: 24px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 24px 70px -34px rgba(0, 0, 0, 0.95);
  --shadow-sm: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  --ease: cubic-bezier(0.22, 0.68, 0, 1);
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #eef1f8;
  --bg-2: #f7f9fd;
  --text: #0d1424;
  --muted: #5b6478;
  --muted-2: #7b8497;
  --line: rgba(13, 20, 36, 0.09);
  --line-strong: rgba(13, 20, 36, 0.16);
  --card: linear-gradient(180deg, #ffffff, #fbfcff);
  --card-flat: #ffffff;
  --side: rgba(255, 255, 255, 0.78);
  --topbar: rgba(247, 249, 253, 0.78);
  --input: rgba(13, 20, 36, 0.04);
  --hover: rgba(13, 20, 36, 0.04);
  --shadow: 0 24px 60px -34px rgba(15, 23, 42, 0.35);
  --shadow-sm: 0 12px 26px -20px rgba(15, 23, 42, 0.35);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    'Plus Jakarta Sans',
    system-ui,
    -apple-system,
    'Segoe UI',
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: radial-gradient(1200px 620px at 82% -12%, rgba(139, 92, 246, 0.16), transparent 62%), radial-gradient(900px 520px at -8% 8%, rgba(34, 211, 238, 0.09), transparent 58%), var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}
.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
}
img,
svg {
  display: block;
}
::selection {
  background: var(--accent);
  color: #fff;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------- primitives ------------------------- */
.grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.card-sub {
  font-size: 10.5px;
  color: var(--muted);
}
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform 0.18s var(--ease),
    background 0.18s,
    border-color 0.18s,
    box-shadow 0.18s,
    opacity 0.18s;
  user-select: none;
}
.btn:active {
  transform: scale(0.975);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow:
    0 14px 34px -16px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.btn-ghost {
  background: var(--input);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}
.btn-soft {
  background: var(--accent-soft);
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn-soft:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
.btn-danger {
  background: rgba(251, 113, 133, 0.14);
  color: var(--bad);
  border-color: rgba(251, 113, 133, 0.32);
}
.btn-danger:hover {
  background: rgba(255, 42, 74, 0.952);
  color: #fff;
}
.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 10px;
}
.btn-icon {
  padding: 0 8px;
}
.btn-block {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.6;
  pointer-events: none;
}

.icon-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s var(--ease);
  flex: none;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--hover);
}
.icon-btn.sm {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
.icon-btn .dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--bad);
  box-shadow: 0 0 0 2px var(--bg-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-ok {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.26);
}
.badge-warn {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.26);
}
.badge-bad {
  color: var(--bad);
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.26);
}
.badge-info {
  color: var(--info);
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.26);
}
.badge-mute {
  color: var(--muted);
  background: var(--input);
  border-color: var(--line);
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  flex: none;
}
.avatar.xl {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  font-size: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  outline: none;
  transition:
    border-color 0.18s,
    box-shadow 0.18s,
    background 0.18s;
}
textarea {
  height: auto;
  min-height: 96px;
  padding: 11px 13px;
  resize: vertical;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted-2);
}
input:focus,
select:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
  background: color-mix(in srgb, var(--input) 60%, transparent);
}
select {
  appearance: none;
  cursor: pointer;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}
select option {
  background: var(--card-flat);
  color: var(--text);
}

.input {
  position: relative;
  display: flex;
  align-items: center;
}
.input > svg {
  position: absolute;
  left: 13px;
  color: var(--muted-2);
  pointer-events: none;
}
.input input {
  padding-left: 40px;
  height: 46px;
}
.input .eye {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.input .eye:hover {
  color: var(--text);
  background: var(--hover);
}
.input-row {
  display: flex;
  gap: 8px;
}
.input-row input {
  flex: 1;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.check input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

.link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
}
.link:hover {
  text-decoration: underline;
}

.chip {
  height: 32px;
  padding: 0 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.16s var(--ease);
  white-space: nowrap;
}
.chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.chip.active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.search {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 40px;
  padding: 0 10px 0 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input);
  color: var(--muted);
  transition:
    border-color 0.18s,
    box-shadow 0.18s;
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13px;
  box-shadow: none !important;
}
.search kbd {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  border: 1px solid var(--line);
  background: var(--hover);
  border-radius: 6px;
  padding: 1px 6px;
}
.search.sm {
  height: 36px;
  width: 100%;
}

.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--input);
}
.empty b {
  color: var(--text);
  font-size: 14px;
}
.empty span {
  font-size: 12.5px;
}
.empty svg {
  color: var(--muted-2);
  margin-bottom: 4px;
}

/* =========================================================
   AUTH
   ========================================================= */
.auth {
  position: relative;
  box-sizing: border-box;
  height: 100vh;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
}
@media (max-height: 820px) {
  .auth-hero h1 {
    margin: 20px 0 12px;
  }
  .auth-list {
    margin-top: 22px;
    gap: 14px;
  }
  .auth-stats {
    margin-top: 22px;
  }
}
.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  animation: float 16s ease-in-out infinite;
}
.o1 {
  width: 520px;
  height: 520px;
  bottom: -160px;
  right: -80px;
  background: var(--accent);
}
.o2 {
  width: 420px;
  height: 420px;
  top: -160px;
  left: -80px;
  background: var(--accent-2);
  animation-delay: -5s;
  opacity: 0.35;
}
.o3 {
  width: 300px;
  height: 300px;
  top: 42%;
  left: 38%;
  background: #ec4899;
  opacity: 0.18;
  animation-delay: -9s;
}
.grid-lines {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--line) 1px, transparent 1px), linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.55;
}

.auth-shell {
  position: relative;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 72px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 12px 26px -12px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand-text {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand-text b {
  font-weight: 800;
}
.brand-text span {
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
  transform: translateY(-1px);
}

.auth-hero h1 {
  margin: 44px 0 18px;
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.03;
  letter-spacing: -0.045em;
  font-weight: 800;
  max-width: 12ch;
}
.auth-sub {
  color: var(--muted);
  font-size: 15.5px;
  max-width: 44ch;
  line-height: 1.65;
}

.auth-list {
  list-style: none;
  margin: 38px 0 0;
  padding: 0;
  display: grid;
  gap: 20px;
}
.auth-list li {
  display: flex;
  gap: 15px;
  align-items: flex-start;
}
.al-ico {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
}
.auth-list b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}
.auth-list small {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.auth-stats {
  display: flex;
  gap: 12px;
  margin-top: 42px;
  flex-wrap: wrap;
}
.stat-chip {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(12px);
}
.stat-chip b {
  font-size: 18px;
  letter-spacing: -0.02em;
}
.stat-chip span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

.auth-card {
  position: relative;
  padding: 38px 36px 30px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  background: var(--card);
  backdrop-filter: blur(24px);
  box-shadow:
    0 40px 100px -40px rgba(0, 0, 0, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
[data-theme='light'] .auth-card {
  background: var(--card);
}
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--accent) 55%, transparent), transparent 38%, transparent 65%, color-mix(in srgb, var(--accent-2) 35%, transparent));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.auth-card-head h2 {
  font-size: 23px;
  letter-spacing: -0.03em;
  font-weight: 800;
  text-align: center;
}
.auth-card-head p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 5px;
}
.auth-card form {
  margin-top: 26px;
  display: grid;
  gap: 16px;
}
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.auth-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted-2);
  padding-top: 4px;
}
.auth-hint code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--muted);
}
.btn-block {
  margin-top: 6px;
  height: 46px;
}
.btn.loading span,
.btn.loading svg {
  opacity: 0;
}
.btn.loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.7s linear infinite;
}
.btn.loading {
  position: relative;
}

/* =========================================================
   SHELL
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px 18px;
  background: var(--side);
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--line);
  z-index: 40;
  overflow: visible;
}
.sb-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.sidebar .brand {
  padding: 0 6px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 16px 12px 8px;
}
.nav-label:first-child {
  padding-top: 0;
}
.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: 0.16s var(--ease);
}
.nav-link:hover {
  color: var(--text);
  background: var(--hover);
}
.nav-link.active {
  color: var(--text);
  background: linear-gradient(90deg, var(--accent-soft), transparent 85%);
}
.nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  bottom: 11px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent-glow);
}
.nav-ico {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--muted-2);
  transition: color 0.16s;
}
/* .nav-link:hover .nav-ico,
.nav-link.active .nav-ico {
  color: var(--accent);
} */
.nav-ico svg {
  width: 19px;
  height: 19px;
}
.nav-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 99px;
  color: var(--muted);
  background: var(--input);
  border: 1px solid var(--line);
}
.nav-badge.ok {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.22);
}

.side-card {
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
}
.side-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.16);
  animation: pulse 2.4s infinite;
}
.meter {
  height: 5px;
  border-radius: 99px;
  background: var(--input);
  margin: 11px 0 8px;
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.side-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted-2);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--input);
}
.user-chip-info {
  min-width: 0;
  flex: 1;
}
.user-chip-info b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip-info span {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 76px;
  padding: 14px 32px;
  background: var(--topbar);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
}
.page-head {
  min-width: 0;
  flex: 1;
}
.page-head h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.page-head p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-wrap {
  position: relative;
}
.search-wrap .search {
  width: 280px;
}
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-height: 400px;
  overflow: auto;
  padding: 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--card-flat);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  pointer-events: none;
  transition: 0.16s var(--ease);
  z-index: 50;
}
.search-results.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.sr-group {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 8px 10px 6px;
}
.sr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--muted);
}
.sr-item:hover {
  background: var(--hover);
  color: var(--text);
}
.sr-item > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.sr-item b {
  display: block;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
}
.sr-item small {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--c1, var(--accent)), var(--c2, var(--accent-2)));
}
.sr-empty {
  padding: 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
}

.user-wrap {
  position: relative;
}
.user-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 4px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: 0.16s;
}
.user-btn:hover {
  background: var(--hover);
  border-color: var(--line);
}
.user-btn .caret {
  color: var(--muted-2);
}
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 230px;
  padding: 8px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--card-flat);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  pointer-events: none;
  transition: 0.16s var(--ease);
  z-index: 50;
}
.user-menu.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.um-head {
  padding: 9px 10px 11px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.um-head b {
  display: block;
  font-size: 12.5px;
}
.um-head span {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 1px;
}
.user-menu a,
.user-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.user-menu a:hover,
.user-menu button:hover {
  background: var(--hover);
  color: var(--text);
}
.user-menu #menuLogout {
  color: var(--bad);
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(3, 5, 10, 0.6);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  z-index: 35;
}
.only-mobile {
  display: none !important;
}

.view {
  flex: 1;
  padding: 28px 32px 64px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

/* =========================================================
   DASHBOARD
   ========================================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}
.kpi-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpi-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.kpi {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}
.kpi::after {
  content: '';
  position: absolute;
  inset: -60% 40% 40% -20%;
  background: radial-gradient(closest-side, var(--accent-glow), transparent 70%);
  opacity: 0.16;
  pointer-events: none;
}
.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.kpi-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.kpi-value {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin-top: 14px;
  line-height: 1.1;
}
.kpi-value small {
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0;
}
.kpi-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
}
.kpi-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 700;
}
.kpi-delta.up {
  color: var(--ok);
}
.kpi-delta.down {
  color: var(--bad);
}
.kpi-delta small {
  font-weight: 500;
  color: var(--muted-2);
  margin-left: 2px;
}
.spark {
  width: 74px;
  height: 30px;
  flex: none;
  opacity: 0.9;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.62fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.grid-2.dash-split {
  align-items: stretch;
}
.grid-2.even {
  grid-template-columns: 1fr 1fr;
}
.full-width-card {
  width: 100%;
  grid-column: 1 / -1;
}
.dash-left {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dash-left .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.dash-side .card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* charts */
.chart {
  position: relative;
  margin: 4px -6px -6px;
}
.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart text {
  font-family: inherit;
  font-size: 11px;
  fill: var(--muted-2);
}
.chart .grid-line {
  stroke: var(--line);
  stroke-width: 1;
}
.area-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 8px 16px var(--accent-glow));
}
.area-dot {
  fill: var(--card-flat);
  stroke: var(--accent);
  stroke-width: 2.5;
}
.hover-line {
  stroke: var(--line-strong);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.hover-dot {
  fill: var(--accent);
  stroke: var(--bg-2);
  stroke-width: 2;
}
.stop-a {
  stop-color: var(--accent);
}
.stop-b {
  stop-color: var(--accent);
}
.chart-tip {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--card-flat);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  transform: translate(-50%, -118%);
  white-space: nowrap;
  transition:
    left 0.08s linear,
    top 0.08s linear;
}
.chart-tip span {
  font-size: 10px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.chart-tip b {
  font-size: 12.5px;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  background: var(--input);
  border: 1px solid var(--line);
}
.seg button {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.seg button.active {
  background: var(--card-flat);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.donut {
  position: relative;
  width: 176px;
  height: 176px;
}
.donut svg {
  transform: rotate(-90deg);
}
.donut circle {
  fill: none;
  stroke-width: 14;
  stroke-linecap: round;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 1px;
}
.donut-center b {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.donut-center span {
  font-size: 10.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.legend {
  width: 100%;
  display: grid;
  gap: 9px;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted);
}
.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 3px;
  flex: none;
}
.legend-item b {
  margin-left: auto;
  color: var(--text);
  font-weight: 700;
}
.legend-item small {
  color: var(--muted-2);
  font-size: 11px;
  width: 36px;
  text-align: right;
}

.rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-radius: 12px;
  transition: background 0.16s;
}
.rank-row:hover {
  background: var(--hover);
}
.rank {
  width: 18px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--muted-2);
  text-align: center;
  flex: none;
}
.ch-mini {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.ch-mini.lg {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  font-size: 12px;
}
.rank-main {
  flex: 1;
  min-width: 0;
}
.rank-main b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-main small {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
}
.rank-viewers {
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rank-viewers small {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--muted-2);
}
.trend {
  font-size: 11px;
  font-weight: 700;
  min-width: 44px;
  text-align: right;
}
.trend.up {
  color: var(--ok);
}
.trend.down {
  color: var(--bad);
}

.activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}
.act-row {
  display: flex;
  gap: 12px;
  padding: 9px 6px;
  border-radius: 12px;
  transition: background 0.16s;
}
.act-row:hover {
  background: var(--hover);
}
.act-row-last {
  background: rgba(124, 58, 237, 0.06);
  border-left: 3px solid var(--accent);
}
.act-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--muted);
}
.act-ico.ok {
  color: var(--ok);
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
}
.act-ico.warn {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.2);
}
.act-ico.bad {
  color: var(--bad);
  background: rgba(251, 113, 133, 0.1);
  border-color: rgba(251, 113, 133, 0.2);
}
.act-ico.info {
  color: var(--info);
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.2);
}
.act-body {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.act-body b {
  color: var(--text);
  font-weight: 600;
}
.act-time {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

.bars {
  display: grid;
  gap: 15px;
}
.bar-row {
  display: grid;
  grid-template-columns: 108px 1fr 64px;
  align-items: center;
  gap: 14px;
}
.bar-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-track {
  height: 8px;
  border-radius: 99px;
  background: var(--input);
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.9s var(--ease);
}
.bar-val {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* =========================================================
   TABLES / LISTS
   ========================================================= */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.toolbar .select {
  width: 150px;
  height: 36px;
  font-size: 12.5px;
}
#clientStatus {
  width: 100%;
  flex: 1;
  min-width: 0;
}
.list-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--muted-2);
  margin: -4px 2px 14px;
}
.dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted-2);
}

.table-wrap {
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  min-width: 0;
}
.table-wrap::-webkit-scrollbar {
  display: none;
}
.table-view-bar {
  display: flex;
  justify-content: flex-end;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.table-wrap.cards-view table {
  min-width: 0;
}
.table-wrap.cards-view table,
.table-wrap.cards-view thead,
.table-wrap.cards-view tbody,
.table-wrap.cards-view tr,
.table-wrap.cards-view td {
  display: block;
  width: 100%;
}
.table-wrap.cards-view thead {
  display: none;
}
.table-wrap.cards-view tbody {
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
  min-width: 0;
  width: 100%;
}
.auth-logo-card {
  display: block;
  text-align: center;
  margin-bottom: 16px;
}
.auth-logo-card .logo {
  margin: 0 auto;
  height: 48px;
}
@media (max-width: 480px) {
  .auth-logo-card {
    display: none;
  }
}
.auth-logo {
  display: none;
  text-align: center;
  margin-bottom: 16px;
}
.auth-logo .logo {
  margin: 0 auto;
  height: 60px;
}
@media (max-width: 480px) {
  .auth-logo {
    display: block;
  }
  .auth-shell {
    max-width: 100%;
    justify-self: end;
  }
}
.table-wrap.cards-view tr {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 8px 12px;
  background: var(--input);
  max-width: 100%;
  box-sizing: border-box;
}
.table-wrap.cards-view td {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  border: none;
  min-width: 0;
  overflow-wrap: anywhere;
  flex-wrap: wrap;
}
.table-wrap.cards-view td > * {
  min-width: 0;
  overflow-wrap: anywhere;
}
.table-wrap.cards-view td::before {
  content: attr(data-label);
  flex: 0 0 auto;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 0;
}
.table-wrap.cards-view td[data-label="Ações"] {
  justify-content: flex-end;
}
.table-wrap.cards-view td[data-label="Ações"]::before {
  display: none;
}
table.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.table thead th {
  z-index: 2;
  padding: 13px 18px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: color-mix(in srgb, var(--card-flat) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  vertical-align: middle;
}
.table tbody tr:last-child td {
  border-bottom: 0;
}
.table tbody tr {
  transition: background 0.14s;
}
so
.ta-r {
  text-align: right !important;
}
.sub-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}
.sub-cell b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.sub-cell small {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
}
.created-time {
  font-size: 10.5px;
  color: var(--muted-2);
}
.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
}
.act-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  transition: 0.15s;
}
.act-btn:hover {
  color: var(--text);
  background: var(--hover);
  border-color: var(--line);
}
.act-btn.danger {
  background: #ef4444;
  color: #fff !important;
  border-color: #dc2626;
}
.act-btn.danger:hover {
  color: var(--bad);
  background: #dc2626;
  border-color: #b91c1c;
}
.act-btn[style*='background'] {
  color: #fff !important;
}
.act-btn[style*='background:#3b82f6']:hover {
  background: #2563eb !important;
}
.act-btn[style*='background:#8b5cf6']:hover {
  background: #7c3aed !important;
}
.act-btn[style*='background:#f97316']:hover {
  background: #ea580c !important;
}
.act-btn[style*='background:#22c55e']:hover {
  background: #16a34a !important;
}
.act-btn[style*='background:#22d3ee']:hover {
  background: #0891b2 !important;
}
.act-btn[style*='background:#a855f7']:hover {
  background: #9333ea !important;
}
.act-btn[style*='background:#f59e0b']:hover {
  background: #d97706 !important;
}
.act-btn[style*='background:#ef4444']:hover {
  background: #dc2626 !important;
}
.plan-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.plan-tag i {
  width: 7px;
  height: 7px;
  border-radius: 3px;
  background: var(--accent);
}
.expiry {
  display: flex;
  flex-direction: column;
}
.expiry b {
  font-size: 12.5px;
  font-weight: 600;
}
.expiry small {
  font-size: 10.5px;
  color: var(--muted-2);
}
.expiry small.bad {
  color: var(--bad);
}

/* =========================================================
   CHANNELS
   ========================================================= */
.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.ch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 16px;
}
.ch-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.22s var(--ease),
    border-color 0.22s,
    box-shadow 0.22s;
  outline: none;
}
.ch-card:hover,
.ch-card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow:
    0 30px 60px -30px rgba(0, 0, 0, 0.9),
    0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}
.ch-thumb {
  position: relative;
  aspect-ratio: 16 / 9.6;
  display: grid;
  place-items: center;
  background: radial-gradient(120% 120% at 20% 0%, rgba(255, 255, 255, 0.18), transparent 55%), linear-gradient(135deg, var(--c1), var(--c2));
  overflow: hidden;
}
.ch-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 13px 13px;
  opacity: 0.35;
  mask-image: linear-gradient(160deg, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(160deg, #000, transparent 70%);
}
.ch-logo {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 18px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s var(--ease);
}
.ch-card:hover .ch-logo {
  transform: scale(1.08) rotate(-2deg);
}
.ch-live,
.ch-quality {
  position: absolute;
  z-index: 2;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  background: rgba(6, 9, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}
.ch-live {
  left: 10px;
}
.ch-live::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.6s infinite;
}
.ch-live.off {
  color: rgba(255, 255, 255, 0.7);
}
.ch-live.off::before {
  background: var(--bad);
  animation: none;
}
.ch-quality {
  right: 10px;
  letter-spacing: 0.04em;
  background: rgba(6, 9, 16, 0.4);
}
.play-fab {
  position: absolute;
  z-index: 2;
  bottom: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #0a0f19;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: 0.24s var(--ease);
}
.play-fab svg {
  margin-left: 2px;
}
.ch-card:hover .play-fab,
.ch-card:focus-visible .play-fab {
  opacity: 1;
  transform: none;
}
.ch-body {
  padding: 13px 15px 14px;
}
.ch-name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ch-meta {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 2px;
}
.ch-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.epg-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
}
.epg-now {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   PLANS
   ========================================================= */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 0.22s var(--ease),
    border-color 0.22s;
}
.plan:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}
.plan.featured {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.plan.featured::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -20%, var(--accent-soft), transparent 60%);
  pointer-events: none;
}
.plan-tag-top {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 4px 9px;
  border-radius: 99px;
}
.plan-head {
  position: relative;
}
.plan-name {
  font-size: 15px;
  font-weight: 700;
}
.plan-desc {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 3px;
  min-height: 34px;
}
.plan-price {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 16px 0 18px;
}
.plan-price b {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.05em;
}
.plan-price span {
  font-size: 12px;
  color: var(--muted-2);
}
.plan-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  flex: 1;
}
.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--muted);
}
.plan-features svg {
  color: var(--ok);
  flex: none;
  margin-top: 2px;
}
.plan-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.plan-subs {
  font-size: 11.5px;
  color: var(--muted-2);
  flex: 1;
}
.plan-subs b {
  color: var(--text);
  font-weight: 700;
}
.plan-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--input);
  overflow: hidden;
  margin-top: 8px;
}
.plan-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.plan-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--input);
  color: var(--muted);
  cursor: pointer;
  transition: 0.18s;
  font-size: 13px;
  font-weight: 600;
}
.plan-add:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
}
.plan-add span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* =========================================================
   SERVERS
   ========================================================= */
.srv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.srv {
  padding: 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}
.srv-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.srv-loc {
  display: flex;
  align-items: center;
  gap: 11px;
}
.srv-flag {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  background: var(--input);
  border: 1px solid var(--line);
  color: var(--accent);
}
.srv-loc b {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
}
.srv-loc small {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
}
.srv-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 14px;
}
.srv-stat {
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--input);
  border: 1px solid var(--line);
}
.srv-stat span {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--muted-2);
}
.srv-stat b {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-top: 3px;
}
.load {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--muted);
}
.load-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--input);
  overflow: hidden;
}
.load-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.load-track.warn span {
  background: linear-gradient(90deg, var(--warn), #f97316);
}
.load-track.bad span {
  background: var(--bad);
}
.srv-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.uptime {
  font-size: 11.5px;
  color: var(--muted-2);
}
.uptime b {
  color: var(--ok);
}

/* =========================================================
   SETTINGS
   ========================================================= */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.panel {
  padding: 22px;
}
.panel.span-2 {
  grid-column: 1 / -1;
}
.panel-head {
  margin-bottom: 18px;
}
.panel-head h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.panel-head p {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 3px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .span-2 {
  grid-column: 1 / -1;
}
.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--input);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.profile-row > div:nth-child(2) {
  flex: 1;
}
.profile-row b {
  display: block;
  font-size: 13.5px;
}
.profile-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted-2);
}

.theme-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.theme-choice {
  position: relative;
  height: 76px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #0a0e18;
  cursor: pointer;
  overflow: hidden;
  transition: 0.18s;
}
.theme-choice::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 7px;
  background: linear-gradient(135deg, #121828, #0a0e18);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.theme-choice.light {
  background: #e9edf6;
}
.theme-choice.light::before {
  background: linear-gradient(135deg, #fff, #eef2fa);
  border-color: rgba(13, 20, 36, 0.1);
}
.theme-choice::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 20px;
  width: 34px;
  height: 5px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow:
    0 12px 0 rgba(255, 255, 255, 0.22),
    0 22px 0 rgba(255, 255, 255, 0.12);
}
.theme-choice.light::after {
  box-shadow:
    0 12px 0 rgba(13, 20, 36, 0.16),
    0 22px 0 rgba(13, 20, 36, 0.08);
}
.theme-choice.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.theme-choice em {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}
.theme-choice.light em {
  color: rgba(13, 20, 36, 0.5);
}

.swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.swatch {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: linear-gradient(135deg, var(--sw), var(--sw2));
  cursor: pointer;
  transition: 0.16s;
}
.swatch:hover {
  transform: translateY(-2px);
}
.swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.swatch.active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}
.switch-row b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}
.switch-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}
.switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: none;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.switch > span {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: var(--line-strong);
  transition: background 0.2s;
  pointer-events: none;
}
.switch > span::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s var(--ease);
}
.switch input:checked + span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.switch input:checked + span::after {
  transform: translateX(18px);
}
.switch input:focus-visible + span {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.danger-panel {
  border-color: rgba(251, 113, 133, 0.22);
}
.danger-panel .panel-head h2 {
  color: var(--bad);
}
.save-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--muted-2);
}

/* =========================================================
   MODAL / PLAYER
   ========================================================= */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 5, 10, 0.68);
  backdrop-filter: blur(8px);
  animation: fade 0.18s ease both;
  overflow: auto;
}
.modal {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  background: var(--card-flat);
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.95);
  animation: pop 0.24s var(--ease) both;
}
.modal.wide {
  width: min(880px, 100%);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.modal-head > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-head p {
  font-size: 12px;
  color: var(--muted-2);
  margin-top: 2px;
}
.modal-body {
  padding: 20px 22px;
  overflow: auto;
}
.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
}
.confirm-text {
  font-size: 13.5px;
  line-height: 1.6;
}
.confirm-text b {
  color: #b91c1c;
}
.modal-warn {
  color: var(--bad);
  opacity: .9;
}

.player {
  display: grid;
  gap: 16px;
}
.player-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  overflow: hidden;
  background: radial-gradient(120% 120% at 25% 0%, rgba(255, 255, 255, 0.12), transparent 60%), linear-gradient(135deg, var(--c1), var(--c2));
  border: 1px solid var(--line-strong);
}
.player-video video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.player-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  color: #fff;
  background: rgba(5, 8, 14, 0.55);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s;
  z-index: 2;
}
.player-status.hide {
  opacity: 0;
  pointer-events: none;
}
.player-status p {
  font-size: 12.5px;
  max-width: 32ch;
  color: rgba(255, 255, 255, 0.82);
}
.ps-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
.player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.player-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.player-id h3 {
  font-size: 15px;
  font-weight: 700;
}
.player-id p {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 1px;
}
.epg-card {
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--input);
  border: 1px solid var(--line);
}
.epg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.epg-bar {
  height: 4px;
  border-radius: 99px;
  background: var(--line-strong);
  margin: 8px 0 12px;
  overflow: hidden;
}
.epg-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.epg-rows {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.epg-rows small {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--muted-2);
  margin-bottom: 2px;
}
.epg-rows b {
  font-size: 12.5px;
  font-weight: 600;
}
.player-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11px;
  color: var(--muted-2);
  line-height: 1.5;
}
.player-note svg {
  flex: none;
  margin-top: 1px;
}
.player-more {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.player-more > span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.mini-row {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.mini-ch {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px 6px 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input);
  cursor: pointer;
  transition: 0.16s;
  font-size: 11.5px;
  font-weight: 600;
}
.mini-ch:hover {
  border-color: var(--line-strong);
  background: var(--hover);
}
.mini-ch span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}
.mini-ch b {
  font-weight: 600;
}

/* =========================================================
   TOASTS
   ========================================================= */
#toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: var(--card-flat);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  font-size: 12.5px;
  animation: slideIn 0.28s var(--ease) both;
  pointer-events: auto;
}
.toast.out {
  animation: slideOut 0.22s ease both;
}
.toast-ico {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  color: var(--ok);
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.toast.warn .toast-ico {
  color: var(--warn);
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.25);
}
.toast.bad .toast-ico {
  color: var(--bad);
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.25);
}
.toast b {
  display: block;
  font-size: 12.5px;
}
.toast small {
  display: block;
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 1px;
}

/* =========================================================
   ANIMATIONS
   ========================================================= */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
@keyframes float {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 30px, 0) scale(1.06);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
}
@keyframes slideOut {
  to {
    opacity: 0;
    transform: translateX(24px);
  }
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.view.in > * {
  animation: rise 0.45s var(--ease) both;
}
.view.in > *:nth-child(2) {
  animation-delay: 0.05s;
}
.view.in > *:nth-child(3) {
  animation-delay: 0.1s;
}
.view.in > *:nth-child(4) {
  animation-delay: 0.14s;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1280px) {
  .search-wrap .search {
    width: 220px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1100px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .grid-2.even {
    grid-template-columns: 1fr;
  }
  .plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
  .panel.span-2 {
    grid-column: auto;
  }
  .save-bar {
    grid-column: auto;
  }
  .dash-side {
    order: -1;
  }
}
@media (max-width: 980px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 274px;
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
    background: var(--card-flat);
    z-index: 45;
  }
  body.nav-open .sidebar {
    transform: none;
  }
  body.nav-open .scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .only-mobile {
    display: inline-grid !important;
  }
  .topbar {
    padding: 12px 20px;
    min-height: 68px;
  }
  .view {
    padding: 22px 20px 60px;
  }
  .search-wrap .search {
    width: 200px;
  }
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 460px;
    gap: 36px;
  }
  .auth-hero {
    display: none;
  }
}
@media (max-width: 720px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .page-head {
    flex: 1 1 0;
    min-width: 0;
  }
  .page-head h1 {
    font-size: 18px;
  }
  .top-actions {
    order: 2;
    width: 100%;
    gap: 8px;
  }
  .search-wrap {
    flex: 1;
    min-width: 0;
  }
  .search-wrap .search {
    width: 100%;
  }
  .search kbd {
    display: none;
  }
  .search-results {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 60vh;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .kpi-grid.three {
    grid-template-columns: 1fr;
  }
  .kpi {
    padding: 15px;
  }
  .kpi-value {
    font-size: 23px;
  }
  .spark {
    display: none;
  }
  .plan-grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .bar-row {
    grid-template-columns: 86px 1fr 52px;
    gap: 10px;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal-head,
  .modal-body,
  .modal-foot {
    padding-left: 16px;
    padding-right: 16px;
  }
  .epg-rows {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .save-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  #toasts {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    min-width: 0;
    max-width: none;
  }
}
@media (max-width: 520px) {

  .ch-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  .ch-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    font-size: 15px;
  }
  .ch-body {
    padding: 11px 12px 12px;
  }
  .ch-foot {
    display: none;
  }
  .srv-stats {
    grid-template-columns: 1fr 1fr;
  }
  .auth-card {
    padding: 28px 22px 24px;
  }
  .auth-stats {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
