/* ============================================================
   Kepri admin panel — KEP-4 (register D60).
   One stylesheet, loaded last in both directions, in five parts:
     1. Tokens      the prototype's tokens.css, light mode, word for word
     2. Re-skin     eClassify's Bootstrap pages take the tokens with no markup change
     3. Frame       sidebar, top bar, page column, footer, sign-in
     4. Blocks      the k- classes new screens are built from (docs/panel-design.md)
     5. Screens     rules one screen needs, under its own class (KEP-7: .k-config, .k-settings)
   Logical properties throughout, so right to left needs no second file.
   Colours come from the tokens; white on a teal or status fill is the one literal.
   ============================================================ */

/* ---------- 1. Tokens (kepri-product-prototype/assets/css/tokens.css) ---------- */

@font-face {
  font-family: 'Zain'; font-weight: 300; font-style: normal;
  src: url('../fonts/zain/Zain-Light.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Zain'; font-weight: 400; font-style: normal;
  src: url('../fonts/zain/Zain-Regular.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Zain'; font-weight: 700; font-style: normal;
  src: url('../fonts/zain/Zain-Bold.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Zain'; font-weight: 800; font-style: normal;
  src: url('../fonts/zain/Zain-ExtraBold.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* primitives: the teal scale */
  --c-teal-50:  #E6F7FA;
  --c-teal-100: #CCF0F4;
  --c-teal-200: #99E0E9;
  --c-teal-300: #66D1DF;
  --c-teal-400: #33C1D4;
  --c-teal-500: #00B2CA;   /* Kepri Teal, the anchor */
  --c-teal-600: #008B9E;
  --c-teal-700: #006472;   /* Dark Teal: teal text that passes on light */
  --c-teal-800: #004E5A;
  --c-teal-900: #003941;   /* Ink */

  /* primitives: neutrals and accent */
  --c-paper: #F5F7F8;
  --c-grey:  #7A8A93;
  --c-grey-700: #5B6E76;
  --c-amber-500: #CA7C00;
  --c-amber-300: #E9B04C;
  --c-amber-100: #F7ECD9;

  /* primitives: system colours */
  --c-success-500: #2E9E6B;  --c-success-100: #E3F3EC;
  --c-error-500:   #C0473D;  --c-error-100:   #F7E6E4;
  --c-warn-500:    #C8941F;  --c-warn-100:    #F7EFDC;
  --c-info-500:    #2A7DB0;  --c-info-100:    #E3EFF6;

  --c-border-light: #D8E0E3;

  /* semantic */
  --bg:          var(--c-paper);
  --card:        #FFFFFF;
  --text:        var(--c-teal-900);
  --muted:       var(--c-grey-700);
  --muted-on-tint: #4E6168;
  --faint:       rgba(0, 57, 65, .07);
  --border:      var(--c-border-light);
  --border-strong: var(--c-grey);

  --action:        var(--c-teal-500);
  --action-hover:  var(--c-teal-600);
  --action-ink:    #FFFFFF;
  --action-tint:   var(--c-teal-50);
  --action-disabled: var(--c-teal-200);
  --brand-deep:    var(--c-teal-700);
  --brand-ink:     var(--c-teal-900);
  --link:          var(--c-teal-700);

  --accent:        var(--c-amber-500);
  --accent-tint:   var(--c-amber-100);
  --accent-deep:   #9C5F00;
  --accent-ink:    #8A5400;

  --success:      var(--c-success-500);  --success-tint: var(--c-success-100);
  --error:        var(--c-error-500);    --error-tint:   var(--c-error-100);
  --warn:         var(--c-warn-500);     --warn-tint:    var(--c-warn-100);
  --info:         var(--c-info-500);     --info-tint:    var(--c-info-100);

  /* text-safe status steps, for use on the tinted fills and under white text */
  --success-ink:  #1F7A50;
  --error-ink:    #8A312A;
  --warn-ink:     #755311;
  --info-ink:     #21618A;
  --error-text:   var(--c-error-500);

  --shadow-card:  0 1px 3px rgba(0, 57, 65, .06);
  --shadow-float: 0 6px 18px rgba(0, 57, 65, .16);

  /* shape */
  --r-btn: 10px;
  --r-tile: 12px;
  --r-card: 16px;
  --r-sheet: 24px;

  /* spacing (base 4) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;  --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px;

  /* type scale (floor 12) */
  --f-small: 12px; --f-normal: 14px;
  --f-large: 16px; --f-larger: 18px;
  --f-xl: 24px;    --f-xxl: 28px;

  /* the panel's own: the sidebar's width and its inks on Ink */
  --k-side-w: 248px;
  --k-side-ink: #EAF6F8;
  --k-side-ink-soft: rgba(234, 246, 248, .82);
  --k-side-ink-faint: rgba(234, 246, 248, .6);
  --k-side-line: rgba(255, 255, 255, .12);
  --k-side-hover: rgba(255, 255, 255, .08);

  /* Bootstrap reads Kepri's colours and font from here */
  --bs-primary: var(--c-teal-500);
  --bs-primary-rgb: 0, 178, 202;
  --bs-primary-rgba: 0, 178, 202, 0.15;
  --bs-blue: var(--c-teal-500);
  --bs-body-font-family: 'Zain', 'Segoe UI', system-ui, sans-serif;
  --bs-body-color: var(--text);
  --bs-body-bg: var(--bg);
  --bs-link-color: var(--link);
  --bs-link-hover-color: var(--c-teal-800);
  --bs-border-color: var(--border);
}

/* ---------- 2. Re-skin: eClassify's pages take the tokens ---------- */

body {
  font-family: var(--bs-body-font-family);
  color: var(--text);
  background-color: var(--bg);
}
html[lang="ar"] body { line-height: 1.6; }

/* Zain has no 500 or 600 cut: headings are Regular, labels and buttons Bold */
#main :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6):not([class*="fw-"]):not([class*="font-"]) {
  font-weight: 400;
  color: var(--text);
}
a { color: var(--link); }
a:hover { color: var(--c-teal-800); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

.text-primary { color: var(--brand-deep) !important; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.text-danger { color: var(--error-text) !important; }
.text-success { color: var(--success-ink) !important; }
.text-warning { color: var(--warn-ink) !important; }
.text-info { color: var(--info-ink) !important; }
.border-primary { border-color: var(--action) !important; }
.border-danger { border-color: var(--error) !important; }
.border-warning { border-color: var(--warn) !important; }
.bg-primary, .primary-background-color { background-color: var(--action) !important; }

/* buttons */
.btn { border-radius: var(--r-btn); font-weight: 700; }
.btn-primary {
  --bs-btn-color: var(--action-ink); --bs-btn-bg: var(--action); --bs-btn-border-color: var(--action);
  --bs-btn-hover-color: var(--action-ink); --bs-btn-hover-bg: var(--action-hover); --bs-btn-hover-border-color: var(--action-hover);
  --bs-btn-active-color: var(--action-ink); --bs-btn-active-bg: var(--c-teal-700); --bs-btn-active-border-color: var(--c-teal-700);
  --bs-btn-disabled-color: var(--action-ink); --bs-btn-disabled-bg: var(--action-disabled); --bs-btn-disabled-border-color: var(--action-disabled);
  --bs-btn-focus-shadow-rgb: 0, 178, 202;
}
.btn-outline-primary {
  --bs-btn-color: var(--brand-deep); --bs-btn-bg: var(--card); --bs-btn-border-color: var(--c-teal-600);
  --bs-btn-hover-color: var(--brand-deep); --bs-btn-hover-bg: var(--action-tint); --bs-btn-hover-border-color: var(--action);
  --bs-btn-active-color: var(--brand-deep); --bs-btn-active-bg: var(--action-tint); --bs-btn-active-border-color: var(--action);
  --bs-btn-disabled-color: var(--action-disabled); --bs-btn-disabled-border-color: var(--action-disabled);
  --bs-btn-focus-shadow-rgb: 0, 178, 202;
  background-color: var(--bs-btn-bg);
}
.btn-secondary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--c-grey-700); --bs-btn-border-color: var(--c-grey-700);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--muted-on-tint); --bs-btn-hover-border-color: var(--muted-on-tint);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--c-teal-900); --bs-btn-active-border-color: var(--c-teal-900);
}
.btn-outline-secondary {
  --bs-btn-color: var(--muted); --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--faint); --bs-btn-hover-border-color: var(--border-strong);
  --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--faint); --bs-btn-active-border-color: var(--border-strong);
}
.btn-danger {
  --bs-btn-color: #fff; --bs-btn-bg: var(--error); --bs-btn-border-color: var(--error);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--error-ink); --bs-btn-hover-border-color: var(--error-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--error-ink); --bs-btn-active-border-color: var(--error-ink);
}
/* KEP-77: Delete in All Ads' details window was black (custom.css); it is the danger button */
.ad-preview-delete-btn { color: #fff; background-color: var(--error); }
.ad-preview-delete-btn:hover { color: #fff; background-color: var(--error-ink); }
.btn-success {
  --bs-btn-color: #fff; --bs-btn-bg: var(--success-ink); --bs-btn-border-color: var(--success-ink);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--success-ink); --bs-btn-hover-border-color: var(--success-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--success-ink); --bs-btn-active-border-color: var(--success-ink);
}
.btn-warning {
  --bs-btn-color: #fff; --bs-btn-bg: var(--warn-ink); --bs-btn-border-color: var(--warn-ink);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--warn-ink); --bs-btn-hover-border-color: var(--warn-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--warn-ink); --bs-btn-active-border-color: var(--warn-ink);
}
.btn-info {
  --bs-btn-color: #fff; --bs-btn-bg: var(--info-ink); --bs-btn-border-color: var(--info-ink);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--info-ink); --bs-btn-hover-border-color: var(--info-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--info-ink); --bs-btn-active-border-color: var(--info-ink);
}
.btn-outline-danger {
  --bs-btn-color: var(--error-ink); --bs-btn-border-color: var(--error);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--error); --bs-btn-hover-border-color: var(--error);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--error-ink); --bs-btn-active-border-color: var(--error-ink);
}
.btn-outline-success {
  --bs-btn-color: var(--success-ink); --bs-btn-border-color: var(--success);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--success-ink); --bs-btn-hover-border-color: var(--success-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--success-ink); --bs-btn-active-border-color: var(--success-ink);
}
.btn-outline-warning {
  --bs-btn-color: var(--warn-ink); --bs-btn-border-color: var(--warn);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--warn-ink); --bs-btn-hover-border-color: var(--warn-ink);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--warn-ink); --bs-btn-active-border-color: var(--warn-ink);
}

