:root {
    --color-bg-dark: #33393F;
    --color-accent: #FD7F50;
    --color-text-on-dark: #FD7F50;
    --color-bg-sidebar: #2a2f35;
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* Reset بسيط */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #111;
    background: transparent; /* مهم عشان يبان الـ gradient */
}

/* خلفية متحركة أوضح 
.bg-animated {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 0% 0%,   #3f4752, #222831 45%, #14171a 100%),
        radial-gradient(circle at 100% 100%, #2f3640, #222831 45%, #14171a 100%);
    background-size: 200% 200%;
    animation: gradientMove 25s ease-in-out infinite;
}
*/


/* خلفية متحركة أوضح */
.bg-animated {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 0% 0%,   #23ed8b, #00d4ff 45%, #14171a 100%),
        radial-gradient(circle at 100% 100%, #23ed8b, #00d4ff 45%, #14171a 100%);
    background-size: 200% 200%;
    animation: gradientMove 25s ease-in-out infinite;
}

@keyframes gradientMove {
    0%   { background-position: 0% 0%, 100% 100%; }
    50%  { background-position: 100% 0%, 0% 100%; }
    100% { background-position: 0% 0%, 100% 100%; }
}


/* الهيدر */
.main-header {
    background-color: var(--color-bg-dark) !important;
    color: #fff;
}

.text-accent {
    color: var(--color-accent) !important;
}

.logo-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* تخطيط أساسي */
.main-layout {
    min-height: calc(100vh - 56px);
}

/* القائمة الجانبية */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: var(--color-bg-sidebar);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.sidebar .nav-link {
    color: #dcdcdc;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #1f2328;
    color: var(--color-accent);
    transform: translateX(-2px);
}

/* الفوتر */
.main-footer {
    background-color: var(--color-bg-dark) !important;
    color: #fff;
    font-size: 0.8rem;
}

/* شارة الإشعارات */
.notif-badge {
    position: absolute;
    top: -4px;
    right: -8px;
    background-color: #ff4757;
    font-size: 0.7rem;
}

/* حالة المستخدم */
.user-chip {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background-color: rgba(0, 0, 0, 0.25);
    color: #fff;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-online {
    background-color: #2ecc71;
}

/* الداش بورد كروت بسيطة */
.dashboard-cards .card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-soft);
    background-color: #ffffff; /* أبيض وواضح فوق الخلفية */
    color: #111;
}

/* زر اللون البرتقالي */
.btn-accent {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(253, 127, 80, 0.4);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}

.btn-accent:hover {
    background-color: #ff6a33;
    border-color: #ff6a33;
    box-shadow: 0 4px 14px rgba(253, 127, 80, 0.55);
    transform: translateY(-1px);
}

/* تحسين بسيط لبطاقة تسجيل الدخول */
.card {
    border-radius: 1rem;
}

/* تجاوب */
@media (max-width: 767.98px) {
    .sidebar {
        min-height: auto;
    }

    .main-layout .row.flex-nowrap {
        flex-wrap: wrap;
    }

    .sidebar {
        width: 100%;
    }
}


/* ===== Dashboard metrics ===== */

.dashboard-page {
    padding-bottom: 2rem;
}

.dashboard-animate {
    animation: dashFadeUp 0.5s ease-out;
}

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

.metric-card {
    background-color: #ffffff;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric-card::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--color-accent), #ffb08a);
    opacity: 0.9;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.metric-title {
    font-size: 0.9rem;
    color: #666;
}

.metric-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-accent);
}

.metric-sub {
    font-size: 0.9rem;
    color: #555;
}

.metric-link {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: #1a73e8;
}

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

