/* Nobaj - Studio Pro Design System
   Quiet, editorial UI: strong hierarchy, restrained color, no decorative noise. */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-deep: #090b18;
  --bg-surface: #11152a;
  --bg-surface-elevated: #191e38;
  --border-subtle: rgba(255, 255, 255, 0.105);
  --border-active: rgba(139, 92, 246, 0.58);
  --accent-violet: #8b5cf6;
  --accent-violet-light: #c4b5fd;
  --accent-violet-glow: rgba(139, 92, 246, 0.18);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

body {
  font-family: 'Plus Jakarta Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-main);
  overflow-x: hidden;
  background-image: 
    linear-gradient(180deg, rgba(255,255,255,0.018), transparent 180px),
    radial-gradient(ellipse at 50% -40%, rgba(139, 92, 246, 0.16), transparent 55%);
  background-attachment: fixed;
}

body[dir="rtl"],
html[dir="rtl"] body {
  font-family: 'IBM Plex Sans Arabic', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

.site-header {
  background: rgba(9, 11, 24, 0.92);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hero-block {
  padding-top: 10px;
}

.hero-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid currentColor;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.stats-strip {
  max-width: 960px;
  margin: 8px auto 0;
  padding: 14px 18px 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(17, 21, 42, 0.82);
}

.stats-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-kicker {
  color: #d7dde7;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.stats-live {
  color: #718096;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.stat-item {
  display: flex;
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 0 16px;
  border-inline-start: 1px solid rgba(255,255,255,0.08);
}

.stat-item:first-child {
  border-inline-start: 0;
  padding-inline-start: 0;
}

.stat-item:last-child {
  padding-inline-end: 0;
}

.stat-item strong {
  color: #f7f8fa;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-item span {
  color: #7f8b9d;
  font-size: 10px;
  font-weight: 600;
}

.ad-slot {
  display: flex;
  width: 100%;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border-radius: 10px;
}

.ad-slot-placeholder {
  max-width: 960px;
  border: 1px dashed rgba(255,255,255,0.1);
  background: rgba(15, 19, 37, 0.68);
  color: #606b7b;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ad-slot-live {
  min-height: 90px;
  overflow: hidden;
}

.ad-slot ins {
  width: 100%;
}

.admin-shell {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.admin-login {
  width: min(440px, 100%);
  margin: 48px auto;
  padding: 30px;
}

.admin-login h1,
.admin-heading h1 {
  margin-top: 8px;
  color: #f8fafc;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.admin-login p {
  margin-top: 8px;
  color: #8490a1;
  font-size: 13px;
}

.admin-login-form {
  display: grid;
  gap: 9px;
  margin-top: 24px;
}

.admin-login-form label {
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.admin-login-form input {
  min-height: 46px;
  padding: 0 13px;
  border-radius: 9px;
}

.admin-error {
  min-height: 18px;
  color: #fda4af;
  font-size: 12px;
}

.admin-header-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
}

.admin-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric {
  display: flex;
  min-height: 116px;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
}

.admin-metric span {
  color: #8490a1;
  font-size: 12px;
  font-weight: 700;
}

.admin-metric strong {
  color: #c4b5fd;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.admin-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.admin-panel {
  min-height: 300px;
  padding: 20px;
}

.admin-panel-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.admin-panel-title h2 {
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 800;
}

.admin-panel-title span {
  color: #677386;
  font-family: monospace;
  font-size: 10px;
}

.admin-bars {
  display: grid;
  gap: 18px;
}

.admin-bar-row {
  display: grid;
  gap: 6px;
}

.admin-bar-label {
  display: flex;
  justify-content: space-between;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
}

.admin-bar-label b {
  color: #c4b5fd;
}

.admin-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: #0b0f23;
}

.admin-bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
}

.admin-bar-row small {
  color: #697587;
  font-size: 10px;
}

.admin-table-wrap {
  max-height: 240px;
  overflow: auto;
}

.admin-panel table {
  width: 100%;
  border-collapse: collapse;
  color: #aeb8c7;
  font-size: 11px;
}

.admin-panel th,
.admin-panel td {
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: start;
}

.admin-panel th {
  color: #687587;
  font-size: 10px;
  font-weight: 800;
}

.admin-empty,
.admin-status {
  color: #687587;
  font-size: 12px;
}

.admin-status {
  margin-top: 14px;
  direction: ltr;
  text-align: left;
}

.language-trigger {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #14182e;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.language-trigger:hover,
.language-trigger:focus-visible {
  border-color: rgba(139, 92, 246, 0.5);
  background: #1b2040;
  color: white;
  outline: none;
}

.language-globe {
  color: var(--accent-violet-light);
  font-size: 17px;
  line-height: 1;
}

.language-popover {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  z-index: 60;
  width: 286px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: #13172d;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.38);
}

.language-popover-heading {
  padding: 0 4px 10px;
  color: #7f8b9d;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

.language-option {
  min-height: 38px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 12px;
  text-align: start;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.language-option:hover,
.language-option:focus-visible {
  border-color: rgba(255,255,255,0.09);
  background: #22262e;
  color: white;
  outline: none;
}

.language-option.is-selected {
  background: rgba(139, 92, 246, 0.18);
  color: var(--accent-violet-light);
}

/* Studio Surface Panels */
.studio-panel {
  background: rgba(17, 21, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 10px 24px -18px rgba(0, 0, 0, 0.8);
}

.studio-card {
  background: rgba(25, 30, 56, 0.82);
  border: 1px solid var(--border-subtle);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.studio-card:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(35, 39, 73, 0.92);
}

/* Studio Tab Switcher (Segmented tactile control) */
.tab-switcher {
  max-width: 100%;
  overflow-x: auto;
  background: #10142a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.tab-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn.active-tab {
  background: #24294a;
  color: var(--accent-violet-light);
  border: 1px solid rgba(139, 92, 246, 0.42);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Drag & Drop Target Area */
.dropzone-target {
  background: #14171c;
  border: 1.5px dashed rgba(255, 255, 255, 0.12);
  transition: all 0.25s ease;
}

.dropzone-target:hover {
  border-color: rgba(139, 92, 246, 0.62);
  background: #191e38;
}

.dropzone-active {
  border-color: #8b5cf6 !important;
  background: rgba(139, 92, 246, 0.08) !important;
  box-shadow: 0 0 40px rgba(139, 92, 246, 0.2) !important;
  transform: scale(1.008);
}

/* Gradient primary action */
.btn-violet {
  background: linear-gradient(115deg, #8b5cf6, #06b6d4);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid rgba(196, 181, 253, 0.75);
  box-shadow: 0 5px 20px rgba(124, 58, 237, 0.32);
  transition: all 0.2s ease;
}

.btn-violet:hover {
  background: linear-gradient(115deg, #9f67ff, #22d3ee);
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.28);
  transform: translateY(-1px);
}

.btn-violet:active {
  transform: translateY(0);
}

/* Subtle Secondary / Ghost Button */
.btn-ghost {
  background: #171c37;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background: #22284a;
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

/* Precision Progress Bar */
.progress-track {
  background: #0a0d20;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-fill {
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

/* Form Controls: Custom Inputs & Selects */
select, input[type="number"], input[type="text"] {
  background-color: #0e1228 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
  transition: all 0.2s ease;
}

select:focus, input:focus {
  border-color: #a78bfa !important;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25) !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #090a0d;
}
::-webkit-scrollbar-thumb {
  background: #232936;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #333c4f;
}

@media (max-width: 640px) {
  .admin-shell {
    width: min(100% - 24px, 1100px);
    padding-top: 28px;
  }

  .admin-login {
    margin: 20px auto;
    padding: 22px;
  }

  .admin-heading {
    align-items: start;
  }

  .admin-heading h1 {
    font-size: 24px;
  }

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

  .admin-metric {
    min-height: 100px;
    padding: 14px;
  }

  .admin-metric strong {
    font-size: 24px;
  }

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

  .stats-strip {
    margin-top: 4px;
    padding: 13px 12px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 12px;
  }

  .stat-item {
    min-height: 42px;
    padding-inline: 10px;
  }

  .stat-item:nth-child(3) {
    border-inline-start: 0;
    padding-inline-start: 0;
  }

  .stat-item:nth-child(4) {
    padding-inline-end: 0;
  }

  .stat-item strong {
    font-size: 17px;
  }

  .stat-item span {
    font-size: 9px;
  }

  .language-popover {
    inset-inline-end: -6px;
    width: min(286px, calc(100vw - 32px));
  }

  .tab-switcher {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    overflow: hidden;
  }

  .tab-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 3px;
    padding-inline: 6px !important;
    font-size: 11px;
    white-space: nowrap;
  }

  .tab-btn > span:first-child {
    display: none;
  }

  .tab-btn > span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

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