/* cards */
.card {
  --bs-card-bg: var(--card);
  --bs-card-border-color: transparent;
  --bs-card-border-radius: var(--r-card);
  --bs-card-inner-border-radius: var(--r-card);
  --bs-card-cap-bg: transparent;
  border: 0;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}
.card .card-header { background-color: transparent; border-bottom-color: var(--faint) !important; }
.card .card-header :is(h4, .h4) { font-size: var(--f-larger); font-weight: 400; }

/* tables: the prototype's quiet header and hairline rows, on bootstrap-table too */
.table {
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--faint);
  --bs-table-striped-bg: rgba(0, 57, 65, .025);
  --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: var(--action-tint);
  --bs-table-hover-color: var(--text);
  color: var(--text);
}
.table > thead th,
.bootstrap-table .fixed-table-container .table thead th {
  font-size: var(--f-small); font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .03em;
  background-color: transparent;
  border-color: var(--faint);
  border-block-end: 1px solid var(--border);
}
.table > tbody td { font-size: var(--f-normal); border-color: var(--faint); vertical-align: middle; }
/* a row that needs attention, and eClassify's grey table head */
.table-warning { --bs-table-bg: var(--warn-tint); --bs-table-striped-bg: var(--warn-tint); --bs-table-color: var(--text); --bs-table-border-color: var(--faint); }
.table-danger { --bs-table-bg: var(--error-tint); --bs-table-striped-bg: var(--error-tint); --bs-table-color: var(--text); --bs-table-border-color: var(--faint); }
.table-light { --bs-table-bg: var(--bg); --bs-table-color: var(--muted); --bs-table-border-color: var(--faint); }
/* KEP-77: All Ads' bulk status dialog heads its table with Bootstrap's black; it reads as every other table head */
.table-dark { --bs-table-bg: transparent; --bs-table-striped-bg: transparent; --bs-table-color: var(--muted); --bs-table-border-color: var(--border); }
.bootstrap-table .fixed-table-container,
.bootstrap-table .fixed-table-container.fixed-height:not(.has-footer) { border-color: var(--faint); }
.bootstrap-table .fixed-table-container .table tbody tr.selected td { background-color: var(--action-tint); }
.fixed-table-pagination .page-list .btn,
.fixed-table-toolbar .btn { font-weight: 400; }
/* the library puts this gap on the right, which is the wrong side of "Showing 1 to 10 of 12" in Arabic */
.fixed-table-pagination > .pagination-detail .pagination-info { margin-right: 0; margin-inline-end: 5px; }
/* on a phone a list turns into cards; the library aligns them left, which put each value far from its label right to left (KEP-7) */
.bootstrap-table .fixed-table-container .table tbody tr .card-view :is(.card-view-title, .card-view-value) { text-align: start !important; }

/* status badges: tinted fill, text-safe ink (the sidebar's counters keep their solid red, part 3) */
.badge { border-radius: 7px; font-weight: 700; font-size: var(--f-small); line-height: 1.5; padding: 2px 10px; }
.badge:is(.bg-success, .bg-light-success, .badge-success) { background-color: var(--success-tint) !important; color: var(--success-ink) !important; }
.badge:is(.bg-danger, .bg-light-danger, .badge-danger)   { background-color: var(--error-tint) !important;   color: var(--error-ink) !important; }
.badge:is(.bg-warning, .bg-light-warning, .badge-warning) { background-color: var(--warn-tint) !important;    color: var(--warn-ink) !important; }
.badge:is(.bg-info, .bg-light-info, .badge-info, .alert-info) { background-color: var(--info-tint) !important; color: var(--info-ink) !important; }
.badge:is(.bg-primary, .bg-light-primary, .badge-primary) { background-color: var(--c-teal-800) !important; color: #fff !important; }
.badge:is(.bg-secondary, .bg-light-secondary, .bg-light, .badge-secondary) { background-color: var(--faint) !important; color: var(--muted-on-tint) !important; }
/* KEP-77: All Ads' Featured and Soft Rejected (bg-black) and the bulk dialog's Permanent Rejected (bg-dark), in Kepri's ink */
.badge:is(.bg-black, .bg-dark) { background-color: var(--text) !important; color: var(--card) !important; }

/* forms */
.form-control, .form-select {
  border-color: var(--border);
  border-radius: var(--r-btn);
  color: var(--text);
}
.form-control::placeholder { color: var(--muted); }
.form-control:focus, .form-select:focus {
  border-color: var(--action);
  box-shadow: 0 0 0 .2rem rgba(0, 178, 202, .15);
  color: var(--text);
}
.form-control:disabled, .form-select:disabled, .form-control[readonly] { background-color: var(--bg); color: var(--muted); }
.form-label, .col-form-label, label { color: var(--text); }
.form-check-input { border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--action); border-color: var(--action); }
.form-check-input:focus { border-color: var(--action); box-shadow: 0 0 0 .2rem rgba(0, 178, 202, .15); }
/* a switch sits in the room its label leaves for it; Mazer's rtl.css pushed it 2.5em the other way, over the label (KEP-7) */
.form-switch .form-check-input { margin-inline-start: -2.5em; }
.input-group-text { background-color: var(--bg); border-color: var(--border); color: var(--muted); }
.invalid-feedback, .parsley-errors-list { color: var(--error-text); }
.select2-container--bootstrap-5 .select2-selection { border-color: var(--border); border-radius: var(--r-btn); }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
  border-color: var(--action);
  box-shadow: 0 0 0 .2rem rgba(0, 178, 202, .15);
}
.select2-container--bootstrap-5 .select2-dropdown { border-color: var(--border); border-radius: var(--r-btn); }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--highlighted { background-color: var(--action-tint); color: var(--text); }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__options .select2-results__option.select2-results__option--selected { background-color: var(--action); color: var(--action-ink); }

