/* ================================================================
   Unique Store - SaaS Dashboard Design System (2026 Modern Edition)
   Font: Tajawal, Palette: Dark Slate + Indigo/Rose + Emerald/Amber
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  --dash-bg: #f8fafc;
  --dash-surface: #ffffff;
  --dash-border: #e2e8f0;
  --dash-border-subtle: #f1f5f9;
  
  --dash-text: #0f172a;
  --dash-text-muted: #64748b;
  --dash-text-light: #94a3b8;
  
  --dash-primary: #0284c7;
  --dash-primary-hover: #0369a1;
  --dash-primary-subtle: #e0f2fe;
  
  --dash-brand: #e11d48;
  --dash-brand-hover: #be123c;
  --dash-brand-subtle: #ffe4e6;
  
  --dash-sidebar-bg: #0f172a;
  --dash-sidebar-hover: #1e293b;
  --dash-sidebar-text: #94a3b8;
  --dash-sidebar-active-bg: rgba(56, 189, 248, 0.12);
  --dash-sidebar-active-text: #38bdf8;
  
  --dash-success: #10b981;
  --dash-success-subtle: #ecfdf5;
  --dash-success-text: #065f46;
  
  --dash-warning: #f59e0b;
  --dash-warning-subtle: #fffbeb;
  --dash-warning-text: #92400e;
  
  --dash-danger: #ef4444;
  --dash-danger-subtle: #fef2f2;
  --dash-danger-text: #991b1b;
  
  --dash-purple: #8b5cf6;
  --dash-purple-subtle: #f5f3ff;
  
  --dash-radius: 14px;
  --dash-radius-sm: 8px;
  --dash-radius-lg: 20px;
  --dash-radius-full: 9999px;
  
  --dash-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --dash-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --dash-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --dash-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--dash-bg) !important;
  color: var(--dash-text) !important;
  font-family: 'Tajawal', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  direction: rtl;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==================== Layout Shell ==================== */
.dashboard-shell {
  display: flex !important;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar */
.dashboard-sidebar {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 260px !important;
  background-color: var(--dash-sidebar-bg) !important;
  color: var(--dash-sidebar-text) !important;
  display: flex !important;
  flex-direction: column !important;
  z-index: 1040 !important;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15) !important;
  transition: transform 0.25s ease-in-out !important;
  overflow-y: auto !important;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff !important;
  text-decoration: none !important;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(225, 29, 72, 0.35);
  flex-shrink: 0;
}

.brand-info strong {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

.brand-info small {
  display: block;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.sidebar-close {
  display: none;
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
}

.user-info strong {
  display: block;
  font-size: 13.5px;
  color: #f8fafc;
  font-weight: 700;
}

.user-info .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #34d399;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #34d399;
  display: inline-block;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-grow: 1;
}

.sidebar-section {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748b;
  padding: 14px 12px 6px;
}

.sidebar-link {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  color: #94a3b8 !important;
  text-decoration: none !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.sidebar-link-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-link-content i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: color 0.15s ease;
}

.sidebar-link:hover {
  background-color: var(--dash-sidebar-hover) !important;
  color: #f8fafc !important;
}

.sidebar-link:hover .sidebar-link-content i {
  color: #38bdf8;
}

.sidebar-link.active {
  background-color: var(--dash-sidebar-active-bg) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-right: 3px solid #38bdf8 !important;
}

.sidebar-link.active .sidebar-link-content i {
  color: #38bdf8;
}

.nav-badge {
  background: #f43f5e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-logout button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 9px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sidebar-logout button:hover {
  background: #ef4444;
  color: #fff;
}

/* ==================== Main Area ==================== */
.dashboard-main {
  margin-right: 260px !important;
  width: calc(100% - 260px) !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-topbar {
  height: 64px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--dash-shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--dash-border);
  border-radius: 8px;
  font-size: 20px;
  color: var(--dash-text);
  padding: 4px 10px;
  cursor: pointer;
}

.topbar-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--dash-text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-store-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: #f1f5f9;
  color: #334155;
  padding: 7px 14px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease;
}

