/* =====================================================================
   Abaya World - application styling
   Built on Bootstrap 5.3 (the RTL build is loaded automatically in Arabic).
   Layout uses logical properties so one stylesheet serves LTR and RTL.
   ===================================================================== */

:root {
    --aw-navy:        #1c2540;
    --aw-navy-soft:   #27324f;
    --aw-navy-line:   #33405f;
    --aw-gold:        #c08a34;
    --aw-gold-soft:   #f3e4c4;

    --aw-bg:          #f7f4ee;
    --aw-surface:     #ffffff;
    --aw-border:      #eae4d6;
    --aw-text:        #1c2540;
    --aw-muted:       #6b7280;
    --aw-faint:       #a3a9b7;

    --aw-green:       #1f9d6b;
    --aw-green-bg:    #e7f6ee;
    --aw-amber:       #c08a34;
    --aw-amber-bg:    #fbf1de;
    --aw-blue:        #3b6fd1;
    --aw-blue-bg:     #eaf0fc;
    --aw-red:         #d1495b;
    --aw-red-bg:      #fcebed;

    --aw-sidebar-w:   264px;
    --aw-header-h:    64px;
    --aw-radius:      16px;
    --aw-radius-sm:   10px;
    --aw-shadow:      0 1px 2px rgba(28, 37, 64, .04), 0 6px 18px rgba(28, 37, 64, .05);
    --aw-shadow-lg:   0 10px 32px rgba(28, 37, 64, .14);

    --bs-primary:     #1c2540;
    --bs-primary-rgb: 28, 37, 64;
    --bs-body-bg:     var(--aw-bg);
    --bs-body-color:  var(--aw-text);
    --bs-border-color:var(--aw-border);
    --bs-link-color:  #2f4272;
    --bs-link-hover-color: #c08a34;
}

/* ---- Base ---------------------------------------------------------- */

html, body { height: 100%; }

body {
    background: var(--aw-bg);
    color: var(--aw-text);
    font-family: "Plus Jakarta Sans", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: .935rem;
    -webkit-font-smoothing: antialiased;
}

/* Arabic gets a font actually drawn for Arabic, not a Latin font's fallback glyphs */
html[dir="rtl"] body {
    font-family: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
    font-size: .97rem;
    line-height: 1.75;
}

a { text-decoration: none; }
a:hover { text-decoration: none; }

.text-muted { color: var(--aw-muted) !important; }

/* Numbers stay readable and aligned in both directions */
.num, .table td.num, .table th.num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
    direction: ltr;
    unicode-bidi: embed;
}
html[dir="rtl"] .num { text-align: right; }

/* ---- App shell ------------------------------------------------------ */

.aw-shell { display: flex; min-height: 100vh; }

.aw-sidebar {
    width: var(--aw-sidebar-w);
    flex: 0 0 var(--aw-sidebar-w);
    background: var(--aw-navy);
    color: #ced4e4;
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform .25s ease;
    overflow: hidden;
}

.aw-sidebar__brand {
    height: var(--aw-header-h);
    display: flex;
    align-items: center;
    gap: .65rem;
    padding-inline: 1.1rem;
    border-bottom: 1px solid var(--aw-navy-line);
    flex: 0 0 auto;
}

.aw-sidebar__brand .mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--aw-gold), #a8842f);
    color: #1c2540;
    display: grid; place-items: center;
    font-weight: 700; font-size: 1rem;
    flex: 0 0 auto;
}

