/* ============================================================
   DAWRAK MANAGER — Frontend Dashboard CSS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ── */
:root {
  --mgr-primary:   #ff6b35;
  --mgr-primary-d: #e55520;
  --mgr-dark:      #0f172a;
  --mgr-dark2:     #1e293b;
  --mgr-sidebar-w: 240px;
  --mgr-topbar-h:  58px;
  --mgr-bg:        #f1f5f9;
  --mgr-card:      #ffffff;
  --mgr-border:    #e2e8f0;
  --mgr-text:      #1e293b;
  --mgr-muted:     #64748b;
  --mgr-radius:    14px;
  --mgr-shadow:    0 1px 12px rgba(0,0,0,.07);
  --mgr-font:      'Tajawal', sans-serif;
}

/* ── Reset ── */
.dw-mgr-wrap, .dw-mgr-wrap * { box-sizing: border-box; }
.dw-mgr-wrap { font-family: var(--mgr-font); direction: rtl; color: var(--mgr-text); }

/* ══════════════════ LOGIN ══════════════════ */
.dw-mgr-login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--mgr-dark) 0%, #0f3460 100%);
  padding: 24px;
  font-family: var(--mgr-font);
  direction: rtl;
}
.dw-mgr-login-card {
  background: #fff;
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dw-mgr-login-logo {
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--mgr-dark);
  text-align: center;
  margin-bottom: 4px;
}
.dw-mgr-login-logo em { color: var(--mgr-primary); font-style: normal; }
.dw-mgr-login-subtitle { text-align: center; color: var(--mgr-muted); font-size: .9rem; margin-bottom: 28px; }

/* ══════════════════ LAYOUT ══════════════════ */
.dw-mgr-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--mgr-bg);
}

/* ── Top Bar ── */
.dw-mgr-topbar {
  height: var(--mgr-topbar-h);
  background: var(--mgr-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.dw-mgr-topbar-brand { display: flex; align-items: center; gap: 14px; }
.dw-mgr-logo { font-size: 1.5rem; font-weight: 900; color: #fff; }
.dw-mgr-logo em { color: var(--mgr-primary); font-style: normal; }
.dw-mgr-store-name {
  color: rgba(255,255,255,.55);
  font-size: .88rem;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,.15);
}
.dw-mgr-topbar-actions { display: flex; align-items: center; gap: 12px; }
.dw-mgr-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: #6b7280;
}
.dw-mgr-status-dot.active { background: #10b981; box-shadow: 0 0 6px #10b98166; }
.dw-mgr-status-text { color: rgba(255,255,255,.6); font-size: .82rem; }
.dw-mgr-logout-btn {
  color: rgba(255,255,255,.5);
  text-decoration: none;
  font-size: .82rem;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.15);
  transition: all .2s;
}
.dw-mgr-logout-btn:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* ── Body (sidebar + main) ── */
.dw-mgr-body { display: flex; flex: 1; min-height: calc(100vh - var(--mgr-topbar-h)); }

/* ── Sidebar ── */
.dw-mgr-sidebar {
  width: var(--mgr-sidebar-w);
  background: var(--mgr-dark2);
  display: flex;
  flex-direction: column;
  padding: 16px 10px;
  position: sticky;
  top: var(--mgr-topbar-h);
  height: calc(100vh - var(--mgr-topbar-h));
  overflow-y: auto;
  flex-shrink: 0;
}
.dw-mgr-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255,255,255,.55);
  font-size: .9rem;
  font-weight: 600;
  transition: all .2s;
  margin-bottom: 3px;
}
.dw-mgr-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.dw-mgr-nav-item.active { background: var(--mgr-primary); color: #fff; box-shadow: 0 4px 12px rgba(255,107,53,.35); }
.dw-mgr-nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.dw-mgr-sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.08); }

/* ── Main Content ── */
.dw-mgr-main { flex: 1; overflow-y: auto; padding: 0; }
.dw-mgr-page { padding: 24px; max-width: 1000px; }
.dw-mgr-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.dw-mgr-page-title { font-size: 1.4rem; font-weight: 800; margin: 0; color: var(--mgr-dark); }
.dw-mgr-page-date { color: var(--mgr-muted); font-size: .85rem; }
.dw-mgr-live-badge {
  background: #dcfce7;
  color: #15803d;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 700;
  animation: pulseBadge 2s infinite;
}
@keyframes pulseBadge { 0%,100%{opacity:1}50%{opacity:.7} }

