/*
 * Look Loops admin theme — /admin/ (platform) and /vendor-admin/ (brands).
 * Loaded after Django's admin CSS by templates/admin/base_site.html.
 *
 * 1. Brand tokens mapped onto Django's own CSS variables, so every stock admin
 *    page (change lists, forms, inlines, filters, popups) takes the look.
 * 2. The shell: top bar, task sidebar (utils/admin_nav.py), content area.
 * 3. Components used by the dashboards and quick actions (.ll-*).
 * Logical properties (margin-inline-start…) keep Arabic RTL correct; Django
 * adds its rtl.css on top for its own widgets.
 */

:root {
  --ll-olive: #3d4a2f;
  --ll-ink: #1f2417;
  --ll-cream: #faf5ec;
  --ll-sage: #b4b7a3;
  --ll-orange: #ca511d;
  --ll-accent: #b8461a;          /* orange darkened for white text (AA) */
  --ll-accent-ink: #8a3510;
  --ll-accent-soft: #fff7f1;
  --ll-accent-line: #e8b99c;
  --ll-muted: #5b6150;
  --ll-line: #e6e1d3;
  --ll-line-soft: #efebe0;
  --ll-field: #cfc9b8;
  --ll-panel: #f4f1e8;
  --ll-white: #fff;
  --ll-radius: 14px;
  --ll-radius-sm: 9px;

  /* Django admin variables */
  --primary: var(--ll-olive);
  --secondary: var(--ll-ink);
  --accent: var(--ll-cream);
  --primary-fg: var(--ll-white);
  --body-fg: var(--ll-ink);
  --body-bg: var(--ll-cream);
  --body-quiet-color: var(--ll-muted);
  --body-medium-color: #3f4535;
  --body-loud-color: var(--ll-ink);
  --header-color: var(--ll-ink);
  --header-branding-color: var(--ll-ink);
  --header-bg: var(--ll-cream);
  --header-link-color: var(--ll-ink);
  --breadcrumbs-fg: var(--ll-muted);
  --breadcrumbs-link-fg: var(--ll-ink);
  --breadcrumbs-bg: transparent;
  --link-fg: var(--ll-ink);
  --link-hover-color: var(--ll-accent);
  --link-selected-fg: var(--ll-accent-ink);
  --hairline-color: var(--ll-line-soft);
  --border-color: var(--ll-field);
  --error-fg: #8a2a1c;
  --message-success-bg: #e7ede0;
  --message-warning-bg: #fff4de;
  --message-error-bg: #fbeae6;
  --message-info-bg: #eef1f6;
  --darkened-bg: #f8f6ef;
  --selected-bg: var(--ll-panel);
  --selected-row: #fff7f1;
  --button-fg: var(--ll-cream);
  --button-bg: var(--ll-ink);
  --button-hover-bg: var(--ll-olive);
  --default-button-bg: var(--ll-ink);
  --default-button-hover-bg: var(--ll-olive);
  --close-button-bg: #6b705f;
  --close-button-hover-bg: var(--ll-ink);
  --delete-button-bg: #8a2a1c;
  --delete-button-hover-bg: #6e2016;
  --object-tools-fg: var(--ll-ink);
  --object-tools-bg: var(--ll-white);
  --object-tools-hover-bg: var(--ll-panel);
  --font-family-primary: "Poppins", system-ui, sans-serif;
}

html[dir="rtl"] { --font-family-primary: "Zain", "Poppins", system-ui, sans-serif; }
html[dir="rtl"] body { font-size: 16px; }

