/* =========================================================
   Adwaa Alghamer · Attendance & HR — theme
   Brand: deep green + desert gold (from the logo's sun rays).
   Change the variables below to re-colour the whole system.
   ========================================================= */
:root {
    --erp-primary: #0b5c4b;          /* brand green — main actions */
    --erp-primary-dark: #084536;
    --erp-primary-light: #e7f1ed;
    --erp-ink: #0f2a25;              /* sidebar / mobile header */
    --erp-ink-2: #163a33;
    --erp-accent: #ba9968;           /* desert gold from the logo */
    --erp-accent-soft: #f4ecdf;
    --erp-sidebar: var(--erp-ink);
    --erp-sidebar-text: #a9bfb8;
    --erp-bg: #f3f4f1;               /* stone */
    --erp-card: #ffffff;
    --erp-border: #e2e6e1;
    --erp-line: #edf0ec;
    --erp-text: #18221f;
    --erp-muted: #66736f;
    --ok: #1e8a5f; --ok-bg: #e2f3ea;
    --warn: #9a6512; --warn-bg: #fbf0da;
    --bad: #b8392a; --bad-bg: #fbe7e3;
    --info: #2c5f9e; --info-bg: #e5eef9;
    --violet: #6a46b0; --violet-bg: #efe9fa;
    --erp-radius: 14px;
    --erp-radius-sm: 9px;
    --shadow-1: 0 1px 2px rgba(15, 42, 37, .05), 0 1px 1px rgba(15, 42, 37, .03);
    --shadow-2: 0 10px 30px -12px rgba(15, 42, 37, .22);
    --font: 'IBM Plex Sans', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-primary: var(--erp-primary);
    --bs-primary-rgb: 11, 92, 75;
    --bs-link-color: var(--erp-primary);
    --bs-link-color-rgb: 11, 92, 75;
    --bs-link-hover-color: var(--erp-primary-dark);
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--erp-text);
    --bs-border-color: var(--erp-border);
    --bs-border-radius: var(--erp-radius-sm);
    --bs-border-radius-lg: 12px;
}
[dir=rtl] { --font: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif; }

