/* NEURA OS - Obsidian & Champagne Gold Architectural Standard */

:root {
  --bg-deep-void: #02050b;
  --bg-surface-1: #08101e;
  --bg-surface-2: #0c172b;
  --gold-100: #fbf3de;
  --gold-200: #f2dfa8;
  --gold-300: #e3c16e;
  --gold-400: #d4a644;
  --gold-500: #be8c28;
  --border-hairline: rgba(227, 193, 110, 0.18);
  --border-hairline-hover: rgba(242, 223, 168, 0.48);
  --text-title: #f8fafc;
  --text-main: #e2e8f0;
  --text-sub: #b4c2d6;
  --text-muted: #7f91aa;
  --status-green: #4ade80;
  --status-yellow: #fbbf24;
  --status-red: #f87171;
  --status-blue: #60a5fa;
  --status-purple: #c084fc;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  background-color: var(--bg-deep-void);
  color: var(--text-main);
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  direction: rtl;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background: radial-gradient(ellipse 80% 45% at 50% 0%, #09172e 0%, #030812 50%, #02050b 100%);
  background-attachment: fixed;
  position: relative;
}

/* Subtle Architectural Grid Overlay (Calm, Minimal Executive Backdrop) */
.architectural-grid-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, rgba(227, 193, 110, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(227, 193, 110, 0.03) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 25%, #000 30%, transparent 100%);
}

/* Tabular Numbers Discipline */
.tabular-nums,
[id$="-amount"],
[id$="-count"],
[id$="-val"],
[id$="-display"],
.num-tabular {
  font-variant-numeric: tabular-nums;
}

/* Obsidian Glass Surface Cards (Single-Elevation Discipline) */
.cyber-glass-card,
.obsidian-card {
  background: linear-gradient(155deg, rgba(10, 20, 38, 0.82) 0%, rgba(4, 8, 16, 0.94) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border-hairline);
  border-radius: 18px !important;
  box-shadow: 0 14px 36px -14px rgba(0, 0, 0, 0.72);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cyber-glass-card:hover,
.obsidian-card:hover {
  border-color: var(--border-hairline-hover);
}

/* Sticky Glass Header & Bottom Navigation Dock */
.glass-header {
  background: rgba(4, 8, 17, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-hairline);
}

.glass-dock {
  background: rgba(4, 8, 17, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border-hairline);
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* Primary Gold CTA & Secondary Architectural Buttons */
.btn-gold-primary {
  background: linear-gradient(135deg, #fbf3de 0%, #edd184 30%, #c99733 72%, #916719 100%);
  color: #030813 !important;
  border: 1px solid rgba(242, 223, 168, 0.65);
  border-radius: 999px;
  font-weight: 800;
  transition: opacity 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}
.btn-gold-primary:hover {
  opacity: 0.93;
}
.btn-gold-primary:active {
  transform: scale(0.98);
}

.btn-gold-outline {
  background: rgba(12, 23, 43, 0.75);
  color: var(--gold-200);
  border: 1px solid var(--border-hairline);
  border-radius: 10px;
  font-weight: 600;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
}
.btn-gold-outline:hover {
  border-color: var(--border-hairline-hover);
  background: rgba(227, 193, 110, 0.1);
}

.neura-action-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
  cursor: pointer;
}
.neura-action-btn:active {
  transform: scale(0.97);
}

/* Department Filter Pills */
.dept-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 4px 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
}
.dept-bar::-webkit-scrollbar {
  display: none;
}

.dept-pill {
  padding: 6px 13px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: rgba(8, 16, 30, 0.78);
  color: var(--text-sub);
  white-space: nowrap;
  flex-shrink: 0;
  touch-action: pan-x pan-y;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dept-pill:hover {
  border-color: var(--border-hairline-hover);
  color: var(--gold-100);
}
.dept-pill.active {
  background: linear-gradient(135deg, #fbf3de 0%, #edd184 30%, #c99733 72%, #916719 100%);
  color: #030813;
  border-color: var(--gold-200);
}

.dock-btn {
  flex-shrink: 0;
  white-space: nowrap;
  touch-action: pan-x pan-y;
}

/* Playbook Stepper (Dynamic Stages per Holding Department) */
.stepper-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin: 12px 0 8px 0;
  width: 100%;
}

.stepper-progress-line {
  position: absolute;
  top: 50%;
  left: 12px;
  right: 12px;
  height: 2px;
  background: rgba(127, 145, 170, 0.24);
  transform: translateY(-50%);
  z-index: 1;
}

.stepper-active-line {
  position: absolute;
  top: 50%;
  right: 12px;
  height: 2px;
  background: linear-gradient(to left, var(--gold-300), var(--gold-100));
  transform: translateY(-50%);
  z-index: 2;
  transition: width 0.35s ease;
}

.stepper-node {
  position: relative;
  z-index: 3;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  transition: all 0.25s ease;
  background: var(--bg-surface-1);
  border: 1px solid rgba(227, 193, 110, 0.25);
  color: var(--text-muted);
}

.stepper-node.completed {
  background: var(--gold-400);
  border-color: var(--gold-200);
  color: #030813;
}

.stepper-node.active {
  background: var(--gold-100);
  border-color: var(--gold-300);
  color: #030813;
}

.stepper-node.stage-zero-active {
  background: var(--status-yellow);
  border-color: var(--gold-100);
  color: #030813;
}

/* Modal Backdrop */
.modal-backdrop {
  background: rgba(2, 5, 11, 0.84);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep-void);
}
::-webkit-scrollbar-thumb {
  background: rgba(227, 193, 110, 0.25);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gold-300);
}

/* Split Leagues Podium */
.leaderboard-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: flex-end;
  padding: 20px 8px 8px 8px;
  width: 100%;
}

