/* The 7khalas logo (mark + wordmark) exactly as on the sign-in page, for the dark bars of the app:
   farm sidebar, mobile top bar and the Super Admin top bar. */
.bx-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; line-height: 1; }
.bx-brand:hover { text-decoration: none; }
.bx-brand img { width: 36px; height: 36px; display: block; flex-shrink: 0; border-radius: 9px; }
.bx-brand .bx-wordmark { white-space: nowrap; font-size: 1.45rem; line-height: 1; font-weight: 800; letter-spacing: -.02em; color: #fff; display: inline-flex; align-items: baseline; font-family: "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.bx-brand .bx-agrix { color: #8be09a; }
.bx-brand .bx-i { position: relative; display: inline-block; }
.bx-brand .bx-i::after { content: ""; position: absolute; width: .3em; height: .2em; top: -.12em; left: .06em; background: #8be09a; border-radius: 0 100% 0 100%; transform: rotate(-12deg); }

.sidebar-brand.bx-brand { display: flex; justify-content: center; }
.sidebar-icon-only .sidebar-brand.bx-brand .bx-wordmark { display: none; }

.agricore-mobile-brand.bx-brand img { width: 32px; height: 32px; border-radius: 8px; }
.agricore-mobile-brand.bx-brand .bx-wordmark { font-size: 1.3rem; }

/* Super Admin top bar (horizontal theme): the template sizes brand images to its own logo, so pin ours. */
.navbar .navbar-brand.bx-brand { display: inline-flex; align-items: center; gap: .55rem; margin-right: 0; width: auto; }
.navbar .navbar-brand.bx-brand img { width: 36px; height: 36px; max-width: none; max-height: none; }
.navbar .navbar-brand.bx-brand.brand-logo-mini img { width: 34px; height: 34px; }
.navbar .navbar-brand.bx-brand.brand-logo { margin-right: 2rem; }
.navbar .navbar-brand-wrapper:has(.bx-brand) { width: auto; }

/* ---------------------------------------------------------------- Trial ribbon
   A gold ribbon with notched ends on the dark green bars. The shape (and no hover/press state) is what sets it
   apart from the app's rounded action buttons: it is a status marker, not something to press. Colours are the
   app's own: the gold of the Farm tiles and the deep green of the sidebar. */
.agx-ribbon {
  --agx-gold: #f4b942; --agx-gold-deep: #d99a1f; --agx-ink: #14391f;
  position: relative; display: block; margin: .15rem 0 .9rem; padding: .5rem 1.7rem .5rem 1.1rem;
  background: linear-gradient(180deg, #f8c85a 0%, var(--agx-gold) 55%, var(--agx-gold-deep) 100%);
  color: var(--agx-ink); text-align: left; line-height: 1.15; cursor: default; user-select: none;
  clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 50%, 100% 100%, 0 100%);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .22);
}
.agx-ribbon::before { /* the folded tail on the left edge */
  content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 0; border-style: solid; border-width: 0 0 7px 9px;
  border-color: transparent transparent rgba(0, 0, 0, .28) transparent;
}
.agx-ribbon-title { display: flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.agx-ribbon-title i { font-size: 1rem; }
.agx-ribbon-sub { display: block; margin-top: .2rem; font-size: .72rem; font-weight: 600; letter-spacing: .01em; opacity: .9; }
.agx-ribbon-link { display: inline-block; margin-top: .25rem; font-size: .72rem; font-weight: 700; color: var(--agx-ink); text-decoration: underline; text-underline-offset: 2px; }
.agx-ribbon-link:hover { color: #000; }
.agx-ribbon.is-ending .agx-ribbon-title i { animation: agx-tick 1.2s ease-in-out infinite; }
@keyframes agx-tick { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(14deg); } }
.sidebar-icon-only .agx-ribbon { padding: .45rem .3rem; text-align: center; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%); margin-bottom: .6rem; }
.sidebar-icon-only .agx-ribbon-title { justify-content: center; }
.sidebar-icon-only .agx-ribbon-title span, .sidebar-icon-only .agx-ribbon-sub, .sidebar-icon-only .agx-ribbon-link { display: none; }

/* Phones: a small ribbon tag beside the logo in the top bar. */
.agx-ribbon-tag {
  display: inline-flex; align-items: center; gap: .25rem; margin-left: .55rem; padding: .22rem 1rem .22rem .6rem;
  background: linear-gradient(180deg, #f8c85a, #e5a823); color: #14391f; font-size: .66rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8px) 50%, 100% 100%, 0 100%); white-space: nowrap; text-decoration: none; cursor: default;
}
.agx-ribbon-tag:hover { color: #14391f; text-decoration: none; }
.agx-ribbon-tag small { font-size: .64rem; font-weight: 700; letter-spacing: 0; text-transform: none; }

/* ---------------------------------------------------------------- Notification settings (profile page) */
.notif-settings .notif-head, .notif-settings .notif-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px 84px; gap: .75rem; align-items: center; }
.notif-settings .notif-head { padding: 0 0 .4rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8f9cb3; text-align: center; }
.notif-settings .notif-head span:first-child { text-align: left; }
.notif-settings .notif-row { padding: .8rem 0; border-top: 1px solid #edf1ee; }
.notif-settings .notif-label { font-weight: 600; }
.notif-settings .notif-help { font-size: .82rem; color: #6b7a72; }
.notif-settings .notif-cell { display: flex; justify-content: center; }
.notif-settings .form-check-input { width: 2.4rem; height: 1.25rem; cursor: pointer; }
.notif-settings .form-check-input:checked { background-color: #1f6428; border-color: #1f6428; }
.notif-settings .notif-locked { font-size: .72rem; font-weight: 700; color: #1f6428; background: rgba(31, 100, 40, .1); border-radius: 999px; padding: .15rem .55rem; white-space: nowrap; }
@media (max-width: 575.98px) { .notif-settings .notif-head, .notif-settings .notif-row { grid-template-columns: minmax(0, 1fr) 60px 60px; gap: .4rem; } }

/* ---------------------------------------------------------------- Global search results */
.agricore-search-pill { position: relative; }
.agx-search-panel {
  position: fixed; z-index: 5000; max-height: min(65vh, 520px); overflow-y: auto;
  background: #fff; border: 1px solid #dce5e0; border-radius: 16px; box-shadow: 0 18px 40px -12px rgba(6, 40, 28, .35); padding: .35rem 0; text-align: left;
}
.agx-search-panel[hidden] { display: none; }
.agx-search-head { padding: .55rem 1rem .25rem; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #1f6428; }
.agx-search-head i { font-size: .95rem; vertical-align: -1px; }
.agx-search-item { display: flex; flex-direction: column; padding: .5rem 1rem; color: #0f2d46; text-decoration: none; border-left: 3px solid transparent; }
.agx-search-item.active, .agx-search-item:hover { background: #f1f7f2; border-left-color: #1f6428; text-decoration: none; color: #0f2d46; }
.agx-search-title { font-weight: 600; line-height: 1.25; }
.agx-search-sub { font-size: .8rem; color: #5b7083; line-height: 1.25; }
.agx-search-empty { padding: 1rem; color: #5b7083; font-size: .92rem; }

/* Phone header: keep the wordmark on one line next to the trial tag. */
@media (max-width: 420px) {
  .agricore-mobile-brand { min-width: 0; flex-shrink: 0; }
  .agricore-mobile-brand .bx-wordmark { font-size: 1.2rem; }
  .agricore-mobile-brand img { width: 30px; height: 30px; }
  .agx-ribbon-tag { padding-left: .4rem; padding-right: .7rem; font-size: .62rem; }
}

/* The full 7khalas logo (image, Oct 2026). The square "A" mark beside it only shows where there is no room for the
   logo: the collapsed sidebar and the small top-bar logo. */
.bx-brand img.bx-wordmark-img { width: auto; height: 50px; border-radius: 0; }
.bx-brand img.bx-mark-img { display: none; }
.sidebar-icon-only .sidebar-brand.bx-brand img.bx-mark-img { display: block; }
.sidebar-icon-only .sidebar-brand.bx-brand img.bx-wordmark-img { display: none; }
.agricore-mobile-brand.bx-brand img.bx-wordmark-img { height: 42px; }
.navbar .navbar-brand.bx-brand img.bx-wordmark-img { width: auto; height: 44px; }
.notif-settings .notif-head, .notif-settings .notif-row { grid-template-columns: minmax(0, 1fr) 72px 72px 72px; }
@media (max-width: 575.98px) { .notif-settings .notif-head, .notif-settings .notif-row { grid-template-columns: minmax(0, 1fr) 52px 52px 52px; gap: .4rem; } .notif-settings .notif-head { font-size: .62rem; } }
/* Phone notifications: this device's state and the button that asks the phone's permission */
.push-card { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding: .9rem 1rem; border-radius: 14px; background: rgba(31, 100, 40, .07); border: 1px solid rgba(31, 100, 40, .18); }
.push-card > i { font-size: 1.8rem; color: #1f6428; }
.push-card-text { flex: 1 1 260px; min-width: 0; }
.push-card-text strong { display: block; }
.push-card-text span { font-size: .85rem; color: #6b7a72; }
.push-card[data-state="blocked"] { background: rgba(220, 53, 69, .07); border-color: rgba(220, 53, 69, .25); }
.push-card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.push-offer { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; padding: .9rem 1.1rem; margin-bottom: 1rem; border-radius: 14px; background: #fff; border: 1px solid rgba(31, 100, 40, .25); box-shadow: 0 6px 20px rgba(0, 0, 0, .05); }
.push-offer > i { font-size: 1.7rem; color: #1f6428; }
.push-offer > div:nth-child(2) { flex: 1 1 240px; min-width: 0; }
.push-offer strong { display: block; }
.push-offer span { font-size: .85rem; color: #6b7a72; }
.push-offer-actions { display: flex; gap: .5rem; }
body.theme-dark .push-offer { background: #1d242d; border-color: #2f4a37; }
body.theme-dark .push-card-text span, body.theme-dark .push-offer span { color: #b1b1b5; }

/* ===== 7khalas Box theme (7khalas) =====
   A market-stall look: an oat-cream page, warm white cards, near-black hand-lettered headings, leaf green as the
   main colour, terracotta and a teal splash as accents, and hand-drawn tick boxes for lists. Dark mode is a warm
   espresso, menu included. Use the --kh-* tokens for any new page or component, not hard-coded hex values. */
:root, body {
  --kh-page: #f3eedf; --kh-surface: #fffdf7; --kh-soft: #ece5d2; --kh-raised: #f7f2e4; --kh-border: #e2d9c3;
  --kh-sidebar: #fbf7ec; --kh-sidebar-text: #231f1c; --kh-sidebar-muted: #7a7062; --kh-sidebar-hover: #efe8d6; --kh-sidebar-line: #e7dfca;
  --kh-heading: #231f1c; --kh-muted: #6b6255; --kh-primary: #3d8b2f; --kh-primary-hover: #2f7124; --kh-link: #2f7124;
  --kh-leaf: #7cc243; --kh-almond: #c8794b; --kh-almond-deep: #9a5532; --kh-oat: #f0cdb4; --kh-milk: #a88468; --kh-teal: #1e8c94; --kh-sun: #e9b949;
  --kh-success: #3d8b2f; --kh-warning: #c98a12; --kh-info: #1e8c94; --kh-danger: #c4452f; --kh-overdue: #b3341f;
  --agricore-content-bg: var(--kh-page);
  --bs-body-bg: var(--kh-page); --bs-body-color: var(--kh-heading); --bs-border-color: var(--kh-border);
  --bs-primary: #3d8b2f; --bs-primary-rgb: 61, 139, 47;
  --bs-link-color: var(--kh-link); --bs-link-color-rgb: 47, 113, 36; --bs-link-hover-color: #24581b;
  --bs-success: #3d8b2f; --bs-success-rgb: 61, 139, 47; --bs-warning: #c98a12; --bs-warning-rgb: 201, 138, 18;
  --bs-info: #1e8c94; --bs-info-rgb: 30, 140, 148; --bs-danger: #c4452f; --bs-danger-rgb: 196, 69, 47;
  --bs-secondary-color: var(--kh-muted);
}
body.theme-dark {
  --kh-page: #1a1714; --kh-surface: #24201b; --kh-soft: #2e2922; --kh-raised: #2e2922; --kh-border: #3a332a;
  --kh-sidebar: #14120f; --kh-sidebar-text: #f1ead9; --kh-sidebar-muted: #a39885; --kh-sidebar-hover: #24201b; --kh-sidebar-line: #2a251f;
  --kh-heading: #f4eedf; --kh-muted: #b3a892; --kh-primary: #8fd460; --kh-primary-hover: #a9e07f; --kh-link: #a9e07f;
  --kh-success: #8fd460; --kh-warning: #e9b949; --kh-info: #5cc3ca; --kh-danger: #f07a63; --kh-overdue: #ff9580;
  --agricore-content-bg: var(--kh-page);
  --bs-body-bg: var(--kh-page); --bs-body-color: var(--kh-heading); --bs-border-color: var(--kh-border);
  --bs-secondary-bg: var(--kh-raised); --bs-tertiary-bg: var(--kh-surface); --bs-secondary-color: var(--kh-muted);
  --bs-link-color: #a9e07f; --bs-link-color-rgb: 169, 224, 127; --bs-link-hover-color: #c4ec9f;
}

/* Page, cards and text */
body, .content-wrapper, .main-panel, .footer, .page-body-wrapper { background: var(--kh-page) !important; }
body { color: var(--kh-heading); }
.card, .modal-content, .dropdown-menu, .list-group-item, .offcanvas { background-color: var(--kh-surface); border-color: var(--kh-border); color: var(--kh-heading); }
.card { border: 1px solid var(--kh-border) !important; border-radius: 18px; }
h1, h2, h3, h4, h5, h6, .card-title, .page-title, .stat-card-value { color: var(--kh-heading); }
/* Hand-lettered headings, like a market label. Numbers and body text stay in Nunito so they read easily. */
h1, h2, h3, .page-title, .card .card-title, .modal-title, .auth-title, .kh-display {
  font-family: var(--kh-display) !important; font-weight: 400 !important; letter-spacing: .01em;
}
.card .card-title { font-size: 1.35rem; text-transform: none; }
.kh-caps { font-family: var(--kh-display); text-transform: uppercase; letter-spacing: .04em; }
.text-muted, .card-description, .stat-card-label, .form-text, small.text-muted { color: var(--kh-muted) !important; }
.table, .table > :not(caption) > * > * { color: var(--kh-heading); border-color: var(--kh-border); background-color: transparent; }
.table thead th { color: var(--kh-muted); }
hr, .border, .border-top, .border-bottom, .border-start, .border-end { border-color: var(--kh-border) !important; }
a:not(.btn):not(.nav-link):not(.dropdown-item) { color: var(--kh-link); }
body.theme-dark a.card-view-more, body.theme-dark .card a:not(.btn):not(.dropdown-item):not(.nav-link) { color: var(--kh-link); }

/* Inputs */
.form-control, .form-select, .input-group-text, .select2-container .select2-selection { background-color: var(--kh-surface); border-color: var(--kh-border); color: var(--kh-heading); }
body:not(.theme-dark) .form-control, body:not(.theme-dark) .form-select { background-color: #fffefa; }
body.theme-dark .form-control, body.theme-dark .form-select, body.theme-dark .input-group-text { background-color: var(--kh-raised); border-color: var(--kh-border); color: var(--kh-heading); }
.form-control::placeholder { color: var(--kh-muted); opacity: .8; }
.form-control:focus, .form-select:focus { border-color: var(--kh-primary); box-shadow: 0 0 0 .2rem rgba(124, 194, 67, .28); }

/* Sidebar: oat cream in light mode, espresso in dark mode */
#sidebar.sidebar, body:not(.theme-dark) #sidebar.sidebar, body.theme-dark #sidebar.sidebar { background: var(--kh-sidebar) !important; border-right: 1px solid var(--kh-sidebar-line); }
#sidebar.sidebar .nav .nav-item .collapse, #sidebar.sidebar .sub-menu { background: transparent !important; }
#sidebar.sidebar .nav .nav-item .nav-link, #sidebar.sidebar .nav .nav-item .nav-link .menu-title, #sidebar.sidebar .sub-menu .nav-link { color: var(--kh-sidebar-text) !important; }
#sidebar.sidebar .nav-category, #sidebar.sidebar .nav .nav-item.nav-category, #sidebar.sidebar .sidebar-category, #sidebar.sidebar .sidebar-category p { color: var(--kh-sidebar-muted) !important; }
#sidebar.sidebar .nav .nav-item .nav-link i.menu-arrow, #sidebar.sidebar .nav .nav-item .nav-link i.menu-arrow::before { color: var(--kh-sidebar-muted) !important; }
#sidebar.sidebar .nav .nav-item:not(.active) > .nav-link:hover { background: var(--kh-sidebar-hover) !important; border-radius: 12px; }
.sidebar .nav .nav-item.active > .nav-link { background: var(--kh-primary) !important; box-shadow: 0 8px 18px -10px rgba(61, 139, 47, .9); border-radius: 12px; }
.sidebar .nav .nav-item.active > .nav-link .menu-title, .sidebar .nav .nav-item.active > .nav-link i { color: #fff !important; }
body.theme-dark .sidebar .nav .nav-item.active > .nav-link .menu-title, body.theme-dark .sidebar .nav .nav-item.active > .nav-link i { color: #14120f !important; }
/* Menu icons take turns in the market colours (deep enough to read on cream). */
body:not(.theme-dark) #sidebar .nav > .nav-item:nth-of-type(4n+1) > .nav-link i.menu-icon { color: #3d8b2f !important; }
body:not(.theme-dark) #sidebar .nav > .nav-item:nth-of-type(4n+2) > .nav-link i.menu-icon { color: #9a5532 !important; }
body:not(.theme-dark) #sidebar .nav > .nav-item:nth-of-type(4n+3) > .nav-link i.menu-icon { color: #1e8c94 !important; }
body:not(.theme-dark) #sidebar .nav > .nav-item:nth-of-type(4n+4) > .nav-link i.menu-icon { color: #b07a10 !important; }
body.theme-dark #sidebar .nav .nav-item .nav-link i.menu-icon { color: #a9e07f !important; }
#sidebar .btn-success, #sidebar .btn-primary { background: var(--kh-surface) !important; color: var(--kh-sidebar-text) !important; border: 1px solid var(--kh-sidebar-line) !important; box-shadow: none; }
body:not(.theme-dark) #sidebar .bx-wordmark-img { content: url(/assets/images/brand/7khalas-logo-on-light.png?v=7c1); }
.agricore-mobile-tabbar { background: var(--kh-sidebar) !important; border-top: 1px solid var(--kh-sidebar-line); }
body:not(.theme-dark) .agricore-mobile-tabbar a, body:not(.theme-dark) .agricore-mobile-tabbar i, body:not(.theme-dark) .agricore-mobile-tabbar span { color: #6b6255; }
body:not(.theme-dark) .agricore-mobile-tabbar .active, body:not(.theme-dark) .agricore-mobile-tabbar .active i, body:not(.theme-dark) .agricore-mobile-tabbar .active span { color: #3d8b2f !important; }

/* Buttons: leaf-green pills */
.btn-primary, .btn-success, .btn-primary:disabled, .btn-success:disabled { background: var(--kh-primary) !important; border-color: var(--kh-primary) !important; color: #fff !important; box-shadow: 0 6px 16px -9px rgba(61, 139, 47, .9); }
.btn-primary:hover, .btn-success:hover, .btn-primary:focus, .btn-success:focus, .btn-primary:active, .btn-success:active { background: var(--kh-primary-hover) !important; border-color: var(--kh-primary-hover) !important; }
body.theme-dark .btn-primary, body.theme-dark .btn-success, body.theme-dark .btn-primary:hover, body.theme-dark .btn-success:hover { color: #14120f !important; }
.btn-outline-primary, .btn-outline-success { color: var(--kh-primary) !important; border-color: var(--kh-primary) !important; }
body.theme-dark .btn-outline-primary:hover, body.theme-dark .btn-outline-success:hover { color: #14120f !important; }
#ai-chat-trigger { background: var(--kh-almond); color: #fff; box-shadow: 0 10px 22px -8px rgba(200, 121, 75, .8); }
.agricore-icon-btn.agricore-icon-btn-primary { background: var(--kh-almond) !important; box-shadow: 0 6px 16px -6px rgba(200, 121, 75, .8); }
.content-wrapper .btn:not(.btn-link):not(.btn-close), .modal .btn:not(.btn-link):not(.btn-close) {
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  font-size: .9rem; font-weight: 700; line-height: 1.2; padding: .45rem 1.1rem; border-radius: 999px; white-space: nowrap;
}
.content-wrapper .table .btn.btn-sm, .content-wrapper .list-unstyled .btn.btn-sm { min-height: 32px; padding: .25rem .7rem; font-size: .8rem; }

/* Status colours */
.text-success { color: var(--kh-success) !important; }
.text-warning { color: var(--kh-warning) !important; }
.text-info { color: var(--kh-info) !important; }
.text-danger { color: var(--kh-overdue) !important; }
.progress-bar, .progress-bar.bg-primary, .progress-bar.bg-success { background-color: var(--kh-leaf) !important; }
.form-check-input:checked { background-color: var(--kh-primary); border-color: var(--kh-primary); }
html body .badge.badge:not(.bg-light) {
  color: #fff !important; border-radius: 999px !important; font-weight: 700; font-size: .78em; line-height: 1.25;
  padding: .35em .8em; white-space: nowrap; display: inline-flex; align-items: center; gap: .3em; border: 0;
}
html body .badge.badge.bg-success, html body .badge.badge.badge-success, html body .badge.badge.bg-primary, html body .badge.badge.badge-primary { background-color: #3d8b2f !important; }
html body .badge.badge.bg-info, html body .badge.badge.badge-info { background-color: #1e8c94 !important; }
html body .badge.badge.bg-warning, html body .badge.badge.badge-warning { background-color: #b07a10 !important; }
html body .badge.badge.bg-danger, html body .badge.badge.badge-danger { background-color: #c4452f !important; }
html body .badge.badge.bg-secondary, html body .badge.badge.badge-secondary, html body .badge.badge.bg-dark { background-color: #7a7062 !important; }
html body .badge.badge:not([class*="bg-"]):not([class*="badge-"]) { background-color: #7a7062; }

/* KPI tiles: soft tinted icon and a colour bar on top, in the market colours */
.stat-card { overflow: hidden; }
.stat-card .stat-card-icon { background: rgba(124, 194, 67, .2) !important; color: #2f7124 !important; }
.stat-card .stat-card-icon.bg-warning { background: rgba(233, 185, 73, .28) !important; color: #8a5e05 !important; }
.stat-card .stat-card-icon.bg-info { background: rgba(30, 140, 148, .16) !important; color: #16707a !important; }
.stat-card .stat-card-icon.bg-danger { background: rgba(200, 121, 75, .22) !important; color: #9a5532 !important; }
body.theme-dark .stat-card .stat-card-icon { background: rgba(143, 212, 96, .14) !important; color: #a9e07f !important; }
body.theme-dark .stat-card .stat-card-icon.bg-warning { background: rgba(233, 185, 73, .14) !important; color: #e9b949 !important; }
body.theme-dark .stat-card .stat-card-icon.bg-info { background: rgba(92, 195, 202, .14) !important; color: #5cc3ca !important; }
body.theme-dark .stat-card .stat-card-icon.bg-danger { background: rgba(240, 205, 180, .14) !important; color: #f0cdb4 !important; }
body:not(.theme-dark) .stat-card { border-top: 4px solid var(--kh-leaf) !important; }
body:not(.theme-dark) .stat-card:has(.stat-card-icon.bg-warning) { border-top-color: var(--kh-sun) !important; }
body:not(.theme-dark) .stat-card:has(.stat-card-icon.bg-info) { border-top-color: var(--kh-teal) !important; }
body:not(.theme-dark) .stat-card:has(.stat-card-icon.bg-danger) { border-top-color: var(--kh-almond) !important; }
.stat-card .stat-card-value { font-weight: 900; }

/* Header banner: leaf green into almond in light mode; espresso in dark mode */
body[class*="agricore-time-"] {
  --agricore-hero-photo: linear-gradient(105deg, #2f7124 0%, #3d8b2f 30%, #7cc243 62%, #c8794b 100%);
  --agricore-hero-photo-sm: linear-gradient(160deg, #2f7124 0%, #3d8b2f 40%, #7cc243 75%, #c8794b 100%);
  --agricore-hero-shade: 0; --agricore-hero-shade-sm: 0;
}
body.theme-dark[class*="agricore-time-"] {
  --agricore-hero-photo: linear-gradient(105deg, #14120f 0%, #24201b 55%, #2b3a22 100%);
  --agricore-hero-photo-sm: linear-gradient(160deg, #14120f 0%, #24201b 55%, #2b3a22 100%);
}
@media (max-width: 991.98px) {
  body:not(.theme-dark) .agricore-mobile-sticky-bar.agricore-scrolled { background: var(--kh-sidebar) !important; box-shadow: 0 4px 14px rgba(35, 31, 28, .12) !important; border-bottom: 1px solid var(--kh-sidebar-line); }
  body:not(.theme-dark) .agricore-mobile-sticky-bar.agricore-scrolled .bx-wordmark-img { content: url(/assets/images/brand/7khalas-logo-on-light.png?v=7c1); }
  body:not(.theme-dark) .agricore-mobile-sticky-bar.agricore-scrolled .mdi:not(.agricore-icon-btn-primary .mdi) { color: #231f1c !important; }
  body.theme-dark .agricore-mobile-sticky-bar.agricore-scrolled { background: #14120f !important; }
}

/* Hand-drawn touches: tick-box lists (like the label's claims), doodle dashes beside a title, and a paint splash. */
.kh-ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.kh-ticks li { display: flex; align-items: flex-start; gap: .6rem; font-family: var(--kh-display); font-size: 1.05rem; text-transform: uppercase; letter-spacing: .03em; }
.kh-ticks li::before {
  content: ""; flex: 0 0 22px; height: 22px; margin-top: .05rem; border: 2px solid var(--kh-heading); border-radius: 4px 6px 4px 5px;
  background: no-repeat center / 16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5l3.5 3.5L14 3' fill='none' stroke='%237cc243' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
body.theme-dark .kh-ticks li::before { border-color: var(--kh-heading); }
.kh-doodle { position: relative; display: inline-block; padding: 0 1.6rem; }
.kh-doodle::before, .kh-doodle::after {
  content: ""; position: absolute; top: 50%; width: 1.1rem; height: 1rem; transform: translateY(-50%);
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 16'%3E%3Cpath d='M2 3l12 2M1 8.5h14M2 14l12-2' stroke='%23231f1c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}
.kh-doodle::before { left: 0; } .kh-doodle::after { right: 0; transform: translateY(-50%) scaleX(-1); }
body.theme-dark .kh-doodle::before, body.theme-dark .kh-doodle::after { filter: invert(1); }
.kh-splash { position: relative; overflow: hidden; }
.kh-splash::after {
  content: ""; position: absolute; right: -18px; top: -14px; width: 110px; height: 90px; opacity: .85; pointer-events: none;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 90'%3E%3Cpath d='M30 20c12-14 40-12 52 2s22 30 8 44-34 20-52 12S4 60 10 44s8-12 20-24z' fill='%231e8c94'/%3E%3Ccircle cx='18' cy='78' r='5' fill='%231e8c94'/%3E%3Ccircle cx='98' cy='12' r='4' fill='%231e8c94'/%3E%3C/svg%3E");
}

/* SaaS billing off: no trial ribbon, subscription links or referral cards (tenant-features.js sets the class). */
.kh-no-subscription [data-agricore-access="billing"],
.kh-no-subscription a[href="/subscription"],
.kh-no-subscription a[href^="/subscription?"],
.kh-no-subscription a[href^="/subscription#"],
.kh-no-subscription [data-referral-card],
.kh-no-subscription .agx-ribbon,
.kh-no-subscription .agx-ribbon-tag,
.kh-no-subscription .kh-saas-only { display: none !important; }