/* menus, dialogs, tabs, pages */
.dropdown-menu {
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-border-radius: var(--r-tile);
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-link-hover-color: var(--text);
  --bs-dropdown-link-hover-bg: var(--action-tint);
  --bs-dropdown-link-active-color: var(--action-ink);
  --bs-dropdown-link-active-bg: var(--action);
  box-shadow: var(--shadow-float);
}
.modal-content { border: 0; border-radius: var(--r-card); box-shadow: var(--shadow-float); }
.modal-header, .modal-footer { border-color: var(--faint); }
.nav-tabs, .nav-pills { --bs-nav-link-color: var(--brand-deep); --bs-nav-link-hover-color: var(--c-teal-800); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--action); --bs-nav-pills-link-active-color: var(--action-ink); --bs-nav-pills-border-radius: var(--r-btn); }
.nav-tabs { --bs-nav-tabs-link-active-color: var(--text); --bs-nav-tabs-border-color: var(--border); }
.pagination {
  --bs-pagination-color: var(--brand-deep);
  --bs-pagination-hover-color: var(--brand-deep);
  --bs-pagination-hover-bg: var(--action-tint);
  --bs-pagination-border-color: var(--border);
  --bs-pagination-active-bg: var(--action);
  --bs-pagination-active-border-color: var(--action);
  --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(0, 178, 202, .15);
}
.alert { border: 0; border-radius: var(--r-tile); }
.alert-success { background-color: var(--success-tint); color: var(--success-ink); }
.alert-danger  { background-color: var(--error-tint);   color: var(--error-ink); }
.alert-warning { background-color: var(--warn-tint);    color: var(--warn-ink); }
.alert-info, .alert-primary { background-color: var(--info-tint); color: var(--info-ink); }
.swal2-popup { border-radius: var(--r-card); font-family: var(--bs-body-font-family); }
.swal2-styled.swal2-confirm { background-color: var(--action); border-radius: var(--r-btn); }
.swal2-styled.swal2-cancel, .swal2-styled.swal2-deny { border-radius: var(--r-btn); }
.toastify { border-radius: var(--r-tile); font-weight: 700; box-shadow: var(--shadow-float); }

/* ---------- 3. Frame ---------- */

/* icons from <x-kepri-icon>; the four that point somewhere turn round in right to left */
.k-ic { display: inline-block; flex: none; vertical-align: -0.2em; }
html[dir="rtl"] .k-ic--mirror { transform: scaleX(-1); }

/* the k mark on teal */
.k-mark {
  flex: none; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--c-teal-500); color: #fff;
  font-family: 'Zain', sans-serif; font-weight: 400; font-size: 22px; line-height: 1;
}

/* sidebar: Ink ground, 248 wide. Mazer keeps the open/close mechanics (#sidebar.active, the burger, the drawer under 1200px). */
#sidebar .sidebar-wrapper {
  width: var(--k-side-w);
  display: flex; flex-direction: column;
  padding: var(--s-4) var(--s-3);
  background-color: var(--c-teal-900); color: var(--k-side-ink);
  scrollbar-width: none;
}
#sidebar .sidebar-wrapper::-webkit-scrollbar { display: none; }
/* Mazer's own scroll thumb, kept as a faint line on Ink */
#sidebar .ps__rail-y { background-color: transparent !important; width: 6px; }
#sidebar .ps__thumb-y { background-color: rgba(255, 255, 255, .22) !important; width: 3px !important; inset-inline-end: 1px; }

#sidebar .sidebar-header { padding: var(--s-2) var(--s-2) var(--s-4); font-size: var(--f-large); font-weight: 400; }
#sidebar .sidebar-header .d-flex { justify-content: space-between !important; gap: var(--s-2); }
#sidebar .sidebar-header .logo { min-width: 0; }
#sidebar .k-brand { display: flex; align-items: center; gap: var(--s-2); min-width: 0; color: var(--k-side-ink); text-decoration: none; }
#sidebar .k-brand b { font-size: var(--f-large); font-weight: 700; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#sidebar .burger-btn { flex: none; color: var(--k-side-ink-soft); line-height: 1; padding: var(--s-2); margin: 0 !important; border-radius: 8px; }
#sidebar .burger-btn:hover { background: var(--k-side-hover); color: #fff; }

#sidebar .sidebar-menu { flex: 1 0 auto; }
#sidebar .menu { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 0; font-weight: 700 !important; }
#sidebar .menu .sidebar-item { margin: 0; list-style: none; }
#sidebar .menu .sidebar-link {
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 44px; margin: 0 !important; padding: 10px var(--s-3) !important;
  border: 0 !important; border-radius: 10px;
  background-color: transparent; color: var(--k-side-ink-soft);
  font-size: var(--f-normal); font-weight: 700; line-height: 1.5; text-align: start;
  transition: background-color .15s;
}
#sidebar .menu .sidebar-link .menu-item {
  flex: 1 1 auto; min-width: 0; margin: 0 !important;
  color: inherit !important; font-weight: inherit !important;
  overflow-wrap: anywhere;
}
#sidebar .menu .sidebar-link :is(svg, i) { flex: none; color: inherit !important; fill: none !important; }
#sidebar .menu .sidebar-link:hover { background-color: var(--k-side-hover) !important; color: var(--k-side-ink-soft); }
#sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link { background-color: var(--c-teal-700) !important; color: #fff; }
#sidebar .menu .sidebar-item.has-sub:has(.submenu.active) > .sidebar-link,
#sidebar .menu .sidebar-item.has-sub.submenu-open > .sidebar-link { background-color: var(--k-side-hover) !important; color: #fff; }

/* counters: pending work, read at a glance on Ink */
#sidebar .menu .sidebar-link .badge {
  flex: none; min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background-color: var(--error) !important; color: #fff !important;
  font-size: var(--f-small); font-weight: 700; text-align: center;
}

/* groups: eClassify's submenus, opened and closed by custom.js */
#sidebar .sidebar-chevron { position: static; flex: none; margin: 0 !important; margin-inline-end: 4px !important; border-color: var(--k-side-ink-faint) !important; transform: rotate(45deg); }
html[dir="rtl"] #sidebar .sidebar-chevron { transform: rotate(-135deg); }
#sidebar .menu .sidebar-item.has-sub:has(.submenu.active) > .sidebar-link .sidebar-chevron,
#sidebar .menu .sidebar-item.has-sub.submenu-open > .sidebar-link .sidebar-chevron { transform: rotate(135deg); }
#sidebar .menu .submenu {
  margin: 3px 0 0 !important; margin-inline-start: 21px !important;
  padding: 0 !important; padding-inline-start: var(--s-2) !important;
  border-inline-start: 1px solid var(--k-side-line);
}
#sidebar .menu .submenu .submenu-item { border: 0 !important; }
#sidebar .menu .submenu .submenu-item::before { content: none; }
#sidebar .menu .submenu .submenu-item a {
  display: flex; align-items: center;
  min-height: 38px; margin: 0 !important; padding: 6px var(--s-3) !important;
  border: 0 !important; border-radius: 8px;
  background-color: transparent !important; color: rgba(234, 246, 248, .72) !important;
  font-size: var(--f-normal); font-weight: 400; letter-spacing: 0; line-height: 1.5;
}
#sidebar .menu .submenu .submenu-item a:hover { background-color: var(--k-side-hover) !important; color: #fff !important; }
#sidebar .menu .submenu .submenu-item.active > a { background-color: var(--c-teal-700) !important; color: #fff !important; font-weight: 700; }

#sidebar .sidebar-new-title,
#sidebar .sidebar-new-title.active {
  margin: var(--s-3) 0 2px !important; padding: 0 var(--s-3);
  color: var(--k-side-ink-faint); font-size: var(--f-small); font-weight: 700; letter-spacing: .03em;
}
#sidebar .k-side-rule { height: 1px; margin: var(--s-2) var(--s-2); background: var(--k-side-line); list-style: none; }
#sidebar .k-side-rule:last-child { display: none; }

#sidebar .k-side-foot {
  display: flex; align-items: center; gap: var(--s-2);
  margin-block-start: var(--s-3); padding: var(--s-3) var(--s-2) 0;
  border-block-start: 1px solid var(--k-side-line);
}
#sidebar .k-side-foot__avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); color: #fff;
}
#sidebar .k-side-foot b { min-width: 0; font-size: var(--f-large); font-weight: 700; overflow-wrap: anywhere; }

/* the page column sits beside the sidebar in either direction */
#sidebar ~ #main { margin-left: 0; margin-right: 0; margin-inline-start: var(--k-side-w); }
#sidebar:not(.active) ~ #main { margin-inline-start: 0; }
#main.layout-navbar { display: flex; flex-direction: column; min-height: 100vh; transition: margin .5s ease-out; }
#main #main-content { flex: 1 0 auto; padding: var(--s-2) var(--s-5) var(--s-5); }
.page-heading { margin: 0 0 var(--s-4); }
.page-heading :is(h1, h2, h3, h4, .h3, .h4) {
  margin-block-end: 4px; text-align: start;
  font-size: var(--f-xl); font-weight: 400; line-height: 1.5; color: var(--text);
  overflow-wrap: anywhere;
}
.sidebar-overlay { display: none; }
/* Under 992 the sidebar is a drawer over the page, with a scrim; from 992 up it sits beside the page
   (sidebar-responsive.js opens and closes it at the same width). eClassify opened it over the page from 768 to 1199. */