.podium-pedestal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  border-radius: 18px 18px 10px 10px;
  padding: 12px 8px 10px 8px;
  text-align: center;
  position: relative;
  transition: border-color 0.25s ease;
  flex: 1;
  max-width: 150px;
  margin: 0 auto;
}

.podium-rank-1 {
  height: 155px;
  background: linear-gradient(180deg, rgba(227, 193, 110, 0.22) 0%, rgba(8, 16, 30, 0.92) 100%);
  border: 1px solid rgba(242, 223, 168, 0.55);
  order: 2;
}

.podium-rank-2 {
  height: 128px;
  background: linear-gradient(180deg, rgba(180, 194, 214, 0.16) 0%, rgba(8, 16, 30, 0.9) 100%);
  border: 1px solid rgba(180, 194, 214, 0.35);
  order: 3;
}

.podium-rank-3 {
  height: 108px;
  background: linear-gradient(180deg, rgba(190, 140, 40, 0.16) 0%, rgba(8, 16, 30, 0.9) 100%);
  border: 1px solid rgba(190, 140, 40, 0.35);
  order: 1;
}

.podium-crown {
  position: absolute;
  top: -22px;
  font-size: 20px;
}

/* Interactive Input Rules */
input, textarea, select {
  user-select: text !important;
  -webkit-user-select: text !important;
  pointer-events: auto !important;
  touch-action: auto !important;
  position: relative;
  z-index: 20;
}

button {
  pointer-events: auto !important;
  touch-action: manipulation;
  cursor: pointer;
}

.portal-tab {
  position: relative;
  z-index: 10;
}

#escalation-form input,
#escalation-form textarea,
#escalation-form select,
#escalation-form button,
#escalation-form label {
  position: relative !important;
  z-index: 30 !important;
  pointer-events: auto !important;
}

/* Capsule Chips (1-Click Calendar & Filter Pills) */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.capsule-chip {
  padding: 6px 13px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface-1);
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.capsule-chip:hover {
  border-color: var(--border-hairline-hover);
  color: var(--gold-100);
}

.capsule-chip.active,
.capsule-chip-hour.active {
  background: linear-gradient(135deg, #fbf3de 0%, #edd184 30%, #c99733 72%, #916719 100%);
  border-color: var(--gold-200);
  color: #030813;
}

/* 10 Distinct Approved Calendar Event Accents (Aligned 100% with CALENDAR_COLOR_CODES) */
.cal-legend-rail {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
}
.cal-legend-rail::-webkit-scrollbar {
  display: none;
}
.cal-legend-chip {
  flex-shrink: 0;
  white-space: nowrap;
  touch-action: pan-x pan-y;
}

/* Visible Champagne Gold Horizontal Scroll Container for Dense Tables */
.neura-x-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(227, 193, 110, 0.45) rgba(2, 5, 11, 0.65);
}
.neura-x-scroll::-webkit-scrollbar {
  height: 6px;
}
.neura-x-scroll::-webkit-scrollbar-track {
  background: rgba(2, 5, 11, 0.65);
  border-radius: 9999px;
}
.neura-x-scroll::-webkit-scrollbar-thumb {
  background: rgba(227, 193, 110, 0.42);
  border-radius: 9999px;
}
.neura-x-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(242, 223, 168, 0.72);
}

.neura-desktop-only {
  display: none;
}
.neura-desktop-inline-flex {
  display: none;
}
.neura-mobile-only {
  display: block;
}
@media (min-width: 768px) {
  .neura-desktop-only {
    display: block;
  }
  .neura-desktop-inline-flex {
    display: inline-flex;
  }
  .neura-mobile-only {
    display: none;
  }
}

