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

:root {
  --font-arabic: 'Tajawal', sans-serif;
  --font-english: 'Outfit', sans-serif;

  /* Color Palette - Elegant Premium Green & Gold */
  --primary: #1b4332;
  --primary-light: #2d6a4f;
  --primary-dark: #081c15;
  
  --secondary: #d4af37; /* Metallic Gold */
  --secondary-light: #f3e5ab;
  --secondary-dark: #aa7c11;

  --accent-red: #e63946;
  --accent-green: #2a9d8f;
  --accent-blue: #457b9d;

  --bg-main: #f4f6f3;
  --bg-card: #ffffff;
  --bg-sidebar: #0f2a1d;
  
  --text-main: #2f3e36;
  --text-muted: #6e7e75;
  --text-on-dark: #e8f5e9;

  --border-color: rgba(27, 67, 50, 0.1);
  --border-radius-sm: 10px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-arabic), var(--font-english), sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  direction: rtl;
  overflow-x: hidden;
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */
.login-body {
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
  position: relative;
  min-height: 100vh;
  padding: 20px;
}

.login-body::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background: radial-gradient(circle at 80% 20%, rgba(212, 175, 55, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 10% 80%, rgba(45, 106, 79, 0.4) 0%, transparent 60%);
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  padding: 36px 28px;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--secondary);
  margin-bottom: 12px;
  box-shadow: var(--shadow-md);
}

.login-header h2 {
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-header p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.form-group {
  margin-bottom: 16px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  color: var(--text-main);
  background: #fafbfa;
  transition: var(--transition-fast);
  font-family: inherit;
  min-height: 46px;
}

.form-control:focus {
  border-color: var(--primary);
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.12);
}

.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.2);
  font-family: inherit;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: scale(0.98);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   Dashboard Main Layout
   ========================================================================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar Backdrop on Mobile */
.sidebar-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.show {
  display: block;
  opacity: 1;
}

/* Sidebar Styling */
.sidebar {
  width: 280px;
  background: var(--bg-sidebar);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  position: fixed;
  top: 0; bottom: 0; right: 0;
  z-index: 999;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--secondary);
}

.sidebar-logo-text {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}

.sidebar-logo-text span {
  display: block;
  font-size: 11px;
  color: var(--secondary);
  font-weight: 500;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  font-size: 14.5px;
  transition: var(--transition-fast);
}

.nav-item.active a, .nav-item a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.nav-item.active a {
  border-right: 4px solid var(--secondary);
  background: rgba(212, 175, 55, 0.15);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-sm);
}

.user-badge-info h4 {
  font-size: 14px;
  font-weight: 700;
}

.user-badge-info span {
  font-size: 11.5px;
  color: var(--secondary);
}

.btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--accent-red);
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: var(--border-radius-sm);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
}

.btn-logout:hover {
  background: rgba(230, 57, 70, 0.1);
  border-color: var(--accent-red);
}

/* Main Content Area */
.main-content {
  margin-right: 280px;
  flex: 1;
  padding: 30px;
  min-height: 100vh;
  transition: var(--transition-normal);
  max-width: 100%;
}

/* Top Header */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 12px;
}

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

.page-title h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 2px;
}

.page-title p {
  color: var(--text-muted);
  font-size: 13.5px;
}

.menu-toggle-dash {
  display: none;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  padding: 8px;
}

.menu-toggle-dash span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: var(--primary);
  margin: 4px auto;
  border-radius: 2px;
}

.date-badge {
  background: #fff;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  border: 1px solid var(--border-color);
}

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

.kpi-card {
  background: var(--bg-card);
  padding: 18px 20px;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-normal);
}

.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.kpi-card-info h3 {
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.kpi-card-info .kpi-val {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-english);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(45, 106, 79, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--primary-light);
}

.kpi-card:nth-child(2) .kpi-icon {
  background: rgba(212, 175, 55, 0.1);
}