.topbar-store-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.topbar-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.topbar-pill.role-manager {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.topbar-pill.role-employee {
  background-color: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.dash-content {
  padding: 24px 28px 48px;
  flex-grow: 1;
}

.dashboard-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.dashboard-page-heading .eyebrow {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--dash-brand);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.dashboard-page-heading h1 {
  font-size: 22px;
  font-weight: 900;
  margin: 0;
  color: var(--dash-text);
}

/* ==================== Cards & Panels ==================== */
.dash-card {
  background-color: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 20px;
  box-shadow: var(--dash-shadow-sm);
  margin-bottom: 20px;
}

/* Stat Grid & Cards */
.stat-grid-modern {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin-bottom: 24px !important;
}

@media (max-width: 1200px) {
  .stat-grid-modern {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .stat-grid-modern {
    grid-template-columns: 1fr !important;
  }
}

.stat-card-modern {
  background: #ffffff !important;
  border: 1px solid var(--dash-border) !important;
  border-radius: var(--dash-radius) !important;
  padding: 18px 20px !important;
  box-shadow: var(--dash-shadow-sm) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}

.stat-card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--dash-shadow);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.stat-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dash-text-muted);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 16px;
}

.stat-icon.icon-revenue {
  background: #eff6ff;
  color: #0284c7;
}

.stat-icon.icon-delivery {
  background: #f0fdf4;
  color: #16a34a;
}

.stat-icon.icon-pending {
  background: #fffbeb;
  color: #d97706;
}

.stat-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--dash-text);
  line-height: 1.2;
  margin-bottom: 6px;
}

.stat-meta {
  font-size: 11.5px;
  color: var(--dash-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Rate progress bars */
.rate-progress-bar {
  height: 8px;
  background-color: #f1f5f9;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.rate-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.rate-progress-fill.fill-success {
  background-color: #10b981;
}

.rate-progress-fill.fill-danger {
  background-color: #ef4444;
}

/* ==================== Filter Tabs & Card ==================== */
.filter-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-bottom: 16px !important;
}

.filter-tab {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 16px !important;
  background-color: #ffffff !important;
  border: 1px solid var(--dash-border) !important;
  border-radius: 999px !important;
  color: #475569 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  transition: all 0.15s ease !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.filter-tab:hover {
  background-color: #f8fafc !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}

.filter-tab.active {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
}

.filter-card {
  background-color: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  box-shadow: var(--dash-shadow-sm);
}

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 5px;
}

/* ==================== Bulk Actions Floating Bar ==================== */
.bulk-actions-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background-color: #0f172a;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: var(--dash-shadow-md);
  animation: slideDown 0.2s ease-out;
}

