/* ==========================================================================
   khotwa LOGISTICS ERP - OPERATIONS DASHBOARD STYLES (operations.css)
   Exact match to Screenshots 3, 4, 5:
   - Header with Quick Action Pills and Branch Selector
   - Dark Sleek Right Sidebar (v4.10.261)
   - Pink Glow Cards, Status Adjustments & 5-Pillar Referrals
   ========================================================================== */

.operations-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: #f4f8fb;
}

/* ==========================================================================
   1. GLOBAL TOP HEADER (Navbar)
   ========================================================================== */
.ops-top-header {
  height: 64px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.ops-header-brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ops-khotwa-logo,
.ops-codex-logo {
  font-family: var(--font-arabic);
  font-size: 1.85rem;
  font-weight: 900;
  color: #0284c7;
  letter-spacing: -0.5px;
  text-decoration: none;
}

.ops-brand-subtitle {
  background: #f0f9ff;
  color: #0284c7;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  border: 1px solid #bae6fd;
}

/* Search Bar */
.ops-search-box {
  position: relative;
  width: 320px;
}

.ops-search-input {
  width: 100%;
  height: 38px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-full);
  padding: 0 38px 0 16px;
  font-family: var(--font-arabic);
  font-size: 0.88rem;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.ops-search-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199,  0.12);
}

.ops-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #0284c7;
  font-size: 0.95rem;
  pointer-events: none;
}

/* Quick Action Pills in Header */
.ops-header-actions-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ops-action-pill {
  background: #ffffff;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ops-action-pill:hover {
  background: #e0f2fe;
  border-color: #0284c7;
  color: #0284c7;
}

.ops-action-pill.dropdown-pill {
  position: relative;
}

.ops-menu-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #1e40af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

/* User & Branch selector on far side */
.ops-user-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.ops-user-badge-header:hover {
  background: #f0f9ff;
}

.ops-user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #1e40af);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ops-user-name-text {
  font-size: 0.86rem;
  font-weight: 700;
  color: #1e293b;
}

.ops-branch-select-tag {
  color: #64748b;
  font-size: 0.82rem;
}

/* ==========================================================================
   2. MAIN WORKSPACE WITH RIGHT DARK SIDEBAR
   ========================================================================== */
.ops-workspace-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Central Content Container (Left / Center) */
.ops-main-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  background: radial-gradient(circle at 80% 10%, #fde8ed 0%, transparent 35%),
              #faf5f6;
}

/* Right Sidebar (Dark Theme matching image 3, 4, 5) */
.ops-dark-sidebar {
  width: 250px;
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  user-select: none;
  z-index: 40;
}