.kpi-card:nth-child(3) .kpi-icon {
  background: rgba(230, 57, 70, 0.08);
}

.kpi-card:nth-child(4) .kpi-icon {
  background: rgba(42, 157, 143, 0.08);
}

/* Dashboard Sections */
.dashboard-section {
  display: none;
}

.dashboard-section.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

/* Panels */
.panel {
  background: var(--bg-card);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  padding: 20px;
  margin-bottom: 24px;
}

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

.panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  min-width: 650px;
}

.custom-table th {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border-color);
  font-size: 13.5px;
  background: #fafbfa;
}

.custom-table td {
  padding: 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13.5px;
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tr:hover {
  background-color: #fafbfa;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.status-new { background: #e8f5e9; color: var(--primary-light); }
.status-pending { background: #fff8e1; color: var(--secondary-dark); }
.status-shipping { background: #e3f2fd; color: var(--accent-blue); }
.status-delivered { background: #e0f2f1; color: var(--accent-green); }
.status-returned { background: #ffebee; color: var(--accent-red); }
.status-cancelled { background: #eeeeee; color: #757575; }
.status-apologized { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

/* Inline Status Badge Select (تغيير حالة الطلب مباشرة من الجدول) */
.status-badge-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px 4px 22px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  outline: none;
  font-family: inherit;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-repeat: no-repeat;
  background-position: left 7px center;
  background-size: 10px 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23334155' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  line-height: 1.3;
}

.status-badge-select:hover {
  filter: brightness(0.96);
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.status-badge-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 67, 50, 0.15);
}

.status-badge-select option {
  background-color: #ffffff !important;
  color: #1e293b !important;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 12px;
}

.status-badge-select.status-new { background-color: #e8f5e9; color: var(--primary-light); }
.status-badge-select.status-pending { background-color: #fff8e1; color: var(--secondary-dark); }
.status-badge-select.status-shipping { background-color: #e3f2fd; color: var(--accent-blue); }
.status-badge-select.status-delivered { background-color: #e0f2f1; color: var(--accent-green); }
.status-badge-select.status-returned { background-color: #ffebee; color: var(--accent-red); }
.status-badge-select.status-cancelled { background-color: #eeeeee; color: #757575; }
.status-badge-select.status-apologized { background-color: #fff7ed; color: #c2410c; border-color: #fed7aa; }


/* Order Status Tabs (خانات تصفية حالات الطلبات) */
.order-status-tabs-container {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  align-items: center;
  margin-bottom: 16px;
  padding: 4px 2px 10px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.order-status-tabs-container::-webkit-scrollbar {
  height: 5px;
}
.order-status-tabs-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
}
.order-status-tabs-container::-webkit-scrollbar-thumb {
  background: rgba(27, 67, 50, 0.2);
  border-radius: 10px;
}

.order-status-tab-btn {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 25px;
  padding: 7px 15px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s ease;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  white-space: nowrap;
  flex-shrink: 0;
}

.order-status-tab-btn:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--primary);
  transform: translateY(-1px);
}

.order-status-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(27, 67, 50, 0.35);
}

.order-status-tab-btn .tab-badge {
  background: #f1f5f9;
  color: #334155;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-english);
}

.order-status-tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Floating Toast Notification */
.dash-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1e293b;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.dash-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.dash-toast.success {
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Action Buttons */
.btn-action {
  background: #fafbfa;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--primary);
  font-family: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
}

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

.btn-action-danger {
  color: var(--accent-red);
}

.btn-action-danger:hover {
  background: var(--accent-red);
  color: #ffffff;
  border-color: var(--accent-red);
}

.btn-secondary-action {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--primary-dark);
  border: none;
  border-radius: var(--border-radius-sm);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  box-shadow: 0 4px 10px rgba(212, 175, 55, 0.25);
}

.btn-secondary-action:hover {
  filter: brightness(1.05);
}

.btn-secondary-action:active {
  transform: scale(0.98);
}

/* ==========================================================================
   Desktop Table Actions Cluster (منظومة أزرار الإجراءات في الجدول)
   ========================================================================== */
.custom-table th.th-actions,
.custom-table td.td-order-actions {
  text-align: center;
  min-width: 210px;
  width: 210px;
  padding: 8px 10px;
}

.table-actions-cluster {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.actions-row-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.actions-row-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.btn-action-sm {
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.2;
}

.btn-action-sm:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-action-confirm {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  border: none;
}
.btn-action-confirm:hover {
  background: #15803d;
  color: #ffffff;
}

.btn-action-apologize {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}
.btn-action-apologize:hover {
  background: #fed7aa;
  color: #9a3412;
}

.btn-action-apologized-wa {
  background: #ea580c;
  color: #ffffff;
  border: none;
}
.btn-action-apologized-wa:hover {
  background: #c2410c;
  color: #ffffff;
}

.btn-action-details {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
.btn-action-details:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-action-wa {
  background: #25d366;
  color: #ffffff;
  border: none;
}
.btn-action-wa:hover {
  background: #1ebd5b;
  color: #ffffff;
}

.badge-confirmed-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

.btn-action-shipping-direct {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: none;
}
.btn-action-shipping-direct:hover {
  background: #0369a1;
  color: #ffffff;
}

.btn-action-deliver-direct {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  color: #ffffff;
  border: none;
}
.btn-action-deliver-direct:hover {
  background: #0f766e;
  color: #ffffff;
}

/* Secondary tool icons in table */
.btn-action-icon {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #64748b;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn-action-icon:hover {
  background: #f8fafc;
  color: var(--primary);
  border-color: #cbd5e1;
}

.btn-action-icon.btn-action-edit:hover {
  color: #0d9488;
  border-color: #0d9488;
  background: #f0fdfa;
}
.btn-action-icon.btn-action-waybill:hover {
  color: #0284c7;
  border-color: #0284c7;
  background: #f0f9ff;
}
.btn-action-icon.btn-action-shipping:hover {
  color: #10b981;
  border-color: #10b981;
  background: #ecfdf5;
}
.btn-action-icon.btn-action-delete:hover {
  color: var(--accent-red);
  border-color: #fca5a5;
  background: #fef2f2;
}

/* ==========================================================================
   Mobile-Optimized Cards View for Orders & Expenses (بطاقات الهاتف المنظمة)
   ========================================================================== */
.orders-mobile-cards, .expenses-mobile-cards {
  display: none;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.order-mobile-card, .expense-mobile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
}

.order-mobile-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 10px;
}

.order-card-id-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.order-card-id {
  font-weight: 800;
  font-size: 15px;
  color: var(--primary);
  font-family: var(--font-english);
}

.order-card-date {
  font-size: 11.5px;
  color: var(--text-muted);
}

.order-card-customer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.order-card-customer-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 15px;
  color: var(--text-main);
}

.order-card-price-badge {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-english);
  background: rgba(27, 67, 50, 0.06);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}

.order-card-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f8fafc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #475569;
}

.order-card-meta-grid .meta-item strong {
  color: #0f172a;
}

.order-card-apology-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: #c2410c;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.4;
}

.order-card-contact-strip {
  display: flex;
  gap: 8px;
}

.btn-card-call {
  flex: 2;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-card-call:hover {
  background: #dcfce7;
}

.btn-card-wa {
  flex: 1;
  background: #25d366;
  color: #ffffff;
  border: none;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-card-wa:hover {
  background: #1ebd5b;
}

.order-card-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}

.card-primary-actions {
  display: flex;
  gap: 8px;
}

.btn-card-primary {
  flex: 1;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-card-confirm {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
}

.btn-card-apologize {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.btn-card-apology-followup {
  background: #ea580c;
  color: #ffffff;
}

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

.card-confirmed-status-pill {
  padding: 8px 12px;
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.card-secondary-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.btn-card-tool {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 7px 4px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  font-family: inherit;
}

.btn-card-tool:hover {
  background: #f1f5f9;
  color: var(--primary);
  border-color: #cbd5e1;
}

.btn-card-tool-danger {
  color: var(--accent-red);
}
.btn-card-tool-danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ==========================================================================
   Mobile Bottom App Navigation Bar
   ========================================================================== */
.mobile-dash-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: #ffffff;
  border-top: 1px solid rgba(27, 67, 50, 0.12);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 900;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}

.dash-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  gap: 3px;
  flex: 1;
  transition: var(--transition-fast);
}

.dash-bottom-nav-item.active {
  color: var(--primary);
  font-weight: 800;
}

.dash-bottom-icon {
  font-size: 19px;
}

/* Floating Quick Add Button */
.dash-bottom-add-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-dark) 100%);
  color: var(--primary-dark);
  border: 3.5px solid #ffffff;
  box-shadow: 0 4px 16px rgba(170, 124, 17, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  cursor: pointer;
  margin-top: -24px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.dash-bottom-add-btn:active {
  transform: scale(0.92);
}

/* ==========================================================================
   Modals & Touch-Friendly Forms
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-container {
  background: #ffffff;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  max-width: 600px;
  width: 100%;
  padding: 26px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.modal-title-bar h3 {
  font-size: 19px;
  color: var(--primary);
  font-weight: 800;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 4px;
}

.btn-close:hover {
  color: var(--accent-red);
}

/* Product Selection Rows in Add Order Modal */
.product-selection-row {
  display: flex;
  gap: 8px;
  align-items: center;
  background: #fafbfa;
  border: 1px solid var(--border-color);
  padding: 10px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 10px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}

.qty-stepper button {
  width: 36px;
  height: 42px;
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
}

.qty-stepper input {
  width: 48px;
  text-align: center;
  height: 42px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-weight: 800;
  font-size: 15px;
  font-family: var(--font-english);
}

/* Filter controls */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 991px) {
  .sidebar {
    right: -300px; /* Fully hidden offscreen */
  }
  .sidebar.open {
    right: 0;
  }
  .main-content {
    margin-right: 0 !important;
    padding: 16px !important;
    padding-bottom: 85px !important; /* Space for bottom nav */
  }
  .menu-toggle-dash {
    display: flex !important;
  }
  .mobile-dash-bottom-nav {
    display: flex !important;
  }
  .date-badge {
    display: none; /* Hide date on small screens to save header space */
  }
}

@media (max-width: 768px) {
  .table-responsive {
    display: none; /* Replace tables with mobile cards */
  }
  .orders-mobile-cards, .expenses-mobile-cards {
    display: flex;
  }

  /* Bottom sheet modal styling on mobile */
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-container {
    max-width: 100% !important;
    width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: 85vh !important;
    padding: 20px !important;
    animation: slideUpModal 0.25s ease-out !important;
  }

  @keyframes slideUpModal {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .kpi-card {
    padding: 14px 16px;
  }

  .kpi-card-info .kpi-val {
    font-size: 20px;
  }

  .kpi-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }

  .product-selection-row {
    flex-wrap: wrap;
  }

  .product-selection-row select {
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* Mobile Filter Bar Organized Grid */
  .filter-bar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  .filter-bar .form-group {
    margin-bottom: 0 !important;
    min-width: 0 !important;
    width: 100%;
  }

  .filter-bar .form-group:first-child {
    grid-column: 1 / -1;
  }

  .filter-bar #filterAssignDiv {
    grid-column: 1 / -1;
  }

  .filter-bar #btnApplyFilters,
  .filter-bar #btnClearFilters {
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
  }

  .filter-bar #btnPrintSelectedWaybills {
    grid-column: 1 / -1;
    width: 100% !important;
    margin-right: 0 !important;
    justify-content: center;
    padding: 9px 14px;
  }
}

/* ========================================================
   /* CUSTOMER LOYALTY & ADVANCED ANALYTICS ENHANCEMENTS */
   ======================================================== */
.loyalty-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
  margin-right: 4px;
}

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

.loyalty-repeat {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.loyalty-vip {
  background: linear-gradient(135deg, #ede9fe, #fae8ff);
  color: #6b21a8;
  border: 1px solid #d8b4fe;
  box-shadow: 0 2px 4px rgba(107, 33, 168, 0.12);
}

.customer-loyalty-box {
  margin-top: 14px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: var(--border-radius-sm);
  padding: 14px 16px;
}

.customer-loyalty-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.customer-loyalty-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.customer-loyalty-stat-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  text-align: center;
}

.customer-loyalty-stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.customer-loyalty-stat-card .stat-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-english);
}

.customer-previous-orders-list {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 12px;
  max-height: 140px;
  overflow-y: auto;
}

.customer-prev-order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px dashed #e2e8f0;
}

.customer-prev-order-item:last-child {
  border-bottom: none;
}

/* Analytics Panels Grid */
.analytics-grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (max-width: 992px) {
  .analytics-grid-two {
    grid-template-columns: 1fr;
  }
}

/* Rate Progress Bar in Tables */
.table-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 110px;
}

.table-progress-bar {
  flex: 1;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

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

.progress-green { background: #10b981; }
.progress-amber { background: #f59e0b; }
.progress-red { background: #ef4444; }
.progress-blue { background: #0284c7; }


/* High z-index for editOrderModal */
#editOrderModal {
  z-index: 1250 !important;
}

/* ===================================================
   Daily Orders KPI Bar & Interactive Calendar System
   =================================================== */

/* 1. Daily Orders Top KPI Bar */
.daily-orders-kpi-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.daily-kpi-card {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.daily-kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.daily-kpi-card.active {
  background: linear-gradient(135deg, rgba(27, 67, 50, 0.06), rgba(45, 106, 79, 0.12));
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.12);
}

.daily-kpi-card.active::before {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  bottom: -1px;
  width: 4px;
  background: var(--primary);
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

.daily-kpi-icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.daily-kpi-card.active .daily-kpi-icon {
  background: var(--primary);
  color: #fff;
}

.daily-kpi-content {
  flex: 1;
  min-width: 0;
}

.daily-kpi-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.daily-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.daily-kpi-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-english);
  line-height: 1.1;
}

.daily-kpi-unit {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.daily-kpi-extra {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary-light);
  font-family: var(--font-english);
  background: #eafaf1;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

/* Button to toggle Calendar View */
.btn-toggle-calendar {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  font-family: inherit;
}

.btn-toggle-calendar:hover,
.btn-toggle-calendar.open {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.25);
}

.btn-toggle-calendar .calendar-toggle-indicator {
  font-size: 11px;
  transition: transform 0.25s ease;
}

.btn-toggle-calendar.open .calendar-toggle-indicator {
  transform: rotate(180deg);
}

/* 2. Interactive Orders Calendar Widget */
.orders-calendar-container {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: block;
  animation: fadeIn 0.25s ease;
}

.orders-calendar-container.collapsed {
  display: none;
}

.orders-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

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

.calendar-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  color: var(--primary);
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.calendar-nav-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.calendar-month-title {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--primary);
  min-width: 140px;
  text-align: center;
}

.calendar-quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-action-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-cal-today {
  background: #eafaf1;
  color: #1b4332;
  border-color: #a7f3d0;
}
.btn-cal-today:hover {
  background: #1b4332;
  color: #fff;
}

.btn-cal-reset {
  background: #f1f5f9;
  color: #334155;
}
.btn-cal-reset:hover {
  background: #334155;
  color: #fff;
}

/* Calendar Weekdays */
.orders-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 6px 0;
  background: #f8fafc;
  border-radius: 8px;
}

/* Calendar Days Grid */
.orders-calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-day-cell {
  min-height: 58px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
}

.calendar-day-cell.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.calendar-day-cell:not(.empty):hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.06);
}