/* ══════════════════ STAT CARDS ══════════════════ */
.dw-mgr-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px,1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.dw-mgr-stat-card {
  background: var(--mgr-card);
  border-radius: var(--mgr-radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--mgr-shadow);
  border-top: 3px solid var(--accent, var(--mgr-primary));
}
.dw-mgr-stat-icon { font-size: 1.8rem; margin-bottom: 8px; }
.dw-mgr-stat-val { font-size: 1.9rem; font-weight: 900; color: var(--accent, var(--mgr-primary)); line-height: 1; }
.dw-mgr-stat-label { font-size: .8rem; color: var(--mgr-muted); margin-top: 5px; }

/* ══════════════════ QUICK GRID ══════════════════ */
.dw-mgr-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.dw-mgr-quick-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 14px;
  background: var(--mgr-card);
  border-radius: var(--mgr-radius);
  text-decoration: none;
  color: var(--mgr-text);
  box-shadow: var(--mgr-shadow);
  border: 2px solid transparent;
  transition: all .2s;
  font-weight: 700;
  font-size: .9rem;
}
.dw-mgr-quick-card:hover { border-color: var(--qcolor); transform: translateY(-3px); }
.dw-mgr-quick-icon { font-size: 2rem; }

/* ══════════════════ ALERTS / NOTICES ══════════════════ */
.dw-mgr-alert {
  padding: 13px 18px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-mgr-alert-success { background: #dcfce7; border: 1px solid #86efac; color: #15803d; }
.dw-mgr-alert-error   { background: #fee2e2; border: 1px solid #fca5a5; color: #dc2626; }
.dw-mgr-alert-warning { background: #fff7ed; border: 1px solid #fed7aa; color: #c2410c; }
.dw-mgr-alert-box {
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.dw-mgr-alert-box-title { font-weight: 800; margin-bottom: 10px; }
.dw-mgr-alert-warning { background: #fff7ed; border: 1.5px solid #fed7aa; color: #c2410c; }
.dw-mgr-tags-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.dw-mgr-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 20px; font-size: .82rem; font-weight: 600; }
.dw-mgr-tag-warn { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.dw-mgr-link { color: var(--mgr-primary); font-weight: 700; text-decoration: none; font-size: .88rem; }
.dw-mgr-noaccess { padding: 40px; text-align: center; background: #fee2e2; border-radius: 14px; font-family: var(--mgr-font); color: #dc2626; font-size: 1.1rem; }

/* ══════════════════ FILTER TABS ══════════════════ */
.dw-mgr-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.dw-mgr-ftab {
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  color: var(--mgr-muted);
  font-size: .85rem;
  font-weight: 600;
  background: var(--mgr-card);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dw-mgr-ftab:hover { color: var(--mgr-text); }
.dw-mgr-ftab.active { background: var(--mgr-dark); color: #fff; }
.dw-mgr-ftab-count {
  background: rgba(255,255,255,.25);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: .75rem;
}
.dw-mgr-ftab.active .dw-mgr-ftab-count { background: rgba(255,255,255,.2); }

/* ══════════════════ ORDER CARDS ══════════════════ */
.dw-mgr-orders-list { display: grid; gap: 12px; }
.dw-mgr-order-card {
  background: var(--mgr-card);
  border-radius: var(--mgr-radius);
  padding: 18px 20px;
  box-shadow: var(--mgr-shadow);
  border-right: 4px solid var(--order-color, var(--mgr-primary));
}
.dw-mgr-order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.dw-mgr-order-num { font-size: 1.1rem; font-weight: 900; letter-spacing: 1px; }
.dw-mgr-order-status-badge { padding: 5px 14px; border-radius: 20px; font-size: .82rem; font-weight: 700; }
.dw-mgr-order-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--mgr-muted); margin-bottom: 10px; }
.dw-mgr-order-total { color: var(--mgr-primary); font-weight: 800; }
.dw-mgr-order-notes { background: #f8fafc; border-radius: 8px; padding: 9px 14px; font-size: .85rem; margin-bottom: 10px; }
.dw-mgr-order-action { margin-top: 8px; }

/* ══════════════════ FORMS ══════════════════ */
.dw-mgr-form-group { margin-bottom: 16px; }
.dw-mgr-label { display: block; font-size: .88rem; font-weight: 700; color: var(--mgr-dark); margin-bottom: 6px; }
.dw-mgr-label .req { color: var(--mgr-primary); }
.dw-mgr-label-sm { display: block; font-size: .8rem; font-weight: 600; color: var(--mgr-muted); margin-bottom: 4px; }
.dw-mgr-input, .dw-mgr-select, .dw-mgr-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--mgr-border);
  border-radius: 10px;
  font-family: var(--mgr-font);
  font-size: .92rem;
  color: var(--mgr-text);
  background: #fafafa;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  direction: rtl;
}
.dw-mgr-input:focus, .dw-mgr-select:focus, .dw-mgr-textarea:focus {
  border-color: var(--mgr-primary);
  box-shadow: 0 0 0 3px rgba(255,107,53,.12);
  background: #fff;
}
.dw-mgr-input-sm { padding: 8px 12px; font-size: .86rem; }
.dw-mgr-textarea { resize: vertical; }
.dw-mgr-hint { font-size: .78rem; color: var(--mgr-muted); margin-top: 5px; }
.dw-mgr-form-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dw-mgr-form-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── Form Sections ── */
.dw-mgr-form-section {
  background: var(--mgr-card);
  border-radius: var(--mgr-radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--mgr-shadow);
}
.dw-mgr-form-section-title {
  font-size: .92rem;
  font-weight: 800;
  color: var(--mgr-dark);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mgr-border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-mgr-form-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mgr-border);
}
.dw-mgr-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 8px;
}

/* ── Image Upload ── */
.dw-mgr-image-upload-area {
  border: 2px dashed var(--mgr-border);
  border-radius: 12px;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s;
}
.dw-mgr-image-upload-area:hover { border-color: var(--mgr-primary); }
.dw-mgr-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--mgr-muted);
  font-size: .9rem;
  padding: 24px;
  text-align: center;
}
.dw-mgr-upload-trigger {
  color: var(--mgr-primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.dw-mgr-image-preview { position: relative; padding: 10px; }
.dw-mgr-image-preview img { max-height: 180px; max-width: 100%; border-radius: 10px; object-fit: contain; }
.dw-mgr-img-remove {
  position: absolute;
  top: 6px; right: 6px;
  background: #ef4444;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px; height: 26px;
  cursor: pointer;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Settings Images ── */
.dw-mgr-img-field { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dw-mgr-img-thumb { width: 70px; height: 70px; border-radius: 10px; object-fit: cover; border: 2px solid var(--mgr-border); }
.dw-mgr-img-cover { width: 120px; height: 70px; }
.dw-mgr-img-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 1.5rem; background: #f1f5f9; }

/* ══════════════════ OPTIONS / CHOICES ══════════════════ */
.dw-mgr-options-empty {
  background: #f8fafc;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: var(--mgr-muted);
  font-size: .88rem;
}
.dw-mgr-opt-group {
  background: #f8fafc;
  border: 1.5px solid var(--mgr-border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}
.dw-mgr-opt-group-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.dw-mgr-opt-group-drag, .dw-mgr-choice-drag { color: #cbd5e1; cursor: grab; font-size: 1.1rem; padding-top: 8px; }
.dw-mgr-opt-group-fields { flex: 1; }
.dw-mgr-opt-remove-group, .dw-mgr-choice-remove {
  background: #fee2e2;
  color: #ef4444;
  border: none;
  border-radius: 8px;
  width: 30px; height: 30px;
  cursor: pointer;
  font-size: .8rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  transition: background .15s;
}
.dw-mgr-opt-remove-group:hover, .dw-mgr-choice-remove:hover { background: #ef4444; color: #fff; }

/* Choices */
.dw-mgr-choices-list { display: grid; gap: 8px; margin-bottom: 10px; }
.dw-mgr-choice-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  border: 1px solid var(--mgr-border);
}
.dw-mgr-choice-row input[type=text] { flex: 1; }
.dw-mgr-choice-price-wrap { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.dw-mgr-price-prefix, .dw-mgr-price-suffix { font-size: .82rem; font-weight: 700; color: #10b981; }
.dw-mgr-price-input { width: 80px !important; text-align: center; }
.dw-mgr-add-choice-btn {
  background: none;
  border: 1.5px dashed #94a3b8;
  color: #64748b;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: var(--mgr-font);
  font-size: .83rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all .2s;
}
.dw-mgr-add-choice-btn:hover { border-color: var(--mgr-primary); color: var(--mgr-primary); }
.dw-mgr-checkbox-group { display: flex; flex-direction: column; justify-content: flex-start; }

/* Toggle Switch */
.dw-mgr-toggle { display: inline-flex; align-items: center; cursor: pointer; }
.dw-mgr-toggle input { display: none; }
.dw-mgr-toggle-slider {
  width: 40px; height: 22px;
  background: #cbd5e1;
  border-radius: 11px;
  position: relative;
  transition: background .2s;
}
.dw-mgr-toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 16px; height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.dw-mgr-toggle input:checked + .dw-mgr-toggle-slider { background: #10b981; }
.dw-mgr-toggle input:checked + .dw-mgr-toggle-slider::before { transform: translateX(-18px); }

/* ══════════════════ PRODUCT CARDS ══════════════════ */
.dw-mgr-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 16px;
}
.dw-mgr-item-card {
  background: var(--mgr-card);
  border-radius: var(--mgr-radius);
  overflow: hidden;
  box-shadow: var(--mgr-shadow);
  border: 2px solid transparent;
  transition: all .2s;
}
.dw-mgr-item-card:hover { border-color: var(--mgr-primary); transform: translateY(-2px); }
.dw-mgr-item-disabled { opacity: .55; }
.dw-mgr-item-img {
  height: 150px;
  background: #f1f5f9;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dw-mgr-item-img img { width: 100%; height: 100%; object-fit: cover; }
.dw-mgr-item-img-placeholder { font-size: 3rem; }
.dw-mgr-item-status-dot {
  position: absolute; top: 8px; left: 8px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid #fff;
}
.dw-mgr-item-body { padding: 14px 16px; }
.dw-mgr-item-name { font-size: 1rem; font-weight: 800; margin-bottom: 4px; }
.dw-mgr-item-desc { font-size: .8rem; color: var(--mgr-muted); margin-bottom: 8px; }
.dw-mgr-item-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dw-mgr-item-price { font-size: 1.05rem; font-weight: 900; color: var(--mgr-primary); }
.dw-mgr-item-cat { font-size: .78rem; color: var(--mgr-muted); background: #f1f5f9; padding: 3px 8px; border-radius: 6px; }
.dw-mgr-item-stock { font-size: .8rem; margin-bottom: 4px; }
.dw-mgr-item-opts-count { font-size: .78rem; color: #6366f1; margin-bottom: 8px; }
.dw-mgr-item-actions { display: flex; gap: 8px; padding: 10px 16px; background: #fafafa; border-top: 1px solid var(--mgr-border); }

/* ══════════════════ CATEGORIES ══════════════════ */
.dw-mgr-cats-list { display: flex; flex-wrap: wrap; gap: 8px; }
.dw-mgr-cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f1f5f9;
  border-radius: 20px;
  font-size: .85rem;
  font-weight: 600;
  border: 1.5px solid var(--mgr-border);
}
.dw-mgr-chip-del {
  background: none;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: .8rem;
  padding: 0;
  line-height: 1;
  transition: color .15s;
}
.dw-mgr-chip-del:hover { color: #ef4444; }
.dw-mgr-cat-form { background: #f8fafc; border-radius: 10px; padding: 14px; border: 1.5px dashed var(--mgr-border); }
.dw-mgr-cat-form-row { display: flex; gap: 10px; align-items: flex-end; }

/* ══════════════════ SECTIONS ══════════════════ */
.dw-mgr-section { background: var(--mgr-card); border-radius: var(--mgr-radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--mgr-shadow); }
.dw-mgr-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dw-mgr-section-title { font-size: .95rem; font-weight: 800; color: var(--mgr-dark); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.dw-mgr-section-title::before { content:''; width:3px; height:18px; background:var(--mgr-primary); border-radius:3px; display:inline-block; }

/* ══════════════════ CARD ══════════════════ */
.dw-mgr-card { background: var(--mgr-card); border-radius: var(--mgr-radius); padding: 22px; box-shadow: var(--mgr-shadow); margin-bottom: 20px; }
.dw-mgr-card-title { font-size: 1rem; font-weight: 800; margin-bottom: 18px; color: var(--mgr-dark); }

/* ══════════════════ INVENTORY ══════════════════ */
.dw-mgr-inventory-list { display: grid; gap: 10px; }
.dw-mgr-inv-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,.05);
}
.dw-mgr-inv-item-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.dw-mgr-inv-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.dw-mgr-inv-name { font-weight: 700; font-size: .9rem; }
.dw-mgr-inv-cat { font-size: .78rem; color: var(--mgr-muted); }
.dw-mgr-inv-current { font-size: 1.3rem; font-weight: 900; min-width: 40px; text-align: center; }
.dw-mgr-inv-edit { display: flex; flex-direction: column; align-items: center; gap: 4px; flex-shrink: 0; }

/* ══════════════════ BRANCHES ══════════════════ */
.dw-mgr-branches-list { display: grid; gap: 12px; }
.dw-mgr-branch-card {
  background: var(--mgr-card);
  border-radius: var(--mgr-radius);
  padding: 18px 20px;
  box-shadow: var(--mgr-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.dw-mgr-branch-icon { font-size: 2rem; flex-shrink: 0; }
.dw-mgr-branch-info { flex: 1; }
.dw-mgr-branch-name { font-size: 1.05rem; font-weight: 800; margin-bottom: 4px; }
.dw-mgr-branch-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .82rem; color: var(--mgr-muted); }
.dw-mgr-branch-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dw-mgr-status-pill { padding: 5px 12px; border-radius: 20px; font-size: .8rem; font-weight: 700; background: #f1f5f9; color: var(--mgr-muted); }
.dw-mgr-status-pill.active { background: #dcfce7; color: #15803d; }
.dw-mgr-add-branch-card { max-width: 700px; }
.dw-mgr-branch-form {}
.dw-mgr-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--mgr-muted);
  font-size: .82rem;
  font-weight: 600;
}
.dw-mgr-divider::before, .dw-mgr-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--mgr-border);
}

/* ══════════════════ BUTTONS ══════════════════ */
.dw-mgr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: var(--mgr-font);
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .2s;
  white-space: nowrap;
}
.dw-mgr-btn-primary { background: linear-gradient(135deg, var(--mgr-primary), var(--mgr-primary-d)); color: #fff; box-shadow: 0 3px 10px rgba(255,107,53,.3); }
.dw-mgr-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(255,107,53,.4); }
.dw-mgr-btn-outline { background: transparent; border: 2px solid var(--mgr-border); color: var(--mgr-text); }
.dw-mgr-btn-outline:hover { border-color: var(--mgr-primary); color: var(--mgr-primary); }
.dw-mgr-btn-info { background: #3b82f6; color: #fff; }
.dw-mgr-btn-danger { background: #ef4444; color: #fff; }
.dw-mgr-btn-success { background: #10b981; color: #fff; }
.dw-mgr-btn-sm { padding: 7px 14px; font-size: .82rem; border-radius: 8px; }
.dw-mgr-btn-lg { padding: 13px 28px; font-size: 1rem; }
.dw-mgr-btn-full { width: 100%; }
.dw-mgr-btn[style*='background:#'] { color: #fff; }
.dw-mgr-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ══════════════════ EMPTY STATE ══════════════════ */
.dw-mgr-empty { text-align: center; padding: 50px 24px; }
.dw-mgr-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.dw-mgr-empty-title { font-size: 1.1rem; font-weight: 800; color: var(--mgr-dark); margin-bottom: 6px; }
.dw-mgr-empty-sub { color: var(--mgr-muted); font-size: .88rem; }
.dw-mgr-muted { color: var(--mgr-muted); font-size: .88rem; }

/* ══════════════════ TOAST ══════════════════ */
.dw-mgr-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  font-family: var(--mgr-font);
  font-size: .9rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 12px;
  background: var(--mgr-dark);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
  display: none;
}
.dw-mgr-toast.show { display: block; animation: slideInToast .3s ease; }
@keyframes slideInToast { from { transform: translateY(20px); opacity:0; } to { transform: translateY(0); opacity:1; } }

/* ══════════════════ RESPONSIVE ══════════════════ */
@media (max-width: 768px) {
  .dw-mgr-sidebar { display: none; }
  .dw-mgr-main { width: 100%; }
  .dw-mgr-page { padding: 16px; }
  .dw-mgr-form-row2, .dw-mgr-form-row3 { grid-template-columns: 1fr; }
  .dw-mgr-stats-grid { grid-template-columns: repeat(2,1fr); }
}

/* Mobile sidebar toggle */
@media (max-width: 768px) {
  .dw-mgr-topbar { padding: 0 14px; }
  .dw-mgr-topbar-brand::before {
    content: '☰';
    color: rgba(255,255,255,.7);
    font-size: 1.2rem;
    cursor: pointer;
    margin-left: 10px;
  }
}

/* ══════════════════════════════════════════
   ADDITIONAL STYLES - v1.1
══════════════════════════════════════════ */

/* Topbar orders alert pill */
.dw-mgr-topbar-orders-alert {
  background: #ef4444;
  color: #fff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  animation: pulseBadge 1.5s infinite;
}

/* Hamburger button */
.dw-mgr-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin-left: 8px;
}
.dw-mgr-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(255,255,255,.75);
  border-radius: 2px;
  transition: all .3s;
}
@media (max-width: 768px) {
  .dw-mgr-hamburger { display: flex; }
}

/* Sidebar mobile */
.dw-mgr-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.dw-mgr-sidebar-overlay.show { display: block; }
@media (max-width: 768px) {
  .dw-mgr-sidebar {
    position: fixed;
    top: var(--mgr-topbar-h);
    right: -260px;
    height: calc(100vh - var(--mgr-topbar-h));
    width: 240px;
    transition: right .3s ease;
    z-index: 160;
  }
  .dw-mgr-sidebar.open { right: 0; }
}

/* Orders badge on nav */
.dw-mgr-orders-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ef4444;
  color: #fff;
  border-radius: 10px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: .72rem;
  font-weight: 800;
  margin-right: auto;
  animation: pulseBadge 1.5s infinite;
}

/* Order age label */
.dw-mgr-order-age {
  font-size: .75rem;
  color: #94a3b8;
  margin-top: 2px;
}

/* Order items summary */
.dw-mgr-order-items-summary {
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: .82rem;
  color: #475569;
  margin-bottom: 8px;
  border-right: 3px solid #e2e8f0;
}

/* Order action row */
.dw-mgr-order-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

/* Active order highlight */
.dw-mgr-order-active {
  box-shadow: 0 0 0 2px var(--order-color, #3b82f6),
              var(--mgr-shadow);
}

/* Dashboard 2-col grid */
.dw-mgr-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 640px) {
  .dw-mgr-dash-grid { grid-template-columns: 1fr; }
}

/* Low stock rows */
.dw-mgr-low-stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: .88rem;
}
.dw-mgr-low-stock-row:last-child { border-bottom: none; }
.dw-mgr-low-stock-name { font-weight: 600; }
.dw-mgr-low-stock-qty {
  background: #fff7ed;
  color: #c2410c;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 700;
}
.dw-mgr-low-stock-qty.zero { background: #fee2e2; color: #dc2626; }

/* Recent orders table */
.dw-mgr-recent-orders { display: grid; gap: 8px; }
.dw-mgr-recent-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.dw-mgr-recent-row:last-child { border-bottom: none; }
.dw-mgr-recent-num { font-size: .82rem; font-weight: 800; letter-spacing: .5px; }
.dw-mgr-recent-customer { font-size: .78rem; color: var(--mgr-muted); margin-top: 2px; }
.dw-mgr-recent-amount { font-size: .88rem; font-weight: 700; color: var(--mgr-primary); text-align: left; }
.dw-mgr-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 700;
}

/* Chart wrap */
.dw-mgr-chart-wrap {
  width: 100%;
  overflow: hidden;
}

/* Upload area drag-over */
.dw-mgr-image-upload-area.drag-over {
  border-color: var(--mgr-primary);
  background: rgba(255,107,53,.04);
}

/* Product form section visible border */
.dw-mgr-product-form-wrap .dw-mgr-form-section {
  border: 1.5px solid var(--mgr-border);
}

/* Print styles for branch page */
@media print {
  .dw-mgr-topbar, .dw-mgr-filter-tabs, .dw-mgr-order-actions-row,
  .dw-mgr-refresh-btn, .dw-mgr-live-badge { display: none !important; }
  .dw-mgr-order-card { break-inside: avoid; border: 1px solid #ccc !important; }
}