body.erp, body.erp-mobile { font-family: var(--font); background: var(--erp-bg); color: var(--erp-text); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
[dir=rtl] body.erp, [dir=rtl] body.erp-mobile { font-size: 15px; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; letter-spacing: -.01em; }
[dir=rtl] h1, [dir=rtl] h2, [dir=rtl] h3, [dir=rtl] h4, [dir=rtl] h5, [dir=rtl] h6 { letter-spacing: 0; }
.tnum, .m-clock, .erp-stat .value, .kpi-value, td { font-variant-numeric: tabular-nums; }
::selection { background: var(--erp-accent-soft); }

/* ---------- Buttons & controls ---------- */
.btn { border-radius: var(--erp-radius-sm); font-weight: 500; }
.btn-lg { border-radius: 12px; font-weight: 600; }
.btn-primary { --bs-btn-bg: var(--erp-primary); --bs-btn-border-color: var(--erp-primary); --bs-btn-hover-bg: var(--erp-primary-dark); --bs-btn-hover-border-color: var(--erp-primary-dark); --bs-btn-active-bg: var(--erp-primary-dark); --bs-btn-active-border-color: var(--erp-primary-dark); --bs-btn-disabled-bg: var(--erp-primary); --bs-btn-disabled-border-color: var(--erp-primary); }
.btn-outline-primary { --bs-btn-color: var(--erp-primary); --bs-btn-border-color: #b9d3ca; --bs-btn-hover-bg: var(--erp-primary-light); --bs-btn-hover-color: var(--erp-primary-dark); --bs-btn-hover-border-color: var(--erp-primary); --bs-btn-active-bg: var(--erp-primary); --bs-btn-active-color: #fff; }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--erp-border); --bs-btn-hover-bg: #f6f7f5; --bs-btn-hover-border-color: #d3d9d3; }
.btn-accent { background: var(--erp-accent); color: #fff; border: none; }
.btn-accent:hover { background: #a6855a; color: #fff; }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: #187550; --bs-btn-hover-border-color: #187550; }
.btn-danger { --bs-btn-bg: var(--bad); --bs-btn-border-color: var(--bad); --bs-btn-hover-bg: #9c2f22; --bs-btn-hover-border-color: #9c2f22; }
.btn-check:checked + .btn-outline-primary, .btn-outline-primary:active { background: var(--erp-primary) !important; border-color: var(--erp-primary) !important; color: #fff !important; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--erp-primary); box-shadow: 0 0 0 3px rgba(186, 153, 104, .35); outline: none; }
.form-control, .form-select { border-color: #d7ddd7; border-radius: var(--erp-radius-sm); min-height: 40px; }
.form-control-lg, .form-select-lg { min-height: 48px; border-radius: 12px; }
.form-control-sm, .form-select-sm { min-height: 32px; }
textarea.form-control { min-height: auto; }
.form-label { font-weight: 500; color: #33413d; margin-bottom: 6px; }
.form-text { color: var(--erp-muted); }
.input-group-text { background: #f6f7f5; border-color: #d7ddd7; color: var(--erp-muted); }
.form-check-input:checked { background-color: var(--erp-primary); border-color: var(--erp-primary); }
body.erp a:not(.btn):not(.nav-link):not(.dropdown-item):not(.page-link) { color: var(--erp-primary); text-decoration: none; }
body.erp a:not(.btn):not(.nav-link):hover { text-decoration: underline; text-underline-offset: 3px; }
.text-primary { color: var(--erp-primary) !important; }
.bg-primary { background-color: var(--erp-primary) !important; }
.page-link { color: var(--erp-primary); border-color: var(--erp-border); }
.active > .page-link { background: var(--erp-primary); border-color: var(--erp-primary); }
.dropdown-menu { border: 1px solid var(--erp-border); border-radius: 12px; box-shadow: var(--shadow-2); padding: 6px; }
.dropdown-item { border-radius: 8px; padding: 7px 10px; }
.dropdown-item:active { background: var(--erp-primary); }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-2); }
.alert { border-radius: 12px; border: 1px solid transparent; }
.alert-success { background: var(--ok-bg); color: #145c40; border-color: #c7e6d4; }
.alert-danger { background: var(--bad-bg); color: #8c2a1f; border-color: #f2cbc3; }
.alert-warning { background: var(--warn-bg); color: #75500f; border-color: #f0dcb0; }
.alert-info { background: var(--info-bg); color: #234d80; border-color: #c9daf0; }
.alert-light { background: #fff; }
.progress { background: #e8ebe7; border-radius: 99px; }
.progress-bar { border-radius: 99px; }
.list-group-item { border-color: var(--erp-line); }

/* Pills (filters) */
.nav-pills { gap: 4px; background: #fff; border: 1px solid var(--erp-border); border-radius: 12px; padding: 4px; }
.nav-pills .nav-link { color: #44524e; border-radius: 9px; padding: 6px 12px; font-weight: 500; }
.nav-pills .nav-link:hover { background: #f3f5f2; }
.nav-pills .nav-link.active { background: var(--erp-ink); color: #fff; }
.nav-pills .nav-link .badge { font-size: 11px; }

/* Soft status badges (whole system) */
.badge { font-weight: 600; border-radius: 7px; padding: .38em .6em; letter-spacing: 0; }
.badge.bg-success { background: var(--ok-bg) !important; color: #17694a !important; }
.badge.bg-danger { background: var(--bad-bg) !important; color: #9c2f22 !important; }
.badge.bg-warning { background: var(--warn-bg) !important; color: #8a5a10 !important; }
.badge.bg-info { background: var(--info-bg) !important; color: #234d80 !important; }
.badge.bg-primary { background: var(--erp-primary-light) !important; color: var(--erp-primary-dark) !important; }
.badge.bg-secondary { background: #eceeeb !important; color: #4d5a56 !important; }
.badge.bg-dark { background: #2b3532 !important; color: #fff !important; }
.badge.bg-light { background: #f4f5f3 !important; }
.erp-nav .badge, .m-nav .badge, .rounded-pill.bg-danger { background: var(--bad) !important; color: #fff !important; }
.erp-nav .badge.bg-warning { background: var(--erp-accent) !important; color: #1c140a !important; }

/* ---------- Sidebar ---------- */
.erp-sidebar { position: fixed; inset: 0 auto 0 0; width: 252px; background: var(--erp-ink); color: var(--erp-sidebar-text); z-index: 1040; transition: transform .25s, width .2s; display: flex; flex-direction: column; }
.erp-sidebar::before { /* faint sun rays from the logo */
    content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; pointer-events: none; opacity: .5;
    background: repeating-conic-gradient(from 200deg at 105% -10%, rgba(186,153,104,.13) 0deg 1.2deg, transparent 1.2deg 9deg);
    -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.erp-brand { position: relative; padding: 22px 20px 16px; }
.erp-brand-logo { width: 100%; max-width: 196px; height: auto; display: block; }
.erp-brand-sub { font-size: 12px; color: var(--erp-accent); margin-top: 8px; font-weight: 500; }
.erp-search { position: relative; margin: 4px 14px 6px; }
.erp-search input { width: 100%; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.08); color: #fff; border-radius: 10px; padding: 8px 12px 8px 34px; font-size: 13px; }
[dir=rtl] .erp-search input { padding: 8px 34px 8px 12px; }
.erp-search input::placeholder { color: #7f9790; }
.erp-search input:focus { outline: none; border-color: var(--erp-accent); background: rgba(255,255,255,.09); }
.erp-search i { position: absolute; top: 50%; transform: translateY(-50%); inset-inline-start: 12px; color: #7f9790; font-size: 13px; }
.erp-nav { padding: 4px 12px 20px; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.erp-nav-title { font-size: 12px; color: #6f8a83; padding: 16px 10px 6px; font-weight: 500; }
body.erp .erp-nav a { color: var(--erp-sidebar-text) !important; text-decoration: none !important; }
body.erp .erp-nav a.active, body.erp .erp-nav a:hover { color: #fff !important; }
.erp-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; margin-bottom: 1px; font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.erp-nav a i { font-size: 16px; width: 18px; text-align: center; opacity: .85; }
.erp-nav a:hover { background: rgba(255,255,255,.05); }
.erp-nav a.active { background: rgba(255,255,255,.09); }
.erp-nav a.active i { color: var(--erp-accent); opacity: 1; }
.erp-nav a.active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--erp-accent); }
[dir=rtl] .erp-nav a.active::before { border-radius: 3px 0 0 3px; }
.erp-nav a .badge { margin-inline-start: auto; }
.erp-nav .nav-empty { display: none; padding: 10px; font-size: 12.5px; color: #7f9790; }
.erp-side-user { border-top: 1px solid rgba(255,255,255,.07); padding: 12px 14px; display: flex; align-items: center; gap: 10px; color: #dfe9e5; }
.erp-side-user .who { line-height: 1.2; min-width: 0; }
.erp-side-user .who b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erp-side-user .who small { color: #7f9790; }
.erp-collapse-btn { margin-inline-start: auto; background: transparent; border: 1px solid rgba(255,255,255,.1); color: #a9bfb8; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.erp-collapse-btn:hover { color: #fff; border-color: rgba(255,255,255,.25); }

/* collapsed (desktop) */
@media (min-width: 992px) {
    body.nav-collapsed .erp-sidebar { width: 76px; }
    body.nav-collapsed .erp-main { margin-inline-start: 76px; }
    body.nav-collapsed .erp-brand-logo { max-width: 44px; height: 40px; object-fit: cover; object-position: right center; }
    [dir=rtl] body.nav-collapsed .erp-brand-logo { object-position: left center; }
    body.nav-collapsed .erp-brand-sub, body.nav-collapsed .erp-search, body.nav-collapsed .erp-nav-title,
    body.nav-collapsed .erp-nav a span, body.nav-collapsed .erp-nav a .badge, body.nav-collapsed .erp-side-user .who, body.nav-collapsed .erp-side-user .erp-avatar { display: none; }
    body.nav-collapsed .erp-nav a { justify-content: center; padding: 10px 0; }
    body.nav-collapsed .erp-nav a i { font-size: 18px; }
    body.nav-collapsed .erp-nav-title + a { margin-top: 10px; }
    body.nav-collapsed .erp-collapse-btn { margin: 0 auto; transform: scaleX(-1); }
}

/* ---------- Main ---------- */
.erp-main { margin-inline-start: 252px; min-height: 100vh; transition: margin .2s; }
.erp-topbar { display: flex; align-items: center; gap: 12px; background: rgba(243, 244, 241, .85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--erp-border); padding: 14px 28px; position: sticky; top: 0; z-index: 1030; }
.erp-breadcrumb { font-size: 12px; color: var(--erp-muted); }
.erp-page-title { font-size: 21px; font-weight: 600; margin: 0; letter-spacing: -.015em; line-height: 1.25; }
[dir=rtl] .erp-page-title { letter-spacing: 0; }
.erp-topbar .btn-light { height: 38px; min-width: 38px; }
.erp-today { font-size: 12.5px; color: var(--erp-muted); background: #fff; border: 1px solid var(--erp-border); border-radius: 9px; padding: 8px 12px; }
.erp-avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--erp-accent); color: #1c140a; display: inline-grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.erp-content { padding: 24px 28px 48px; max-width: 1640px; }
@media (max-width: 991px) {
    .erp-sidebar { transform: translateX(-100%); }
    .erp-sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0,0,0,.45); }
    .erp-main { margin-inline-start: 0; }
    .erp-content { padding: 16px 12px 40px; }
    .erp-topbar { padding: 10px 12px; }
    .erp-page-title { font-size: 18px; }
    .erp-backdrop { position: fixed; inset: 0; background: rgba(15, 42, 37, .4); z-index: 1035; display: none; }
    .erp-sidebar.open + .erp-backdrop { display: block; }
}

/* ---------- Cards / tables ---------- */
.erp-card { background: var(--erp-card); border: 1px solid var(--erp-border); border-radius: var(--erp-radius); box-shadow: var(--shadow-1); }
.erp-card > .table-responsive:first-child, .erp-card > .table-responsive:last-child { border-radius: var(--erp-radius); }
.erp-card-header { padding: 14px 18px; border-bottom: 1px solid var(--erp-line); display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.erp-card-body { padding: 20px; }
.erp-stat { background: #fff; border: 1px solid var(--erp-border); border-radius: var(--erp-radius); padding: 14px 16px; display: flex; gap: 12px; align-items: center; height: 100%; box-shadow: var(--shadow-1); transition: border-color .15s; }
a:hover > .erp-stat { border-color: #c4cfc8; }
.erp-stat .icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.erp-stat .value { font-size: 22px; font-weight: 600; line-height: 1; }
.erp-stat .label { font-size: 12.5px; color: var(--erp-muted); margin-top: 5px; }
.i-green { background: var(--ok-bg); color: var(--ok); } .i-gold { background: var(--warn-bg); color: var(--warn); }
.i-red { background: var(--bad-bg); color: var(--bad); } .i-blue { background: var(--info-bg); color: var(--info); }
.i-purple { background: var(--violet-bg); color: var(--violet); } .i-gray { background: #eef0ed; color: #55625e; }
.table-erp { margin: 0; --bs-table-bg: transparent; }
.table-erp thead th { background: #f8f9f7; color: var(--erp-muted); font-weight: 500; font-size: 12.5px; border-bottom: 1px solid var(--erp-border); white-space: nowrap; padding: 10px 14px; }
.table-erp td { vertical-align: middle; border-color: var(--erp-line); padding: 12px 14px; }
.table-erp tbody tr:last-child td { border-bottom: 0; }
.table-erp tbody tr:hover { background: #f9faf8; }
.table-sm td { padding: 8px 10px; }
.trust { display: inline-block; min-width: 46px; text-align: center; border-radius: 99px; padding: 2px 9px; font-weight: 600; font-size: 12px; }
.trust-ok { background: var(--ok-bg); color: var(--ok); } .trust-mid { background: var(--warn-bg); color: var(--warn); } .trust-bad { background: var(--bad-bg); color: var(--bad); }
.flag-chip { display: inline-block; background: var(--bad-bg); color: #9c2f22; border-radius: 6px; padding: 1px 7px; font-size: 11.5px; margin: 1px; }
.map-box { height: 380px; border-radius: var(--erp-radius); border: 1px solid var(--erp-border); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-day { border-radius: 9px; padding: 5px 3px; min-height: 58px; font-size: 10.5px; overflow: hidden; line-height: 1.25; border: 1px solid var(--erp-line); background: #fff; }
.cal-day .n { font-weight: 600; font-size: 13px; }
.cal-present { background: var(--ok-bg); } .cal-late { background: var(--warn-bg); } .cal-half_day { background: var(--info-bg); }
.cal-absent { background: var(--bad-bg); } .cal-weekend, .cal-holiday { background: #f0f1ee; color: #8a9692; } .cal-leave { background: var(--violet-bg); } .cal-unpaid_leave { background: #e3dcef; color: #5b3f8a; } .cal-upcoming { background: #fff; color: #b5bec6; }

/* Dashboard hero */
.dash-hero { position: relative; overflow: hidden; border-radius: 18px; background: var(--erp-ink); color: #fff; padding: 22px 24px; margin-bottom: 18px; }
.dash-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-conic-gradient(from 190deg at 100% 0%, rgba(186,153,104,.16) 0deg 1deg, transparent 1deg 8deg);
    -webkit-mask-image: radial-gradient(circle at 100% 0, #000, transparent 70%); mask-image: radial-gradient(circle at 100% 0, #000, transparent 70%); }
[dir=rtl] .dash-hero::after { transform: scaleX(-1); }
.dash-hero h2 { font-size: 22px; margin: 0 0 4px; }
.dash-hero .sub { color: #a9bfb8; font-size: 13.5px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: rgba(255,255,255,.08); border-radius: 12px; overflow: hidden; margin-top: 18px; position: relative; z-index: 1; }
.kpi { background: var(--erp-ink-2); padding: 14px 16px; color: #fff; text-decoration: none !important; display: block; }
.kpi:hover { background: #1b443c; }
.kpi-value { font-size: 30px; font-weight: 600; line-height: 1; }
.kpi-label { color: #a9bfb8; font-size: 12.5px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.kpi-label .dot { width: 8px; height: 8px; border-radius: 50%; }
.kpi-bar { height: 4px; background: rgba(255,255,255,.1); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.kpi-bar span { display: block; height: 100%; background: var(--erp-accent); }
@media (max-width: 767px) { .kpis { grid-template-columns: repeat(2, 1fr); } .kpi-value { font-size: 24px; } }

@media print {
    .erp-sidebar, .erp-topbar, .no-print, form.erp-card, .erp-backdrop { display: none !important; }
    .erp-main { margin: 0 !important; } .erp-content { padding: 0; max-width: none; }
    .erp-card { border: none; box-shadow: none; }
    body.erp { background: #fff; }
}

/* ---------- Mobile app ---------- */
body.erp-mobile { background: var(--erp-bg); padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.m-header { position: relative; overflow: hidden; background: var(--erp-ink); color: #fff; padding: calc(14px + env(safe-area-inset-top)) 18px 74px; }
.m-header::after { content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-conic-gradient(from 195deg at 100% -5%, rgba(186,153,104,.18) 0deg 1.1deg, transparent 1.1deg 8deg);
    -webkit-mask-image: radial-gradient(circle at 100% 0, #000, transparent 75%); mask-image: radial-gradient(circle at 100% 0, #000, transparent 75%); }
[dir=rtl] .m-header::after { transform: scaleX(-1); }
.m-header > * { position: relative; z-index: 1; }
.m-top { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.m-top img { height: 26px; }
.m-icon-btn { width: 38px; height: 38px; border-radius: 11px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: #fff; display: inline-grid; place-items: center; position: relative; text-decoration: none; }
.m-icon-btn:hover, .m-icon-btn:focus { color: #fff; background: rgba(255,255,255,.14); }
.m-header .btn-outline-light { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); border-radius: 11px; height: 38px; }
.m-hello { color: #a9bfb8; font-size: 13.5px; }
.m-header .name { font-size: 22px; font-weight: 600; line-height: 1.25; }
.m-header .meta { color: var(--erp-accent); font-size: 13px; margin-top: 2px; }
.m-wrap { padding: 0 14px; margin-top: -58px; position: relative; z-index: 2; max-width: 560px; margin-inline: auto; }
.m-card { background: #fff; border-radius: 20px; border: 1px solid var(--erp-border); box-shadow: 0 8px 24px -14px rgba(15,42,37,.25); padding: 18px; margin-bottom: 12px; }
.m-card-title { font-weight: 600; font-size: 15px; }
.m-clock { font-size: 40px; font-weight: 600; letter-spacing: -.02em; text-align: center; line-height: 1.1; margin-top: 2px; }
.m-date { text-align: center; color: var(--erp-muted); margin: 6px 0 14px; }
.m-date .badge { font-size: 12px; }

/* Check-in dial: ring shows how much of today's shift has passed */
.m-dial { --p: 0; position: relative; width: 196px; height: 196px; margin: 10px auto 6px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--erp-accent) calc(var(--p) * 1%), #ebeee9 0); }
.m-dial::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #fff; }
.m-dial .m-btn { position: relative; margin: 0; }
.m-dial-caption { text-align: center; color: var(--erp-muted); font-size: 12.5px; margin-bottom: 8px; }
.m-btn { width: 164px; height: 164px; border-radius: 50%; border: none; display: grid; place-items: center; margin: 8px auto; color: #fff; font-weight: 600; font-size: 16px; letter-spacing: .02em; box-shadow: 0 14px 30px -10px rgba(11,92,75,.6); transition: transform .12s; }
.m-btn:active { transform: scale(.96); }
.m-btn i { font-size: 42px; display: block; margin-bottom: 2px; }
.m-btn.in { background: radial-gradient(circle at 35% 28%, #1a8f74, var(--erp-primary) 60%, var(--erp-primary-dark)); }
.m-btn.out { background: radial-gradient(circle at 35% 28%, #d4604f, #b13a2b 60%, #8f2c20); box-shadow: 0 14px 30px -10px rgba(177,58,43,.6); }
.m-btn:disabled { background: #cfd6d2; box-shadow: none; color: #fff; }
.m-loc { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 13px; }
.m-loc.ok { background: var(--ok-bg); color: #145c40; } .m-loc.bad { background: var(--bad-bg); color: #8c2a1f; } .m-loc.wait { background: #eff1ee; color: #55625e; }
.m-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.m-mini div { background: #f6f7f4; border: 1px solid var(--erp-line); border-radius: 12px; padding: 10px 4px; }
.m-mini b { display: block; font-size: 19px; font-weight: 600; color: var(--erp-text); }
.m-mini span { font-size: 11.5px; color: var(--erp-muted); }

/* Bottom navigation */
.m-nav { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--erp-border); display: flex; z-index: 1000; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
.m-nav a, .m-nav button { flex: 1; text-align: center; padding: 4px 0; color: #6b7874; text-decoration: none; font-size: 11.5px; background: none; border: none; font-weight: 500; }
.m-nav i { display: block; font-size: 20px; width: 52px; height: 30px; line-height: 30px; margin: 0 auto 2px; border-radius: 15px; transition: background .15s; }
.m-nav a.active { color: var(--erp-primary-dark); font-weight: 600; }
.m-nav a.active i { background: var(--erp-primary-light); color: var(--erp-primary); }
#camBox video, #camBox img { width: 100%; border-radius: 14px; background: #000; max-height: 320px; object-fit: cover; transform: scaleX(-1); }

/* ---------- Arabic / RTL ---------- */
[dir=rtl] .erp-sidebar { inset: 0 0 0 auto; }
[dir=rtl] .table-erp thead th { font-size: 13px; }
@media (max-width: 991px) {
    [dir=rtl] .erp-sidebar { transform: translateX(100%); }
    [dir=rtl] .erp-sidebar.open { transform: none; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* Multi image uploader */
.photo-uploader .up-thumb{position:relative;width:78px;height:78px;border-radius:10px;overflow:hidden;border:1px solid #e3d6c3;background:#faf7f2}
.photo-uploader .up-thumb img{width:100%;height:100%;object-fit:cover}
.photo-uploader .up-file{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;font-size:10px;padding:4px;text-align:center;word-break:break-all;color:#6b5a43}
.photo-uploader .up-file i{font-size:24px;color:#c0392b}
.photo-uploader .up-del{position:absolute;top:3px;inset-inline-end:3px;width:22px;height:22px;border-radius:50%;border:0;background:rgba(0,0,0,.65);color:#fff;font-size:15px;line-height:20px;padding:0}
.photo-uploader .up-add:disabled{opacity:.55}
.photo-strip{display:flex;flex-wrap:wrap;gap:6px}
.photo-strip img{width:64px;height:64px;object-fit:cover;border-radius:8px;border:1px solid #e3d6c3}

/* Mobile action tiles */
.m-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;text-decoration:none;padding:14px 4px;border-radius:14px;background:#f6f7f4;border:1px solid var(--erp-line);color:var(--erp-text);font-size:12.5px;font-weight:500;line-height:1.25;height:100%}
.m-tile:active{background:var(--erp-primary-light)}
.m-tile i{font-size:22px;color:var(--erp-primary);width:44px;height:44px;line-height:44px;border-radius:12px;background:#fff;border:1px solid var(--erp-line)}
.bal-box{border:1px solid var(--erp-border);border-radius:14px;padding:12px 10px;text-align:center;background:#fff}
.bal-box .num{font-size:28px;font-weight:600;color:var(--erp-primary);line-height:1.1;font-variant-numeric:tabular-nums}
.bal-box .lbl{font-size:12px;color:#6c757d}
.adv-badge{background:#fff3cd;color:#8a6200;border:1px solid #f0d48a}
body.erp .dash-hero a.kpi, body.erp .dash-hero a.kpi:hover { color: #fff !important; text-decoration: none !important; }
.erp-stat .label { line-height: 1.3; }