.calendar-day-cell .day-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-color);
  font-family: var(--font-english);
}

.calendar-day-cell .day-orders-badge {
  font-size: 10px;
  font-weight: 800;
  color: #166534;
  background: #dcfce7;
  padding: 2px 6px;
  border-radius: 8px;
  font-family: var(--font-english);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Special Cell States */
.calendar-day-cell.is-today {
  border: 2px solid #16a34a;
  background: #f0fdf4;
}

.calendar-day-cell.is-today .day-number::after {
  content: ' •';
  color: #16a34a;
  font-size: 14px;
}

.calendar-day-cell.has-orders {
  background: #fafffc;
  border-color: #bbf7d0;
}

.calendar-day-cell.is-selected {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 12px rgba(27, 67, 50, 0.35) !important;
}

.calendar-day-cell.is-selected .day-number {
  color: #ffffff !important;
}

.calendar-day-cell.is-selected .day-orders-badge {
  background: #ffffff !important;
  color: var(--primary) !important;
}

/* Calendar Footer Legend */
.calendar-footer-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  font-size: 11.5px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.today-dot {
  background: #16a34a;
  border: 1px solid #15803d;
}

.has-orders-dot {
  background: #bbf7d0;
  border: 1px solid #86efac;
}

.selected-dot {
  background: var(--primary);
}

/* 3. Selected Date Filter Banner */
.selected-date-banner {
  background: linear-gradient(135deg, #1b4332, #2d6a4f);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(27, 67, 50, 0.2);
  animation: fadeIn 0.2s ease;
}

.selected-date-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.selected-date-count-chip {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-english);
}

.selected-date-sales-chip {
  background: var(--secondary);
  color: #0f2a1d;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font-english);
}

.btn-clear-date-filter {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.btn-clear-date-filter:hover {
  background: #ffffff;
  color: #1b4332;
}

/* 4. Grouped Orders by Date ("اوردرات كل يوم تبقي منفصله") */
.date-group-header-row td {
  padding: 14px 10px 8px 10px !important;
  background: transparent !important;
  border-bottom: none !important;
}

.date-group-header-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-right: 4px solid var(--primary);
  border-radius: 8px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.date-group-header-box.is-today-group {
  background: #f0fdf4;
  border-color: #86efac;
  border-right: 5px solid #16a34a;
}

.date-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--primary);
}