.aw-sidebar__brand .name {
    color: #fff; font-weight: 700; font-size: 1.02rem;
    line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aw-sidebar__brand .sub { color: #8a93ae; font-size: .72rem; }

.aw-sidebar__scroll { overflow-y: auto; flex: 1 1 auto; padding: .75rem 0 1.5rem; }
.aw-sidebar__scroll::-webkit-scrollbar { width: 6px; }
.aw-sidebar__scroll::-webkit-scrollbar-thumb { background: #3a4665; border-radius: 3px; }

.aw-navgroup {
    padding: 1rem 1.15rem .35rem;
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #6f7b9c;
    font-weight: 600;
}

.aw-nav a {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .58rem 1.15rem;
    color: #c3cbdf;
    font-size: .9rem;
    border-inline-start: 3px solid transparent;
    transition: background .15s, color .15s;
}
.aw-nav a i { font-size: 1.03rem; width: 1.25rem; text-align: center; flex: 0 0 auto; }
.aw-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.aw-nav a.active {
    background: rgba(192, 138, 52, .16);
    color: #fff;
    border-inline-start-color: var(--aw-gold);
    font-weight: 700;
}
.aw-nav a .badge { margin-inline-start: auto; }

/* ---- Main column ---------------------------------------------------- */

.aw-main {
    flex: 1 1 auto;
    margin-inline-start: var(--aw-sidebar-w);
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.aw-header {
    height: var(--aw-header-h);
    background: var(--aw-surface);
    border-bottom: 1px solid var(--aw-border);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding-inline: 1rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.aw-header__search { flex: 1 1 auto; max-width: 480px; position: relative; }
.aw-header__search input {
    background: var(--aw-bg);
    border: 1px solid transparent;
    border-radius: 999px;
    padding-inline: 2.3rem .9rem;
    height: 38px;
    font-size: .88rem;
}
.aw-header__search input:focus {
    background: #fff;
    border-color: #c3cbdf;
    box-shadow: none;
}
.aw-header__search i {
    position: absolute;
    inset-inline-start: .8rem;
    top: 50%; transform: translateY(-50%);
    color: var(--aw-muted); font-size: .95rem; pointer-events: none;
}

.aw-content { padding: 1.25rem; flex: 1 1 auto; }
@media (min-width: 1400px) { .aw-content { padding: 1.5rem 1.75rem; } }

.aw-iconbtn {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--aw-text);
    background: transparent;
    border: none;
    position: relative;
}
.aw-iconbtn:hover { background: var(--aw-bg); color: var(--aw-navy); }
.aw-iconbtn .dot {
    position: absolute; top: 6px; inset-inline-end: 6px;
    min-width: 17px; height: 17px; padding: 0 4px;
    border-radius: 999px; background: #d93a4b; color: #fff;
    font-size: .62rem; font-weight: 700;
    display: grid; place-items: center;
}

/* ---- Page heading --------------------------------------------------- */

.aw-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1.15rem;
}
.aw-page-head h1 {
    font-size: 1.32rem;
    font-weight: 650;
    margin: 0;
    letter-spacing: -.01em;
}
.aw-page-head .sub { color: var(--aw-muted); font-size: .85rem; margin-top: .1rem; }
.aw-page-head .spacer { margin-inline-start: auto; }

/* ---- Cards ---------------------------------------------------------- */

.card {
    border: 1px solid var(--aw-border);
    border-radius: var(--aw-radius);
    box-shadow: var(--aw-shadow);
    background: var(--aw-surface);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid var(--aw-border);
    padding: .85rem 1.1rem;
    font-weight: 600;
    font-size: .95rem;
    display: flex; align-items: center; gap: .6rem;
}
.card-header .spacer { margin-inline-start: auto; }
.card-body { padding: 1.1rem; }

/* ---- Stat tiles ------------------------------------------------------ */

.stat {
    background: var(--aw-surface);
    border: 1px solid var(--aw-border);
    border-radius: var(--aw-radius);
    padding: .95rem 1.05rem;
    box-shadow: var(--aw-shadow);
    height: 100%;
    display: flex;
    align-items: flex-start;
    gap: .85rem;
}
.stat__icon {
    width: 42px; height: 42px; flex: 0 0 auto;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 1.15rem;
}
.stat__label { color: var(--aw-muted); font-size: .78rem; font-weight: 600; }
.stat__value {
    font-size: 1.5rem; font-weight: 800; line-height: 1.25;
    font-variant-numeric: tabular-nums; direction: ltr;
}
html[dir="rtl"] .stat__value { text-align: right; }
.stat__meta { font-size: .74rem; color: var(--aw-muted); }

.tint-navy   { background: #e8ebf5; color: #2b3a63; }
.tint-gold   { background: var(--aw-amber-bg); color: #8a6420; }
.tint-green  { background: var(--aw-green-bg); color: #1a7a54; }
.tint-red    { background: var(--aw-red-bg); color: #a3384a; }
.tint-blue   { background: var(--aw-blue-bg); color: #2a54a8; }
.tint-purple { background: #f0eafa; color: #5b3a9e; }
.tint-teal   { background: #e0f4f4; color: #14706e; }
.tint-orange { background: var(--aw-amber-bg); color: #a95c14; }

/* ---- Tables ---------------------------------------------------------- */

.aw-table-wrap {
    border-radius: var(--aw-radius);
    border: 1px solid var(--aw-border);
    background: var(--aw-surface);
    box-shadow: var(--aw-shadow);
    overflow: hidden;
}
.aw-table-scroll { overflow-x: auto; }

.table {
    margin: 0;
    --bs-table-hover-bg: #f7f8fb;
    font-size: .885rem;
}
.table > thead > tr > th {
    background: #fafbfd;
    border-bottom: 1px solid var(--aw-border);
    color: var(--aw-muted);
    font-weight: 600;
    font-size: .74rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: .5rem .6rem;
}
.table > tbody > tr > td {
    padding: .5rem .6rem;
    vertical-align: middle;
    border-color: #eef0f4;
}
.table > tbody > tr:last-child > td { border-bottom: 0; }

/* Action column: shrink to fit and keep every button on one line.
   Forms are block elements by default, which is what used to push the
   delete button onto its own row. */
.table-actions {
    white-space: nowrap;
    text-align: end;
    width: 1%;
}
.table-actions .btn { padding: .2rem .45rem; font-size: .82rem; }
.table-actions > a,
.table-actions > button,
.table-actions > form {
    /* !important beats Bootstrap's .d-inline, so every button sits on the
       same baseline whether or not the view added that class. */
    display: inline-block !important;
    vertical-align: middle;
    margin: 0;
}
.table-actions > * + * { margin-inline-start: .2rem; }

/* ---- Badges / status -------------------------------------------------- */

.badge { font-weight: 700; letter-spacing: .01em; padding: .38em .75em; border-radius: 999px; }
.badge-soft { border: 1px solid transparent; }
.badge-soft.bg-secondary { background: #eceef3 !important; color: #4a5468 !important; }
.badge-soft.bg-primary   { background: var(--aw-blue-bg) !important; color: #24407e !important; }
.badge-soft.bg-info      { background: var(--aw-blue-bg) !important; color: #15628c !important; }
.badge-soft.bg-warning   { background: var(--aw-amber-bg) !important; color: #8a5d10 !important; }
.badge-soft.bg-success   { background: var(--aw-green-bg) !important; color: #176b3d !important; }
.badge-soft.bg-danger    { background: var(--aw-red-bg) !important; color: #a3202f !important; }
.badge-soft.bg-dark      { background: #e4e6ec !important; color: #2b3245 !important; }

.priority-urgent { box-shadow: inset 3px 0 0 #e0a800; }
.priority-vip    { box-shadow: inset 3px 0 0 #8e44ad; }
html[dir="rtl"] .priority-urgent { box-shadow: inset -3px 0 0 #e0a800; }
html[dir="rtl"] .priority-vip    { box-shadow: inset -3px 0 0 #8e44ad; }

/* ---- Forms ------------------------------------------------------------ */

.form-label { font-weight: 550; font-size: .82rem; margin-bottom: .3rem; color: #3a4256; }
.form-label .req { color: #d93a4b; }
.form-control, .form-select {
    border-color: #d8dce6;
    border-radius: var(--aw-radius-sm);
    padding: .48rem .7rem;
    font-size: .9rem;
}
.form-control:focus, .form-select:focus {
    border-color: #8fa0c8;
    box-shadow: 0 0 0 3px rgba(44, 62, 110, .1);
}
.form-control-lg { font-size: 1rem; padding: .6rem .85rem; }
.input-group-text { background: #f3f5f9; border-color: #d8dce6; font-size: .85rem; color: var(--aw-muted); }
textarea.form-control { min-height: 84px; }

.btn { border-radius: var(--aw-radius-sm); font-weight: 700; font-size: .88rem; padding: .5rem 1rem; transition: transform .15s, box-shadow .15s; }
.btn-lg { padding: .68rem 1.3rem; font-size: .97rem; }
.btn-sm { padding: .28rem .6rem; font-size: .8rem; }
.btn-primary { background: var(--aw-navy); border-color: var(--aw-navy); box-shadow: 0 6px 14px -6px rgba(28,37,64,.5); }
.btn-primary:hover, .btn-primary:focus { background: #161d33; border-color: #161d33; transform: translateY(-1px); }
.btn-gold { background: var(--aw-gold); border-color: var(--aw-gold); color: #1c2540; box-shadow: 0 6px 14px -6px rgba(192,138,52,.55); }
.btn-gold:hover { background: #a8762c; border-color: #a8762c; color: #1c2540; transform: translateY(-1px); }
.btn-outline-secondary { border-color: #d3d8e3; color: #46506a; }
.btn-outline-secondary:hover { background: #eef0f5; border-color: #c3cad8; color: #1c2540; }

/* ---- Empty state -------------------------------------------------------- */

.aw-empty { text-align: center; padding: 3rem 1rem; color: var(--aw-muted); }
.aw-empty i { font-size: 2.6rem; opacity: .35; display: block; margin-bottom: .7rem; }
.aw-empty h6 { color: #3a4256; font-weight: 600; margin-bottom: .3rem; }

/* ---- Toasts ------------------------------------------------------------- */

.aw-toasts {
    position: fixed;
    top: calc(var(--aw-header-h) + 12px);
    inset-inline-end: 16px;
    z-index: 1090;
    display: flex; flex-direction: column; gap: .5rem;
    max-width: min(380px, calc(100vw - 32px));
}
.aw-toast {
    background: #fff;
    border: 1px solid var(--aw-border);
    border-inline-start: 4px solid var(--aw-navy);
    border-radius: var(--aw-radius-sm);
    box-shadow: var(--aw-shadow-lg);
    padding: .7rem .85rem;
    display: flex; align-items: flex-start; gap: .6rem;
    font-size: .88rem;
    animation: awSlideIn .22s ease;
}
.aw-toast.success { border-inline-start-color: #1c7a45; }
.aw-toast.error   { border-inline-start-color: #c0273a; }
.aw-toast.warning { border-inline-start-color: #c98a10; }
.aw-toast.info    { border-inline-start-color: #1a5fa8; }
.aw-toast i { font-size: 1.05rem; flex: 0 0 auto; margin-top: .05rem; }
.aw-toast.success i { color: #1c7a45; }
.aw-toast.error i   { color: #c0273a; }
.aw-toast.warning i { color: #c98a10; }
.aw-toast.info i    { color: #1a5fa8; }
.aw-toast .close { margin-inline-start: auto; border: 0; background: none; color: var(--aw-muted); }

@keyframes awSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---- Progress steps (order pipeline) -------------------------------------- */

.aw-steps { display: flex; flex-wrap: wrap; gap: .35rem; }
.aw-step {
    flex: 1 1 0; min-width: 74px;
    text-align: center;
    font-size: .68rem;
    color: var(--aw-muted);
}
.aw-step .bar {
    height: 5px; border-radius: 3px; background: #e4e7ee; margin-bottom: .35rem;
}
.aw-step.done .bar    { background: #1c7a45; }
.aw-step.current .bar { background: var(--aw-gold); }
.aw-step.done, .aw-step.current { color: #3a4256; font-weight: 600; }

/* ---- Timeline ---------------------------------------------------------- */

.aw-timeline { position: relative; padding-inline-start: 1.6rem; }
.aw-timeline::before {
    content: ""; position: absolute;
    inset-inline-start: .42rem; top: .3rem; bottom: .3rem;
    width: 2px; background: #e4e7ee;
}
.aw-tl-item { position: relative; padding-bottom: 1.1rem; }
.aw-tl-item::before {
    content: ""; position: absolute;
    inset-inline-start: -1.32rem; top: .3rem;
    width: 10px; height: 10px; border-radius: 50%;
    background: #fff; border: 2px solid var(--aw-gold);
}
.aw-tl-item.muted::before { border-color: #c3cad8; }
.aw-tl-time { font-size: .74rem; color: var(--aw-muted); }
.aw-tl-body { font-size: .875rem; }

/* ---- Kanban ------------------------------------------------------------- */

.aw-kanban { display: flex; gap: .8rem; overflow-x: auto; padding-bottom: .75rem; align-items: flex-start; }
.aw-kcol {
    flex: 0 0 268px; width: 268px;
    background: #eceef4;
    border-radius: var(--aw-radius);
    padding: .6rem;
    max-height: calc(100vh - 210px);
    display: flex; flex-direction: column;
}
.aw-kcol__head {
    display: flex; align-items: center; gap: .45rem;
    font-size: .78rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .05em; color: #4a5468;
    padding: .15rem .3rem .55rem;
}
.aw-kcol__head .count {
    margin-inline-start: auto; background: #fff; color: #4a5468;
    border-radius: 999px; padding: .05rem .45rem; font-size: .72rem;
}
.aw-kcol__body { overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }

.aw-kcard {
    background: #fff;
    border: 1px solid var(--aw-border);
    border-radius: var(--aw-radius-sm);
    padding: .6rem .7rem;
    box-shadow: 0 1px 2px rgba(20,26,45,.06);
    cursor: grab;
    font-size: .84rem;
}
.aw-kcard:hover { box-shadow: var(--aw-shadow); }
.aw-kcard.dragging { opacity: .45; }
.aw-kcol.dragover { outline: 2px dashed #97a3c0; outline-offset: -4px; }
.aw-kcard__no { font-weight: 700; font-size: .8rem; color: var(--aw-navy); }
.aw-kcard__row { display: flex; align-items: center; gap: .35rem; margin-top: .25rem; color: var(--aw-muted); font-size: .76rem; }

/* ---- Workshop employee (phone-first) ------------------------------------- */

.aw-taskcard {
    background: #fff;
    border: 1px solid var(--aw-border);
    border-radius: var(--aw-radius);
    box-shadow: var(--aw-shadow);
    padding: 1rem;
    margin-bottom: .8rem;
}
.aw-taskcard h6 { font-weight: 700; margin-bottom: .15rem; }
.aw-bigbtn {
    min-height: 54px; font-size: 1rem; font-weight: 600;
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    width: 100%;
}

/* ---- POS ----------------------------------------------------------------- */

.pos-wrap { display: grid; grid-template-columns: 1fr 400px; gap: 1rem; align-items: start; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: .6rem; }
.pos-tile {
    background: #fff; border: 1px solid var(--aw-border); border-radius: var(--aw-radius-sm);
    padding: .6rem; text-align: center; cursor: pointer; transition: .15s;
}
.pos-tile:hover { border-color: var(--aw-gold); box-shadow: var(--aw-shadow); transform: translateY(-1px); }
.pos-tile__img {
    height: 78px; border-radius: 6px; background: #f1f3f8;
    display: grid; place-items: center; margin-bottom: .45rem;
    overflow: hidden; color: #b3bacb; font-size: 1.5rem;
}
.pos-tile__img img { width: 100%; height: 100%; object-fit: cover; }
.pos-tile__name { font-size: .8rem; font-weight: 600; line-height: 1.25; }
.pos-tile__price { font-size: .8rem; color: #1c7a45; font-weight: 700; direction: ltr; }
.pos-tile__stock { font-size: .7rem; color: var(--aw-muted); }

.pos-cart { position: sticky; top: calc(var(--aw-header-h) + 1rem); }
.pos-cart__items { max-height: 44vh; overflow-y: auto; }
.pos-line { border-bottom: 1px solid #eef0f4; padding: .55rem 0; }
.pos-line:last-child { border-bottom: 0; }

@media (max-width: 1199px) {
    .pos-wrap { grid-template-columns: 1fr; }
    .pos-cart { position: static; }
}

/* ---- Print --------------------------------------------------------------- */

@media print {
    .aw-sidebar, .aw-header, .aw-mobilenav, .no-print, .aw-toasts { display: none !important; }
    .aw-main { margin: 0 !important; }
    .aw-content { padding: 0 !important; }
    body { background: #fff; font-size: 12px; }
    .card { box-shadow: none !important; border: 0 !important; }
    .aw-table-wrap { border: 0; box-shadow: none; }
    a[href]::after { content: none !important; }
}

/* ---- Custom Modal/Dialog -------------------------------------------------- */

/* Override browser default alert/confirm styling */
.aw-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(28, 37, 64, 0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.aw-modal {
    background: var(--aw-surface);
    border-radius: var(--aw-radius);
    box-shadow: var(--aw-shadow-lg);
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    animation: slideUp .25s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.aw-modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--aw-text);
    margin-bottom: 0.75rem;
}

.aw-modal-message {
    font-size: 0.95rem;
    color: var(--aw-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.aw-modal-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.aw-modal-btn {
    padding: 0.65rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.aw-modal-btn-primary {
    background: var(--aw-navy);
    color: white;
}

.aw-modal-btn-primary:hover {
    background: var(--aw-navy-soft);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(28, 37, 64, 0.3);
}

.aw-modal-btn-secondary {
    background: var(--aw-bg);
    color: var(--aw-text);
    border: 1px solid var(--aw-border);
}

.aw-modal-btn-secondary:hover {
    background: var(--aw-border);
    transform: translateY(-2px);
}

/* ---- Responsive: tablet and phone ------------------------------------------ */

.aw-backdrop {
    position: fixed; inset: 0; background: rgba(16, 21, 36, .45);
    z-index: 1035; display: none;
}
.aw-backdrop.show { display: block; }

@media (max-width: 991.98px) {
    .aw-sidebar { transform: translateX(-100%); }
    html[dir="rtl"] .aw-sidebar { transform: translateX(100%); }
    .aw-sidebar.open { transform: translateX(0); }
    .aw-main { margin-inline-start: 0; }
    .aw-content { padding: 1rem .85rem 5rem; }
}

/* Bottom navigation for phones */
.aw-mobilenav { display: none; }

@media (max-width: 767.98px) {
    .aw-mobilenav {
        display: flex;
        position: fixed; inset-inline: 0; bottom: 0;
        background: #fff;
        border-top: 1px solid var(--aw-border);
        z-index: 1039;
        padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
        box-shadow: 0 -2px 12px rgba(20,26,45,.07);
    }
    .aw-mobilenav a {
        flex: 1 1 0; text-align: center;
        color: var(--aw-muted); font-size: .66rem; font-weight: 600;
        padding: .35rem .1rem; border-radius: 8px;
        display: flex; flex-direction: column; align-items: center; gap: .15rem;
    }
    .aw-mobilenav a i { font-size: 1.22rem; }
    .aw-mobilenav a.active { color: var(--aw-navy); background: #f2f4f9; }

    .aw-page-head h1 { font-size: 1.14rem; }
    .card-body { padding: .9rem; }
    .stat { padding: .8rem .85rem; }
    .stat__value { font-size: 1.2rem; }
    .aw-header__search { display: none; }
    .aw-kcol { flex-basis: 84vw; width: 84vw; }
}

/* Turn wide tables into stacked cards on phones.
   Add class "aw-cards-sm" to the table and data-label to each cell. */
@media (max-width: 767.98px) {
    .aw-cards-sm thead { display: none; }
    .aw-cards-sm, .aw-cards-sm tbody, .aw-cards-sm tr, .aw-cards-sm td { display: block; width: 100%; }
    .aw-cards-sm tr {
        border: 1px solid var(--aw-border);
        border-radius: var(--aw-radius-sm);
        margin-bottom: .6rem;
        padding: .3rem .1rem;
        background: #fff;
    }
    .aw-cards-sm td {
        display: flex; justify-content: space-between; align-items: center; gap: .75rem;
        border: 0 !important; padding: .38rem .75rem !important;
        text-align: start !important;
    }
    .aw-cards-sm td::before {
        content: attr(data-label);
        color: var(--aw-muted); font-size: .74rem; font-weight: 600;
        text-transform: uppercase; letter-spacing: .04em;
        flex: 0 0 auto;
    }
    .aw-cards-sm td.table-actions { justify-content: flex-end; }
    .aw-cards-sm td.table-actions::before { content: ""; }
}

/* ---- Utility -------------------------------------------------------------- */

.cursor-pointer { cursor: pointer; }
.fw-550 { font-weight: 550; }
.fs-sm { font-size: .82rem; }
.fs-xs { font-size: .74rem; }
.min-w-0 { min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticky-actions { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--aw-border); padding: .75rem 0; }