@media (max-width: 991.98px) {
  #sidebar ~ #main { margin-inline-start: 0; }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 998;
    background: rgba(0, 57, 65, .45);
    opacity: 0; visibility: hidden; transition: opacity .3s ease-out, visibility .3s ease-out;
  }
  #sidebar.active ~ .sidebar-overlay { opacity: 1; visibility: visible; }
}
@media (max-width: 767.98px) {
  #main #main-content { padding: var(--s-2) var(--s-4) var(--s-4); }
  #sidebar .sidebar-header .d-flex { justify-content: space-between !important; }
}

/* top bar: the prototype draws none, so it is the page's own ground with the two menus at the end */
.k-topbar .navbar { height: auto; min-height: 64px; padding: var(--s-2) var(--s-5); background-color: transparent; }
.k-topbar .container-fluid { padding: 0; gap: var(--s-2); }
.k-topbar .burger-btn { display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-btn); color: var(--text); }
.k-topbar .burger-btn:hover { background: var(--faint); color: var(--text); }
.k-topbar .dropdown-btn {
  min-height: 40px; padding: 0 var(--s-3); gap: 6px;
  background-color: var(--card); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-size: var(--f-normal); font-weight: 700;
}
.k-topbar .user-dropdown { color: var(--text); text-decoration: none; }
/* a name is cut at its own end, whichever way the page reads */
.k-topbar .user-dropdown-name { color: var(--text); font-size: var(--f-normal); font-weight: 700 !important; unicode-bidi: plaintext; }
.k-topbar .topbarUserDropdown .dropdown-item { display: flex; align-items: center; min-height: 40px; }
@media (max-width: 767.98px) {
  .k-topbar .navbar { padding: var(--s-2) var(--s-4); }
}
/* KEP-32: the menus take the room they need, not half the bar, so on a phone the language button keeps its arrow
   inside and the account name is cut short instead */
.k-topbar .container-fluid > .col-6 { width: auto; }
.k-topbar .container-fluid > .col-6:last-child { flex: 1 1 0; min-width: 0; }
.k-topbar .navbar-collapse { min-width: 0; }
.k-topbar .navbar-collapse > .dropdown:first-child { flex-shrink: 0; }
.k-topbar .navbar-collapse > .dropdown:last-child,
.k-topbar #profileDropdown .text { min-width: 0; }
.k-topbar .dropdown-btn { flex-shrink: 0; white-space: nowrap; }
/* app.css narrows the menus to 160px and rtl.css doesn't, so right to left they were 240px and ran off a phone */
.k-topbar .dropdown-menu { min-width: 160px; }
/* an initial on a person's colour (components/avatar-initial: the dark tokens, picked by name) */
.avatar-initial { font-weight: 700; }

/* footer: a quiet line that closes the page column */
.k-footer { padding: var(--s-3) var(--s-5) var(--s-4); color: var(--muted); font-size: var(--f-small); }
@media (max-width: 767.98px) { .k-footer { padding-inline: var(--s-4); } }

/* sign-in and password pages: the sidebar's Ink, one card */
body.k-auth {
  min-height: 100vh; margin: 0; padding: var(--s-4);
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--c-teal-900), var(--c-teal-700));
}
.k-auth__wrap { width: 100%; display: grid; justify-items: center; }
.k-auth__wrap > div { width: min(420px, 100%); }
.k-auth__card {
  padding: var(--s-6) var(--s-5);
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.k-auth__brand { display: flex; align-items: center; justify-content: center; gap: var(--s-2); margin-block-end: var(--s-5); color: var(--text); }
.k-auth__brand b { font-size: var(--f-larger); font-weight: 700; }
.k-auth__head { margin-block-end: var(--s-5); text-align: center; }
.k-auth__head h3 { margin: 0 0 4px; font-size: var(--f-xl); font-weight: 400; color: var(--text); }
.k-auth__head p { margin: 0; color: var(--muted); font-weight: 300; }
.k-auth__card .form-control { min-height: 56px; background-color: var(--card); }
.k-auth__card .form-floating > label { color: var(--muted); }
/* a floating label shrinks toward its own start; transform-origin has no logical value, so right to left is named */
[dir="rtl"] .form-floating > label { transform-origin: 100% 0; }
.k-auth__card .form-control-icon { color: var(--muted); cursor: pointer; }
.k-auth__card .login_btn { min-height: 48px; font-size: var(--f-large); }
.k-auth__card a { font-weight: 700; text-decoration: underline; }

/* ---------- 4. Blocks: what new panel screens are built from ---------- */

/* page title, its line of help, and section headings */
.k-title { margin: 0 0 4px; font-size: var(--f-xl); font-weight: 400; line-height: 1.5; color: var(--text); text-align: start; overflow-wrap: anywhere; }
.k-sub { max-width: 70ch; margin: 0 0 var(--s-4); color: var(--muted); font-weight: 300; }
.k-h2 { margin: var(--s-5) 0 2px; font-size: var(--f-larger); font-weight: 400; line-height: 1.5; color: var(--text); text-align: start; }
/* a section heading with its action on the same baseline */
.k-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s-3); flex-wrap: wrap; margin-block: var(--s-5) var(--s-3); }
.k-head .k-h2 { margin-block: 0; }
.k-head .k-btn { flex: none; }

/* card */
.k-card { padding: var(--s-4); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.k-card--flush { padding: 0; overflow: hidden; }

/* stat cards */
.k-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--s-3); margin-block-end: var(--s-4); }
.k-stat {
  display: grid; gap: 2px; padding: var(--s-4);
  background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card);
  color: var(--text); text-align: start; text-decoration: none;
}
.k-stat > span { font-size: var(--f-small); font-weight: 700; color: var(--muted); }
.k-stat > b { font-size: 22px; line-height: 1.5; }
.k-stat > i { font-style: normal; font-size: var(--f-small); color: var(--muted); }
.k-stat--teal { background: linear-gradient(135deg, var(--c-teal-900), var(--c-teal-700)); }
.k-stat--teal > span, .k-stat--teal > b { color: #fff; }
a.k-stat:hover { outline: 2px solid var(--action); color: var(--text); }
a.k-stat--teal:hover { color: #fff; }
/* a figure that needs attention, inside a stat or a cell */
.k-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--warn-ink) !important; font-weight: 700; }
/* a late figure in red, as the moderation queue's "27 h · Over 24 h" (KEP-76) */
.k-flag--error { color: var(--error-ink) !important; }

