/* =====================================================================
   Inventory System — main stylesheet (RTL, Kurdish)
   ===================================================================== */
:root {
    --sidebar-width: 250px;
    --topbar-height: 56px;
    --brand: #0d6efd;
}

* { font-family: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif; }

body { background: #f4f6f9; }
[data-bs-theme="dark"] body { background: #1a1d21; }

/* ---------- Layout ---------- */
.app-wrapper { display: flex; min-height: 100vh; }

.app-sidebar {
    width: var(--sidebar-width);
    background: #1e2a38;
    color: #cdd7e2;
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .25s ease;
}
.sidebar-brand {
    height: var(--topbar-height);
    display: flex; align-items: center; gap: .6rem;
    padding: 0 1rem;
    font-weight: 700; color: #fff;
    background: rgba(0,0,0,.2);
    position: sticky; top: 0;
}
.sidebar-brand i { color: var(--brand); font-size: 1.3rem; }
.sidebar-nav { padding: .5rem; }
.sidebar-nav .nav-link {
    color: #cdd7e2; border-radius: .5rem; padding: .6rem .8rem; margin-bottom: .15rem;
    display: flex; align-items: center; gap: .65rem; font-size: .93rem;
}
.sidebar-nav .nav-link i { width: 20px; text-align: center; }
.sidebar-nav .nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--brand); color: #fff; }
.sidebar-nav .sidebar-heading {
    color: #7f8ba0; font-size: .72rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .06em; padding: .9rem .8rem .35rem; margin-top: .4rem;
    display: flex; align-items: center; gap: .5rem;
}
.sidebar-nav .sidebar-heading::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

.app-main {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    display: flex; flex-direction: column; min-width: 0;
}
.app-topbar {
    height: var(--topbar-height);
    background: #fff; border-bottom: 1px solid #e5e7eb;
    position: sticky; top: 0; z-index: 1030;
    display: flex; align-items: center;
}
[data-bs-theme="dark"] .app-topbar { background: #242830; border-color: #333; }
.app-content { flex: 1; }

/* ---------- Sidebar collapse ----------
   The sidebar sits on the inline-start edge (left in LTR, right in RTL), so it
   must hide toward that edge: -100% in LTR, +100% in RTL. translateX is a
   physical axis, hence the dir-aware rules. */
.sidebar-collapsed .app-sidebar { transform: translateX(-100%); }
[dir="rtl"] .sidebar-collapsed .app-sidebar { transform: translateX(100%); }
.sidebar-collapsed .app-main { margin-inline-start: 0; }
@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); }
    [dir="rtl"] .app-sidebar { transform: translateX(100%); }
    .app-main { margin-inline-start: 0; }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-backdrop {
        position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 1035;
    }
}

/* ---------- Cards / stats ---------- */
.stat-card {
    border: none; border-radius: .8rem; overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.stat-card .stat-icon {
    width: 54px; height: 54px; border-radius: .7rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; }
.stat-card .stat-label { color: #6c757d; font-size: .85rem; }

.card { border: none; border-radius: .8rem; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.card-header { background: transparent; border-bottom: 1px solid rgba(0,0,0,.06); font-weight: 600; }

/* ---------- Tables ---------- */
.table thead th { white-space: nowrap; font-size: .85rem; color: #6c757d; }
.table-hover tbody tr:hover { background: rgba(13,110,253,.04); }

/* ---------- Login ---------- */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e2a38 0%, #0d6efd 100%);
    padding: 1rem;
}
.login-card {
    background: #fff; border-radius: 1rem; padding: 2.2rem;
    width: 100%; max-width: 400px;
}
.login-logo {
    width: 70px; height: 70px; margin: 0 auto;
    background: var(--brand); color: #fff; border-radius: 1rem;
    display: flex; align-items: center; justify-content: center; font-size: 2rem;
}

/* ---------- POS layout ---------- */
.pos-grid { display: grid; grid-template-columns: 1fr 380px; gap: 1rem; }
@media (max-width: 991.98px) { .pos-grid { grid-template-columns: 1fr; } }
.pos-cart-item { display: flex; align-items: center; gap: .5rem; padding: .4rem 0; border-bottom: 1px dashed #ddd; }

/* ---------- POS product grid ---------- */
.grid-card { transition: transform .1s ease, box-shadow .1s ease; border: 1px solid rgba(0,0,0,.08); }
.grid-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.12); border-color: var(--brand); }
.grid-card:active { transform: scale(.97); }
#gridToggle.active { background: var(--brand); color: #fff; }

/* ---------- Utilities ---------- */
.cursor-pointer { cursor: pointer; }
.badge-status { font-size: .72rem; }

/* ---------- Print ---------- */
@media print {
    .app-sidebar, .app-topbar, .app-footer, .no-print { display: none !important; }
    .app-main { margin: 0 !important; }
    body { background: #fff; }
}