.sidebar-header-branding {
  padding: 1.25rem 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-version-pill {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 0.68rem;
  font-family: var(--font-en);
  padding: 2px 8px;
  border-radius: 4px;
}

.sidebar-khotwa-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-khotwa-name {
  color: #ffffff;
  font-family: var(--font-en);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.sidebar-system-badge {
  background: #0284c7;
  color: #ffffff;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.sidebar-ops-subtitle {
  color: #94a3b8;
  font-size: 0.72rem;
}

/* Fast Search inputs in top of sidebar */
.sidebar-quick-inputs {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-input-wrap {
  position: relative;
  width: 100%;
}

.sidebar-input-field {
  width: 100%;
  height: 32px;
  background: var(--sidebar-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #e2e8f0;
  font-family: var(--font-arabic);
  font-size: 0.78rem;
  padding: 0 28px 0 8px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.sidebar-input-field:focus {
  border-color: #0284c7;
}

.sidebar-input-icon {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #64748b;
  font-size: 0.85rem;
}

/* Sidebar Menu Navigation List */
.sidebar-menu-nav {
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #f1f5f9;
}

.sidebar-nav-item.active {
  background: #0284c7;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2, 132, 199,  0.35);
}

.sidebar-nav-item i {
  font-size: 0.95rem;
  width: 18px;
  text-align: center;
}

.sidebar-nav-item .nav-count-badge {
  margin-right: auto;
  background: rgba(255, 255, 255, 0.15);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 10px;
  color: #ffffff;
}

/* Sidebar Footer User & Status */
.sidebar-footer-card {
  padding: 0.85rem 1rem;
  background: var(--sidebar-card-bg);
  border-top: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-user-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-user-identity {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e293b;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-user-title {
  color: #f8fafc;
  font-size: 0.82rem;
  font-weight: 700;
}

.sidebar-system-online-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.online-status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #10b981;
}

.online-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.sidebar-logout-btn {
  color: #94a3b8;
  font-size: 0.74rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  transition: color var(--transition-fast);
}

.sidebar-logout-btn:hover {
  color: #ef4444;
}

/* ==========================================================================
   3. OPERATIONS MAIN VIEWPORT COMPONENTS
   ========================================================================== */

/* Top Heading & Branch Metadata */
.ops-title-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.75rem;
}

.ops-branch-last-update-pill {
  background: #ffffff;
  border: 1px solid #bae6fd;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.branch-name-bold {
  color: #0284c7;
  font-weight: 800;
  font-size: 0.95rem;
}

.last-update-timestamp {
  color: #64748b;
  font-size: 0.78rem;
  font-family: var(--font-en);
}

.ops-section-badge {
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.ops-main-heading {
  font-size: 1.85rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 0.25rem;
}

.ops-subheading-tag {
  color: #0284c7;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Status Adjustment Action Card (Matching the deep pink card in screenshot) */
.ops-action-card-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.ops-status-adjust-card {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.status-adjust-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.status-adjust-label {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
}

.status-adjust-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e293b;
}

.status-adjust-circle-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e40af;
  box-shadow: 0 4px 16px rgba(192, 30, 82, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.3rem;
}

.status-adjust-actions {
  display: flex;
  gap: 8px;
  margin-top: 1.25rem;
}

.btn-fast-action {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-arabic);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
}

.btn-primary-action {
  background: var(--color-primary);
  color: #ffffff;
}

.btn-primary-action:hover {
  background: var(--color-primary-dark);
}

.btn-secondary-action {
  background: #f0f9ff;
  color: #1e40af;
  border: 1px solid #bae6fd;
}

.btn-secondary-action:hover {
  background: #e0f2fe;
}

/* ==========================================================================
   4. REFERRAL ROW (الإحالات - Five Pillars from Screenshots)
   ========================================================================== */
.referral-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.referral-cards-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.referral-card {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.referral-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: background var(--transition-fast);
}

.referral-card:hover {
  transform: translateY(-3px);
  border-color: #0ea5e9;
  box-shadow: 0 10px 24px rgba(2, 132, 199,  0.1);
}

.referral-card:hover::before {
  background: var(--color-primary);
}

.referral-card-icon-bubble {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e40af;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(192, 30, 82, 0.25);
}

.referral-card-category {
  font-size: 0.86rem;
  font-weight: 700;
  color: #64748b;
}

.referral-card-count {
  font-size: 1.45rem;
  font-weight: 900;
  color: #1e293b;
}

/* ==========================================================================
   5. INTERACTIVE DEMO TOOLS: BARCODE WEDGE & DUAL CLOSING PANELS
   ========================================================================== */
.ops-interactive-panels-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.interactive-card {
  background: #ffffff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.interactive-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.interactive-card-title i {
  color: #0284c7;
}

/* Barcode input wedge simulator */
.barcode-wedge-box {
  display: flex;
  gap: 8px;
  margin-bottom: 1rem;
}

.barcode-wedge-input {
  flex: 1;
  height: 42px;
  background: #f0f9ff;
  border: 2px dashed #0ea5e9;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: var(--font-en);
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e293b;
  outline: none;
}

.barcode-wedge-input:focus {
  background: #ffffff;
  border-style: solid;
}

.barcode-scan-feed {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  max-height: 140px;
  overflow-y: auto;
  font-size: 0.78rem;
  font-family: var(--font-en);
}

.feed-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #e2e8f0;
}

.feed-item:last-child {
  border-bottom: none;
}

/* Dual closing simulator */
.dual-closing-step-box {
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-sm);
  padding: 0.9rem;
  margin-bottom: 0.75rem;
}

.dual-closing-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.dual-closing-step-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge-pending {
  background: #fef3c7;
  color: #d97706;
}

.status-badge-success {
  background: #d1fae5;
  color: #059669;
}

/* Modals & Drawers */
.ops-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ops-modal-overlay.active {
  display: flex;
}

.ops-modal-window {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  box-shadow: var(--shadow-lg);
  border: 1px solid #e0f2fe;
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.ops-modal-header {
  padding: 1.25rem 1.5rem;
  background: #f0f9ff;
  border-bottom: 1px solid #e0f2fe;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ops-modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #1e293b;
}

.ops-modal-close-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
}

.ops-modal-close-btn:hover {
  color: #ef4444;
}

.ops-modal-body {
  padding: 1.5rem;
}
