@font-face {
  font-family: "Geist";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geist-latin-variable.woff2") format("woff2-variations");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/static/fonts/geist-mono-latin-variable.woff2") format("woff2-variations");
}

:root {
  --bg: #000;
  --bg-2: #0a0a0a;
  --panel: #111;
  --panel-2: #171717;
  --hover: #1a1a1a;
  --line: #333;
  --line-soft: #222;
  --text: #ededed;
  --text-strong: #fff;
  --muted: #a1a1a1;
  --muted-2: #888;
  --danger: #e5484d;
  --ok: #50e3c2;
  --radius: 8px;
  --radius-lg: 10px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Fluid scale (screen-aware like Vercel) */
  --sidebar-w: clamp(240px, 18vw, 280px);
  --pad-x: clamp(16px, 2.2vw, 32px);
  --pad-y: clamp(16px, 1.8vw, 28px);
  --text-sm: clamp(13px, 0.85vw + 10px, 14px);
  --text-base: clamp(14px, 0.9vw + 10px, 15px);
  --text-md: clamp(15px, 1vw + 10px, 16px);
  --text-lg: clamp(18px, 1.2vw + 12px, 22px);
  --text-xl: clamp(22px, 1.6vw + 12px, 28px);
  --nav-h: clamp(38px, 3.2vw, 42px);
  --icon: clamp(18px, 1.2vw, 20px);
  --control-h: clamp(36px, 3vw, 40px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  font-size: 16px;
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

h1, h2, h3, h4, p { margin: 0; }

/* ========== Auth ========== */
.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.auth-card {
  width: min(360px, 100%);
  border: 1px solid var(--line);
  background: var(--bg-2);
  border-radius: 12px;
  padding: 40px 32px 32px;
}

.auth-card-clean {
  text-align: center;
}

.auth-logo-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 20px;
}

.auth-logo {
  width: 28px;
  height: 24px;
  display: block;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.auth-card h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.auth-card-clean .subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.subtitle {
  color: var(--muted);
  font-size: var(--text-sm);
  margin-bottom: 24px;
}

.auth-form {
  display: grid;
  gap: 14px;
  text-align: left;
}

.auth-card form { display: grid; gap: 14px; }

.auth-form label {
  text-align: left;
}

.error {
  color: #ff6369;
  font-size: 13px;
  text-align: left;
}

/* ========== Shell ========== */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line-soft);
  background: var(--bg);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 10px;
}

.logo-mark {
  width: 26px;
  height: 26px;
  border-radius: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.logo-mark .vercel-logo {
  width: 22px;
  height: 19px;
  display: block;
}

.logo-title {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-strong);
  line-height: 1.25;
}

.logo-sub {
  font-size: var(--text-sm);
  color: var(--muted-2);
  line-height: 1.25;
  margin-top: 2px;
}

.side-find {
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted-2);
  margin: 0 4px 4px;
}

.side-find svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-find input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  min-width: 0;
  font-size: var(--text-base);
  color: var(--text);
}

.side-find input::placeholder { color: var(--muted-2); }

.side-find kbd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 6px;
  height: 20px;
  display: inline-flex;
  align-items: center;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: auto;
  padding: 0 4px 8px;
}

.nav-label {
  margin: 14px 10px 6px;
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: var(--nav-h);
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.2;
}

.nav-item:hover {
  background: var(--hover);
  color: var(--text);
}

.nav-item.active {
  background: var(--panel-2);
  color: var(--text-strong);
}

.nav-ico {
  width: var(--icon);
  height: var(--icon);
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-foot {
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.logout-btn {
  width: 100%;
  height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: 500;
}

.logout-btn:hover {
  color: var(--text);
  background: var(--hover);
}

.main-wrap {
  min-width: 0;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: clamp(56px, 6vw, 64px);
  padding: 0 var(--pad-x);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: saturate(180%) blur(12px);
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.topbar h1 {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-strong);
}

.page-sub {
  font-size: var(--text-sm);
  color: var(--muted-2);
}

.menu-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
}

.content {
  padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) + 16px);
  width: 100%;
  max-width: none;
  flex: 1;
}

