/* ============================================================
   Overrides & polish on top of admin.css
   ============================================================ */

/* Spin animation for Lucide Loader2 icon */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

:root {
  --brand-grad: linear-gradient(135deg, #F9FF00 0%, #d4db00 100%);
  --brand-grad-2: linear-gradient(135deg, #F9FF00 0%, #c8cf00 100%);
}

/* ===== Sidebar layout ===== */
.sidebar {
  display: flex !important;
  flex-direction: column !important;
}

/* ===== Sidebar logo redesign ===== */
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar .brand .logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--brand-grad);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: none;
}
.sidebar .brand .logo::before {
  content: "";
  font-size: 22px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.3));
}
.sidebar .brand .name {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.2px;
}
/* logoPulse animation removed */

/* ===== Top-bar nav progress (instant on click) ===== */
.nav-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #F9FF00, #d4db00, #c8cf00);
  background-size: 200% 100%;
  animation: navShimmer 1.4s linear infinite;
  z-index: 10000;
  width: 0;
  opacity: 0;
  transition: width .25s ease, opacity .25s;
  box-shadow: none;
  pointer-events: none;
}
.nav-progress.is-active { opacity: 1; }
@keyframes navShimmer { from { background-position: 0 0; } to { background-position: 200% 0; } }

/* ===== Page loader (route transitions) ===== */
.page-loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,10,0.4);
  backdrop-filter: blur(4px);
  z-index: 9999;
  animation: fadeIn 0.15s ease-out;
}
.page-loader__ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.15);
  border-top-color: #F9FF00;
  border-right-color: #d4db00;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}
.page-loader__text {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== Centered layout for cards & content ===== */
.content > .container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}
/* Wide container variant (fb-share, etc.) */
.container--wide { max-width: 95% !important; }

.card {
  margin-bottom: 16px;
}

/* card head: vertical center alignment of left/right blocks */
.apps-head {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.apps-head__left { display: flex; flex-direction: column; gap: 4px; }
.apps-head__right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ===== Unified page header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 16px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.page-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #f1f5f9;
}
.page-header .muted {
  margin: 2px 0 0;
  font-size: 13px;
}
.page-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== Buttons: unified appearance ===== */
.primary,
button.primary,
.btn-edit,
.btn-del,
.btn-cancel,
button[type="submit"]:not(.tag) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s;
  line-height: 1;
}
.primary,
button.primary {
  background: #F9FF00 !important;
  color: #0A0A0A !important;
  border: 0;
  box-shadow: none;
}
.primary:hover,
button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn-edit {
  background: rgba(249,255,0,0.15) !important;
  color: #F9FF00 !important;
  border-color: rgba(249,255,0,0.3) !important;
}
.btn-edit:hover { background: rgba(249,255,0,0.25) !important; }
.btn-del {
  background: rgba(239,68,68,0.15) !important;
  color: #f87171 !important;
  border-color: rgba(239,68,68,0.3) !important;
}
.btn-del:hover { background: rgba(239,68,68,0.25) !important; }
.btn-cancel {
  background: rgba(255,255,255,0.06) !important;
  color: #94a3b8 !important;
  border-color: rgba(255,255,255,0.1) !important;
}
.btn-cancel:hover { background: rgba(255,255,255,0.12) !important; }