/* table */
/* positioned, so a visually-hidden header inside it scrolls with it instead of widening the page right to left (KEP-7) */
.k-table-wrap { position: relative; overflow-x: auto; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.k-table { width: 100%; min-width: 640px; border-collapse: collapse; color: var(--text); }
.k-table th {
  padding: var(--s-3) var(--s-4); border-block-end: 1px solid var(--border);
  font-size: var(--f-small); font-weight: 700; color: var(--muted);
  text-align: start; text-transform: uppercase; letter-spacing: .03em;
}
.k-table td { padding: var(--s-3) var(--s-4); border-block-end: 1px solid var(--faint); font-size: var(--f-normal); vertical-align: middle; }
.k-table tr:last-child td { border-block-end: 0; }
/* a totals row (Daily revenue, KEP-194) */
.k-table tfoot th, .k-table tfoot td { border-block-start: 1px solid var(--border); border-block-end: 0; font-size: var(--f-normal); font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; }
.k-table tr.is-overdue td { background: var(--warn-tint); }
.k-table tr.is-open td { background: var(--action-tint); }
.k-table code { font-family: inherit; font-size: 13px; color: var(--brand-deep); direction: ltr; unicode-bidi: isolate; }
.k-nowrap { white-space: nowrap; }
/* numbers and Latin units keep their own direction in Arabic */
.k-num { display: inline-block; direction: ltr; unicode-bidi: isolate; }
/* KEP-224 (D127): an amount inside Arabic names the pound ج.م, so there a k-num reads in the direction of its first
   letter: "1,250 ج.م" right to left (the number, then ج.م); a number, a phone, a time or "KP-7" left to right as before */
html[dir="rtl"] .k-num { unicode-bidi: plaintext; }

/* status badge */
.k-badge { display: inline-block; padding: 2px 10px; border-radius: 7px; font-size: var(--f-small); font-weight: 700; line-height: 1.5; white-space: nowrap; }
.k-badge--success { background: var(--success-tint); color: var(--success-ink); }
.k-badge--error   { background: var(--error-tint);   color: var(--error-ink); }
.k-badge--warn    { background: var(--warn-tint);    color: var(--warn-ink); }
.k-badge--info    { background: var(--info-tint);    color: var(--info-ink); }
.k-badge--teal    { background: var(--c-teal-800);   color: #fff; }
.k-badge--plain   { background: var(--faint);        color: var(--muted-on-tint); }
/* a badge holding a sentence wraps inside its cell (KEP-98: a late pickup's reason) */
.k-badge--wrap    { white-space: normal; }

/* buttons: primary by default, 48 high; --sm is the 44-high one tables and headings use */
.k-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 var(--s-4);
  border: 1px solid transparent; border-radius: var(--r-btn);
  background: var(--action); color: var(--action-ink);
  font: inherit; font-size: var(--f-large); font-weight: 700; line-height: 1.5; text-decoration: none; white-space: nowrap;
  cursor: pointer; transition: background-color .15s, transform .08s;
}
.k-btn:hover { background: var(--action-hover); color: var(--action-ink); }
.k-btn:active:not(:disabled) { background: var(--c-teal-700); transform: scale(.97); }
.k-btn:disabled, .k-btn.is-disabled { background: var(--action-disabled); color: #fff; cursor: default; pointer-events: none; }
.k-btn--outline { background: var(--card); color: var(--brand-deep); border-color: var(--c-teal-600); }
.k-btn--outline:hover, .k-btn--outline:active:not(:disabled) { background: var(--action-tint); color: var(--brand-deep); border-color: var(--action); }
.k-btn--outline:disabled { background: var(--card); color: var(--action-disabled); border-color: var(--action-disabled); }
.k-btn--danger { background: var(--error); }
.k-btn--danger:hover, .k-btn--danger:active:not(:disabled) { background: var(--error-ink); }
.k-btn--ghost { min-height: 44px; background: none; color: var(--brand-deep); }
.k-btn--ghost:hover, .k-btn--ghost:active:not(:disabled) { background: var(--action-tint); color: var(--brand-deep); }
.k-btn--sm { min-height: 44px; font-size: var(--f-normal); }
.k-btn--block { display: flex; width: 100%; }
.k-btn.is-loading { pointer-events: none; opacity: .7; }
/* a row of actions, and a row of filters above a table */
.k-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.k-acts--end { justify-content: flex-end; margin-block-start: var(--s-2); }
.k-filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-block-end: var(--s-3); }
.k-filters .k-input { width: auto; min-width: 150px; }

/* form field: label, control, then a hint or an error */
.k-field { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 6px; margin-block-end: var(--s-3); }
.k-field > label { margin: 0; font-size: var(--f-normal); font-weight: 400; color: var(--text); }
.k-input {
  display: block; width: 100%; min-height: 48px; padding: 0 var(--s-3);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-btn);
  color: var(--text); font: inherit; font-size: var(--f-large); line-height: 1.5;
}
.k-input::placeholder { color: var(--muted); }
.k-input:focus { outline: none; border-color: var(--action); box-shadow: inset 0 0 0 .5px var(--action); }
.k-input:disabled { background: var(--bg); color: var(--muted); }
textarea.k-input { min-height: 110px; padding: var(--s-3); resize: vertical; }
.k-input--sm { min-height: 44px; font-size: var(--f-normal); }
.k-input.is-invalid, .k-input--error { border-color: var(--error) !important; }
.k-hint { font-size: var(--f-small); color: var(--muted); }
.k-err { display: flex; align-items: center; gap: 4px; font-size: var(--f-small); color: var(--error-text); }
.k-form--2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 var(--s-4); }

/* an empty list says so, and offers the next step */
.k-empty { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-6) var(--s-5); text-align: center; }
.k-empty__ic { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--action-tint); color: var(--brand-deep); }
.k-empty > b { font-size: var(--f-larger); font-weight: 400; color: var(--brand-deep); }
.k-empty > p { max-width: 30ch; margin: 0; color: var(--muted); font-weight: 300; }

/* the line under a page that says its actions are logged */
.k-audit { display: flex; align-items: center; gap: 6px; margin-block-start: var(--s-4); color: var(--muted); font-size: var(--f-small); }

/* a bootstrap-table list in the prototype's look (KEP-6): the search box and the table's own buttons on the page's
   ground, the table on a card with the quiet header and hairline rows, the paging under it. The page wraps the
   <table> in <div class="k-bt">; a cell that may hold a long name or email takes data-class="k-bt__wrap". */
.k-bt .fixed-table-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-block-end: var(--s-3); }
.k-bt .fixed-table-toolbar::after { content: none; }
.k-bt .fixed-table-toolbar > * { float: none !important; margin: 0 !important; }
/* room for "Search by name, email or mobile…" in Arabic too; it shrinks on a phone */
.k-bt .fixed-table-toolbar .search { order: -1; position: relative; flex: 0 1 420px; }
.k-bt .fixed-table-toolbar .columns { margin-inline-start: auto !important; }
.k-bt .fixed-table-toolbar .search-input {
  min-height: 48px; padding-inline-start: 44px;
  background-color: var(--card); border-radius: var(--r-btn) !important; font-size: var(--f-large);
}
/* the prototype's magnifier, drawn in the muted ink (the SVG is only its shape) */
.k-bt .fixed-table-toolbar .search::before {
  content: ""; position: absolute; z-index: 5; inset-inline-start: 14px; top: 50%;
  width: 19px; height: 19px; margin-top: -9.5px; background: var(--muted); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4.5 4.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.k-bt .fixed-table-container {
  background: var(--card); border: 0 !important; border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden;
}
.k-bt .fixed-table-container .table > tbody > tr > td { padding: var(--s-3) var(--s-4); border-block-end: 1px solid var(--faint); }
.k-bt .fixed-table-container .table > tbody > tr:last-child > td { border-block-end: 0; }
.k-bt .fixed-table-container .table thead th .th-inner { padding: var(--s-3) var(--s-4); }
.k-bt .fixed-table-container .table > tbody > tr.no-records-found > td { padding: 0; }
.k-bt .fixed-table-pagination { padding-block-start: var(--s-3); }
.k-bt__wrap { min-width: 140px; overflow-wrap: break-word; }
/* a late row, as .k-table's (KEP-76): the page's data-row-style returns { classes: 'is-overdue' } */
.k-bt .fixed-table-container .table > tbody > tr.is-overdue > td { background: var(--warn-tint); }
/* the Action column (data-class="k-bt__pin") stays at the card's end edge, right in English and left in Arabic, while
   the other columns scroll under it; its buttons take two lines rather than widen it. bootstrap-table's fixed-columns
   add-on isn't loaded for these tables, so data-fixed-right-number never pinned anything. */
.k-bt .fixed-table-container .table > thead > tr > th.k-bt__pin,
.k-bt .fixed-table-container .table > tbody > tr > td.k-bt__pin {
  position: sticky; inset-inline-end: 0; z-index: 2;
  background: var(--card); box-shadow: inset 1px 0 0 var(--faint);
}
html[dir="rtl"] .k-bt .fixed-table-container .table > thead > tr > th.k-bt__pin,
html[dir="rtl"] .k-bt .fixed-table-container .table > tbody > tr > td.k-bt__pin { box-shadow: inset -1px 0 0 var(--faint); }
/* one button a line, all as wide as the widest, so the pinned column stays narrow (about 170px) */
.k-bt .fixed-table-container .table > tbody > tr.is-overdue > td.k-bt__pin { background: var(--warn-tint); }
.k-bt td.k-bt__pin .k-acts--row { flex-direction: column; flex-wrap: nowrap; align-items: stretch; width: max-content; }
/* the columns under it scroll sideways inside the card, with a thin scrollbar that shows they do */
.k-bt .fixed-table-body { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
/* on a phone the table shows each row as a stacked card: long values and the buttons wrap inside it. Only there:
   in the table, "anywhere" lets the browser squeeze a column below its longest word, so a mobile number or an email
   broke in the middle (1012345 / 678) though the columns already scroll under the pinned Action column. */
.k-bt .card-view-value { min-width: 0; overflow-wrap: anywhere; }
.k-bt .card-view-value .k-num { max-width: 100%; overflow-wrap: anywhere; }

/* a person's photo, or their initial on the teal tint, as the prototype's Users list (KEP-6) */
.k-avatar {
  flex: none; width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  display: inline-grid; place-items: center;
  background: var(--action-tint); color: var(--brand-deep); font-size: var(--f-large); font-weight: 700; text-decoration: none;
}
.k-avatar__img { width: 100%; height: 100%; object-fit: cover; }

/* a listing in a table cell, as the prototype's queue (KEP-76): a small photo beside the title and the price */
.k-listing { display: flex; align-items: center; gap: var(--s-3); min-width: 220px; }
.k-listing__img { flex: none; width: 56px; height: 56px; border-radius: var(--r-btn); object-fit: cover; background: var(--faint); }
.k-listing__text { display: grid; gap: 2px; min-width: 0; }
.k-listing__text > b { font-weight: 700; color: var(--brand-deep); overflow-wrap: anywhere; }
.k-listing__text > .k-num { color: var(--muted); font-size: var(--f-small); }

/* two columns, as the prototype's review page (KEP-76): a narrower start column (photos) beside a wider card; one
   column under 992px. Each column may hold anything. */
.k-split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-4); align-items: start; }
/* the wider column first (the ledger's record page, KEP-194) */
.k-split--wide-start { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 991.98px) { .k-split { grid-template-columns: minmax(0, 1fr); } }