.section { display: none; }
.section.active { display: block; }

/* ========== Cards / Stats ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(10px, 1.2vw, 14px);
  margin-bottom: clamp(12px, 1.4vw, 16px);
}

.stats-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card,
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.stat-card {
  padding: clamp(14px, 1.4vw, 18px);
  min-height: clamp(96px, 10vw, 112px);
}

.stat-card p {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

.stat-card h2 {
  margin-top: 12px;
  font-size: var(--text-xl);
  font-weight: 600;
  letter-spacing: -0.045em;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.card {
  padding: clamp(16px, 1.6vw, 22px);
  margin-bottom: clamp(12px, 1.4vw, 16px);
}

.audience-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.audience-tab {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
}

.audience-tab:hover {
  color: var(--text);
  background: var(--hover);
}

.audience-tab.active {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.opt-tag {
  color: var(--muted-2);
  font-weight: 400;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.head-actions select {
  width: auto;
  min-width: 140px;
  height: 32px;
}

.daily-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
  gap: 8px;
  align-items: end;
  min-height: 120px;
  padding: 8px 0 4px;
}

.daily-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.daily-bar .bar {
  width: 100%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  background: #fff;
  min-height: 4px;
}

.daily-bar .bar-label {
  font-size: 11px;
  color: var(--muted-2);
  font-family: var(--mono);
}

.daily-bar .bar-count {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-head h3 {
  font-size: var(--text-md);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.chip {
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(12px, 1.4vw, 16px);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid label,
.auth-card label {
  display: grid;
  gap: 7px;
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}

.form-grid label[hidden],
label[hidden],
button[hidden],
[hidden] {
  display: none !important;
}

.form-grid .full { grid-column: 1 / -1; }

.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
  color: var(--text) !important;
  font-size: var(--text-base) !important;
  font-weight: 400 !important;
  grid-template-columns: none !important;
  line-height: 1.2;
}

.check-row input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  min-height: 16px;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
  accent-color: #fff;
  cursor: pointer;
  border-radius: 4px;
}

.check-row span {
  display: inline-block;
  line-height: 1.2;
  padding-top: 1px;
}

input,
textarea,
select,
.search {
  width: 100%;
  height: var(--control-h);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0 12px;
  outline: none;
  font-size: var(--text-base);
  color: var(--text);
}

textarea {
  height: auto;
  padding: 12px;
  resize: vertical;
  min-height: 96px;
}

input:focus,
textarea:focus,
select:focus,
.search:focus {
  border-color: #fff;
}

input[readonly] {
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--text-sm);
}

.search {
  max-width: min(280px, 100%);
  height: 36px;
}

.btn {
  height: var(--control-h);
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--text-base);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.btn.primary {
  background: #fff;
  color: #000;
}

.btn.primary:hover { background: #eaeaea; }

.btn.danger {
  background: transparent;
  border-color: var(--line);
  color: #ff6369;
}

.btn.danger:hover {
  background: rgba(229, 72, 77, 0.08);
  border-color: rgba(229, 72, 77, 0.45);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text);
}

.btn.ghost:hover { background: var(--hover); }

.topbar .btn.ghost {
  margin-left: auto;
}

.btn.sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 6px;
}

.btn.soft {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.btn.soft:hover {
  background: var(--hover);
  border-color: var(--line-strong);
}

.full-btn { width: 100%; }

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.row-actions .status {
  flex: 1 1 100%;
}

.action-btns {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
}

.plans-layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: clamp(12px, 1.4vw, 16px);
  align-items: start;
}

.plans-list-card {
  min-width: 0;
}

.plans-table {
  width: 100%;
  min-width: 680px;
}

.plans-table th:nth-child(1),
.plans-table td:nth-child(1) { width: 28%; }
.plans-table th:nth-child(2),
.plans-table td:nth-child(2),
.plans-table th:nth-child(3),
.plans-table td:nth-child(3),
.plans-table th:nth-child(4),
.plans-table td:nth-child(4) { width: 10%; }
.plans-table th:nth-child(5),
.plans-table td:nth-child(5) { width: 12%; }
.plans-table th:nth-child(6),
.plans-table td:nth-child(6) { width: 30%; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.status {
  margin: 0;
  color: var(--muted-2);
  font-size: var(--text-sm);
  font-family: var(--mono);
}

.hint {
  color: var(--muted-2);
  font-size: var(--text-sm);
  margin-top: 12px;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  font-size: var(--text-base);
}

th {
  color: var(--muted-2);
  font-weight: 500;
  font-size: var(--text-sm);
  white-space: nowrap;
}

td {
  white-space: nowrap;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
}

td.plan-name-cell {
  white-space: normal;
  min-width: 130px;
  max-width: 200px;
}

td.plan-name-cell .plan-name {
  color: var(--text-strong);
  font-weight: 500;
  font-size: var(--text-base);
}

td.plan-name-cell .plan-desc {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

td.num-cell {
  font-variant-numeric: tabular-nums;
}

td.actions-cell {
  white-space: nowrap;
}

#usersBody td:first-child,
#blockedBody td:first-child,
#creditsBody td:first-child,
#membersBody td:first-child,
#taskUsersBody td:first-child {
  font-family: var(--mono);
  font-size: var(--text-sm);
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 500;
}

.badge.ok {
  color: var(--ok);
  border-color: rgba(80, 227, 194, 0.3);
  background: rgba(80, 227, 194, 0.08);
}

.badge.bad {
  color: #ff6369;
  border-color: rgba(229, 72, 77, 0.35);
  background: rgba(229, 72, 77, 0.08);
}

.badge.muted {
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px;
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line);
}

.link-btn:hover { text-decoration-color: var(--text); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 30;
}

/* Large screens: keep content readable but use full width */
@media (min-width: 1400px) {
  .content {
    padding-right: clamp(24px, 4vw, 48px);
    padding-left: clamp(24px, 4vw, 48px);
  }
}