/* ===== App cards grid: tidy alignment ===== */
.apps-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 16px !important;
  margin-top: 16px;
}
.app-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s, box-shadow .15s;
}
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.12);
}
.app-card__header { display: flex; gap: 12px; align-items: center; }
.app-card__icon {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover;
  background: rgba(255,255,255,0.06);
}
.app-card__title .name { font-weight: 700; font-size: 15px; }
.app-card__title .pkg { font-size: 12px; color: #64748b; word-break: break-all; }
.app-card__meta {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.app-card__actions {
  display: flex; gap: 8px; margin-top: auto;
  padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.06);
}
.app-card__actions > * { flex: 1; }

/* ===== Tags / badges ===== */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
}
.tag--ok { background: #dcfce7; color: #16a34a; }
.tag--err { background: #fee2e2; color: #dc2626; }
.tag--muted { background: #f1f5f9; color: #94a3b8; }

/* ===== Status tabs (markets / status filters) ===== */
.status-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  border-bottom: 2px solid #eef2f8;
  margin: 12px 0;
}
.status-tab {
  padding: 8px 18px;
  font-size: 13px; font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color .12s;
}
.status-tab:hover { color: #1f2a44; }
.status-tab.active { color: #1f2a44; border-bottom-color: #F9FF00; }
.tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 18px; padding: 0 6px;
  background: #eef2f8; color: #6b7280;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.status-tab.active .tab-count { background: #F9FF00; color: #0A0A0A; }
.tab-count--ok { background: #dcfce7; color: #16a34a; }
.tab-count--err { background: #fee2e2; color: #dc2626; }

/* ===== Forms: inputs unified ===== */
.field { margin-bottom: 12px; }
.field label {
  display: block; font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: #64748b; margin-bottom: 6px;
}
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input:not([type]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  background: #fff;
  outline: 0;
  transition: border-color .12s, box-shadow .12s;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus {
  border-color: #F9FF00;
  box-shadow: 0 0 0 2px rgba(249,255,0,0.08);
}

/* ===== Sub-cards inside form ===== */
.app-subcard {
  background: #fafbff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
}
.app-subcard h4 { color: #1f2a44; }

/* ===== Pagination ===== */
.pagination .page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 10px;
  background: #fff; border: 1px solid #e2e8f0;
  color: #475569; text-decoration: none; font-weight: 600;
}
.pagination .page:hover { background: #f8fafc; }
.pagination .page.current { background: var(--brand-grad); color: #0A0A0A; border: 0; }

/* ===== Messages ===== */
.msg {
  padding: 12px 16px; border-radius: 10px;
  margin-bottom: 12px; font-size: 14px;
  display: flex; align-items: center; gap: 8px;
}
.msg.ok { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.msg.err { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== Tabs (form tabs) ===== */
.tabs {
  display: flex; gap: 4px;
  border-bottom: 2px solid #eef2f8;
  margin: 12px 0 16px;
}
.tab-btn {
  padding: 10px 22px;
  background: transparent; border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  color: #64748b; font-weight: 600; font-size: 14px;
  transition: color .12s;
  min-height: auto;
  border-radius: 0;
}
.tab-btn:hover { color: #1f2a44; }
.tab-btn.active { color: #1f2a44; border-bottom-color: #F9FF00; }

/* ===== Switch (toggle) ===== */
.switch {
  position: relative; display: inline-block; width: 46px; height: 26px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cbd5e1; border-radius: 26px;
  transition: .2s;
}
.switch .slider::before {
  content: ""; position: absolute;
  height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .slider { background: var(--brand-grad); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ===== Tables ===== */
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; padding: 10px 12px;
  font-size: 11px; font-weight: 700;
  color: #64748b; text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 2px solid #e2e8f0;
}
.table td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}
.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* role-table center alignment */
.role-table th, .role-table td { text-align: center; }
.role-table td:first-child, .role-table th:first-child { text-align: left; }

/* ===== Grid helpers ===== */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 12px; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-8 { grid-column: span 8; }
@media (max-width: 768px) {
  .col-2, .col-3, .col-4, .col-6, .col-8 { grid-column: span 12; }
}

/* form action bar */
.app-form__actions, .form-actions {
  display: flex; gap: 8px; justify-content: flex-start;
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}

.muted { color: #64748b; font-size: 13px; }

/* ===== App form header ===== */
.app-form__header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.app-form__icon {
  width: 64px; height: 64px; border-radius: 14px; object-fit: cover;
}

/* ===== Sidebar nav ===== */
.menu {
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.menu-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.25);
  padding: 6px 20px 4px;
}

.menu-spacer { flex: 1; min-height: 12px; }

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  margin: 1px 8px;
  border-radius: 11px;
  color: rgba(255,255,255,0.55);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
  white-space: nowrap;
  position: relative;
}
.menu-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}
.menu-item.active {
  background: rgba(249,255,0,0.1);
  color: #fff;
  font-weight: 600;
}
.menu-item__ico {
  font-size: 17px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  line-height: 1;
}
.menu-item__label { flex: 1; }
.menu-item__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #F9FF00;
  flex-shrink: 0;
  box-shadow: 0 0 4px rgba(249,255,0,0.3);
}
.menu-item--logout {
  color: rgba(255,255,255,0.35) !important;
  margin-top: 2px;
}
.menu-item--logout:hover {
  background: rgba(239,68,68,0.1) !important;
  color: #fca5a5 !important;
}

/* Keep old .menu a for backward compat */
.menu a {
  text-decoration: none;
}

/* ===== Burger / mobile sidebar ===== */
.burger-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  background: var(--brand-grad);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}
.burger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
body.sidebar-open .burger-btn span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.sidebar-open .burger-btn span:nth-child(2) { opacity: 0; }
body.sidebar-open .burger-btn span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,10,10,0.55);
  z-index: 30;
  backdrop-filter: blur(2px);
}

/* ============================================================
   DARK THEME POLISH — coherent contrast & separation
   ============================================================ */

/* Outer cards on dark bg */
.card {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 16px !important;
  color: #e2e8f0;
  backdrop-filter: blur(8px);
}
.card h3, .card h4 { color: #f1f5f9 !important; }

/* Sub-cards inside form: stronger contrast vs outer card */
.app-subcard {
  background: rgba(10,10,10,0.55) !important;
  border: 1px solid rgba(249,255,0,0.18) !important;
  border-radius: 14px !important;
  padding: 18px !important;
  margin-top: 14px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.app-subcard h4 { color: #F9FF00 !important; margin-bottom: 12px !important; }

/* Inputs on dark theme */
input[type="text"],
input[type="url"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input:not([type]),
select,
textarea {
  padding: 12px 14px !important;
  border-radius: 12px !important;
  background: rgba(10,10,10,0.6) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  font-size: 14px !important;
}
input::placeholder, textarea::placeholder { color: #64748b !important; }
input:focus, select:focus, textarea:focus {
  border-color: #F9FF00 !important;
  background: rgba(10,10,10,0.85) !important;
  box-shadow: 0 0 0 2px rgba(249,255,0,0.1) !important;
}
/* Select dropdown arrow spacing */
select {
  padding-right: 32px !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  border-radius: 8px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 14px !important;
}
/* Calendar/date picker icon in dark theme */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}

/* Read-only inputs (e.g. traffic url) */
input[readonly] {
  background: rgba(10,10,10,0.4) !important;
  color: #cbd5e1 !important;
}

/* ── Chrome autofill override (dark theme) ──────────────────
   Chrome autofill injects a white/blue background even over !important.
   The box-shadow trick is the only reliable workaround.
   ─────────────────────────────────────────────────────────── */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill {
  -webkit-text-fill-color: #f1f5f9 !important;
  -webkit-box-shadow: 0 0 0 1000px rgba(10,10,10,0.85) inset !important;
  box-shadow: 0 0 0 1000px rgba(10,10,10,0.85) inset !important;
  caret-color: #f1f5f9 !important;
  /* Delay the transition so the inset shadow "wins" */
  transition: background-color 99999s ease-in-out 0s !important;
}

/* ── Number input: hide browser spinner, fix height ── */
input[type="number"] {
  -moz-appearance: textfield !important;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
}

/* Field labels */
.field label {
  color: #94a3b8 !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
}

/* Tags on dark */
.tag {
  background: rgba(255,255,255,0.06) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}
.tag--ok { background: rgba(16,185,129,0.15) !important; color: #6ee7b7 !important; border-color: rgba(16,185,129,0.3) !important; }
.tag--err { background: rgba(239,68,68,0.15) !important; color: #fca5a5 !important; border-color: rgba(239,68,68,0.3) !important; }
.tag--muted { background: rgba(255,255,255,0.04) !important; color: #64748b !important; }

/* Buttons */
.btn-edit {
  background: rgba(245,158,11,0.15) !important;
  color: #fcd34d !important;
  border-color: rgba(245,158,11,0.3) !important;
}
.btn-edit:hover { background: rgba(245,158,11,0.25) !important; }
.btn-del {
  background: rgba(239,68,68,0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,0.3) !important;
}
.btn-del:hover { background: rgba(239,68,68,0.25) !important; }
.btn-cancel {
  background: rgba(255,255,255,0.06) !important;
  color: #cbd5e1 !important;
  border-color: rgba(255,255,255,0.12) !important;
}
.btn-cancel:hover { background: rgba(255,255,255,0.12) !important; }

/* Status tabs */
.status-tabs {
  border-bottom: 2px solid rgba(255,255,255,0.08) !important;
}
.status-tab { color: #94a3b8 !important; }
.status-tab:hover { color: #f1f5f9 !important; }
.status-tab.active { color: #fff !important; border-bottom-color: #F9FF00 !important; }
.tab-count {
  background: rgba(255,255,255,0.08) !important;
  color: #cbd5e1 !important;
}
.status-tab.active .tab-count { background: var(--brand-grad) !important; color: #0A0A0A !important; }

/* Form tabs */
.tabs { border-bottom: 2px solid rgba(255,255,255,0.08) !important; }
.tab-btn { color: #94a3b8 !important; background: transparent !important; }
.tab-btn:hover { color: #f1f5f9 !important; }
.tab-btn.active {
  color: #fff !important;
  border-bottom-color: #F9FF00 !important;
}

/* Tables */
.table th { color: #94a3b8 !important; border-bottom-color: rgba(255,255,255,0.08) !important; }
.table td { color: #e2e8f0 !important; border-bottom-color: rgba(255,255,255,0.05) !important; }
.table tbody tr:hover { background: rgba(255,255,255,0.03) !important; }

/* Muted text */
.muted { color: #94a3b8 !important; }

/* Code blocks */
code {
  background: rgba(255,255,255,0.05) !important;
  color: #c8cdd3 !important;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

/* Geo grid items: ensure visible text */
.app-subcard label {
  color: #e2e8f0 !important;
}
.app-subcard label code {
  background: rgba(249,255,0,0.18) !important;
  color: #F9FF00 !important;
}

/* App-card on dark */
.app-card {
  background: rgba(255,255,255,0.04) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}
.app-card:hover { border-color: rgba(249,255,0,0.4) !important; }
.app-card__title .name { color: #f1f5f9 !important; }
.app-card__title .pkg { color: #94a3b8 !important; }
.app-card__actions { border-top: 1px solid rgba(255,255,255,0.06) !important; }

/* Form action bar */
.app-form__actions, .form-actions { border-top: 1px solid rgba(255,255,255,0.08) !important; }
.app-form__header { border-bottom: 1px solid rgba(255,255,255,0.08) !important; }

/* Pagination */
.pagination .page {
  background: rgba(255,255,255,0.04) !important;
  color: #cbd5e1 !important;
  border-color: rgba(255,255,255,0.08) !important;
}
.pagination .page:hover { background: rgba(255,255,255,0.08) !important; }

/* Messages */
.msg.ok {
  background: rgba(16,185,129,0.12) !important;
  color: #a7f3d0 !important;
  border-color: rgba(16,185,129,0.3) !important;
}
.msg.err {
  background: rgba(239,68,68,0.12) !important;
  color: #fca5a5 !important;
  border-color: rgba(239,68,68,0.3) !important;
}

/* Page title in apps-head */
.apps-head h3, .apps-head h1 {
  background: linear-gradient(135deg, #fff 0%, #F9FF00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   APP FORM — redesigned (af-*)
   ============================================================ */

.af-wrap {
  max-width: 860px;
  margin: 0 auto;
}

/* Hero header */
.af-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 28px 24px;
  background: linear-gradient(135deg, rgba(249,255,0,0.18) 0%, rgba(212,219,0,0.18) 100%);
  border: 1px solid rgba(249,255,0,0.3);
  border-radius: 20px;
  margin-bottom: 20px;
  overflow: hidden;
}
.af-hero__glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(249,255,0,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.af-hero__icon {
  width: 80px; height: 80px;
  border-radius: 20px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.12);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.af-hero__label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #F9FF00;
  margin-bottom: 4px;
}
.af-hero__name {
  font-size: 22px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 4px;
  line-height: 1.2;
}
.af-hero__pkg {
  font-size: 12px;
  color: #94a3b8;
  font-family: monospace;
  word-break: break-all;
}
.af-hero__badge {
  margin-left: auto;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
  font-weight: 600;
  color: #F9FF00;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Tabs — pill style */
.af-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  background: rgba(10,10,10,0.5);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 5px;
}
.af-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
  min-height: auto;
}
.af-tab:hover { color: #e2e8f0; background: rgba(255,255,255,0.04); }
.af-tab--active {
  background: var(--brand-grad) !important;
  color: #0A0A0A !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.af-tab__ico { font-size: 16px; }

/* Section cards */
.af-section {
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 20px;
}
.af-section--accent {
  border-color: rgba(249,255,0,0.3) !important;
  background: rgba(249,255,0,0.06) !important;
}
.af-section__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.af-section__ico { font-size: 18px; line-height: 1; }
.af-section__title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #F9FF00;
}

/* Market cards */
.af-market-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.af-market-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 12px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.af-market-card input[type="radio"] { display: none; }
.af-market-card__ico { font-size: 28px; }
.af-market-card__name { font-size: 14px; font-weight: 700; color: #e2e8f0; }
.af-market-card__sub { font-size: 11px; color: #64748b; }
.af-market-card--active {
  border-color: #F9FF00 !important;
  background: rgba(249,255,0,0.15) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.af-market-card--active .af-market-card__name { color: #F9FF00; }

/* Hint text */
.af-hint {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* Copy line (traffic URL) */
.af-copyline {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.af-copyline input { flex: 1; font-family: monospace; font-size: 13px; }
.af-copy-btn {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(249,255,0,0.4);
  background: rgba(249,255,0,0.15);
  color: #F9FF00;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  min-height: auto;
}
.af-copy-btn:hover { background: rgba(249,255,0,0.25); }
.af-copy-btn--ok {
  background: rgba(16,185,129,0.15) !important;
  border-color: rgba(16,185,129,0.4) !important;
  color: #6ee7b7 !important;
}

/* Photo row */
.af-photo-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.af-photo-preview {
  width: 88px; height: 88px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

/* Channel chips */
.af-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.af-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  letter-spacing: 0.5px;
}
.af-channel input { display: none; }
.af-channel:hover { border-color: rgba(249,255,0,0.4); color: #F9FF00; }
.af-channel--active {
  background: rgba(249,255,0,0.2) !important;
  border-color: #F9FF00 !important;
  color: #F9FF00 !important;
}

/* Action bar */
.af-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 4px;
}

/* Form wrapper */
.af-form {
  display: flex;
  flex-direction: column;
}

@media (max-width: 768px) {
  .af-market-grid { grid-template-columns: 1fr; }
  .af-hero { flex-wrap: wrap; }
  .af-hero__badge { margin-left: 0; }
}

/* Link Generator hero */
.lg-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, rgba(249,255,0,0.15) 0%, rgba(200,207,0,0.1) 100%);
  border: 1px solid rgba(249,255,0,0.25);
  border-radius: 20px;
  margin-bottom: 20px;
  overflow: hidden;
}
.lg-hero__glow {
  position: absolute; top: -40px; right: -40px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(200,207,0,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.lg-hero__ico {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}
.lg-hero__title {
  margin: 0 0 4px;
  font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, #F9FF00 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lg-hero__sub { margin: 0; font-size: 13px; color: #94a3b8; }

/* ============================================================
   LINK GENERATOR (lg-*)
   ============================================================ */

.lg-wrap {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lg-section {
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 20px;
}
.lg-section--accent {
  border-color: rgba(249,255,0,0.3) !important;
  background: rgba(249,255,0,0.06) !important;
}
.lg-section--result {
  border-color: rgba(16,185,129,0.3) !important;
  background: rgba(16,185,129,0.05) !important;
}

.lg-section__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.lg-section__ico { font-size: 18px; }
.lg-section__title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #e2e8f0;
  flex: 1;
}

/* Market filter pills */
.lg-filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.lg-filter-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  min-height: auto;
}
.lg-filter-btn:hover { border-color: rgba(249,255,0,0.4); color: #F9FF00; }
.lg-filter-btn--active {
  background: var(--brand-grad) !important;
  border-color: transparent !important;
  color: #0A0A0A !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Search */
.lg-search {
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
}

/* App list */
.lg-list {
  max-height: 260px;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.07);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.lg-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.lg-app-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background .12s;
}
.lg-app-row:last-child { border-bottom: 0; }
.lg-app-row:hover { background: rgba(255,255,255,0.04); }
.lg-app-row--active { background: rgba(249,255,0,0.18) !important; }
.lg-app-row__icon { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.lg-app-row__info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lg-app-row__name { font-size: 14px; font-weight: 600; color: #e2e8f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-app-row__bundle { font-size: 11px; color: #64748b; font-family: monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-app-row__market { font-size: 16px; flex-shrink: 0; }
.lg-app-row__check { color: #6ee7b7; font-size: 16px; font-weight: 700; flex-shrink: 0; }

/* Generate row */
.lg-gen-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.lg-naming-input { flex: 1; }
.lg-gen-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  border: 0;
  background: var(--brand-grad);
  color: #0A0A0A;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: auto;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: opacity .15s, transform .12s;
  flex-shrink: 0;
}
.lg-gen-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.lg-gen-btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.3); }

/* Spinner */
.lg-spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* Copied badge */
.lg-copied-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(16,185,129,0.2);
  color: #6ee7b7;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(16,185,129,0.3);
}

/* Result */
.lg-result-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.lg-result-code {
  flex: 1;
  display: block;
  padding: 12px 14px;
  background: rgba(10,10,10,0.7) !important;
  color: #6ee7b7 !important;
  border-radius: 10px;
  font-size: 13px;
  word-break: break-all;
  line-height: 1.6;
  border: 1px solid rgba(16,185,129,0.2);
}
.lg-copy-btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
  min-height: auto;
}
.lg-copy-btn:hover { background: rgba(255,255,255,0.1); }
.lg-copy-btn--ok {
  background: rgba(16,185,129,0.15) !important;
  border-color: rgba(16,185,129,0.4) !important;
  color: #6ee7b7 !important;
}

/* ============================================================
   SETTINGS PAGE (settings-* / modal-*)
   ============================================================ */

.settings-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.settings-user-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  transition: border-color .12s;
}
.settings-user-row:hover { border-color: rgba(249,255,0,0.25); }

.settings-user-row__avatar {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #0A0A0A;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.settings-user-row__info { flex: 1; min-width: 0; }
.settings-user-row__name {
  font-size: 14px; font-weight: 600; color: #f1f5f9;
  display: flex; align-items: center; gap: 8px;
}
.settings-user-row__email { font-size: 12px; color: #64748b; margin-top: 2px; }

.settings-role-badge {
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.settings-role-badge--admin {
  background: rgba(249,255,0,0.2);
  color: #F9FF00;
  border: 1px solid rgba(249,255,0,0.3);
}
.settings-role-badge--manager {
  background: rgba(16,185,129,0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16,185,129,0.25);
}

.settings-user-row__status { flex-shrink: 0; }
.settings-status { font-size: 12px; font-weight: 600; }
.settings-status--on { color: #6ee7b7; }
.settings-status--off { color: #64748b; }

.settings-user-row__actions {
  display: flex; gap: 6px; flex-shrink: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(5,10,20,0.75);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn .15s ease-out;
}
.modal-box {
  width: 90%; max-width: 480px;
  max-height: 90vh; overflow-y: auto;
  background: #0f1929;
  border: 1px solid rgba(249,255,0,0.3);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  animation: fadeIn .15s ease-out;
}
.modal-header {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.modal-header__ico { font-size: 22px; }
.modal-header__title {
  flex: 1; margin: 0;
  font-size: 17px; font-weight: 700; color: #f1f5f9;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  font-size: 20px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  min-height: auto; padding: 0;
  transition: background .12s;
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.07);
}

/* Toggle in modal */
.modal-toggle {
  width: 42px; height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  position: relative;
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
  display: inline-block;
}
.modal-toggle--on { background: var(--brand-grad) !important; }
.modal-toggle__knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.modal-toggle--on .modal-toggle__knob { transform: translateX(18px); }

/* ============================================================
   EMOJI PICKER (ep-*)
   ============================================================ */

.ep-wrap { position: relative; }

.ep-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(10,10,10,0.6);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .12s;
  min-height: auto;
}
.ep-trigger:hover { border-color: #F9FF00; }
.ep-trigger__emoji { font-size: 26px; line-height: 1; }
.ep-trigger__arrow { font-size: 10px; color: #64748b; }

.ep-backdrop {
  position: fixed; inset: 0; z-index: 98;
}

.ep-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 300px;
  background: #0f1929;
  border: 1px solid rgba(249,255,0,0.3);
  border-radius: 16px;
  padding: 12px;
  z-index: 99;
  box-shadow: 0 16px 48px rgba(0,0,0,0.6);
  animation: fadeIn .12s ease-out;
}

.ep-search {
  width: 100% !important;
  margin-bottom: 10px !important;
  padding: 8px 12px !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px !important;
  color: #f1f5f9 !important;
  font-size: 13px !important;
  box-sizing: border-box !important;
}
.ep-search:focus { border-color: #F9FF00 !important; }

.ep-scroll {
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.ep-cat { margin-bottom: 12px; }
.ep-cat__label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: #475569;
  margin-bottom: 6px;
}
.ep-empty { text-align: center; color: #64748b; padding: 16px; font-size: 13px; }

.ep-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}

.ep-btn {
  font-size: 22px;
  padding: 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background .1s, transform .1s;
  min-height: auto;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.ep-btn:hover {
  background: rgba(255,255,255,0.08);
  transform: scale(1.2);
}
.ep-btn--active {
  background: rgba(249,255,0,0.25) !important;
  border-color: rgba(249,255,0,0.5) !important;
}

/* ============================================================
   LOGS PAGE (log-*)
   ============================================================ */

.log-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  transition: border-color .15s, background .15s;
}
.log-card:hover {
  border-color: rgba(249,255,0,0.3);
  background: rgba(10,10,10,0.7);
}

.log-card__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
}
.log-card__icon--fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(255,255,255,0.04);
}

.log-card__info { flex: 1; min-width: 0; }
.log-card__appname {
  font-size: 15px; font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.log-card__bundle {
  font-family: monospace;
  font-size: 12px; color: #64748b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 2px;
}
.log-card__bundle--only {
  font-size: 14px; color: #cbd5e1;
}
.log-card__meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.log-card__size {
  font-size: 12px; color: #94a3b8;
  background: rgba(255,255,255,0.06);
  padding: 2px 8px; border-radius: 999px;
}
.log-card__dot { color: #334155; font-size: 12px; }
.log-card__time { font-size: 12px; color: #64748b; }

.log-card__actions {
  display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap;
  justify-content: flex-end;
}

.log-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
  min-height: auto;
  background: transparent;
}
.log-btn--view {
  background: rgba(249,255,0,0.15);
  border-color: rgba(249,255,0,0.3);
  color: #F9FF00;
}
.log-btn--view:hover { background: rgba(249,255,0,0.25); }
.log-btn--dl {
  background: rgba(245,158,11,0.12);
  border-color: rgba(245,158,11,0.25);
  color: #fcd34d;
}
.log-btn--dl:hover { background: rgba(245,158,11,0.22); }
.log-btn--del {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.25);
  color: #fca5a5;
}
.log-btn--del:hover { background: rgba(239,68,68,0.2); }
.log-btn--back {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.1);
  color: #94a3b8;
}
.log-btn--back:hover { background: rgba(255,255,255,0.1); }

/* ============================================================
   NOTIFY PAGE (notify-*)
   ============================================================ */

.notify-teams-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.notify-team-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.notify-team-chip:hover { border-color: rgba(249,255,0,0.4); }
.notify-team-chip--active {
  background: rgba(249,255,0,0.18) !important;
  border-color: #F9FF00 !important;
}
.notify-team-chip__check {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1.5px solid rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: #6ee7b7;
  flex-shrink: 0;
}
.notify-team-chip--active .notify-team-chip__check {
  background: #F9FF00;
  border-color: #F9FF00;
  color: #0A0A0A;
}
.notify-team-chip__name { font-size: 13px; font-weight: 600; color: #e2e8f0; }
.notify-team-chip__count {
  font-size: 11px; font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.notify-team-chip--active .notify-team-chip__count {
  background: rgba(249,255,0,0.3);
  color: #F9FF00;
}

.notify-team-action-btn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #94a3b8;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  min-height: auto;
  transition: background .12s;
}
.notify-team-action-btn:hover { background: rgba(255,255,255,0.08); }
.notify-team-action-btn--sel {
  background: rgba(249,255,0,0.15) !important;
  border-color: rgba(249,255,0,0.35) !important;
  color: #F9FF00 !important;
}
.notify-team-action-btn--sel:hover { background: rgba(249,255,0,0.25) !important; }

.notify-tpl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.notify-tpl-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  white-space: nowrap;
}
.notify-tpl-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  min-height: auto;
  white-space: nowrap;
}
.notify-tpl-btn:hover {
  border-color: rgba(249,255,0,0.5);
  background: rgba(249,255,0,0.15);
  color: #F9FF00;
}

/* ============================================================
   ACL PAGE (acl-*)
   ============================================================ */

.acl-create-form {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.acl-create-form .field { min-width: 160px; }

.acl-team-card {
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color .15s;
}
.acl-team-card:hover { border-color: rgba(249,255,0,0.3); }

.acl-team-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.acl-team-card__avatar {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #0A0A0A;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  letter-spacing: -0.5px;
}
.acl-team-card__info { flex: 1; min-width: 0; }
.acl-team-card__name { font-size: 16px; font-weight: 700; color: #f1f5f9; }
.acl-team-card__note { font-size: 12px; color: #64748b; margin-top: 2px; }

.acl-del-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.1);
  color: #fca5a5;
  font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
  min-height: auto;
  padding: 0;
}
.acl-del-btn:hover { background: rgba(239,68,68,0.25); border-color: rgba(239,68,68,0.4); }

.acl-token-block {
  background: rgba(5,10,20,0.7);
  border: 1px solid rgba(249,255,0,0.2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.acl-token-label {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: #F9FF00;
}
.acl-token-value {
  font-family: monospace;
  font-size: 14px;
  color: #F9FF00;
  word-break: break-all;
  letter-spacing: 0.5px;
}
.acl-token-cmd {
  font-family: monospace;
  font-size: 12px;
  color: #6ee7b7;
  padding: 6px 10px;
  background: rgba(16,185,129,0.08);
  border-radius: 6px;
  border: 1px solid rgba(16,185,129,0.15);
  word-break: break-all;
}

.acl-members__head {
  font-size: 13px; font-weight: 700;
  color: #94a3b8;
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.acl-members__count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 6px;
  background: rgba(249,255,0,0.2);
  color: #F9FF00;
  border-radius: 999px; font-size: 11px; font-weight: 700;
}
.acl-members__empty { font-size: 13px; color: #475569; }
.acl-members__list { display: flex; flex-wrap: wrap; gap: 6px; }
.acl-members__more { font-size: 12px; color: #64748b; align-self: center; }

.acl-member-chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 500;
}

/* ============================================================
   S2S PAGE (s2s-*)
   ============================================================ */

.s2s-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.s2s-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-radius: 14px;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
  min-height: auto;
}
.s2s-btn:hover { transform: translateY(-2px); }
.s2s-btn--af {
  background: linear-gradient(135deg, #F9FF00 0%, #d4db00 100%);
  color: #0A0A0A;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.s2s-btn--af:hover { box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.s2s-btn--fb {
  background: linear-gradient(135deg, #1877f2 0%, #0c5fcd 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(24,119,242,0.4);
}
.s2s-btn--fb:hover { box-shadow: 0 6px 20px rgba(24,119,242,0.55); }

.s2s-log {
  margin: 0;
  background: rgba(5,10,20,0.8) !important;
  color: #a5f3fc;
  padding: 14px 16px;
  border-radius: 10px;
  max-height: 380px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid rgba(255,255,255,0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.s2s-clear-btn {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: auto;
  transition: background .12s;
}
.s2s-clear-btn:hover { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }

/* ===== Mobile ===== */
@media (max-width: 900px) {
  .burger-btn { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 260px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
  }
  .sidebar.open { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0 !important; }
  .content > .container { padding: 70px 16px 24px; }
  .apps-grid { grid-template-columns: 1fr; }
  .app-form__header { flex-wrap: wrap; }
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}
.login-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}
.login-title {
  font-size: 22px;
  font-weight: 800;
  color: #f1f5f9;
  margin: 0 0 24px;
  text-align: center;
}
.login-error {
  color: #fca5a5;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}
.login-field {
  margin-bottom: 16px;
}
.login-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #94a3b8;
  margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(10,10,10,0.6) !important;
  color: #f1f5f9 !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  border-radius: 10px;
  font-size: 15px;
  outline: 0;
  box-sizing: border-box;
  transition: border-color .12s, box-shadow .12s;
}
.login-input:focus {
  border-color: #F9FF00 !important;
  box-shadow: 0 0 0 2px rgba(249,255,0,0.1) !important;
}
.login-btn {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--brand-grad);
  color: #0A0A0A;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
  transition: transform .12s, box-shadow .12s;
}
.login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
