:root {
    --oms-primary: #4f46e5;
    --oms-teal: #0ea5a4;
    --oms-bg: #f4f6fb;
    --oms-border: #e5e7f0;
    --oms-muted: #6b7280;
    --oms-side: #111827;
    --bs-primary: #4f46e5;
    --bs-primary-rgb: 79, 70, 229;
    --bs-link-color: #4f46e5;
    --bs-link-color-rgb: 79, 70, 229;
}
body { background: var(--oms-bg); font-family: "Rubik", "Segoe UI", "Noto Sans Hebrew", "Noto Sans Arabic", Tahoma, sans-serif; color: #1e2333; }
.btn { border-radius: 10px; }
.btn-primary { --bs-btn-bg: var(--oms-primary); --bs-btn-border-color: var(--oms-primary); --bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca; --bs-btn-active-bg: #3730a3; --bs-btn-disabled-bg: #a5b4fc; --bs-btn-disabled-border-color: #a5b4fc; }
.btn-outline-primary { --bs-btn-color: var(--oms-primary); --bs-btn-border-color: var(--oms-primary); --bs-btn-hover-bg: var(--oms-primary); --bs-btn-hover-border-color: var(--oms-primary); --bs-btn-active-bg: var(--oms-primary); }
.form-control, .form-select { border-radius: 10px; border-color: var(--oms-border); }
.form-control:focus, .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 .2rem rgba(99, 102, 241, .15); }
.text-primary { color: var(--oms-primary) !important; }

/* auth */
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(circle at 15% 10%, #e0e7ff 0, transparent 40%), radial-gradient(circle at 85% 90%, #ccfbf1 0, transparent 40%), var(--oms-bg); }
.auth-card { width: 100%; max-width: 430px; background: #fff; border-radius: 22px; padding: 34px 30px; box-shadow: 0 20px 60px rgba(30, 35, 51, .12); }
.auth-logo { width: 80px; height: 80px; display: block; margin: 0 auto 14px; }
.portal-btn { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--oms-side); color: #cbd5e1; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px; color: #fff; font-weight: 700; text-decoration: none; }
.sidebar .side-brand small { display: block; font-weight: 400; color: #94a3b8; font-size: .78rem; }
.sidebar .side-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #64748b; padding: 14px 20px 6px; }
.sidebar a.side-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: #cbd5e1; text-decoration: none; border-inline-start: 3px solid transparent; }
.sidebar a.side-link .bi { font-size: 1.1rem; width: 22px; text-align: center; }
.sidebar a.side-link:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.sidebar a.side-link.active { background: rgba(99, 102, 241, .18); color: #fff; border-inline-start-color: #818cf8; }
.sidebar .side-foot { margin-top: auto; padding: 16px 20px; font-size: .8rem; color: #64748b; }
.main { flex: 1; min-width: 0; }
.topnav { background: #fff; border-bottom: 1px solid var(--oms-border); padding: 12px 24px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 1020; }
.topnav .page-h { font-weight: 700; font-size: 1.2rem; margin: 0; flex: 1; }
.content { padding: 24px; }
.menu-toggle { display: none; }
@media (max-width: 992px) {
    .sidebar { position: fixed; inset-inline-start: 0; z-index: 1050; transform: translateX(100%); transition: transform .2s; }
    [dir="ltr"] .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: none; }
    .menu-toggle { display: inline-flex; }
    .content { padding: 16px; }
}
.impersonate-bar { background: #fef3c7; color: #92400e; padding: 8px 24px; font-size: .9rem; display: flex; gap: 10px; align-items: center; }

/* cards */
.card-x { background: #fff; border: 1px solid var(--oms-border); border-radius: 16px; box-shadow: 0 4px 18px rgba(30, 35, 51, .05); }
.card-x > .card-x-head { padding: 14px 18px; border-bottom: 1px solid var(--oms-border); display: flex; align-items: center; gap: 10px; font-weight: 600; }
.card-x > .card-x-head .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.card-x > .card-x-body { padding: 18px; }
.kpi { padding: 18px; display: flex; gap: 14px; align-items: center; }
.kpi .kpi-icon { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.kpi .kpi-val { font-size: 1.55rem; font-weight: 700; line-height: 1.1; }
.kpi .kpi-label { color: var(--oms-muted); font-size: .85rem; }
.bg-soft-indigo { background: #eef2ff; color: #4f46e5; }
.bg-soft-teal { background: #ccfbf1; color: #0f766e; }
.bg-soft-amber { background: #fef3c7; color: #b45309; }
.bg-soft-rose { background: #ffe4e6; color: #be123c; }
.bg-soft-sky { background: #e0f2fe; color: #0369a1; }
.bg-soft-slate { background: #f1f5f9; color: #334155; }

.status-badge { font-size: .78rem; padding: .38em .8em; border-radius: 999px; font-weight: 500; white-space: nowrap; }
.st-0 { background: #fef3c7; color: #92400e; }
.st-1 { background: #dcfce7; color: #166534; }
.st-2 { background: #fee2e2; color: #991b1b; }
.st-3 { background: #e5e7eb; color: #374151; }
.st-active { background: #dcfce7; color: #166534; }
.st-suspended { background: #fee2e2; color: #991b1b; }
.st-expired { background: #fef3c7; color: #92400e; }

.nav-pills .nav-link { border-radius: 10px; color: #334155; }
.nav-pills .nav-link.active { background: var(--oms-primary); }

/* tables */
table.dataTable { width: 100% !important; }
table.dataTable td, table.dataTable th { vertical-align: middle; }
div.dt-container .dt-search input { border-radius: 10px; }
.thumb { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; background: #f3f4f8; border: 1px solid var(--oms-border); }
.thumb-ph { width: 44px; height: 44px; border-radius: 8px; background: #f3f4f8; display: inline-flex; align-items: center; justify-content: center; color: #c7cbe0; }
.row-actions { white-space: nowrap; }
.row-actions .btn { padding: .25rem .5rem; }
.free-line td { background: #f0fdf4 !important; }
.items-editor td { vertical-align: middle; }
.items-editor input { min-width: 80px; }

.img-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.img-tile { position: relative; width: 96px; height: 96px; border: 1px solid var(--oms-border); border-radius: 10px; overflow: hidden; background: #f8f9fc; }
.img-tile img { width: 100%; height: 100%; object-fit: contain; }
.img-tile button { position: absolute; top: 4px; inset-inline-end: 4px; padding: 0 6px; }

.swal2-popup { border-radius: 20px !important; font-family: inherit; }
.swal2-styled { border-radius: 10px !important; }
.ts-wrapper .ts-control { border-radius: 10px; border-color: var(--oms-border); min-height: 38px; }
.modal-content { border-radius: 18px; border: 0; }
.modal-header { border-bottom-color: var(--oms-border); }
.modal-footer { border-top-color: var(--oms-border); }

@media print {
    .sidebar, .topnav, .no-print, .impersonate-bar { display: none !important; }
    .content { padding: 0; }
    body { background: #fff; }
}