@media (max-width: 1200px) {
  .stats-grid,
  .stats-grid-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .plans-layout {
    grid-template-columns: 1fr;
  }

  .plans-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar-w: 260px;
  }

  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    background: #050505;
  }

  .sidebar.open { transform: none; }

  .menu-toggle { display: inline-grid; place-items: center; }
  .sidebar-backdrop.show { display: block; }

  .grid-2,
  .form-grid { grid-template-columns: 1fr; }

  .plans-form-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .stats-grid-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .search { max-width: none; }

  .content {
    padding: 16px;
    overflow-x: hidden;
  }
}

@media (max-width: 560px) {
  .stats-grid,
  .stats-grid-6 { grid-template-columns: 1fr; }

  .topbar h1 { font-size: 16px; }

  .btn { width: auto; }

  .plans-table {
    min-width: 640px;
  }

  .action-btns .btn.sm {
    padding: 0 8px;
    font-size: 11px;
  }
}

/* ========== Shimmer / skeleton ========== */
@keyframes shimmer-slide {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.shimmer {
  display: inline-block;
  vertical-align: middle;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    #1a1a1a 0%,
    #2a2a2a 40%,
    #1a1a1a 80%
  );
  background-size: 200% 100%;
  animation: shimmer-slide 1.25s ease-in-out infinite;
  pointer-events: none;
  user-select: none;
}

.shimmer-line {
  height: 12px;
  max-width: 100%;
}

.shimmer-num {
  display: block;
  width: 56%;
  height: 28px;
  border-radius: 8px;
  margin-top: 4px;
}

.shimmer-bar {
  display: block;
  width: 22px;
  min-height: 24px;
  border-radius: 6px 6px 2px 2px;
  margin: 0 auto;
}

.shimmer-row td {
  padding-top: 14px;
  padding-bottom: 14px;
}

.stat-card.is-loading h2 {
  min-height: 32px;
  display: flex;
  align-items: center;
}

.daily-bars.is-loading {
  min-height: 120px;
  align-items: flex-end;
}

.content.data-loading {
  position: relative;
}

.content.data-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.08) 0%,
    transparent 40%
  );
}

.card.card-loading {
  position: relative;
  pointer-events: none;
}

