/* shadcn-inspired admin (Express + EJS) */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --fg: #0a0a0a;
  --muted: #71717a;
  --border: #e4e4e7;
  --primary: #18181b;
  --primary-fg: #fafafa;
  --accent: #b32d2e;
  --success: #16a34a;
  --danger: #dc2626;
  --ring: #a1a1aa;
  --sidebar: #09090b;
  --sidebar-fg: #a1a1aa;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  font-family: "DM Sans", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body.admin-body {
  background: var(--bg);
  color: var(--fg);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  font-family: "DM Sans", Inter, system-ui, sans-serif;
}
.admin-sidebar {
  width: 260px;
  background: var(--sidebar);
  color: var(--sidebar-fg);
  padding: 16px 12px;
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-right: 1px solid #27272a;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  overflow: hidden;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 14px;
  border-bottom: 1px solid #27272a;
  margin-bottom: 4px;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-brand strong { display: block; font-size: 0.95rem; font-family: Syne, "DM Sans", sans-serif; }
.sidebar-brand small { color: #a1a1aa; font-size: 0.72rem; text-transform: uppercase; letter-spacing: .06em; }
.sidebar-close-btn { display: none; }
.brand-logo, .topbar-logo {
  width: 36px; height: 36px; border-radius: 10px; display: block; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255,255,255,.08);
}
.topbar-logo { width: 28px; height: 28px; border-radius: 8px; }
.login-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, #b32d2e, #7f1d1d);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; letter-spacing: .04em;
}
.login-mark.sm { width: 36px; height: 36px; font-size: 0.8rem; }
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 transparent;
}
.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}
.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px;
  color: #a1a1aa; text-decoration: none; font-weight: 500;
  flex-shrink: 0;
}
.nav-item:hover { background: #27272a; color: #fff; }
.nav-item.logout {
  color: #f87171;
  flex-shrink: 0;
  margin-top: 6px;
  border-top: 1px solid #27272a;
  padding-top: 12px;
  border-radius: 8px;
}
.admin-main { margin-left: 260px; flex: 1; padding: 28px 32px; min-width: 0; overflow-x: hidden; }
.admin-main.full { margin-left: 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; gap: 12px; flex-wrap: wrap; }
.page-header h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 8px; font-size: 0.875rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; cursor: pointer;
  transition: .15s ease;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: #27272a; }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary { background: #fff; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { background: #f4f4f5; }
.btn-sm { padding: 6px 10px; font-size: 0.78rem; }
.btn-block { width: 100%; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; margin-bottom: 22px; width: 100%; max-width: 100%; }
.stats-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); min-width: 0; overflow: hidden;
}
.stat-card .num { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; }
.stat-card .label { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
@media (max-width: 1100px) {
  .stats-grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .stats-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.badge { padding: 3px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; display: inline-block; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-expired { background: #ffedd5; color: #9a3412; }
.badge-mega { background: #fce7f3; color: #9d174d; }
.badge-diamond { background: #e0f2fe; color: #075985; }
.badge-vip { background: #f3e8ff; color: #6b21a8; }
.badge-gold { background: #fef3c7; color: #92400e; }
.badge-normal { background: #f4f4f5; color: #3f3f46; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--fg); font-size: 0.85rem; font-weight: 600; }
.form-control {
  width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; color: var(--fg); font-size: 0.9rem;
}
.form-control:focus { outline: none; border-color: #a1a1aa; box-shadow: 0 0 0 3px rgba(24,24,27,.08); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-check { display: flex; align-items: center; gap: 8px; margin: 10px 0; font-weight: 500; }
.alert { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--border); }
.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cf-provision-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid #e4e4e7;
  border-radius: 10px;
  background: #fafafa;
}
.cf-amp-modes .form-check { display: block; margin-bottom: 8px; }
.cf-amp-modes--compact .form-check { margin-bottom: 10px; }
.cf-amp-separate-panel { margin: 4px 0 12px 24px; padding: 12px; border-left: 3px solid #6366f1; background: #f8fafc; border-radius: 0 8px 8px 0; }
.cf-zones-row { align-items: flex-end; gap: 8px; }
.cf-provision-box--inline { background: transparent; border: none; padding: 12px 0 0; }
.cf-sync-card { margin-top: 16px; padding: 18px; border: 1px solid #d4d4d8; border-radius: 12px; background: #fff; }
.cf-sync-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.cf-url-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-bottom: 16px; }
.cf-url-grid--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-url-item { padding: 10px 12px; background: #f4f4f5; border-radius: 8px; }
.cf-url-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #71717a; margin-bottom: 4px; }
.cf-url-item code { font-size: 12px; word-break: break-all; }
.cf-tunnel-preview { margin: 14px 0; padding: 12px; background: #fafafa; border: 1px dashed #d4d4d8; border-radius: 8px; }
.cf-tunnel-preview-title { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: #52525b; }
.cf-tunnel-preview-list { margin: 0; padding-left: 18px; font-size: 12px; }
.cf-tunnel-preview-list li { margin-bottom: 4px; }
.cf-inline-input { display: inline-block; width: 72px; padding: 4px 8px; margin: 0 4px; vertical-align: middle; }
.cf-tab-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cf-details { margin-top: 12px; border: 1px solid #e4e4e7; border-radius: 10px; padding: 0 14px; }
.cf-details summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.cf-details-body { padding-bottom: 14px; }
.cf-last-sync { margin-top: 10px; font-size: 12px; }
.alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.img-preview { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.img-preview img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.expiry-box {
  background: #fafafa; border: 1px dashed var(--border); border-radius: 8px; padding: 14px; margin: 12px 0 18px;
}
.expiry-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.muted-text { color: var(--muted); font-size: 0.82rem; margin: 0; }
.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.form-actions { margin: 8px 0 28px; }
.btn-lg { padding: 12px 18px; width: 100%; max-width: 280px; }
.btn-wa { background: #25d366; color: #fff; border-color: #25d366; }
.btn-wa:hover { filter: brightness(0.95); color: #fff; }
.img-preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  position: relative;
}
.ai-settings-box {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 18px;
}
.photo-gallery { margin-top: 6px; }
.photo-dropzone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1.5px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.photo-dropzone.is-dragover {
  border-color: #b45309;
  background: #fffbeb;
}
.photo-dropzone > i { font-size: 1.4rem; color: #b45309; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.photo-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  position: relative;
}
.photo-card.is-dragging { opacity: .45; }
.photo-card.is-over { outline: 2px solid #b45309; }
.photo-card-thumb {
  aspect-ratio: 1;
  background: #f1f5f9;
}
.photo-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.photo-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 6px 8px;
  font-size: 0.72rem;
  color: var(--muted);
}
.photo-drag-hint i { margin-right: 4px; }
.photo-remove {
  border: 0;
  background: #fee2e2;
  color: #991b1b;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
}
.photo-remove:hover { background: #fecaca; }
.actions-cell { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.admin-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 40;
  background: #09090b;
  color: #fff;
  padding: 12px 14px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #27272a;
}
.nav-toggle {
  background: #27272a;
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
}
.topbar-role { margin-left: auto; font-size: 0.75rem; color: #a1a1aa; text-transform: uppercase; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 45;
}
.mobile-only { display: none; }
.ilan-card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 10px;
}
.ilan-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 860px) {
  body.nav-open {
    overflow: hidden !important;
    touch-action: none;
  }
  .admin-topbar {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .admin-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(86vw, 320px);
    z-index: 999;
    transform: translateX(-105%);
    transition: transform .25s cubic-bezier(0.32, 0.72, 0, 1);
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 14px 10px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.65);
    border-right: 1px solid #3f3f46;
  }
  body.nav-open .admin-sidebar {
    transform: translateX(0);
  }
  body.nav-open .sidebar-backdrop {
    display: block;
  }
  .sidebar-backdrop {
    z-index: 998;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .sidebar-brand {
    padding: 4px 8px 12px;
    justify-content: space-between;
  }
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #27272a;
    border: 1px solid #3f3f46;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    margin-left: auto;
    flex-shrink: 0;
  }
  .sidebar-close-btn:active {
    background: #3f3f46;
  }
  .sidebar-nav {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto !important;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-right: 2px;
  }
  .nav-item {
    padding: 12px 14px;
    font-size: 0.95rem;
    border-radius: 10px;
  }
  .nav-item.logout {
    padding: 12px 14px;
    font-size: 0.95rem;
    border-radius: 8px;
  }
  .admin-main {
    margin-left: 0;
    padding: 14px 12px 56px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }
  body.admin-body {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-header h1 {
    font-size: 1.25rem;
  }
  .settings-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }
  .settings-links .btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 8px 12px;
  }
  .settings-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 10px;
    margin-bottom: 14px;
    gap: 8px;
  }
  .settings-tabs::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .desktop-table {
    display: none;
  }
  .mobile-only {
    display: block;
  }
  .btn-lg {
    max-width: none;
    width: 100%;
  }
  .quill-editor {
    min-height: 160px;
  }
  .card {
    padding: 16px 14px;
    border-radius: 12px;
    margin-bottom: 14px;
  }
  .form-group {
    margin-bottom: 14px;
  }
  .form-control {
    font-size: 16px;
    padding: 10px 12px;
  }
  .sticky-save {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 14px max(14px, env(safe-area-inset-bottom, 14px));
    border-top: 1px solid var(--border);
    margin: 18px -14px -14px -14px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    z-index: 30;
  }
  .sticky-save .btn-lg {
    max-width: none;
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    font-weight: 700;
  }
  .ai-settings-box {
    padding: 14px 12px;
  }
  .cf-url-grid--two {
    grid-template-columns: 1fr;
  }
  .cf-sync-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .cf-zones-row {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .visitor-map {
    height: 280px;
  }
}
.sticky-save {
  position: sticky;
  bottom: 0;
  background: rgba(250,250,250,.92);
  padding: 12px 0;
  border-top: 1px solid var(--border);
  z-index: 5;
}
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--muted);
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.tab-panel { display: none !important; }
.tab-panel.active { display: block !important; }
.settings-links { display: flex; flex-wrap: wrap; gap: 8px; }
.code-area {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
}
.favicon-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.favicon-preview img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.visitor-map {
  height: 420px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  z-index: 1;
}
@media (max-width: 860px) {
  .visitor-map { height: 280px; }
}
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
}
.chart-card { min-width: 0; max-width: 100%; overflow: hidden; }
.chart-card canvas { max-height: 280px; width: 100% !important; }
.chart-card.compact { min-height: 240px; }
.chart-card.compact canvas { max-height: 180px; height: 180px; }
.live-dash { margin-bottom: 18px; width: 100%; max-width: 100%; overflow: hidden; }
.live-dash-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.live-dash-head h2 {
  font-size: 1.05rem;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--muted);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22,163,74,.15);
  animation: livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}
.live-charts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 700px) {
  .chart-grid,
  .live-charts { grid-template-columns: 1fr; }
}
.share-bar {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
  width: 110px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.share-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #b45309, #ca8a04);
}
.inline-stat-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-right: 6px;
}
.input-xs {
  width: 88px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
}
.text-warn { color: #c2410c; }
.danger-zone {
  border: 1px solid #fecaca;
  background: #fff7f7;
}
@media (max-width: 960px) {
  .chart-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .settings-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .tab-btn { white-space: nowrap; }
}
.admin-login-body {
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(179,45,46,.18) 0%, transparent 55%),
    radial-gradient(700px 420px at 95% 10%, rgba(24,24,27,.08) 0%, transparent 50%),
    linear-gradient(160deg, #0a0a0a 0%, #18181b 42%, #f4f4f5 42.1%, #fafafa 100%);
  font-family: "DM Sans", system-ui, sans-serif;
}
.welcome-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  gap: 18px;
}
.welcome-banner {
  width: 100%;
  max-width: 720px;
  text-align: center;
  font-family: Syne, "DM Sans", sans-serif;
  font-weight: 800;
  font-size: clamp(1.15rem, 4.2vw, 1.75rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  background: #b32d2e;
  padding: 18px 22px;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(179, 45, 46, .35);
  text-transform: none;
}
.welcome-card {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 20px;
  padding: 36px 28px 32px;
  text-align: center;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
}
.welcome-card h1 {
  font-family: Syne, "DM Sans", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 8px 0 10px;
}
.welcome-lead {
  color: #52525b;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0 0 22px;
}
.welcome-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.btn-welcome {
  padding: 16px 12px;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
}
.btn-welcome-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-decoration: none;
  border-radius: 10px;
  border: 2px solid #18181b;
  color: #18181b;
  background: #fff;
}
.btn-welcome-outline:hover { background: #f4f4f5; }
@media (max-width: 520px) {
  .welcome-actions { grid-template-columns: 1fr; }
}
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel {
  width: 100%;
  max-width: 880px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 0;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  background: #fff;
}
.login-aside {
  background: #0a0a0a;
  color: #fafafa;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.login-aside h1 {
  font-family: Syne, "DM Sans", sans-serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
  font-weight: 800;
}
.login-aside p { color: #a1a1aa; font-size: 0.95rem; max-width: 26ch; line-height: 1.45; }
.login-logo { border-radius: 14px; margin-bottom: 8px; }
.login-card-shad {
  width: 100%; background: #fff; padding: 36px 32px;
}
.login-card-head { margin-bottom: 20px; }
.login-card-head h2 {
  font-family: Syne, "DM Sans", sans-serif;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.login-card-head p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.captcha-group .captcha-q {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f4f4f5;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 4px;
}
.captcha-row { display: flex; gap: 8px; align-items: stretch; }
.captcha-row .form-control { flex: 1; }
.captcha-refresh {
  width: 44px; min-width: 44px; padding: 0;
  font-size: 1.15rem; text-decoration: none;
}
.btn-login { padding: 12px 14px; font-size: 0.95rem; margin-top: 4px; }

.story-dropzone {
  position: relative;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  min-height: 160px;
  padding: 18px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
  outline: none;
}
.story-dropzone:hover, .story-dropzone:focus-visible {
  border-color: #b32d2e;
  background: #fff8f8;
}
.story-dropzone.is-dragover {
  border-color: #b32d2e;
  background: #fff1f2;
  box-shadow: 0 0 0 3px rgba(179,45,46,.12);
}
.story-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  z-index: 1;
}
.story-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-height: 124px;
  pointer-events: none;
}
.story-drop-inner i { font-size: 1.75rem; color: #b32d2e; }
.story-preview {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: center;
}
.story-preview img, .story-preview video {
  width: 96px; height: 96px; object-fit: cover;
  border-radius: 12px; border: 1px solid var(--border); background: #0a0a0a;
}
.story-preview-meta { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

.user-nest { display: flex; flex-direction: column; gap: 12px; }
.user-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.user-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  background: #fafafa;
  border-bottom: 1px solid transparent;
  user-select: none;
}
.user-group[open] > summary { border-bottom-color: var(--border); }
.user-group > summary::-webkit-details-marker { display: none; }
.user-group-title {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 0.95rem;
}
.user-nest-list { padding: 6px 8px 10px; }
.user-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 8px; border-radius: 10px;
}
.user-row:hover { background: #f4f4f5; }
.user-row-main {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: inherit; min-width: 0; flex: 1;
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 10px;
  background: #0a0a0a; color: #fff;
  display: grid; place-items: center; font-weight: 700; flex-shrink: 0;
}
.user-row-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.profil-grid {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 16px;
}
.profil-meta {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.profil-meta span { display: block; font-size: 0.75rem; margin-bottom: 2px; }
.profil-listings { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.profil-listings li {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.profil-listings a { font-weight: 600; color: var(--fg); text-decoration: none; }
.hesab-grid {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px;
}
.hareket-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }

@media (max-width: 860px) {
  .login-panel { grid-template-columns: 1fr; max-width: 440px; }
  .login-aside { padding: 28px 24px 20px; }
  .login-aside h1 { font-size: 1.55rem; }
  .login-card-shad { padding: 24px; }
  .profil-grid, .hesab-grid { grid-template-columns: 1fr; }
  .profil-meta { grid-template-columns: 1fr; }
  .user-row { flex-direction: column; align-items: stretch; }
  .user-row-actions { justify-content: flex-start; }
}

.quill-wrap { margin-bottom: 8px; }
.quill-editor {
  min-height: 220px;
  background: #fff;
  border-radius: 0 0 8px 8px;
}
.ql-toolbar.ql-snow {
  border-radius: 8px 8px 0 0;
  border-color: var(--border);
  background: #fafafa;
}
.ql-container.ql-snow { border-color: var(--border); font-family: "DM Sans", Inter, sans-serif; }

/* Backlink özel tema — cPanel dosya yöneticisi + popup kod editörü */
.bl-fm-howto {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 0.85rem;
}
.bl-fm-howto ul { margin: 8px 0 0 18px; }
.bl-fm-howto li { margin: 4px 0; }
.bl-fm-howto code { background: #fff; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--border); }
.bl-fm {
  border: 1px solid #d4d4d8;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.bl-fm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 8px 6px;
  background: linear-gradient(#fafafa, #f4f4f5);
  border-bottom: 1px solid var(--border);
}
.bl-fm-tool {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 58px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #3f3f46;
  font-size: 0.68rem;
  font-weight: 600;
}
.bl-fm-tool i { font-size: 1.05rem; color: #18181b; }
.bl-fm-tool:hover:not(:disabled) { background: #e4e4e7; }
.bl-fm-tool:disabled { opacity: 0.35; cursor: not-allowed; }
.bl-fm-tool-danger:hover:not(:disabled) { background: #fee2e2; color: #991b1b; }
.bl-fm-toolbar-sep {
  width: 1px;
  background: var(--border);
  margin: 4px 6px;
  align-self: stretch;
}
.bl-fm-path {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.bl-fm-search {
  width: min(240px, 42vw);
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.8rem;
}
.bl-fm-drop { position: relative; }
.bl-fm-drop.is-dragover {
  outline: 2px dashed #b32d2e;
  outline-offset: -4px;
  background: #fff8f8;
}
.bl-fm-table-wrap { max-height: 360px; overflow: auto; }
.bl-fm-table { width: 100%; font-size: 0.82rem; }
.bl-fm-table th {
  position: sticky;
  top: 0;
  background: #fafafa;
  z-index: 1;
}
.bl-fm-table td, .bl-fm-table th { padding: 8px 10px; }
.bl-fm-row { cursor: pointer; }
.bl-fm-row:hover { background: #f4f4f5; }
.bl-fm-row.is-selected { background: #e0f2fe; }
.bl-fm-row i { margin-right: 6px; color: #71717a; }
.bl-fm-url { color: #2563eb; text-decoration: none; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.76rem; }
.bl-fm-url:hover { text-decoration: underline; }
.bl-fm-empty { text-align: center; color: var(--muted); padding: 28px 12px !important; }
.bl-fm-hint { padding: 8px 12px; margin: 0; color: var(--muted); font-size: 0.78rem; border-top: 1px solid var(--border); background: #fafafa; }
.bl-fm-menu {
  position: fixed;
  z-index: 80;
  min-width: 180px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
  padding: 6px;
}
.bl-fm-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.82rem;
  text-align: left;
}
.bl-fm-menu button:hover { background: #f4f4f5; }
.bl-fm-menu button.is-danger { color: #dc2626; }
.bl-fm-menu hr { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
body.bl-ed-open { overflow: hidden; }
.bl-ed-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(9,9,11,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.bl-ed-overlay[hidden] { display: none !important; }
.bl-ed-window {
  width: min(1100px, 96vw);
  height: min(720px, 88vh);
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0,0,0,.4);
}
.bl-ed-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  background: #323233;
  color: #cccccc;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.bl-ed-title-actions { display: flex; align-items: center; gap: 6px; }
.bl-theme-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #cccccc;
  cursor: pointer;
  font-size: 0.82rem;
}
.bl-theme-icon-btn:hover:not(:disabled) { background: #3c3c3c; color: #fff; }
.bl-theme-icon-btn.is-active { background: #094771; color: #75beff; }
.bl-theme-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: none;
  border-radius: 4px;
  background: #0e639c;
  color: #fff;
  font-size: 0.76rem;
  cursor: pointer;
}
.bl-theme-save-btn:hover:not(:disabled) { background: #1177bb; }
.bl-theme-save-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bl-theme-save-btn-sm { height: 26px; padding: 0 8px; font-size: 0.74rem; }
.bl-theme-ai-panel {
  padding: 8px 10px;
  background: #252526;
  border-bottom: 1px solid #3c3c3c;
  flex-shrink: 0;
}
.bl-theme-ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  color: #cccccc;
  font-size: 0.78rem;
}
.bl-theme-ai-mode {
  width: 100%;
  margin-bottom: 6px;
  padding: 4px 8px;
  font-size: 0.76rem;
  background: #3c3c3c;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  color: #cccccc;
}
.bl-theme-ai-prompt {
  width: 100%;
  min-height: 52px;
  max-height: 80px;
  resize: vertical;
  margin-bottom: 6px;
  padding: 6px 8px;
  font-size: 0.78rem;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  color: #cccccc;
  font-family: inherit;
}
.bl-theme-ai-actions { display: flex; align-items: center; gap: 8px; }
.bl-theme-ai-actions span { font-size: 0.72rem; color: #858585; }
.bl-theme-editor-area {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.bl-theme-editor-wrap { position: absolute; inset: 0; overflow: hidden; }
.bl-theme-editor-wrap .CodeMirror {
  height: 100% !important;
  font-family: Consolas, "Courier New", ui-monospace, monospace;
  font-size: 13px;
  line-height: 1.5;
}
.bl-theme-editor-wrap .CodeMirror-gutters { background: #1e1e1e; border-right: 1px solid #3c3c3c; }
.bl-theme-statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  height: 22px;
  font-size: 0.72rem;
  color: #cccccc;
  background: #007acc;
  flex-shrink: 0;
}
.bl-theme-status { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-theme-modified { color: #e2c08d; }
.bl-theme-status-right { display: flex; gap: 12px; }
.bl-theme-status.is-error { color: #f48771; }
.bl-theme-status.is-warn { color: #e2c08d; }
kbd {
  padding: 1px 5px;
  font-size: 0.72rem;
  border-radius: 3px;
  border: 1px solid #ccc;
  background: #f4f4f4;
  font-family: inherit;
}
.login-switch { margin-top: 18px; text-align: center; font-size: 0.9rem; color: var(--muted); }
.login-switch a { color: #b32d2e; font-weight: 600; text-decoration: none; }
.login-panel-wide { max-width: 960px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check-adult { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; line-height: 1.4; margin: 8px 0 14px; }
.check-adult input { margin-top: 3px; }
.apply-hero h2 { margin: 0 0 8px; font-family: Syne, "DM Sans", sans-serif; }
.apply-hero .btn-lg { padding: 14px 22px; font-size: 1.05rem; margin-top: 8px; }
.apply-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.apply-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.apply-photo-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.apply-photo-grid-id { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.apply-photo-grid-id img { height: 240px; }
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: #b32d2e; color: #fff; font-size: 0.7rem; font-weight: 700;
}
@media (max-width: 700px) {
  .form-row-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .bl-fm-table-wrap { max-height: 280px; }
  .bl-ed-overlay { padding: 8px; }
  .bl-ed-window { width: 100%; height: 96vh; border-radius: 8px; }
  .bl-fm-tool span { display: none; }
  .bl-fm-tool { min-width: 40px; }
}

.bl-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.bl-theme-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.bl-theme-card:hover { border-color: var(--swatch, #64748b); }
.bl-theme-card.is-selected {
  border-color: var(--swatch, #b32d2e);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--swatch) 35%, transparent);
}
.bl-theme-swatch {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--swatch, #64748b);
  margin-bottom: 4px;
}
.bl-theme-card strong { font-size: 0.82rem; }
.bl-theme-card span { font-size: 0.78rem; color: var(--muted, #64748b); line-height: 1.3; }
.bl-theme-card em {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: #7c0485;
  background: #f3e8ff;
  padding: 1px 6px;
  border-radius: 999px;
}
.bl-gclick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 2.2em;
}
.bl-gclick-num { font-size: 0.95rem; font-weight: 700; color: var(--fg); }
.bl-gclick-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  flex: 0 0 auto;
}
.bl-gclick.is-live { color: #166534; }
.bl-gclick.is-live .bl-gclick-num { color: #166534; }
.bl-gclick.is-live .bl-gclick-dot {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55);
  animation: bl-gclick-pulse 1.8s ease-out infinite;
}
@keyframes bl-gclick-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
  70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.bl-gclick-sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  max-width: 640px;
}
.bl-gclick-sum .stat-card { padding: 14px 16px; }
.bl-gclick-sum .stat-card .num { font-size: 1.55rem; font-variant-numeric: tabular-nums; }
.bl-gclick-sum .stat-card.is-live .num { color: #166534; }
@media (max-width: 700px) {
  .bl-gclick-sum { grid-template-columns: 1fr; max-width: none; }
}