/* a listing's photos (KEP-76): the first one large, the rest in rows of small squares under it */
.k-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: var(--s-2); }
.k-gallery > a { display: block; aspect-ratio: 1; border-radius: var(--r-btn); overflow: hidden; background: var(--faint); }
.k-gallery > a:first-child { grid-column: 1 / -1; border-radius: var(--r-card); }
.k-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* label and value rows, as the prototype's review card (KEP-76): the label muted at the start, the value at the end */
.k-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3) var(--s-4); margin: 0; }
.k-dl > dt { color: var(--muted); font-weight: 300; }
.k-dl > dd { margin: 0; text-align: end; font-weight: 700; color: var(--brand-deep); overflow-wrap: anywhere; }
.k-dl__colour { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: var(--s-2); }
.k-dl__swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--border); }

/* a paragraph someone typed (a listing's description): its line breaks kept, a long word wrapped; give it dir="auto" */
.k-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-weight: 300; color: var(--text); }

/* a chat, read only, as the prototype's Chat viewer (KEP-78): the thread list beside the conversation, which stays in
   view while a long list scrolls the page. Under 900px one pane shows: the list, or with k-chat--open the
   conversation, whose k-chat__back returns to the list. */
.k-chat { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.k-chat__list { display: grid; gap: var(--s-2); min-width: 0; }
.k-chat__list > .k-filters { flex-wrap: nowrap; margin: 0; }
.k-chat__list > .k-filters .k-input { flex: 1; min-width: 0; }
.k-chat__list .pagination, .k-chat__pages .pagination { margin: 0; }
.k-chat__pages { padding: var(--s-2) var(--s-4) 0; }
.k-chat__view { overflow: hidden; min-width: 0; }
.k-chat__back { display: none; }
@media (min-width: 900px) { .k-chat__view { position: sticky; top: var(--s-4); } }
@media (max-width: 899.98px) {
  .k-chat { grid-template-columns: minmax(0, 1fr); }
  .k-chat--open > .k-chat__list, .k-chat:not(.k-chat--open) > .k-chat__view { display: none; }
  .k-chat__back { display: inline-flex; }
}
/* a thread in the list: the two names, the listing under them; the open one outlined */
.k-thread {
  display: grid; gap: 2px; text-align: start; text-decoration: none; color: var(--text);
  background: var(--card); border-radius: var(--r-tile); padding: var(--s-3); box-shadow: var(--shadow-card);
}
.k-thread:hover { color: var(--text); box-shadow: var(--shadow-float); }
.k-thread > b { font-weight: 700; overflow-wrap: anywhere; }
.k-thread > span { font-size: var(--f-small); color: var(--muted); overflow-wrap: anywhere; }
.k-thread.is-open { outline: 2px solid var(--action); }
/* the bar over a conversation: the listing's photo, title and price, then the page's buttons */
.k-chat__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-4); border-block-end: 1px solid var(--faint);
}
.k-chat__art { flex: none; width: 44px; height: 44px; border-radius: 10px; overflow: hidden; background: var(--faint); }
.k-chat__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-chat__title { flex: 1 1 10rem; min-width: 0; display: grid; }
.k-chat__title > b { font-weight: 700; overflow-wrap: anywhere; }
.k-chat__title > span { font-size: var(--f-small); color: var(--muted); }
.k-chat__price { color: var(--brand-deep); font-weight: 700; }
/* the messages scroll inside the pane, never the page */
.k-chat__scroll { max-height: min(65vh, 560px); overflow-y: auto; padding: var(--s-4); display: grid; gap: var(--s-2); align-content: start; }
.k-chat__day {
  justify-self: center; background: var(--action-tint); color: var(--brand-deep);
  border-radius: 8px; padding: 3px 12px; font-size: var(--f-small); font-weight: 700;
}
/* a message: the buyer's at the start, the seller's at the end (they swap sides in Arabic by themselves); give its
   text dir="auto" */
.k-bubble {
  max-width: min(78%, 36rem); padding: var(--s-2) var(--s-3); border-radius: 14px; overflow-wrap: anywhere;
  justify-self: start; background: var(--card); border-end-start-radius: 4px; box-shadow: var(--shadow-card);
}
.k-bubble--end { justify-self: end; background: var(--c-teal-200); color: #0A3238; border-end-start-radius: 14px; border-end-end-radius: 4px; box-shadow: none; }
.k-bubble--offer { display: grid; background: var(--action-tint); border: 1px solid var(--c-teal-300); box-shadow: none; }
.k-bubble--offer > b { color: var(--brand-deep); font-size: var(--f-larger); }
.k-bubble__who { display: block; font-size: var(--f-small); font-weight: 700; color: var(--brand-deep); }
.k-bubble__text { white-space: pre-wrap; }
.k-bubble__photo { display: block; margin-block-start: var(--s-1); }
.k-bubble__photo img { display: block; max-width: 100%; max-height: 240px; border-radius: 10px; }
.k-bubble audio { display: block; max-width: 100%; margin-block-start: var(--s-1); }
.k-bubble__meta { display: block; font-size: 12px; color: var(--muted); margin-block-start: 2px; }
.k-bubble--end .k-bubble__meta { color: #33565D; }
/* the strip under a conversation that says it can't be answered */
.k-chat__ro {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: var(--s-3); color: var(--muted); font-weight: 700; border-block-start: 1px solid var(--border);
}

/* tabs between a section's pages, as the prototype's .seg (KEP-98: Orders' Assignment | All orders); each tab is a link,
   the open one on the card's white */
.k-seg {
  display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 100%; margin-block-end: var(--s-4);
  padding: 4px; background: var(--faint); border-radius: var(--r-btn);
}
.k-seg__tab {
  display: inline-flex; align-items: center; justify-content: center; min-width: 10rem; min-height: 44px;
  padding-inline: var(--s-4); border-radius: 8px;
  color: var(--muted); font-weight: 700; text-decoration: none;
}
.k-seg__tab:hover { color: var(--brand-deep); }
.k-seg__tab.is-on { background: var(--card); color: var(--brand-deep); box-shadow: var(--shadow-card); }

/* a dropdown with its button on one line (KEP-98: an order's courier and Assign); the button wraps under it when the
   cell is too narrow for both */
.k-assign { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin: 0; }
/* (contain: a select asks a table for room for its longest option, which pushed the Assign column past the card) */
.k-assign > .k-input { flex: 1 1 8.5rem; width: auto; min-width: 0; contain: inline-size; }
.k-assign > .k-btn { flex: none; }
/* in a row of actions it takes the row's whole width, the other actions under it */
.k-acts > .k-assign { flex: 1 1 100%; }

/* the way back to a list, above a page's title (KEP-98: the order page); its arrow turns round in Arabic */
.k-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-block-end: var(--s-2);
  color: var(--brand-deep); font-weight: 700; text-decoration: none;
}
.k-back:hover { color: var(--brand-deep); text-decoration: underline; }

/* a list of events, oldest first (KEP-98: an order's status history and log): when and who on a muted line, then
   what happened */
.k-log { margin: 0; padding: 0; list-style: none; }
.k-log > li { display: grid; gap: 2px; padding-block: var(--s-3); border-block-end: 1px solid var(--faint); overflow-wrap: anywhere; }
.k-log > li:first-child { padding-block-start: 0; }
.k-log > li:last-child { padding-block-end: 0; border-block-end: 0; }
.k-log__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-3); color: var(--muted); font-size: var(--f-small); }
.k-log__what > b { font-weight: 700; color: var(--text); }

/* an on/off switch, as the prototype's COD screen (KEP-99: Reconciled): a teal track when on, grey when off, the knob
   at the end it points to, which is the left in Arabic. The transparent border makes it a 44-high target. */
.k-switch {
  position: relative; flex: none; box-sizing: content-box; width: 46px; height: 28px; margin: -8px; padding: 0;
  border: 8px solid transparent; border-radius: 22px; background: var(--border-strong); background-clip: padding-box;
  appearance: none; cursor: pointer; vertical-align: middle; transition: background-color .15s;
}
.k-switch::before {
  content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-card); transition: inset-inline-start .15s;
}
.k-switch:checked { background-color: var(--action); }
.k-switch:checked::before { inset-inline-start: 21px; }
.k-switch:focus-visible { outline-offset: -6px; }
.k-switch:disabled { opacity: .6; cursor: default; }
/* a table's last column kept at the card's end edge while the rest scrolls under it (KEP-99: the switch on a phone),
   tinted with its row when the row is late or open, as k-bt__pin */