.day-badge-today {
  background: linear-gradient(135deg, #16a34a, #15803d);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}

.day-badge-yesterday {
  background: #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.date-group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.date-group-stat {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--text-main);
}

.date-group-stat.sales {
  color: #166534;
  font-family: var(--font-english);
  font-weight: 700;
}

.date-group-stat.delivered {
  color: #0284c7;
}

/* Mobile Grouped Cards */
.date-group-mobile-wrapper {
  margin-bottom: 16px;
}

.date-group-mobile-header {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-right: 4px solid var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.date-group-mobile-wrapper.is-today-wrapper .date-group-mobile-header {
  background: #f0fdf4;
  border-color: #86efac;
  border-right-color: #16a34a;
}

.dgm-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.dgm-stats {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-english);
}

/* Sidebar & Mobile Nav Badges */
.sidebar-today-badge {
  background: #16a34a;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 12px;
  margin-right: auto;
  font-family: var(--font-english);
}

.mobile-bnav-badge {
  position: absolute;
  top: 4px;
  right: 18px;
  background: #16a34a;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 10px;
  font-family: var(--font-english);
}

@media (max-width: 768px) {
  .daily-orders-kpi-bar {
    grid-template-columns: 1fr 1fr;
  }
  .btn-toggle-calendar {
    grid-column: span 2;
  }
  .calendar-day-cell {
    min-height: 50px;
    padding: 4px 2px;
  }
  .calendar-day-cell .day-orders-badge {
    font-size: 9px;
    padding: 1px 4px;
  }
}

