@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Medium.ttf') format('truetype');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'Vazirmatn';
  src: url('/static/fonts/Vazirmatn-Black.ttf') format('truetype');
  font-weight: 900;
  font-display: swap;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

body {
  direction: rtl;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(80, 130, 255, 0.18), transparent 34%), linear-gradient(135deg, #f8fbff, #eef4ff);
  color: #1e293b;
  padding: 24px;
}

.container {
  max-width: 1450px;
  margin: 0 auto;
}

/* Header / TopNav */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 231, 255, 0.9);
  border-radius: 22px;
  box-shadow: 0 12px 35px rgba(31, 45, 78, 0.05);
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-box {
  width: 50px;
  height: 50px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(220, 231, 255, 0.8);
}

.logo-box img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

.brand-title {
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
}

.brand-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-top: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  font-size: 13px;
  font-weight: 700;
  color: #334155;
  background: #eef4ff;
  padding: 8px 16px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.logout-btn {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 12.5px;
  text-decoration: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.logout-btn:hover {
  background: #ffe4e6;
}

.time-badge {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  background: #eef4ff;
  padding: 8px 16px;
  border-radius: 14px;
  border: 1px solid #dbeafe;
}

.primary-btn {
  background: linear-gradient(135deg, #3217ff, #7c3cff);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 9px 18px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(68, 47, 255, 0.22);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(68, 47, 255, 0.3);
}

/* Auto-Pilot Banner */
.autopilot-banner {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(200, 220, 255, 0.9);
  border-radius: 20px;
  padding: 18px 24px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(31, 45, 78, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.autopilot-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.autopilot-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid #bfdbfe;
}

.autopilot-title {
  font-size: 15px;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.autopilot-desc {
  font-size: 12.5px;
  color: #64748b;
}

.autopilot-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auto-status-pill {
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 8px;
}

.auto-status-on {
  background: #dffcf1;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.auto-status-off {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 28px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

input:checked + .slider {
  background: linear-gradient(135deg, #10b981, #059669);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

.btn-config {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-config:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* KPI Summary Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.kpi-card {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(220, 231, 255, 0.9);
  border-radius: 22px;
  padding: 20px 24px;
  box-shadow: 0 14px 35px rgba(31, 45, 78, 0.05);
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(135deg, #083b7a, #008cff);
}

.kpi-title {
  font-size: 13px;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 24px;
  font-weight: 900;
  color: #0f172a;
}

.kpi-sub {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
}

/* Section Card & Table */
.section-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(220, 231, 255, 0.9);
  border-radius: 26px;
  padding: 24px;
  box-shadow: 0 18px 45px rgba(31, 45, 78, 0.08);
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.section-title {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.coin-category-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  background: #f1f5f9;
  color: #334155;
}

/* Collapsible Chart Styles */
.collapsible-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.collapse-toggle-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.collapse-toggle-btn:hover {
  background: #e2e8f0;
}

.collapse-chevron {
  transition: transform 0.3s ease;
  display: inline-block;
  font-size: 10px;
}

.chart-card.collapsed .collapse-chevron {
  transform: rotate(180deg);
}

.chart-collapsible-body {
  transition: all 0.3s ease;
  margin-top: 18px;
}

.chart-card.collapsed .chart-collapsible-body {
  display: none;
}

/* Chart Tabs */
.chart-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.tab-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.tab-btn.active {
  background: linear-gradient(135deg, #3217ff, #7c3cff);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(50, 23, 255, 0.25);
}

/* Data Table */
.data-table-container {
  overflow-x: auto;
  border-radius: 18px;
  border: 1px solid #e2e8f0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13.5px;
}

.data-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 800;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #1e293b;
}

.data-table tbody tr:hover {
  background: #f8faff;
}

/* Pills & Badges */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-active {
  background: #dffcf1;
  color: #047857;
}

.status-inactive {
  background: #fff1f2;
  color: #be123c;
}

.status-halted {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-weight: 900;
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.platform-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
}

.plat-dk {
  background: #fee2e2;
  color: #ef394e;
}

.plat-techno {
  background: #e0f2fe;
  color: #0284c7;
}

.plat-tapsi {
  background: #fef3c7;
  color: #d97706;
}

.buybox-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.buybox-won {
  background: #dffcf1;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.buybox-lost {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.price-tag {
  font-weight: 800;
  font-size: 14px;
}

.price-our {
  color: #0f172a;
}

.price-comp {
  color: #64748b;
  font-size: 12.5px;
}

.diff-positive {
  color: #be123c;
  font-size: 11.5px;
  font-weight: 700;
}

.diff-negative {
  color: #047857;
  font-size: 11.5px;
  font-weight: 700;
}

.action-link {
  color: #3b82f6;
  text-decoration: none;
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-link:hover {
  text-decoration: underline;
}

/* Margin Pills & Action Buttons */
.margin-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: #f0fdf4;
  color: #15803d;
  font-weight: 800;
  font-size: 12.5px;
  border: 1px solid #bbf7d0;
}

.edit-margin-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.edit-margin-btn:hover {
  background: #e2e8f0;
}

.optimal-target-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 900;
  font-size: 13px;
  border: 1px solid #bfdbfe;
}

.action-btn-optimal {
  background: linear-gradient(135deg, #3217ff, #7c3cff);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(50, 23, 255, 0.22);
  transition: all 0.2s;
}

.action-btn-optimal:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(50, 23, 255, 0.32);
}

.action-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
  transition: all 0.2s;
}

.action-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

.action-btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
  transition: all 0.2s;
}

.action-btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

/* In-DOM Custom Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}

.modal-card {
  background: #ffffff;
  border-radius: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(220, 231, 255, 0.9);
  overflow: hidden;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 18px 24px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #0f172a;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.btn-cancel {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 9px 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.btn-confirm {
  background: linear-gradient(135deg, #3217ff, #7c3cff);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(50, 23, 255, 0.25);
  transition: all 0.2s;
}

.btn-confirm:hover {
  transform: translateY(-1px);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-success {
  background: #047857;
  color: #fff;
}

.toast-error {
  background: #be123c;
  color: #fff;
}

/* =========================================================
   COMPREHENSIVE MOBILE & TABLET RESPONSIVENESS (< 768px)
   ========================================================= */

.mobile-field-label {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding: 8px 10px 30px 10px;
    background-attachment: fixed;
  }

  .container {
    padding: 0;
    max-width: 100%;
  }

  /* 1. Header / TopNav */
  .topnav {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
    border-radius: 16px;
    margin-bottom: 12px;
    gap: 10px;
  }

  .brand-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
  }

  .brand-section > div:nth-child(2) {
    flex: 1;
    min-width: 0;
  }

  .logo-box {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    flex-shrink: 0;
  }

  .brand-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .brand-subtitle {
    display: none;
  }

  .nav-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
  }

  .time-badge {
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 10px;
  }

  .primary-btn {
    flex: 1;
    justify-content: center;
    font-size: 12.5px;
    padding: 8px 12px;
    border-radius: 12px;
  }

  .user-pill {
    display: none;
  }

  .logout-btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 10px;
  }

  /* 2. Main Navigation Tabs (Smooth horizontal scrolling pill bar) */
  .main-nav-tabs {
    display: flex;
    gap: 8px;
    margin: 10px 0 16px 0;
    padding: 4px 2px 10px 2px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
  }

  .main-nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .main-nav-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12.5px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  }

  .main-nav-tab.active {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  }

  .main-nav-tab.active svg {
    stroke: #ffffff;
  }

  /* 3. Auto-Pilot Banner */
  .autopilot-banner {
    padding: 14px;
    border-radius: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .autopilot-info {
    gap: 10px;
  }

  .autopilot-icon {
    width: 36px;
    height: 36px;
    font-size: 17px;
    border-radius: 10px;
    flex-shrink: 0;
  }

  .autopilot-title {
    font-size: 13.5px;
    flex-wrap: wrap;
    gap: 6px;
  }

  .autopilot-desc {
    font-size: 11.5px;
    line-height: 1.5;
  }

  .autopilot-controls {
    justify-content: space-between;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid #e0f2fe;
  }

  /* 4. KPI Grid & Summary Cards (Clean 2x2 layout) */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .kpi-title {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .kpi-value {
    font-size: 17px;
  }

  .kpi-sub {
    font-size: 10px;
    margin-top: 3px;
  }

  /* 5. Shift & Commitments 4-box Grids */
  .shift-metrics-grid,
  .procure-kpi-preview {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .shift-metric-box,
  .kpi-preview-box {
    padding: 12px;
    border-radius: 12px;
  }

  .shift-metric-title,
  .kpi-preview-title {
    font-size: 11.5px;
    margin-bottom: 4px;
  }

  .shift-metric-count {
    font-size: 18px;
    margin-bottom: 4px;
  }

  .shift-metric-count span {
    font-size: 11px;
  }

  .shift-metric-net {
    font-size: 11px;
    line-height: 1.4;
  }

  .shift-current-card {
    padding: 14px;
    border-radius: 16px;
    margin-bottom: 16px;
  }

  .shift-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 14px;
  }

  .shift-card-title {
    font-size: 15px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .shift-rule-hint {
    font-size: 11px;
  }

  /* 6. Section Cards */
  .section-card {
    padding: 14px;
    border-radius: 18px;
    margin-bottom: 16px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }

  .section-title {
    font-size: 14.5px;
  }

  /* 7. Tables (Full tabular layout with smooth touch scrolling) */
  .data-table-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    margin: 8px 0 !important;
    position: relative;
  }

  .data-table {
    display: table !important;
    width: 100% !important;
    min-width: 580px !important;
    border-collapse: collapse !important;
  }

  .data-table thead {
    display: table-header-group !important;
  }

  .data-table tbody {
    display: table-row-group !important;
  }

  .data-table tr {
    display: table-row !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .data-table th,
  .data-table td {
    display: table-cell !important;
    padding: 9px 10px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    vertical-align: middle !important;
  }

  .data-table td:last-child {
    border-bottom: 1px solid #f1f5f9 !important;
  }

  .mobile-field-label {
    display: none !important;
  }

  /* 8. Live Orders Feed */
  .orders-feed-card {
    padding: 14px;
    border-radius: 16px;
  }

  .orders-feed-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
  }

  .orders-feed-actions {
    width: 100%;
    justify-content: space-between;
  }

  .orders-filter-tabs {
    overflow-x: auto;
    max-width: 100%;
    scrollbar-width: none;
  }

  .filter-tab {
    padding: 4px 10px;
    font-size: 11px;
    white-space: nowrap;
  }

  /* 9. Charts & Controls */
  .chart-tabs {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .tab-btn {
    padding: 5px 10px;
    font-size: 11.5px;
    border-radius: 8px;
    white-space: nowrap;
  }

  /* 10. Forms (iOS Zoom Prevention: font-size >= 16px) */
  .form-group input,
  .form-group select {
    font-size: 16px !important;
    padding: 10px 12px !important;
  }

  .procure-grid-form {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .live-calc-preview {
    grid-template-columns: repeat(2, 1fr) !important;
    padding: 12px !important;
    gap: 10px !important;
  }

  /* 11. Modals */
  .modal-backdrop {
    padding: 8px;
  }

  .modal-card {
    width: 96% !important;
    max-width: 96% !important;
    border-radius: 18px !important;
    max-height: 88vh !important;
  }

  .modal-header {
    padding: 12px 16px !important;
  }

  .modal-title {
    font-size: 14.5px !important;
  }

  .modal-body {
    padding: 14px !important;
  }

  .modal-footer {
    padding: 12px 16px !important;
  }
}


/* =========================================================
   Live Orders Feed & Real-time Indicator Styles
   ========================================================= */

.live-sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.live-indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse-ring 1.8s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.orders-feed-card {
  margin-bottom: 24px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.orders-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.orders-feed-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.live-pulse-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}

.pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse-ring 1.6s infinite ease-out;
}

.orders-feed-sub {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.orders-feed-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-sound-toggle:hover {
  background: #e2e8f0;
}

.btn-sound-toggle.muted {
  color: #94a3b8;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.orders-filter-tabs {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 12px;
  gap: 3px;
}

.filter-tab {
  background: transparent;
  border: none;
  padding: 5px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab:hover {
  color: #0f172a;
}

.filter-tab.active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.orders-stream-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-left: 4px;
}

.orders-stream-container::-webkit-scrollbar {
  width: 6px;
}

.orders-stream-container::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

.order-stream-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 16px;
  transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.order-stream-item:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.order-item-new {
  animation: slideInOrder 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}

@keyframes slideInOrder {
  0% {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.order-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.order-platform-tag {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 8px;
}

.order-platform-tag.plat-digikala {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.order-platform-tag.plat-tapsi {
  background: #ffedd5;
  color: #ea580c;
  border: 1px solid #fdba74;
}

.order-platform-tag.plat-technolife {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.order-coin-name {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  flex: 1;
  min-width: 140px;
}

.order-payment-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.order-payment-tag.pay-credit {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.order-payment-tag.pay-cash {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.order-price {
  font-size: 14px;
  font-weight: 900;
  color: #047857;
}

.order-time {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.order-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 8px;
}

.order-code strong {
  color: #1e293b;
}

.order-system-code {
  color: #94a3b8;
  font-family: monospace;
}

.order-detail-right {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.order-rel-time {
  color: #2563eb;
  font-weight: 700;
}

.orders-stream-empty {
  text-align: center;
  padding: 30px;
  color: #94a3b8;
  font-size: 13px;
}

/* Flash animation for table rows on live value update */
.row-live-highlight {
  animation: flashHighlight 1.5s ease-out;
}

@keyframes flashHighlight {
  0% {
    background-color: rgba(56, 189, 248, 0.25);
  }
  100% {
    background-color: transparent;
  }
}


/* Net Price Styles */
.net-price-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.net-price-label {
  color: #64748b;
  font-weight: 600;
  font-size: 10.5px;
}

.order-price-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: left;
}

.order-net-price {
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 2px;
  white-space: nowrap;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}


/* Main Navigation Tabs */
.main-nav-tabs {
  display: flex;
  gap: 10px;
  margin: 16px 0 20px 0;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 8px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-nav-tabs::-webkit-scrollbar {
  display: none;
}

.main-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.main-nav-tab:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.main-nav-tab.active {
  color: #0284c7;
  background: #e0f2fe;
}

/* Shifts View Styles */
.shift-current-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.shift-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.shift-card-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shift-current-badge {
  background: #dcfce7;
  color: #15803d;
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid #86efac;
}

.shift-rule-hint {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}

.shift-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 900px) {
  .shift-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 360px) {
  .shift-metrics-grid {
    grid-template-columns: 1fr !important;
  }
}

.shift-metric-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.shift-metric-box.total-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac;
}

.shift-metric-title {
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shift-metric-count {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 6px;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.shift-metric-count span {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-right: 4px;
}

.shift-metric-net {
  font-size: 13px;
  font-weight: 800;
  color: #059669;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.shift-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.shift-row-clickable:hover {
  background-color: #f8fafc;
}

.shift-row-selected {
  background-color: #e0f2fe !important;
}

.shift-net-col {
  font-weight: 800;
  color: #059669;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.shift-qty-badge {
  display: inline-block;
  background: #f1f5f9;
  color: #1e293b;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}


/* Procurement Form & Shift Real Profit Styles */
.procure-form-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04);
}

.procure-grid-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

@media (max-width: 900px) {
  .procure-grid-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .procure-grid-form {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}

.form-group input, .form-group select {
  font-family: inherit;
  font-size: 13.5px;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.form-group input:focus, .form-group select:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.live-calc-preview {
  background: #f8fafc;
  border: 1px dashed #94a3b8;
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 800px) {
  .live-calc-preview {
    grid-template-columns: repeat(2, 1fr);
  }
}

.calc-item-title {
  font-size: 11.5px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 3px;
}

.calc-item-val {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.btn-procure-submit {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  background: #0284c7;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.btn-procure-submit:hover {
  background: #0369a1;
}

.btn-procure-delete {
  background: transparent;
  color: #ef4444;
  border: 1px solid #fca5a5;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-procure-delete:hover {
  background: #fee2e2;
}

.shift-picker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.shift-picker-bar select {
  font-family: inherit;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  font-size: 13.5px;
}

.profit-positive {
  color: #059669 !important;
}

.profit-negative {
  color: #dc2626 !important;
}


/* Settlement Status & Badge Styles */
.badge-status-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-settled {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-procure-settle {
  background: #10b981;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-procure-settle:hover {
  background: #059669;
}

.btn-procure-unsettle {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-procure-unsettle:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.settle-calc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  margin: 16px 0;
}

.settle-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}

.settle-calc-row:last-child {
  border-bottom: none;
  padding-top: 10px;
  font-weight: 800;
  font-size: 14.5px;
}


/* === Custom Styled Select Boxes & Form Controls === */
select.custom-select,
.form-group select,
.shift-picker-bar select {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.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: left 12px center !important;
  background-size: 15px 15px !important;
  padding: 10px 14px 10px 36px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 9px !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #1e293b !important;
  outline: none !important;
  cursor: pointer !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

select.custom-select:hover,
.form-group select:hover,
.shift-picker-bar select:hover {
  border-color: #94a3b8 !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

select.custom-select:focus,
.form-group select:focus,
.shift-picker-bar select:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Shift Picker Bar refinement */
.shift-picker-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.shift-picker-bar .picker-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  color: #0f172a;
}

.shift-picker-bar select {
  min-width: 200px;
  background-color: #ffffff !important;
}

/* Number inputs clean up (remove ugly default spinner arrows) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
}

/* Table action buttons refine */
.btn-procure-edit {
  background: #f8fafc;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-procure-edit:hover {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #7dd3fc;
}

/* In-DOM Custom Confirm Modal */
.confirm-modal-box {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  text-align: center;
  position: relative;
  border: 1px solid #e2e8f0;
}

.confirm-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 24px;
}
.confirm-icon-danger {
  background: #fee2e2;
  color: #ef4444;
}
.confirm-icon-warning {
  background: #fef3c7;
  color: #d97706;
}
.confirm-icon-info {
  background: #e0f2fe;
  color: #0284c7;
}

.confirm-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.confirm-msg {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 22px;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn-confirm-danger {
  background: #ef4444 !important;
  color: #ffffff !important;
  border: none !important;
}
.btn-confirm-danger:hover {
  background: #dc2626 !important;
}


/* === In-DOM Pure Custom Dropdown Component === */
.custom-dd {
  position: relative;
  width: 100%;
  user-select: none;
}

.custom-dd-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 9px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.custom-dd-trigger:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06);
}

.custom-dd.open .custom-dd-trigger {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.custom-dd-arrow {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.custom-dd.open .custom-dd-arrow {
  transform: rotate(180deg);
  color: #0284c7;
}

.custom-dd-menu {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  left: 0;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 11px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.12), 0 8px 12px -6px rgba(0, 0, 0, 0.06);
  max-height: 250px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
  padding: 6px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.custom-dd.open .custom-dd-menu {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.custom-dd-menu::-webkit-scrollbar {
  width: 6px;
}
.custom-dd-menu::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 6px;
}
.custom-dd-menu::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
}
.custom-dd-menu::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.custom-dd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-dd-item:hover {
  background: #f0f9ff;
  color: #0284c7;
}

.custom-dd-item.selected {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
}

.custom-dd-item-check {
  font-size: 14px;
  font-weight: 800;
  color: #0284c7;
  opacity: 0;
}

.custom-dd-item.selected .custom-dd-item-check {
  opacity: 1;
}

.custom-dd-item-badge {
  font-size: 11px;
  background: #dbeafe;
  color: #1e40af;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 700;
  margin-right: 8px;
}


/* === Global Pure Form Inputs & Coin Cards === */
input[type="text"],
input[type="number"],
input[type="password"] {
  font-family: inherit !important;
  font-size: 13.5px !important;
  padding: 9px 12px !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 8px !important;
  outline: none !important;
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-variant-numeric: normal !important;
  font-feature-settings: normal !important;
  transition: all 0.15s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

input[type="text"]:hover,
input[type="number"]:hover {
  border-color: #94a3b8 !important;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #0284c7 !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

/* Coin Split Cards Grid */
.coin-split-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}

.coin-split-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.coin-split-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #0284c7, #38bdf8);
  opacity: 0.8;
}

.coin-split-card:hover {
  border-color: #bae6fd;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.coin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #e2e8f0;
}

.coin-card-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.coin-field-wrap {
  margin-bottom: 10px;
}

.coin-field-wrap:last-of-type {
  margin-bottom: 0;
}

.coin-field-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 4px;
}

.coin-card-subtotal {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 11.5px;
  color: #0284c7;
  font-weight: 800;
  text-align: left;
  direction: ltr;
}

/* Refined 4-card KPI live preview */
.procure-kpi-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-top: 18px;
}

.kpi-preview-box {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.kpi-preview-title {
  font-size: 11.5px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 6px;
}

.kpi-preview-value {
  font-size: 14.5px;
  font-weight: 800;
  color: #0f172a;
}


/* Coverage Breakdown Badges */
.cov-item-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: normal;
  font-feature-settings: normal;
}

.cov-item-complete {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.cov-item-pending {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Shift Status Sub-bar & Chips */
.shift-status-sub-bar {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}

.status-chip {
  padding: 2px 6px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease-in-out;
}

.status-chip:hover {
  transform: translateY(-1px);
  filter: brightness(0.92);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.platform-chip {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease-in-out;
}

.platform-chip:hover {
  transform: translateY(-1px);
  filter: brightness(0.92);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
}

.chip-active {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.chip-shipped {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.chip-uncertain {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.chip-cancelled {
  background: #fee2e2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

/* Spinner Animation & Disabled State */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.spin-anim {
  animation: spin 0.9s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

.primary-btn:disabled {
  opacity: 0.75 !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}