/* كروت كبيرة للإجماليات */
.metric-card-lg {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.metric-percent {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2ecc71;
}

/* كروت الرسوم البيانية */
.chart-card {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-soft);
    border: none;
    background-color: #ffffff;
    height: 260px;               /* ارتفاع الكرت */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* تحكم في حجم الرسوم البيانية */
.chart-card canvas {
    width: 100% !important;
    height: 200px !important;    /* ارتفاع الرسم نفسه */
    margin-inline: auto;
}

/* ===== Products page ===== */
.products-page {
    padding-bottom: 2rem;
}

.products-page .card {
    border-radius: 0.75rem;
}

.products-table thead th {
    font-size: 0.8rem;
    white-space: nowrap;
}

.products-table tbody td {
    font-size: 0.85rem;
}

.status-badge {
    font-size: 0.75rem;
    padding-inline: 0.45rem;
    padding-block: 0.2rem;
    border-radius: 999px;
}

.status-ok {
    background-color: #2ecc71;
    color: #fff;
}

.status-active {
    background-color: #2ecc71;
    color: #fff;
}

.status-low {
    background-color: #f1c40f;
    color: #111;
}

.status-out {
    background-color: #e74c3c;
    color: #fff;
}


.table-sort-link {
    cursor: pointer;
}

.table-sort-link i {
    font-size: 0.75rem;
    opacity: 0.8;
}


/* سكروول رأسي للجدول مع ثبات الهيدر */
.products-table-wrapper {
    max-height: 500px;      /* غيّرها للمقاس اللي يعجبك أو استخدم 70vh مثلاً */
    overflow-y: auto;
}

/* اختياري: تثبيت عنوان الأعمدة أثناء السكروول */
.products-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background-color: #f8f9fa; /* نفس لون الهيدر bootstrap table-light */
}

/* مربع البحث في القائمة الجانبية */
.sidebar-search-input {
    background-color: #111827;           /* خلفية داكنة */
    border-radius: 999px;               /* شكل كبسولة */
    border: 1px solid #374151;          /* إطار خفيف */
    color: #e5e7eb;
    padding-right: 2.2rem;              /* مساحة لأيقونة البحث */
    padding-left: 0.75rem;
    height: 32px;
    font-size: 0.8rem;
}

.sidebar-search-input::placeholder {
    color: #6b7280;
    font-size: 0.75rem;
}

.sidebar-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px #0ea5e9;      /* هالة تركيز خفيفة سماوية */
    border-color: #0ea5e9;
}

.sidebar-search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: #9ca3af;
    pointer-events: none;               /* ما تمنع الكتابة أو الكليك */
}

/* =========================
   Report: Item Sales Discounts
   ========================= */
.report-page {
  --rp-gap: 12px;
}

.report-page h4 {
  font-size: 1.15rem;
  margin: 0;
}

.report-page .text-muted.small {
  line-height: 1.5;
}

.report-page .card {
  border-radius: 14px;
}

.report-page .card-header {
  border-bottom: 1px solid rgba(0,0,0,.06);
  padding: 12px 14px;
}

.report-page .card-body {
  padding: 14px;
}

/* tighten the filter grid */
.report-page .row.g-3 {
  --bs-gutter-x: 12px;
  --bs-gutter-y: 10px;
}

.report-page .form-label {
  font-weight: 600;
  font-size: .92rem;
  margin-bottom: 6px;
}

.report-page .form-control,
.report-page .form-select {
  border-radius: 10px;
  min-height: 40px;
}

.report-page .form-text {
  font-size: .78rem;
}

.report-page .btn {
  border-radius: 10px;
  min-height: 40px;
}

.report-page .btn.btn-outline-secondary,
.report-page .btn.btn-outline-success {
  min-height: 38px;
}

/* top header spacing */
.report-page .report-topbar {
  gap: 10px !important;
}

/* collapse button nicer */
.report-page .filter-collapse-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* results table */
.report-page .table-responsive {
  border-radius: 12px;
  overflow: auto;
  border: 1px solid rgba(0,0,0,.06);
}

.report-page table.table {
  margin: 0;
  font-size: .92rem;
}

.report-page table.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8f9fa;
  white-space: nowrap;
  font-weight: 700;
  border-bottom: 1px solid rgba(0,0,0,.12);
}

.report-page table.table td,
.report-page table.table th {
  vertical-align: middle;
  padding: 10px 10px;
}

.report-page table.table tbody tr:hover {
  background: rgba(13,110,253,.04);
}

/* numbers alignment */
.report-page .num {
  text-align: left; /* RTL page: numbers feel better left */
  direction: ltr;
  font-variant-numeric: tabular-nums;
}

/* print: hide filters */
@media print {
  .report-page #filtersBox,
  .report-page .btn,
  .report-page .sidebar,
  .report-page header,
  .report-page .main-header {
    display: none !important;
  }
  .report-page .card {
    border: 0 !important;
    box-shadow: none !important;
  }
}

