/* Toast Notifications */
.toast-error {
  background: #9d3542;
}

/* Admin Dashboard Stats */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* تعديل كروت الإحصائيات لتكون محددة بإطار واضح */
.admin-stats > div {
  padding: 1.1rem 1.25rem;
  background: #fff;
  border: 1.5px solid #dcd7ed; /* تم تحديث الإطار ليكون أكثر بؤرة ووضوحاً */
  border-radius: 16px;
  box-shadow: 0 8px 22px #242a550d;
}

.admin-stats small {
  display: block;
  color: #747d90;
}

.admin-stats strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
  color: #403476;
}

.admin-cover {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
}
.custom-btn {
  background: #4a1dfd;
  border-color: #5331da;
    color: #fff;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.custom-btn:hover {
    background: #4a1dfd;
    border-color: #5331da;
    color: #fff;
}

/* Stock Status Pills */
.stock-pill {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  background: #e8f8ef;
  color: #207547;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 800;
  
}

.stock-pill.out {
  background: #fff0f1;
  color: #b14250;
}
.stock-pill.low { background:#fff0dc; color:#c95615; }
.low-stock-text { display:block; margin-top:.25rem; color:#c95615; font-weight:700; }
.low-stock-stat { border-color:#f2b989!important; background:#fffaf5!important; }
.order-details-link { color:#6c4ee3; font-weight:800; text-decoration:none; font-size:.78rem; }
.order-details-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; }
.admin-detail-card { padding:1.5rem; border:1px solid #e3ddec; border-radius:18px; background:#fff; }
.admin-detail-card h2 { color:#403476; font-size:1.15rem; font-weight:800; margin-bottom:1rem; }
.admin-detail-card p { margin-bottom:.5rem; color:#676071; }
.detail-total { display:block; margin-top:1rem; color:#6c4ee3; font-size:1.2rem; }
.coupon-state { display:inline-block; padding:.3rem .65rem; border-radius:20px; font-size:.78rem; font-weight:800; }
.coupon-state.active { background:#dcf7e9; color:#168057; }
.coupon-state.inactive { background:#eee; color:#777; }
@media(max-width:767px){.order-details-grid{grid-template-columns:1fr}.admin-stats{grid-template-columns:1fr 1fr}}

/* Form Card Components */
.form-card {
  max-width: 940px;
  padding: 1.8rem;
  background: #fff;
  border: 1px solid #eceaf3;
  border-radius: 22px;
  box-shadow: 0 10px 28px #242a5510;
}

.form-card label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* إظهار وتحديد كافة الخانات (Textfields / Inputs) بوضوح */
.form-card .form-control {
  background-color: #ffffff !important;
  border: 1.5px solid #b8b3c8 !important; /* إطار داكن ومحدد للمستطيل */
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  color: #24212b;
}

.form-card .form-control:focus {
  border-color: #6f42c1 !important;
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.15) !important;
  outline: none;
}

.form-card small {
  color: #7a8292;
  font-size: 0.76rem;
}

.form-card .field-validation-error {
  display: block;
  margin-top: 0.25rem;
}

.form-cover-preview {
  display: block;
  width: 75px;
  height: 95px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 0.6rem;
}

/* -------------------------------------------------- */
/* تنسيقات الجدول والقوائم المنسدلة (Orders Table)   */
/* -------------------------------------------------- */

/* حاوية الجدول وإطارها الخارجي */
.admin-table-wrap {
  background: #ffffff;
  border-radius: 16px;
  border: 1.5px solid #dcd7ed !important;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* رأس الجدول */
.admin-table-wrap .table thead tr {
  background-color: #f4f1f9 !important;
  border-bottom: 2px solid #dcd7ed !important;
}

/* خطوط فاصلة واضحة بين صفوف الطلبات */
.admin-table-wrap .table tbody tr {
  border-bottom: 1px solid #e8e4f3 !important;
}

/* قائمة خيارات الحالة (Dropdown) لتظهر بمستطيل محدد ومميز */
.admin-table-wrap .form-select {
  border: 1.5px solid #b2a9cc !important;
  background-color: #f8f7fc !important;
  color: #24212b !important;
  font-weight: 700;
  border-radius: 8px;
  padding: 0.4rem 0.65rem;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.admin-table-wrap .form-select:focus {
  border-color: #6f42c1 !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(111, 66, 193, 0.15) !important;
  outline: none;
}

/* Responsive Media Queries */
@media (max-width: 575.98px) {
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .form-card {
    padding: 1.25rem;
  }
 
}
.order-status,
.status-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 0.42rem 0.75rem;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.82rem;
}

.status-select {
  cursor: pointer;
  padding-inline-start: 1rem;
}

.status-new { background: #eeeaff; color: #6547d9; }
.status-preparing { background: #fff0dc; color: #d95813; }
.status-shipped { background: #dcecff; color: #2861c4; }
.status-completed { background: #dcf7e9; color: #168057; }
.status-cancelled { background: #ffe1e5; color: #c9364c; }

.status-select .option-new { background: #eeeaff; color: #6547d9; }
.status-select .option-preparing { background: #fff0dc; color: #d95813; }
.status-select .option-shipped { background: #dcecff; color: #2861c4; }
.status-select .option-completed { background: #dcf7e9; color: #168057; }
.status-select .option-cancelled { background: #ffe1e5; color: #c9364c; }

.orders-status-table td,
.orders-status-table th {
  padding-block: 1rem;
}
.orders-filter { display:grid; grid-template-columns:2fr 1fr 1fr 1fr auto auto auto; gap:.65rem; align-items:end; padding:1rem; margin-bottom:.8rem; border:1px solid #ddd7ea; border-radius:16px; background:#f8f7fc; }
.orders-filter small { display:block; margin-bottom:.25rem; color:#716a80; font-weight:700; }
.orders-filter .form-control,.orders-filter .form-select { min-height:42px; border-color:#d7d0e4; }
.orders-count { margin:.6rem 0; color:#766f83; font-size:.85rem; }
.order-actions { display:flex; gap:.4rem; flex-wrap:wrap; }
.archive-button { border:1px solid #d88916; background:#fff3dc; color:#b76508; font-weight:800; }
.archive-button:hover { background:#d88916; color:#fff; }
@media(max-width:991px){.orders-filter{grid-template-columns:1fr 1fr}.orders-filter>input:first-child{grid-column:1/-1}.orders-table-scroll{overflow-x:auto}.orders-table-scroll table{min-width:950px}}

.dashboard-insights { display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin:1.5rem 0; }
.dashboard-panel { padding:1.25rem; border:1.5px solid #dcd7ed; border-radius:18px; background:#fff; box-shadow:0 8px 22px #242a550a; }
.dashboard-panel-head, .dashboard-section-title { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:1rem; }
.dashboard-panel-head small, .dashboard-section-title small { color:#7a728d; font-weight:700; }
.dashboard-panel-head h2, .dashboard-section-title h2 { margin:.15rem 0 0; color:#302561; font-size:1.2rem; font-weight:800; }
.dashboard-panel-head a, .dashboard-section-title a { color:#6c4ee3; font-size:.8rem; font-weight:800; text-decoration:none; }
.insight-row { display:grid; grid-template-columns:34px 1fr auto; align-items:center; gap:.7rem; padding:.7rem 0; border-top:1px solid #eeeaf4; }
.insight-row img { width:34px; height:43px; object-fit:cover; }
.insight-row strong { color:#342e43; font-size:.88rem; }
.insight-row>span:last-child { color:#746c82; font-size:.78rem; white-space:nowrap; }
.insight-rank { display:grid; place-items:center; width:28px; height:28px; border-radius:50%; background:#eeeaff; color:#6547d9!important; font-weight:800; }
.stock-count { padding:.25rem .55rem; border-radius:20px; background:#fff0dc; color:#c95615!important; font-weight:800; }
.stock-count.empty { background:#ffe1e5; color:#c9364c!important; }
.dashboard-empty { padding:2rem 0; margin:0; color:#857e91; text-align:center; }
.dashboard-section-title { margin-top:2rem; }
@media(max-width:767px){.dashboard-insights{grid-template-columns:1fr}.dashboard-panel{padding:1rem}}

.inventory-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:1rem; margin-bottom:1.2rem; }
.inventory-stat { display:flex; justify-content:space-between; align-items:center; padding:1rem 1.2rem; border:2px solid transparent; border-radius:16px; text-decoration:none; transition:.2s; }
.inventory-stat:hover, .inventory-stat.selected { transform:translateY(-2px); border-color:currentColor; }
.inventory-stat small { font-weight:800; }
.inventory-stat strong { font-size:1.45rem; }
.stat-out { background:#fff0f1; color:#b83549; }
.stat-low { background:#fff2e6; color:#cb5b16; }
.stat-medium { background:#fff8d9; color:#927006; }
.stat-available { background:#e4f8ed; color:#17764f; }
.inventory-filter { display:grid; grid-template-columns:2fr 1fr auto auto; gap:.7rem; margin-bottom:1.2rem; padding:1rem; border:1px solid #e1dceb; border-radius:16px; background:#f8f7fc; }
.inventory-filter .form-control, .inventory-filter .form-select { min-height:44px; border-color:#d8d1e5; }
.inventory-book { display:flex; align-items:center; gap:.75rem; }
.inventory-book img { width:38px; height:50px; object-fit:cover; }
.inventory-quantity { display:inline-grid; place-items:center; min-width:48px; padding:.3rem .6rem; border-radius:20px; }
.quantity-out, .badge-out { background:#ffe0e4; color:#b83549; }
.quantity-low, .badge-low { background:#ffe9d5; color:#cb5b16; }
.quantity-medium, .badge-medium { background:#fff3bf; color:#816205; }
.quantity-available, .badge-available { background:#d7f5e4; color:#17764f; }
.inventory-badge { display:inline-block; min-width:116px; padding:.38rem .7rem; border-radius:20px; text-align:center; font-size:.78rem; font-weight:800; }
.stock-update-form { display:flex; gap:.45rem; align-items:center; }
.stock-update-form .form-control { width:82px; min-height:36px; }
@media(max-width:767px){.inventory-stats{grid-template-columns:1fr 1fr}.inventory-filter{grid-template-columns:1fr 1fr}.inventory-filter input{grid-column:1/-1}.inventory-table-wrap{overflow-x:auto}.inventory-table-wrap table{min-width:760px}}

html[data-theme="dark"] .admin-stats>div, html[data-theme="dark"] .dashboard-panel, html[data-theme="dark"] .admin-detail-card { background:#1c1f2a; border-color:#35394a!important; box-shadow:0 8px 24px #0004; }
html[data-theme="dark"] .admin-stats small, html[data-theme="dark"] .dashboard-panel small, html[data-theme="dark"] .admin-detail-card p { color:#adb0bf; }
html[data-theme="dark"] .admin-stats strong, html[data-theme="dark"] .dashboard-panel h2, html[data-theme="dark"] .dashboard-section-title h2, html[data-theme="dark"] .admin-detail-card h2 { color:#f1eeff; }
html[data-theme="dark"] .admin-table-wrap { background:#1c1f2a; border-color:#373b4c!important; }
html[data-theme="dark"] .admin-table-wrap .table { --bs-table-bg:#1c1f2a; --bs-table-color:#ececf3; --bs-table-border-color:#343849; }
html[data-theme="dark"] .admin-table-wrap .table thead tr { background:#252834!important; border-color:#3b4052!important; }
html[data-theme="dark"] .admin-table-wrap .table tbody tr { border-color:#343849!important; }
html[data-theme="dark"] .admin-table-wrap .form-select { background-color:#252834!important; border-color:#44495c!important; color:#eee!important; }
html[data-theme="dark"] .insight-row { border-color:#333747; }
html[data-theme="dark"] .insight-row strong, html[data-theme="dark"] .inventory-book strong { color:#eee; }
html[data-theme="dark"] .form-card label { color:#e9e7ef; }
html[data-theme="dark"] .low-stock-stat { background:#2c241c!important; border-color:#6d4a2f!important; }
html[data-theme="dark"] .archive-button { background:#3b2d18; border-color:#b9781c; color:#ffc56b; }