.card.card-loading > *:not(.card-shimmer) {
  opacity: 0.22;
  filter: blur(0.5px);
}

.card-shimmer {
  display: none;
  position: absolute;
  inset: 16px;
  z-index: 3;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px;
}

.card.card-loading .card-shimmer {
  display: flex;
}

.card-shimmer .shimmer-line {
  height: 14px;
}

.card-shimmer .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Config form skeleton (no blur overlay) */
.config-skeleton {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 8px;
}

.config-skeleton[hidden] {
  display: none !important;
}

.config-body[hidden] {
  display: none !important;
}

.config-skel-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.config-skel-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.config-skel-block .skel-label {
  width: 28%;
  height: 11px;
  border-radius: 4px;
}

.config-skel-block .skel-input {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

.config-skel-block .skel-textarea {
  width: 100%;
  height: 84px;
  border-radius: 8px;
}

.config-skel-block .skel-check {
  width: 72%;
  height: 18px;
  border-radius: 6px;
}

.config-skeleton .skel-btn {
  width: 140px;
  height: 38px;
  border-radius: 8px;
  margin-top: 4px;
}

@media (max-width: 700px) {
  .config-skel-row {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shimmer {
    animation: none;
    background: #222;
  }
}

/* Users pagination */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px 4px;
  border-top: 1px solid var(--line-soft);
  margin-top: 4px;
}

.pager-meta {
  color: var(--muted-2);
  font-size: 12px;
}

.pager-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pager-pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pager-page {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.pager-page:hover {
  background: var(--hover);
  color: var(--text);
}

.pager-page.active {
  background: #fff;
  color: #000;
  border-color: #fff;
  font-weight: 600;
}

#usersPager .btn:disabled,
#membersPager .btn:disabled,
#taskUsersPager .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== Memberships responsive ========== */
.members-layout {
  min-width: 0;
}

.members-form-card,
.members-list-card {
  min-width: 0;
  max-width: 100%;
}

.members-table {
  width: 100%;
  min-width: 520px;
}

.members-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 980px) {
  #section-memberships .members-layout {
    grid-template-columns: 1fr;
  }

  #section-memberships .members-form-card .form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  #section-memberships .members-form-card .form-grid {
    grid-template-columns: 1fr;
  }

  #section-memberships .members-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #section-memberships .members-actions .btn {
    width: 100%;
    justify-content: center;
  }

  #section-memberships .members-list-card .card-head {
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
  }

  #section-memberships .members-list-card .card-head h3 {
    font-size: 15px;
    line-height: 1.3;
  }

  #section-memberships .members-table-wrap {
    overflow: visible;
  }

  #section-memberships .members-table {
    min-width: 0;
  }

  #section-memberships .members-table thead {
    display: none;
  }

  #section-memberships .members-table,
  #section-memberships .members-table tbody,
  #section-memberships .members-table tr,
  #section-memberships .members-table td {
    display: block;
    width: 100%;
  }

  #section-memberships .members-table tr {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    padding: 12px;
    margin-bottom: 10px;
  }

  #section-memberships .members-table tr:last-child {
    margin-bottom: 0;
  }

  #section-memberships .members-table td {
    border: none;
    padding: 8px 0;
    white-space: normal;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 13px;
  }

  #section-memberships .members-table td + td {
    border-top: 1px solid var(--line-soft);
  }

  #section-memberships .members-table td::before {
    content: attr(data-label);
    color: var(--muted-2);
    font-size: 12px;
    font-weight: 500;
    flex: 0 0 auto;
  }

  #section-memberships .members-table td.actions-cell {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  #section-memberships .members-table td.actions-cell::before {
    margin-bottom: 2px;
  }

  #section-memberships .members-table .action-btns {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #section-memberships .members-table .action-btns .btn {
    width: 100%;
    justify-content: center;
  }

  #section-memberships #membersPager {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #section-memberships #membersPager .pager-btns {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  #section-memberships #membersPager .pager-pages {
    flex: 1 1 auto;
    justify-content: center;
    flex-wrap: wrap;
  }
}