.bulk-actions-bar.active {
  display: flex !important;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.bulk-actions-count {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.bulk-actions-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==================== Modern Table ==================== */
.table-card-modern {
  background-color: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  box-shadow: var(--dash-shadow-sm);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-card-header {
  padding: 16px 20px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-modern {
  margin-bottom: 0 !important;
  font-size: 13.5px;
}

.table-modern thead th {
  background-color: #f8fafc !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid var(--dash-border) !important;
  white-space: nowrap !important;
}

.table-modern tbody td {
  padding: 12px 14px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

.table-modern tbody tr:hover {
  background-color: #f8fafc !important;
}

.table-modern tbody tr.selected {
  background-color: #f0f9ff !important;
}

/* Product thumbnail */
.order-product-thumb {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--dash-border);
  background-color: #f8fafc;
  flex-shrink: 0;
}

.order-product-thumb-empty {
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 16px;
}

/* ==================== Status Badges ==================== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.status-PENDING { background-color: #fef3c7; color: #92400e; }
.status-CONFIRMED { background-color: #dbeafe; color: #1e40af; }
.status-READY { background-color: #ede9fe; color: #5b21b6; }
.status-DELIVERY { background-color: #e0f2fe; color: #0369a1; }
.status-DELIVERED { background-color: #d1fae5; color: #065f46; }
.status-CANCELLED, .status-CANCELLED_CUSTOMER { background-color: #fee2e2; color: #991b1b; }
.status-RETURNED { background-color: #ffedd5; color: #9a3412; }
.status-POSTPONED, .status-NO_ANSWER_1, .status-NO_ANSWER_2, .status-NO_ANSWER_3 { background-color: #f1f5f9; color: #475569; }

/* Status quick select dropdown inside table */
.status-badge-select {
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  width: auto !important;
  min-width: 120px !important;
}

/* Trust Badges */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
}

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

.trust-warning {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.trust-new {
  background-color: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.free-delivery-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  background-color: #f3e8ff;
  color: #7e22ce;
  padding: 2px 7px;
  border-radius: 999px;
}

/* ==================== Call & WhatsApp Buttons ==================== */
.call-btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #eff6ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.call-btn-lg:hover {
  background-color: #0284c7;
  color: #ffffff;
}

.whatsapp-btn-lg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 13.5px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.whatsapp-btn-lg:hover {
  background-color: #059669;
  color: #ffffff;
}

/* Buttons */
.btn-brand {
  background-color: var(--dash-brand) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  padding: 8px 16px !important;
}

.btn-brand:hover {
  background-color: var(--dash-brand-hover) !important;
  color: #ffffff !important;
}

.btn-soft-primary {
  background-color: #eff6ff !important;
  color: #0284c7 !important;
  border: 1px solid #bae6fd !important;
  font-weight: 700 !important;
  border-radius: 9px !important;
  padding: 8px 16px !important;
}

.btn-soft-primary:hover {
  background-color: #0284c7 !important;
  color: #ffffff !important;
}

/* Pagination container */
.pagination-container {
  padding: 12px 20px;
  background-color: #ffffff;
  border-top: 1px solid var(--dash-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* Info grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.info-label {
  font-size: 11.5px;
  color: var(--dash-text-muted);
  font-weight: 700;
}

.info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--dash-text);
}

.info-sub {
  font-size: 12px;
  color: var(--dash-text-muted);
}

/* Mobile Responsiveness */
@media (max-width: 992px) {
  .dashboard-sidebar {
    transform: translateX(105%) !important;
  }
  
  .dashboard-shell.sidebar-open .dashboard-sidebar {
    transform: translateX(0) !important;
  }
  
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    z-index: 1030;
  }
  
  .dashboard-shell.sidebar-open .sidebar-backdrop {
    display: block !important;
  }
  
  .sidebar-close {
    display: block !important;
  }
  
  .sidebar-toggle {
    display: block !important;
  }
  
  .dashboard-main {
    margin-right: 0 !important;
    width: 100% !important;
  }
  
  .dash-content {
    padding: 16px;
  }
}

/* ==================== Detail Page Enhancements ==================== */
.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.detail-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dash-text-muted);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.detail-header .back-link:hover {
  color: var(--dash-primary);
}

.detail-header h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}

.detail-header .header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-header .call-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  background-color: #eff6ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.detail-header .call-action:hover {
  background-color: #0284c7;
  color: #fff;
}

.detail-header .whatsapp-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  background-color: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

.detail-header .whatsapp-action:hover {
  background-color: #059669;
  color: #fff;
}

.section-card {
  background-color: #ffffff;
  border: 1px solid var(--dash-border);
  border-radius: var(--dash-radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--dash-shadow-sm);
}

.section-card h6 {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tel-link {
  color: var(--dash-primary);
  font-weight: 700;
  text-decoration: none;
}

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

.shipment-card {
  border-right: 4px solid var(--dash-border);
}

.shipment-card.ship-success {
  border-right-color: var(--dash-success);
}

.shipment-card.ship-error {
  border-right-color: var(--dash-danger);
}

.shipment-card.ship-pending {
  border-right-color: var(--dash-warning);
}