.k-table .k-pin { position: sticky; inset-inline-end: 0; z-index: 2; background: var(--card); box-shadow: inset 1px 0 0 var(--faint); }
html[dir="rtl"] .k-table .k-pin { box-shadow: inset -1px 0 0 var(--faint); }
.k-table tr.is-overdue > .k-pin { background: var(--warn-tint); }
.k-table tr.is-open > .k-pin { background: var(--action-tint); }

/* ---------- 5. Screens: rules one screen needs, under that screen's own class ---------- */

/* System configuration (KEP-7, admin.html#config): the values in one table, each with its input and unit */
.k-config__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); flex-wrap: wrap; }
.k-config__head .k-sub { margin-block-end: 0; }
.k-config__head .k-btn { flex: none; }
.k-config__values { min-width: 760px; }
/* KEP-217: the setting's label, its key small beneath it */
.k-config__label { display: block; margin: 0; font-weight: 600; color: var(--text); }
.k-config__value { display: grid; gap: var(--s-1); margin: 0; }
.k-config__input { display: flex; align-items: center; gap: var(--s-2); color: var(--muted); }
.k-config__input .k-input { flex: none; width: 8.5rem; }
/* a field's error, under it (parsley.js puts it in the .form-group and marks the group) */
.k-config__value.is-invalid .k-input { border-color: var(--error); }
.k-config__value .parsley-error { font-size: var(--f-small); color: var(--error-text); }
.k-config__status { display: flex; flex-wrap: wrap; gap: var(--s-1); }
.k-config .k-badge svg { vertical-align: -1px; }
.k-config__status + .k-hint { display: block; margin-block-start: 2px; }
.k-config__save { display: flex; justify-content: flex-end; margin-block-start: var(--s-4); }
.k-config__h3 { margin: var(--s-4) 0 2px; font-size: var(--f-large); font-weight: 400; line-height: 1.5; color: var(--text); }
.k-config__h3 + .k-hint { display: block; margin-block-end: var(--s-3); }
.k-config__golive { margin-block-start: var(--s-3); }
.k-config__sizes label { margin: 0; overflow-wrap: anywhere; }
.k-config__sizes select.k-input { width: auto; min-width: 10rem; }
.k-config__sizes .k-acts { flex-wrap: nowrap; }

/* Settings (KEP-7): eClassify's pages keep their layout and take the tokens only (D99); these put right what still looked
   wrong. Every rule hangs on k-settings, on each settings view's section. */
/* the index: the icon sits on its title instead of 90px above it, and the hover lifts like the panel's cards */
/* (a card's own 2.2rem margin inside its h-100 column made every card that much taller than its content) */
.k-settings .setting_active_tab { margin-block-end: 0; }
.k-settings .setting_active_tab > .content { height: auto !important; }
.k-settings .setting_active_tab .card-body { padding-block-start: 0; }
.k-settings .setting_active_tab .title { margin-block-start: 0; }
.k-settings .setting_active_tab:hover { filter: none; box-shadow: var(--shadow-float); }
html[dir="rtl"] .k-settings .arrow_icon { transform: scaleX(-1); }
/* help text at the type scale's floor (Mazer's .form-group small is 11.2px), code in the panel's teal, the upload box in Zain */
.k-settings :is(small, .small, .form-text) { font-size: var(--f-small); }
.k-settings code { color: var(--brand-deep); }
.k-settings .filepond--root { font-family: inherit; }
/* right to left, a Latin value (a coordinate, an address, a model name) and the English help keep their own order */
html[dir="rtl"] .k-settings :is(input:not([type="file"]), textarea, select) { unicode-bidi: plaintext; }
/* (a line set in its own order would start at the left; it keeps the page's side, which match-parent didn't) */
html[dir="rtl"] .k-settings :is(p, .form-text, li, small) { unicode-bidi: plaintext; text-align: right; }
html[dir="rtl"] .k-settings strong { unicode-bidi: plaintext; }
/* a card placed straight in a row (Web Settings) sat 12px outside the page's gutter */
.k-settings .row > .card { width: calc(100% - var(--bs-gutter-x)); margin-inline: calc(var(--bs-gutter-x) * .5); padding-inline: 0; }
/* labels start where their field starts (Firebase and Languages centred theirs) */
.k-settings .col-form-label.text-center { text-align: start !important; }
/* a select styled as a text field gets the select's chevron (SEO's Page) */
.k-settings select.form-control:not([multiple]):not([size]) {
  padding-inline-end: 2.25rem;
  background: var(--card) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right .75rem center / 16px 12px;
}
html[dir="rtl"] .k-settings select.form-control:not([multiple]):not([size]) { background-position: left .75rem center; }
/* on a phone a select and its button (Gemini's model) take a row each, each with its own corners */
@media (max-width: 575.98px) {
  .k-settings .input-group > select.form-control { flex: 1 1 100%; border-radius: var(--r-btn) !important; }
  .k-settings .input-group > select.form-control + .btn { margin-block-start: var(--s-2); margin-inline-start: 0 !important; border-radius: var(--r-btn) !important; }
}
/* an uploaded image's preview keeps its own shape under its upload box (System Settings sized them 31% high, which
   overlapped the next field's label on a phone) */
.k-settings .form-group > img[class*="mt-2"] { display: block; width: auto !important; height: auto !important; max-width: 100%; max-height: 64px; }
/* Select2's own theme on Payment Gateways, in the panel's field shape */
.k-settings .select2-container--default .select2-selection--single { min-height: 38px; border-color: var(--border); border-radius: var(--r-btn); }
.k-settings .select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px; padding-inline: 12px 24px; color: var(--text); }
.k-settings .select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }
.k-settings .select2-container--default.select2-container--focus .select2-selection,
.k-settings .select2-container--default.select2-container--open .select2-selection { border-color: var(--action); }
/* the lists (Languages, SEO) fit their card: headers may wrap, cells are a little tighter, and the menu button isn't
   padded twice */
.k-settings .bootstrap-table .fixed-table-container thead th .th-inner { white-space: normal; padding-inline: 6px; }
.k-settings .bootstrap-table .table td { padding-inline: 6px; }
.k-settings .bootstrap-table td .btn.dropdown { padding: 0; border: 0; }
/* an icon and its words (Import Dummy Data, Edit); eClassify marks an icon-only button with .icon */
.k-settings .btn:not(.icon) > i:first-child { margin-inline-end: 4px; }

/* The Transaction ledger, the record page and Daily revenue (KEP-194, D60): amounts line up at the end edge, the table in
   a card takes the card's shadow only, and the recorded date is a small line under the order number. */
.k-ledger .k-end { text-align: end; }
.k-ledger .k-card .k-table-wrap { box-shadow: none; }
.k-ledger__when { display: block; font-size: var(--f-small); color: var(--muted); }
.k-filters__pair { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: var(--s-2); }
/* The list has ten columns and every amount stays on one line, about 1230px at the panel's usual padding, so from the
   sidebar's breakpoint up it takes tighter cells and two-line headings; sideways scroll is left to narrower screens.
   KEP-194 review: the Type badge may take two lines from here up, not only below 1280: with five-figure amounts the
   table was 13px (Arabic 39px) wider than its card at 1280, and the badge went under the View column. */
@media (min-width: 992px) {
  .k-ledger .k-bt .fixed-table-container .table > tbody > tr > td { padding-inline: var(--s-2); }
  .k-ledger .k-bt .fixed-table-container .table thead th .th-inner { padding-inline: var(--s-2); white-space: normal; }
  .k-ledger .k-bt td:not(.k-nowrap) .k-badge { white-space: normal; text-align: center; }
}
/* With the sidebar open, 1024 leaves 728px: the currency drops under its amount, the Adjusted badge under the order number,
   the time under its date. Five-figure amounts still need a short sideways scroll there, as the prototype has at 1024. */
@media (min-width: 992px) and (max-width: 1279.98px) {
  .k-ledger .k-bt .fixed-table-container .table > tbody > tr > td { padding-inline: var(--s-1); }
  .k-ledger .k-bt .fixed-table-container .table thead th .th-inner { padding-inline: var(--s-1); }
  .k-ledger .k-bt .fixed-table-container .table > tbody > tr > td.k-nowrap { white-space: normal; }
  .k-ledger .k-bt td .k-badge { white-space: normal; text-align: center; }
}
/* The View column is pinned, so it covers whichever amount is scrolled to it: kept narrow, so a whole amount shows beside
   it on a phone, and the text fades before its edge rather than running into the border. */