body { background: var(--ll-cream); color: var(--ll-ink); font-family: var(--font-family-primary); }
a:link, a:visited { color: var(--ll-ink); text-decoration: none; }
/* Django 6 underlines links via a:not(…, #content-main.app-list a, …): specificity (1,1,2). Beat it. */
html body #container a:link, html body #container a:visited { text-decoration: none; }
#container #content a:hover, #container .breadcrumbs a:hover { text-decoration: underline; }
#container #content a.ll-action:hover, #container #content a.ll-btn:hover, #container #content .ll-tabs a:hover { text-decoration: none; }
.ll-topbar form { margin: 0; }
a:hover, a:focus { color: var(--ll-accent); }
:focus-visible { outline: 2px solid var(--ll-accent); outline-offset: 2px; }
.ll-num, .ll-num * { font-family: "Poppins", system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.ll-muted { color: var(--ll-muted); }

/* ---------------------------------------------------------------- shell --- */
#container { min-height: 100vh; display: flex; flex-direction: column; }
.ll-topbar {
  display: flex; align-items: center; gap: 16px; height: 72px; padding: 0 40px;
  background: var(--ll-cream); border-bottom: 1px solid var(--ll-line); color: var(--ll-ink);
  position: sticky; top: 0; z-index: 20;
}
#header.ll-topbar { justify-content: flex-start; }
.ll-topbar-brand a { font-weight: 700; letter-spacing: .14em; text-decoration: none; }
.ll-search {
  flex: 1 1 auto; max-width: 560px; display: flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 14px; background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: 10px; color: var(--ll-muted);
}
.ll-search input { border: 0; outline: 0; flex: 1; font: inherit; font-size: 14px; background: transparent; color: var(--ll-ink); padding: 0; }
.ll-topbar-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.ll-lang button, .ll-btn {
  min-height: 40px; padding: 0 16px; border-radius: var(--ll-radius-sm); border: 1px solid var(--ll-field);
  background: var(--ll-white); color: var(--ll-ink); font: 600 13px "Poppins", sans-serif; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; white-space: nowrap;
}
.ll-lang button[lang="ar"] { font-family: "Zain", sans-serif; font-size: 16px; }
a.ll-btn:link, a.ll-btn:visited { color: var(--ll-ink); }
.ll-btn--dark, a.ll-btn--dark:link, a.ll-btn--dark:visited { background: var(--ll-ink); border-color: var(--ll-ink); color: var(--ll-cream); }
.ll-btn--accent, a.ll-btn--accent:link, a.ll-btn--accent:visited { background: var(--ll-accent); border-color: var(--ll-accent); color: var(--ll-white); }
.ll-btn--danger { color: #8a2a1c; border-color: #e3b8b0; }
.ll-btn:hover { border-color: var(--ll-ink); }
.ll-btn--dark:hover, .ll-btn--accent:hover { filter: brightness(1.1); color: var(--ll-white); }
.ll-btn--sm { min-height: 36px; padding: 0 12px; font-size: 12px; }

.ll-usermenu { position: relative; }
.ll-usermenu summary {
  list-style: none; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.ll-usermenu summary::-webkit-details-marker { display: none; }
.ll-usermenu summary:hover { background: var(--ll-panel); }
.ll-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ll-olive); color: var(--ll-cream); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; text-transform: uppercase; }
.ll-usermenu-panel {
  position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 220px; padding: 12px; display: flex; flex-direction: column; gap: 8px;
  background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: 12px; box-shadow: 0 12px 32px rgba(31, 36, 23, .12); z-index: 30;
}
.ll-usermenu-meta { font-size: 12px; color: var(--ll-muted); }
.ll-usermenu-panel a, .ll-usermenu-panel button { font: inherit; font-size: 14px; text-align: start; background: none; border: 0; padding: 8px 4px; cursor: pointer; color: var(--ll-ink); text-decoration: none; }
.ll-usermenu-panel a:hover, .ll-usermenu-panel button:hover { color: var(--ll-accent); }

.main { display: flex; flex: 1; }
.main > #ll-sidebar + .content, .main .content { flex: 1; min-width: 0; }
.ll-sidebar {
  box-sizing: border-box; width: 248px; background: var(--ll-olive); color: var(--ll-cream); padding: 24px 16px 32px;
  display: flex; flex-direction: column; gap: 2px; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; overflow-y: auto; z-index: 25;
}
/* the sidebar is fixed on the start side; everything else moves over by its width */
body.ll-has-nav #header.ll-topbar, body.ll-has-nav div.breadcrumbs, body.ll-has-nav ul.messagelist { padding-inline-start: calc(248px + 40px); }
body.ll-has-nav .main { padding-inline-start: 248px; }
.ll-sidebar--platform { background: var(--ll-ink); }
.ll-sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 4px 12px 20px; text-decoration: none; }
.ll-sidebar a.ll-sidebar-brand:link, .ll-sidebar a.ll-sidebar-brand:visited { color: var(--ll-cream); }
.ll-sidebar-logo { width: 40px; height: 40px; border-radius: 10px; background: var(--ll-cream); color: var(--ll-olive); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.ll-sidebar-logo img { width: 100%; height: 100%; object-fit: contain; }
.ll-sidebar-brandtext { display: flex; flex-direction: column; line-height: 1.3; }
.ll-sidebar-brandtext b { font-size: 15px; }
.ll-sidebar-brandtext small { font-size: 12px; color: var(--ll-sage); }
.ll-wordmark { font-family: "Poppins", sans-serif; letter-spacing: .12em; }
.ll-group { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ll-sage); font-weight: 600; padding: 16px 12px 6px; }
html[dir="rtl"] .ll-group { letter-spacing: 0; font-size: 14px; }
.ll-sidebar a { text-decoration: none; }
.ll-nav { display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-size: 14px; }
html[dir="rtl"] .ll-nav { font-size: 17px; }
.ll-sidebar a.ll-nav:link, .ll-sidebar a.ll-nav:visited { color: #e9e6da; }
.ll-sidebar a.ll-nav:hover { color: var(--ll-white); background: rgba(250, 245, 236, .08); }
.ll-sidebar a.ll-nav--on:link, .ll-sidebar a.ll-nav--on:visited, .ll-sidebar a.ll-nav--on:hover { background: var(--ll-cream); color: var(--ll-ink); font-weight: 600; }
.ll-nav svg { flex-shrink: 0; }
.ll-nav-label { flex: 1; }
.ll-badge { background: var(--ll-orange); color: var(--ll-white); font: 600 11px "Poppins", sans-serif; border-radius: 10px; padding: 2px 8px; }

#content { padding: 28px 40px 48px; max-width: 1400px; }
#content > h1, .ll-page-title { font-size: 26px; font-weight: 600; margin: 0 0 20px; color: var(--ll-ink); }
html[dir="rtl"] #content > h1 { font-weight: 800; font-size: 30px; }
#content > h2 { font-size: 15px; color: var(--ll-muted); font-weight: 500; margin: -12px 0 20px; }
div.breadcrumbs { background: transparent; color: var(--ll-muted); padding: 16px 40px 0; font-size: 13px; border: 0; }
div.breadcrumbs a:link, div.breadcrumbs a:visited { color: var(--ll-muted); }
div.breadcrumbs a:hover { color: var(--ll-accent); }
#footer { display: none; }

/* messages */
ul.messagelist { padding: 16px 40px 0; margin: 0; }
ul.messagelist li { border-radius: 10px; padding: 12px 16px 12px 44px; margin: 0 0 8px; font-size: 14px; color: var(--ll-ink); border: 1px solid transparent; background-position: 14px 13px; }
html[dir="rtl"] ul.messagelist li { padding: 12px 44px 12px 16px; background-position: calc(100% - 14px) 13px; }
ul.messagelist li.success { border-color: #c7d8bd; }
ul.messagelist li.warning { border-color: #e9cd92; }
ul.messagelist li.error { border-color: #e3b8b0; }

/* ------------------------------------------------------ stock admin pages --- */
.module, #changelist, .inline-group { border-radius: var(--ll-radius); }
.module { background: var(--ll-white); border: 1px solid var(--ll-line); overflow: hidden; }
.module h2, .module caption, .inline-group h2 {
  background: transparent; color: var(--ll-ink); font-size: 16px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 16px 20px 8px;
}
.module h2 a, .module caption a { color: var(--ll-ink); }
fieldset.module { padding: 0 0 8px; margin-bottom: 20px; }
fieldset.module h2.fieldset-heading, fieldset.module > h2 { border-bottom: 1px solid var(--ll-line-soft); padding-bottom: 12px; margin-bottom: 4px; }
.form-row { border-bottom: 1px solid var(--ll-line-soft); padding: 14px 20px; }
.aligned label, .aligned .flex-container > label { color: var(--ll-ink); font-weight: 500; }
.help, p.help, form .aligned p.help, form .aligned div.help { color: var(--ll-muted); font-size: 12px; }

input[type=text], input[type=password], input[type=email], input[type=url], input[type=number], input[type=tel], input[type=search],
textarea, select, .vTextField {
  border: 1px solid var(--ll-field); border-radius: var(--ll-radius-sm); padding: 9px 12px; font: inherit; font-size: 14px; background: var(--ll-white); color: var(--ll-ink); min-height: 40px;
  box-sizing: border-box;
}
select { padding-inline-end: 28px; }
input:focus, textarea:focus, select:focus { border-color: var(--ll-olive); outline: 2px solid rgba(61, 74, 47, .18); outline-offset: 0; }

.button, input[type=submit], input[type=button], .submit-row input, a.button {
  border-radius: var(--ll-radius-sm); padding: 10px 18px; font: 600 14px "Poppins", sans-serif; min-height: 42px; background: var(--ll-white); color: var(--ll-ink); border: 1px solid var(--ll-field);
}
html[dir="rtl"] .button, html[dir="rtl"] input[type=submit], html[dir="rtl"] .submit-row input { font-family: "Zain", sans-serif; font-size: 16px; }
.button:hover, input[type=submit]:hover, input[type=button]:hover { background: var(--ll-panel); border-color: var(--ll-ink); color: var(--ll-ink); }
.button.default, input[type=submit].default, .submit-row input.default { background: var(--ll-ink); border-color: var(--ll-ink); color: var(--ll-cream); }
.button.default:hover, input[type=submit].default:hover { background: var(--ll-olive); color: var(--ll-white); }
.submit-row {
  background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: var(--ll-radius); padding: 14px 20px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  position: sticky; bottom: 12px; z-index: 5; box-shadow: 0 8px 24px rgba(31, 36, 23, .08);
}
.submit-row a.deletelink { border-radius: var(--ll-radius-sm); background: transparent; color: #8a2a1c; border: 1px solid #e3b8b0; padding: 10px 16px; height: auto; }
.submit-row a.deletelink:hover { background: #fbeae6; color: #6e2016; }
.submit-row a.closelink { border-radius: var(--ll-radius-sm); }

/* Page header row (templates/admin/change_list.html, change_form.html): title · search · buttons */
.ll-list-head { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin: 0 0 20px; }
.ll-list-head > h1, .ll-list-head > div:first-child { margin: 0 auto 0 0; margin-inline-end: auto; margin-inline-start: 0; }
.ll-list-head h1 { font-size: 26px; font-weight: 600; margin: 0; color: var(--ll-ink); line-height: 1.2; }
html[dir="rtl"] .ll-list-head h1 { font-weight: 800; font-size: 30px; }
.ll-list-head .ll-lead { margin: 4px 0 0; }
.ll-list-head ul.object-tools { margin: 0; padding: 0; float: none; display: flex; gap: 8px; }
.ll-list-head ul.object-tools:empty { display: none; }
.ll-list-head #toolbar { margin: 0; padding: 0; background: none; border: 0; }
.ll-list-head #changelist-search > div { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ll-list-head #changelist-search label { display: flex; }
.ll-list-head #changelist-search label img { width: 16px; height: 16px; opacity: .6; }
.ll-list-head #searchbar { width: 300px; max-width: 60vw; min-height: 40px; box-sizing: border-box; }
.ll-list-head #changelist-search input[type=submit] { min-height: 40px; }
.ll-list-head #changelist-search .small { width: 100%; text-align: end; }
.ll-list-head .help { margin: 4px 0 0; font-size: 12px; }
ul.object-tools li a:link, ul.object-tools li a:visited {
  border-radius: var(--ll-radius-sm); background: var(--ll-ink); color: var(--ll-cream); font: 600 13px "Poppins", sans-serif; text-transform: none; letter-spacing: 0; padding: 10px 16px;
}
ul.object-tools li a:hover { background: var(--ll-olive); color: var(--ll-white); }
html[dir="rtl"] ul.object-tools li a:link { font-family: "Zain", sans-serif; font-size: 16px; }

/* change list */
#changelist { background: transparent; }
#changelist .changelist-form-container { background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: var(--ll-radius); overflow: hidden; }
#changelist #toolbar { background: var(--ll-white); border-bottom: 1px solid var(--ll-line-soft); padding: 14px 20px; margin: 0; }
#changelist #toolbar form input[type=text] { width: 320px; }
#changelist #toolbar form input[type=submit] { min-height: 40px; }
#changelist .actions { background: var(--ll-darkened-bg, #f8f6ef); border-bottom: 1px solid var(--ll-line-soft); padding: 10px 20px; color: var(--ll-muted); }
#changelist table thead th { background: var(--ll-white); color: var(--ll-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; border-bottom: 1px solid var(--ll-line); padding: 12px 16px; }
html[dir="rtl"] #changelist table thead th { letter-spacing: 0; font-size: 14px; }
#changelist table thead th a:link, #changelist table thead th a:visited { color: var(--ll-muted); }
#result_list td, #result_list th { padding: 13px 16px; border-bottom: 1px solid var(--ll-line-soft); font-size: 14px; vertical-align: middle; }
#result_list tbody tr:hover td, #result_list tbody tr:hover th { background: #fcfaf5; }
#result_list tbody tr.selected td, #result_list tbody tr.selected th { background: var(--selected-row); }
#result_list th.field-__str__ a, #result_list th a { font-weight: 600; }
.paginator { padding: 14px 20px; border-top: 0; color: var(--ll-muted); }
#changelist-filter { background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: var(--ll-radius); overflow: hidden; }
#changelist-filter h2 { background: transparent; color: var(--ll-ink); font-size: 15px; text-transform: none; letter-spacing: 0; padding: 16px 20px 8px; }
#changelist-filter h3 { color: var(--ll-muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
#changelist-filter li.selected a { color: var(--ll-accent-ink); font-weight: 600; }
#changelist-filter a:focus, #changelist-filter a:hover, #changelist-filter li.selected a:focus, #changelist-filter li.selected a:hover { color: var(--ll-accent); }
.change-list .filtered .results, .change-list .filtered .paginator, .filtered #toolbar, .filtered div.xfull { margin-inline-end: 0; }

/* inlines */
.inline-group { background: var(--ll-white); border: 1px solid var(--ll-line); overflow: hidden; margin-bottom: 20px; }
.inline-group .tabular tr.has_original td { padding-top: 12px; }
.inline-group .tabular th { background: var(--ll-white); color: var(--ll-muted); font-weight: 600; font-size: 12px; }
.inline-related h3 { background: var(--ll-panel); color: var(--ll-ink); padding: 10px 20px; font-size: 13px; }
.add-row a:link, .add-row a:visited { color: var(--ll-accent-ink); font-weight: 600; }

/* login */
body.login { background: var(--ll-cream); }
.login #container { background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: 18px; max-width: 420px; margin: 80px auto; min-height: 0; box-shadow: 0 16px 48px rgba(31, 36, 23, .08); overflow: hidden; }
.login .ll-topbar { position: static; padding: 0 28px; }
.login #content { padding: 28px; }
.login .submit-row { position: static; box-shadow: none; border: 0; padding: 12px 0 0; }
.login .submit-row input { width: 100%; }

/* ------------------------------------------------------------ components --- */
.ll-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.ll-page-head h1 { margin: 4px 0; font-size: 30px; font-weight: 600; }
html[dir="rtl"] .ll-page-head h1 { font-weight: 800; font-size: 34px; }
.ll-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ll-muted); font-weight: 600; }
html[dir="rtl"] .ll-eyebrow { letter-spacing: 0; font-size: 14px; }
.ll-lead { color: var(--ll-muted); font-size: 15px; margin: 0; }
.ll-grid { display: grid; gap: 16px; margin-bottom: 24px; }
.ll-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ll-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ll-grid--main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.ll-grid--half { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; gap: 20px; }
.ll-card { background: var(--ll-white); border: 1px solid var(--ll-line); border-radius: var(--ll-radius); }
.ll-card--pad { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ll-card--alert { border-color: var(--ll-accent-line); }
.ll-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.ll-card-head h2 { margin: 0; font-size: 17px; font-weight: 600; color: var(--ll-ink); background: none; padding: 0; text-transform: none; letter-spacing: 0; }
html[dir="rtl"] .ll-card-head h2 { font-weight: 800; font-size: 20px; }
.ll-card-head p { margin: 2px 0 0; color: var(--ll-muted); font-size: 13px; }
.ll-card-head a { font-size: 13px; font-weight: 600; white-space: nowrap; }
.ll-action { text-decoration: none; padding: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ll-ink); }
a.ll-action:hover { border-color: var(--ll-ink); color: var(--ll-ink); }
.ll-action--hot { background: var(--ll-accent-soft); border-color: var(--ll-accent-line); }
.ll-action-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ll-big { font-family: "Poppins", sans-serif; font-size: 40px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.ll-kpi { padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.ll-kpi b { font-family: "Poppins", sans-serif; font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ll-go { font-size: 13px; font-weight: 600; }
.ll-go--hot { color: var(--ll-accent-ink); }
.ll-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ll-tile { padding: 14px; border-radius: 10px; background: var(--ll-panel); display: flex; flex-direction: column; gap: 4px; }
.ll-tile--good { background: #e7ede0; color: #2e4a22; }
.ll-rows { display: flex; flex-direction: column; gap: 10px; }
.ll-rows > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.ll-note { font-size: 13px; padding: 10px 12px; border-radius: var(--ll-radius-sm); background: var(--ll-panel); margin: 0; }
.ll-note--hot { background: var(--ll-accent-soft); color: var(--ll-accent-ink); }
.ll-empty { padding: 24px 20px; color: var(--ll-muted); font-size: 14px; margin: 0; }

table.ll-table { width: 100%; border-collapse: collapse; }
.ll-table th { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ll-muted); text-align: start; font-weight: 600; padding: 10px 20px; border-bottom: 1px solid var(--ll-line); background: none; }
html[dir="rtl"] .ll-table th { letter-spacing: 0; font-size: 14px; }
.ll-table td { padding: 12px 20px; border-bottom: 1px solid var(--ll-line-soft); font-size: 14px; vertical-align: middle; }
.ll-table tr:last-child td { border-bottom: 0; }
.ll-table .ll-end { text-align: end; }
.ll-sub { display: block; font-size: 12px; color: var(--ll-muted); margin-top: 2px; }
.ll-strong { font-weight: 600; }
.ll-inline-form { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
#container input.ll-stock-input { width: 96px; height: 38px; min-height: 0; padding: 6px 10px; box-sizing: border-box; }
.ll-saved { color: #2e5e24; font-size: 12px; font-weight: 600; }
.ll-error { color: #8a2a1c; font-size: 12px; font-weight: 600; }

/* status chips (orders) — text labels, never colour alone */
.ll-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 3px 10px; white-space: nowrap; line-height: 1.5; }
html[dir="rtl"] .ll-chip { font-size: 14px; }
.ll-chip--pending { background: #f6e7c8; color: #6e4304; }
.ll-chip--confirmed { background: #e1e9f5; color: #1e4a8c; }
.ll-chip--processing { background: #ece6f5; color: #4b3a7a; }
.ll-chip--partially_shipped, .ll-chip--shipped { background: #ddefef; color: #145b5b; }
.ll-chip--delivered { background: #e2f0df; color: #2e5e24; }
.ll-chip--cancelled { background: #f6deda; color: #8a2a1c; }
.ll-chip--returned { background: #e9e7e1; color: #4c4a42; }
.ll-chip--soldout { background: #f6deda; color: #8a2a1c; }
.ll-chip--low { background: #fff4de; color: #6e4304; }
.ll-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ll-swatch { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid var(--ll-field); vertical-align: middle; margin-inline-end: 6px; }

/* single-series bars (sales by governorate): one hue, direct values */
.ll-bars { display: flex; flex-direction: column; gap: 12px; }
.ll-bar-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) 130px; gap: 12px; align-items: center; font-size: 14px; }
.ll-bar-track { border-inline-start: 1px solid var(--ll-field); height: 14px; }
.ll-bar { display: block; height: 14px; background: var(--ll-olive); border-start-end-radius: 4px; border-end-end-radius: 4px; }

/* status tabs above a change list */
.ll-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 0 0 16px; padding: 0; list-style: none; }
.ll-tabs a { min-height: 40px; padding: 0 14px; border-radius: var(--ll-radius-sm); display: inline-flex; align-items: center; gap: 8px; font-size: 14px; text-decoration: none; border: 1px solid transparent; }
.ll-tabs a[aria-current="page"] { background: var(--ll-white); border-color: var(--ll-line); font-weight: 600; }
.ll-tabs .ll-count { font: 600 12px "Poppins", sans-serif; background: var(--ll-line-soft); border-radius: 10px; padding: 1px 8px; }
.ll-tabs .ll-count--hot { background: #f6e7c8; color: #6e4304; }

/* order status steps (vendor order form) */
.ll-steps { display: flex; list-style: none; margin: 0; padding: 0; }
.ll-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; text-align: center; color: var(--ll-muted); position: relative; }
html[dir="rtl"] .ll-step { font-size: 15px; }
.ll-step::before { content: ""; position: absolute; top: 14px; inset-inline-start: -50%; width: 100%; height: 2px; background: var(--ll-line); z-index: 0; }
.ll-step:first-child::before { display: none; }
.ll-step-dot { width: 28px; height: 28px; border-radius: 50%; background: var(--ll-line-soft); color: var(--ll-muted); display: flex; align-items: center; justify-content: center; font: 600 12px "Poppins", sans-serif; position: relative; z-index: 1; }
.ll-step--done { color: var(--ll-ink); font-weight: 600; }
.ll-step--done .ll-step-dot { background: var(--ll-ink); color: var(--ll-cream); }
.ll-step--done::before { background: var(--ll-ink); }
.ll-step--next { color: var(--ll-accent-ink); font-weight: 600; }
.ll-step--next .ll-step-dot { background: var(--ll-white); border: 2px solid var(--ll-accent); color: var(--ll-accent); }
.ll-step--off { text-decoration: line-through; }

/* colour × size stock grid (product form) */
.ll-stock-grid { border-collapse: separate; border-spacing: 8px; margin: 0 12px 8px; }
.ll-stock-grid th { font-size: 13px; font-weight: 600; color: var(--ll-ink); text-align: center; background: none; padding: 4px; border: 0; }
.ll-stock-grid th[scope="row"] { text-align: start; font-weight: 500; white-space: nowrap; padding-inline-end: 12px; }
.ll-stock-grid td { padding: 0; border: 0; text-align: center; vertical-align: middle; }
.ll-stock-grid input[type=number] { width: 84px; text-align: center; font: 600 14px "Poppins", sans-serif; font-variant-numeric: tabular-nums; min-height: 44px; padding: 0 6px; }
.ll-stock-grid .ll-cell--zero input[type=number] { background: #fbeae6; border-color: #e3b8b0; color: #8a2a1c; }
.ll-stock-grid .ll-cell--low input[type=number] { background: #fff4de; border-color: #e9cd92; color: #6e4304; }
.ll-stock-grid .ll-cell-off input[type=checkbox] { margin-top: 4px; }
.ll-cell-sku { display: block; font-size: 10px; color: var(--ll-muted); margin-top: 3px; }
.ll-legend { display: flex; gap: 20px; font-size: 12px; color: var(--ll-muted); padding: 0 20px 16px; flex-wrap: wrap; }
.ll-legend span { display: inline-flex; align-items: center; gap: 6px; }
.ll-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ------------------------------------------------------------- responsive --- */
@media (max-width: 1100px) {
  .ll-grid--4, .ll-grid--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ll-grid--main, .ll-grid--half { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .main { flex-direction: column; }
  .ll-sidebar { width: auto; position: static; flex-direction: row; overflow-x: auto; padding: 8px 12px; gap: 4px; }
  body.ll-has-nav #header.ll-topbar, body.ll-has-nav div.breadcrumbs, body.ll-has-nav ul.messagelist { padding-inline-start: 16px; }
  body.ll-has-nav .main { padding-inline-start: 0; }
  .ll-sidebar-brand, .ll-group { display: none; }
  .ll-nav { white-space: nowrap; }
  .ll-topbar { padding: 0 16px; height: 64px; }
  .ll-search { display: none; }
  #content { padding: 20px 16px 40px; }
  div.breadcrumbs, ul.messagelist { padding-inline: 16px; }
  .ll-grid--4, .ll-grid--5, .ll-split { grid-template-columns: minmax(0, 1fr); }
  .ll-table th, .ll-table td { padding: 10px 12px; }
}

/* Screen-reader-only label */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ll-paginator { display: flex; gap: 16px; align-items: center; padding: 14px 20px; margin: 0; border-top: 1px solid var(--ll-line); }
.dashboard.ll-dashboard #content { width: auto; max-width: 1280px; }
.ll-order-progress { margin-bottom: 24px; }
.ll-next-moves { display: flex; flex-wrap: wrap; gap: 10px; }
#changelist + .ll-tabs, .ll-tabs + #content-main { margin-top: 0; }
#content-main > .ll-tabs, #content .ll-tabs { margin-bottom: 16px; }
td.field-subtotal_display, td.field-created { white-space: nowrap; }
.ll-order-progress { clear: both; margin-top: 8px; }
.ll-card + .ll-grid, .ll-card + .ll-card { margin-top: 24px; }
.ll-grid > * { margin: 0; }
.ll-legend i.ll-key--zero { background: #fbeae6; border: 1px solid #e3b8b0; }
.ll-legend i.ll-key--low { background: #fff4de; border: 1px solid #e9cd92; }
.ll-variant-grid .ll-card-head { margin: 0; }
.ll-grid-help { padding: 12px 20px 0; margin: 0; color: var(--ll-muted); font-size: 13px; }
.ll-stock-grid-wrap { overflow-x: auto; padding: 8px 8px 0; }
html[dir="rtl"] .ll-arrow { display: inline-block; transform: scaleX(-1); }

/* --- review fixes (all admin pages) ---
   widgets.css, autocomplete.css and changelists.css load AFTER this file (form media / change_list
   extrastyle), so overrides of their rules carry an extra "html body" to win. */
/* Django uppercases the default button; ours are sentence case like every other button. */
html body .submit-row input.default { text-transform: none; }
.submit-row a.closelink:link, .submit-row a.closelink:visited { background: var(--ll-white); color: var(--ll-ink); border: 1px solid var(--ll-field); padding: 10px 18px; font-weight: 600; height: auto; }
/* Two-box "choose" widget (group permissions, loop products): Django paints the chosen title with
   --secondary + --header-link-color, which are both dark here. */
html body .selector-chosen-title { background: var(--ll-olive); color: var(--ll-cream); }
html body .selector-chosen-title label, html body .selector-chosen-title .helptext { background: none; color: var(--ll-cream); }
html body .selector-available-title { background: var(--ll-panel); color: var(--ll-ink); }
html body .selector-available-title label { background: none; color: var(--ll-ink); }
html body .selector-available, html body .selector-chosen { border-color: var(--ll-line); border-radius: var(--ll-radius-sm); overflow: hidden; }
/* Autocomplete (select2) fields looked disabled on the cream background. */
html body .select2-container--admin-autocomplete { min-width: 280px; }
html body .select2-container--admin-autocomplete .select2-selection--single,
html body .select2-container--admin-autocomplete .select2-selection--multiple { background: var(--ll-white); border-color: var(--ll-field); border-radius: var(--ll-radius-sm); min-height: 40px; }
html body .select2-container--admin-autocomplete .select2-selection--single { height: 40px; }
html body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered { line-height: 38px; padding-inline-start: 12px; }
html body .select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow { height: 38px; }
/* Raw-id user pickers were a tiny box. */
html body input.vForeignKeyRawIdAdminField { width: 120px; }
/* Wide lists: slightly tighter cells and filter column; the table scrolls sideways inside its card. */
html body #changelist table tbody td, html body #changelist table tbody th, html body #changelist table thead th { padding-inline: 12px; }
html body #changelist-filter { flex: 0 0 210px; width: 210px; }
/* Long unbroken values (tokens, URLs) must not push the page wider. */
.readonly { overflow-wrap: anywhere; }
/* Order numbers (LL-YYYYMMDD-XXXXX) and dates read badly when wrapped. */
html body #result_list th.field-order_number, html body #result_list td.field-created, html body #result_list td.field-total_display { white-space: nowrap; }
/* Let the list shrink next to the filter panel so wide tables scroll inside .results instead of
   sliding under the panel (seen in Arabic, where rows are wider). */
html body #changelist .changelist-form-container > div:not(#changelist-filter), html body #changelist-form { flex: 1 1 auto; min-width: 0; }
html body #changelist-filter { margin: 0; margin-inline-start: 20px; }