.neura-event-card {
  --ev-accent: #e3c16e;
  --ev-accent-dot-border: transparent;
  --ev-accent-text: #f2dfa8;
  background: linear-gradient(155deg, rgba(10, 19, 36, 0.94) 0%, rgba(5, 10, 20, 0.98) 100%);
  border: 1px solid color-mix(in srgb, var(--ev-accent) 26%, rgba(227, 193, 110, 0.14));
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--ev-accent) 38%, transparent), 0 10px 26px -14px rgba(0, 0, 0, 0.72);
  color: #f8fafc;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.neura-event-card:hover {
  border-color: color-mix(in srgb, var(--ev-accent) 50%, rgba(242, 223, 168, 0.35));
  transform: translateY(-1px);
}

.event-card-defense, .event-box-defense {
  --ev-accent: #111111;
  --ev-accent-dot-border: rgba(255, 255, 255, 0.6);
  --ev-accent-text: #F8FAFC;
  background: linear-gradient(155deg, rgba(17, 17, 17, 0.97) 0%, rgba(4, 4, 6, 0.99) 100%);
  border-color: rgba(255, 255, 255, 0.22);
}
.event-card-contract, .event-box-contract {
  --ev-accent: #FFFFFF;
  --ev-accent-text: #FFFFFF;
}
.event-card-consultation, .event-box-consultation {
  --ev-accent: #00E599;
  --ev-accent-text: #00E599;
}
.event-card-deadline, .event-box-deadline {
  --ev-accent: #FF8800;
  --ev-accent-text: #FF8800;
}
.event-card-overdue, .event-box-overdue {
  --ev-accent: #FF4D4D;
  --ev-accent-text: #FF6B6B;
  background: linear-gradient(155deg, rgba(42, 12, 18, 0.92) 0%, rgba(12, 7, 14, 0.98) 100%);
}
.event-card-inperson, .event-box-inperson {
  --ev-accent: #FFCC00;
  --ev-accent-text: #FFCC00;
}
.event-card-followup, .event-box-followup {
  --ev-accent: #0099FF;
  --ev-accent-text: #38BDF8;
}
.event-card-casefile, .event-box-casefile {
  --ev-accent: #8B5CF6;
  --ev-accent-text: #A78BFA;
}
.event-card-interview, .event-box-interview {
  --ev-accent: #EC4899;
  --ev-accent-text: #F472B6;
}
.event-card-automation, .event-box-automation,
.event-card-evaluation, .event-box-evaluation {
  --ev-accent: #0D9488;
  --ev-accent-text: #2DD4BF;
}

@keyframes neuraSlideUp {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.neura-drawer-panel {
  animation: neuraSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Restraint Alerts & Floating Points */
.manager-red-pulse {
  border: 1px solid rgba(248, 113, 113, 0.72) !important;
}

.recording-pulse {
  background: #dc2626 !important;
  color: #fff !important;
}

@keyframes float-up-xp {
  0% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -64px); }
}

.xp-floating-element {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-weight: 800;
  font-size: 14px;
  color: var(--gold-200);
  animation: float-up-xp 1.1s ease-out forwards;
}

.np-spark {
  display: inline-block;
  color: var(--gold-100);
}

/* File Preview Grid & Lightbox */
.file-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.file-preview-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-hairline);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.file-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(248, 113, 113, 0.9);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  border: none;
  z-index: 5;
}

#modal-lightbox .lightbox-img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--border-hairline);
}

.dropzone-cyber {
  border: 1.5px dashed rgba(227, 193, 110, 0.35);
  border-radius: 16px;
  background: rgba(8, 16, 30, 0.65);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.dropzone-cyber.dragover,
.dropzone-cyber:hover {
  border-color: var(--gold-300);
  background: rgba(227, 193, 110, 0.08);
}

.ai-pre-clearance-box {
  background: linear-gradient(155deg, rgba(12, 23, 43, 0.9) 0%, rgba(8, 16, 30, 0.96) 100%);
  border: 1px solid var(--border-hairline);
}

/* Desktop Spacing & Layout Fluidity */
@media (min-width: 1024px) {
  main {
    max-width: 1400px !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }

  .cyber-glass-card {
    padding: 1.35rem !important;
    border-radius: 20px !important;
  }

  .cyber-glass-card.max-w-md,
  .cyber-glass-card.max-w-lg {
    max-width: 680px !important;
  }
}

@media (min-width: 1536px) {
  main {
    max-width: 1640px !important;
  }
}

/* Keyboard Accessibility & Smooth Focus Rings */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(242, 223, 168, 0.72);
  outline-offset: 2px;
}

.cyber-glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  border-top: 1px solid rgba(251, 243, 222, 0.08);
}
