

/*
  Global UI fixes for AdminLTE pages:
  - Better RTL alignment (Kurdish/Arabic)
  - Better mobile action button layout
*/

/* Mobile/table action buttons */
.action-buttons {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.action-buttons .btn {
    white-space: nowrap;
}

/* RTL support (AdminLTE master already sets dir="rtl" for ku/ar) */
html[dir="rtl"],
body[dir="rtl"],
[dir="rtl"] {
    direction: rtl;
}

/* Global card header flexbox fix for RTL/LTR compatibility */
.card-header,
html[dir="rtl"] .card-header,
html[dir="ltr"] .card-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap;
}

html[dir="rtl"] .card,
html[dir="rtl"] .card-header {
    text-align: right;
}

html[dir="ltr"] .card,
html[dir="ltr"] .card-header {
    text-align: left;
}

html[dir="rtl"] .card-header .card-title {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

html[dir="ltr"] .card-header .card-title {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
}

/* Logical margin properties for RTL/LTR (auto-mirroring) */
html[dir="rtl"] .mr-1 { margin-right: 0; margin-left: 0.25rem; }
html[dir="rtl"] .mr-2 { margin-right: 0; margin-left: 0.5rem; }
html[dir="rtl"] .mr-3 { margin-right: 0; margin-left: 1rem; }

html[dir="ltr"] .mr-1 { margin-inline-end: 0.25rem; }
html[dir="ltr"] .mr-2 { margin-inline-end: 0.5rem; }
html[dir="ltr"] .mr-3 { margin-inline-end: 1rem; }

/* Make action buttons order feel natural in RTL */
html[dir="rtl"] .action-buttons {
    flex-direction: row-reverse;
}

/* Global small-box consistency for all modules (expenses/sales/purchase/cash drawer/...) */
/* Exclude dashboard KPI cards (they already have custom layout). */
.small-box:not(.dashboard-kpi-box) {
    min-height: 130px;
}

.small-box:not(.dashboard-kpi-box) .inner {
    position: relative;
    z-index: 10;
}

/* Keep long KPI numbers inside summary boxes */
.small-box:not(.dashboard-kpi-box) .inner h3 {
    font-size: clamp(1.50rem, 2.1vw, 2.45rem) !important;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    margin-bottom: 0.35rem;
    padding-right: 70px;
    letter-spacing: -0.2px;
}

html[dir="rtl"] .small-box:not(.dashboard-kpi-box) .inner h3 {
    padding-right: 0;
    padding-left: 70px;
}

.small-box:not(.dashboard-kpi-box) .icon {
    position: absolute;
    top: 20px;
    right: 10px;
    left: auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 60px;
    min-width: 40px;
    min-height: 40px;
    font-size: 2.5rem;
    opacity: 1 !important;
    transition: none;
}

.small-box:not(.dashboard-kpi-box) .icon > i,
.small-box:not(.dashboard-kpi-box) .icon > svg {
    right: 15px;
    left: auto;
}

html[dir="rtl"] .small-box:not(.dashboard-kpi-box) .icon {
    left: 10px !important;
    right: auto !important;
}

html[dir="rtl"] .small-box:not(.dashboard-kpi-box) .icon > i,
html[dir="rtl"] .small-box:not(.dashboard-kpi-box) .icon > svg {
    left: 15px !important;
    right: auto !important;
}


   /* گوهۆڕینا ڕەنگێ پاشبنەما و نڤیسینا Tooltip */
    .tooltip-inner {
        background-color: #ffffff !important; /* ڕەنگێ سپی */
        color: #333 !important;             /* ڕەنگێ نڤیسینێ (تۆخ) */
        border: 1px solid #ddd;              /* چوارچۆڤەکێ تەنک */
        box-shadow: 0px 4px 8px rgba(0,0,0,0.1); /* سێبەرەکا جان وەک یێ وێنەی */
        padding: 10px;                       /* بۆشایی د ناڤ دا */
        font-size: 14px;                     /* قەبارێ نڤیسینێ */
        border-radius: 5px;                  /* خڕکرنا گۆشەیان */
    }

    /* گوهۆڕینا ڕەنگێ ئەو تیرۆکا (Arrow) دچیتە سەر ئای کۆنی */
    .bs-tooltip-top .arrow::before, 
    .bs-tooltip-auto[x-placement^="top"] .arrow::before {
        border-top-color: #ffffff !important;
    }

 

@media (max-width: 575.98px) {
    .small-box:not(.dashboard-kpi-box) {
        min-height: 112px;
    }

    .small-box:not(.dashboard-kpi-box) .inner h3 {
        font-size: clamp(1.20rem, 4.8vw, 1.4rem) !important;
        padding-right: 0;
        padding-left: 0;
        letter-spacing: -0.1px;
    }

    .small-box:not(.dashboard-kpi-box) .icon {
        font-size: 2rem;
        width: 40px;
        min-width: 32px;
        min-height: 32px;
        position: static !important;
        float: none !important;
        margin: 0 auto !important;
    }
    
    /* Hide ONLY cash drawer icons on mobile */
    .cashdraw-icon {
        display: none !important;
    }
}

/* Keep fallback float behavior predictable */
html[dir="rtl"] .small-box:not(.dashboard-kpi-box) .icon { float: left !important; }
html[dir="ltr"] .small-box:not(.dashboard-kpi-box) .icon { float: right !important; }



                /* ئەڤە بارێ لۆدینگێ یە کو جهێ ژمارەی دگریت */
    .skeleton-bar {
        display: inline-block;
        width: 120px; /* قەبارەیێ وێ دگەل ژمارەیێن خۆ ڕێک بێخە */
        height: 28px;
        background-color: rgba(255, 255, 255, 0.25);
        border-radius: 5px;
        position: absolute;
        left: 0;
        top: 5px;
        animation: shimmer 1.5s infinite ease-in-out;
    }

    /* ئەنیمەیشنا دەبریسینێ */
    @keyframes shimmer {
        0% { opacity: 0.4; }
        50% { opacity: 0.8; }
        100% { opacity: 0.4; }
    }

    /* ئەگەر زمانێ تە RTL بیت، بارێ لۆدینگێ ب لایێ ڕاستێ ڤە دانی */
    [dir="rtl"] .skeleton-bar {
        left: auto;
        right: 0;
    }




/* ava claset hnde na ko zman chbit box har hnde xobn */
   
        .box-responsive-rtl {
            margin-left: -6px;
            margin-right: -6px;
        }

        .box-responsive-rtl > [class*="col-"] {
            padding-left: 6px;
            padding-right: 6px;
            margin-bottom: 12px;
        }

        .box-responsive-rtl .small-box {
            margin-bottom: 0;
        }