.k-ledger .k-bt .fixed-table-container .table > thead > tr > th.k-bt__pin .th-inner,
.k-ledger .k-bt .fixed-table-container .table > tbody > tr > td.k-bt__pin { padding-inline: var(--s-1); }
.k-ledger .k-bt td.k-bt__pin .k-btn { padding-inline: var(--s-2); }
@media (max-width: 991.98px) {
  .k-ledger .k-bt td.k-bt__pin::before {
    content: ""; position: absolute; inset-block: 0; inset-inline-end: 100%; width: var(--s-4); pointer-events: none;
    background: linear-gradient(to right, transparent, var(--card));
  }
  html[dir="rtl"] .k-ledger .k-bt td.k-bt__pin::before { background: linear-gradient(to left, transparent, var(--card)); }

  /* All three tables: the first column stays at the start edge, narrow and on a solid ground, so the first amounts show
     beside it on load and the others scroll under it. */
  .k-ledger .k-table { min-width: 0; }
  .k-ledger .k-table :is(thead, tbody, tfoot) > tr > :first-child,
  .k-ledger .k-bt .fixed-table-container .table > thead > tr > th:first-child,
  .k-ledger .k-bt .fixed-table-container .table > tbody > tr:not(.no-records-found) > td:first-child {
    position: sticky; inset-inline-start: 0; z-index: 2; width: 96px; min-width: 96px; max-width: 96px;
    padding-inline: var(--s-2); white-space: normal; overflow-wrap: break-word;
    background: var(--card); box-shadow: inset -1px 0 0 var(--faint);
  }
  html[dir="rtl"] .k-ledger .k-table :is(thead, tbody, tfoot) > tr > :first-child,
  html[dir="rtl"] .k-ledger .k-bt .fixed-table-container .table > thead > tr > th:first-child,
  html[dir="rtl"] .k-ledger .k-bt .fixed-table-container .table > tbody > tr:not(.no-records-found) > td:first-child { box-shadow: inset 1px 0 0 var(--faint); }
  .k-ledger .k-bt .fixed-table-container .table > thead > tr > th:first-child .th-inner { padding-inline: 0; }
  .k-ledger .k-bt td .k-ledger__when { white-space: normal; }
  /* KEP-194 review: the cell scrolled under the first column fades at its edge, as the one under View does, so the end of
     an amount doesn't peek out beside the order number (or the date, or the label) at the far end of a sideways scroll.
     At rest it lies over the next cell's padding only. */
  .k-ledger .k-table :is(thead, tbody, tfoot) > tr > :first-child::after,
  .k-ledger .k-bt .fixed-table-container .table > thead > tr > th:first-child::after,
  .k-ledger .k-bt .fixed-table-container .table > tbody > tr:not(.no-records-found) > td:first-child::after {
    content: ""; position: absolute; inset-block: 0; inset-inline-start: 100%; width: var(--s-4); pointer-events: none;
    background: linear-gradient(to right, var(--card) 50%, transparent);
  }
  html[dir="rtl"] .k-ledger .k-table :is(thead, tbody, tfoot) > tr > :first-child::after,
  html[dir="rtl"] .k-ledger .k-bt .fixed-table-container .table > thead > tr > th:first-child::after,
  html[dir="rtl"] .k-ledger .k-bt .fixed-table-container .table > tbody > tr:not(.no-records-found) > td:first-child::after {
    background: linear-gradient(to left, var(--card) 50%, transparent);
  }
  /* Once the table is scrolled, the fade widens to cover the last few characters of whatever is under the column;
     a browser without scroll-driven animations keeps the narrow fade. */
  @supports (animation-timeline: scroll()) {
    .k-ledger .k-table :is(thead, tbody, tfoot) > tr > :first-child::after,
    .k-ledger .k-bt .fixed-table-container .table > thead > tr > th:first-child::after,
    .k-ledger .k-bt .fixed-table-container .table > tbody > tr:not(.no-records-found) > td:first-child::after {
      animation: k-ledger-fade linear both; animation-timeline: scroll(nearest inline); animation-range: 0 var(--s-7);
    }
  }
}
@keyframes k-ledger-fade { to { width: var(--s-7); } }
/* KEP-194 review: "No ledger records for these filters." spans all ten columns, so on a phone it was centred about 600px
   along a row that scrolls sideways, out of sight. It takes the width the card shows and stays at its start edge. */
.k-ledger .k-bt .fixed-table-body { container-type: inline-size; }
.k-ledger .k-bt .fixed-table-container .table > tbody > tr.no-records-found .k-empty {
  position: sticky; inset-inline-start: 0; width: 100cqi;
}
/* the library's "float-left" and "float-right" are physical, so in Arabic the count sat at the far end of the line */
html[dir="rtl"] .k-ledger .fixed-table-pagination > .pagination-detail { float: right !important; }
html[dir="rtl"] .k-ledger .fixed-table-pagination > .pagination { float: left !important; }
/* an adjustment's changes, one a line: label and amount are each isolated, so the colon stays with its label in Arabic */
.k-log__changes { display: grid; gap: var(--s-1); margin: 0 0 var(--s-2); padding: 0; list-style: none; }
.k-log__changes > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-2); }

/* All Ads' Create and Edit (KEP-77, D60): on a phone each tab's language picker wraps under the tab's heading instead of
   running past the screen (Extra Details 7px, SEO 15px). It hangs on the picker, since the page's script draws the Extra
   Details one. */
:is(#addItemTabs, #editItemTabs) ~ .tab-content .d-flex:has(> [id$="-language-selector"], > .d-flex > [id$="-language-selector"]) { flex-wrap: wrap; gap: var(--s-2); }
:is(#addItemTabs, #editItemTabs) ~ .tab-content [id$="-language-selector"] { max-width: 100%; }

/* Payouts (KEP-193, D60): a cell stacks its value, its small line (the masked number, who sent it) and its badges, which
   may take two lines so a long one, as a deleted seller's, never widens the table on a phone. The full number's dialog
   keeps the number left to right in Arabic too (.k-num). */
.k-payouts__cell { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-1); min-width: 0; }
.k-payouts__cell .k-badge { max-width: 24ch; }
.k-payouts__line { display: block; font-size: var(--f-small); color: var(--muted); }
.k-payouts__cell .k-btn--ghost { padding-inline: 0; }
.k-payouts__number p { margin: 0 0 var(--s-2); }
.k-payouts__number .k-num { font-size: 1.25rem; letter-spacing: .04em; }

/* KEP-222 (D129): the review page's "What changed" card, above the photos and the details. The value rows are .k-dl's,
   each before (struck through) → now; the arrow points at the new value right to left too. Photos added and removed
   as small squares, the removed ones faded. */
.k-changes { margin-block-end: var(--s-4); }
.k-changes__head { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.k-changes__head .k-h2 { margin-block: 0; }
.k-changes__note { margin: var(--s-2) 0 0; color: var(--muted); font-weight: 300; }
.k-changes__note b { color: var(--text); font-weight: 700; }
.k-changes__list { margin-block-start: var(--s-3); }
.k-changes__list del { color: var(--muted); font-weight: 300; text-decoration-color: var(--error); }
.k-changes__list ins { text-decoration: none; }
.k-changes__arrow { display: inline-block; margin-inline: 4px; color: var(--muted); font-weight: 300; }
html[dir="rtl"] .k-changes__arrow { transform: scaleX(-1); }
.k-changes__h3 { margin: var(--s-4) 0 var(--s-2); font-size: var(--f-normal); font-weight: 700; color: var(--text); }
.k-changes__texts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
@media (max-width: 767.98px) { .k-changes__texts { grid-template-columns: minmax(0, 1fr); } }
.k-changes__texts > div { padding: var(--s-3); border-radius: var(--r-btn); background: var(--faint); }
.k-changes__label { display: block; margin-block-end: 4px; color: var(--muted); font-size: var(--f-small); font-weight: 700; }
.k-changes__before { color: var(--muted); }
.k-changes__photos { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.k-changes__photos > a { display: block; width: 72px; height: 72px; border-radius: var(--r-btn); overflow: hidden; background: var(--faint); }
.k-changes__photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.k-changes__photos--removed > a { outline: 2px solid var(--error); outline-offset: -2px; }
.k-changes__photos--removed img { opacity: .5; filter: grayscale(1); }
/* the queue's Edited badge under a listing's title and price, as wide as its word */
.k-listing__text > .k-badge { justify-self: start; }
