/*
 * SokoMazao — "Kitenge Harvest" for the web (landing page, admin console, seller console).
 * Layered on top of the self-hosted Bootstrap: it re-points Bootstrap's own variables at the brand palette,
 * so every existing page picks it up, and adds the few brand pieces Bootstrap has no word for.
 * System fonts only: nothing is fetched from another server (consoles may run on poor connections).
 */

:root {
    --sm-forest: #1b4d3e;
    --sm-forest-deep: #123327;
    --sm-leaf: #2f7d4f;
    --sm-maize: #f2b33d;
    --sm-maize-soft: #ffe3a8;
    --sm-terracotta: #c4572e;
    --sm-cream: #fbf5e6;
    --sm-sand: #f1e7ce;
    --sm-line: #e0d3b3;
    --sm-ink: #2b2418;
    --sm-muted: #5d5443;

    --bs-body-bg: var(--sm-cream);
    --bs-body-color: var(--sm-ink);
    --bs-body-font-family: ui-rounded, "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
    --bs-heading-color: var(--sm-ink);
    --bs-border-color: var(--sm-line);
    --bs-border-radius: .75rem;
    --bs-border-radius-lg: 1.1rem;
    --bs-secondary-color: var(--sm-muted);
    --bs-link-color: var(--sm-forest);
    --bs-link-hover-color: var(--sm-forest-deep);

    --bs-success: var(--sm-forest);
    --bs-success-rgb: 27, 77, 62;
    --bs-warning: var(--sm-maize);
    --bs-warning-rgb: 242, 179, 61;
    --bs-danger: var(--sm-terracotta);
    --bs-danger-rgb: 196, 87, 46;
}

body { background: var(--sm-cream); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .display-5, .display-4 { font-weight: 800; letter-spacing: -.02em; }
.bg-light { background: var(--sm-cream) !important; }
.text-success { color: var(--sm-forest) !important; }
.text-muted, .text-body-secondary { color: var(--sm-muted) !important; }

/* ---- the woven pattern, as a reusable background ---- */
.sm-pattern {
    background-color: var(--sm-forest);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.10' stroke-width='1.4'%3E%3Cpath d='M20 2 38 20 20 38 2 20z'/%3E%3C/g%3E%3Cpath d='M20 13 27 20 20 27 13 20z' fill='%23f2b33d' fill-opacity='.22'/%3E%3C/svg%3E"),
        linear-gradient(135deg, var(--sm-forest), var(--sm-forest-deep));
    background-size: 40px 40px, auto;
}

/* ---- the brand mark ---- */
.sm-brand { display: inline-flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.sm-brand:hover { color: #fff; }
.sm-brand svg { width: 2.1rem; height: 2.1rem; flex: none; }
.sm-brand small { font-weight: 600; opacity: .75; letter-spacing: 0; }

/* ---- buttons ---- */
.btn { border-radius: .85rem; font-weight: 700; padding: .55rem 1.1rem; }
.btn-lg { padding: .8rem 1.5rem; border-radius: 1rem; }
.btn-success { --bs-btn-bg: var(--sm-forest); --bs-btn-border-color: var(--sm-forest); --bs-btn-hover-bg: var(--sm-forest-deep); --bs-btn-hover-border-color: var(--sm-forest-deep); --bs-btn-active-bg: var(--sm-forest-deep); --bs-btn-active-border-color: var(--sm-forest-deep); --bs-btn-disabled-bg: var(--sm-forest); --bs-btn-disabled-border-color: var(--sm-forest); }
.btn-outline-success { --bs-btn-color: var(--sm-forest); --bs-btn-border-color: var(--sm-forest); --bs-btn-hover-bg: var(--sm-forest); --bs-btn-hover-border-color: var(--sm-forest); --bs-btn-active-bg: var(--sm-forest); --bs-btn-active-border-color: var(--sm-forest); }
.btn-maize { --bs-btn-color: var(--sm-forest-deep); --bs-btn-bg: var(--sm-maize); --bs-btn-border-color: var(--sm-maize); --bs-btn-hover-color: var(--sm-forest-deep); --bs-btn-hover-bg: #f7c35e; --bs-btn-hover-border-color: #f7c35e; --bs-btn-active-color: var(--sm-forest-deep); --bs-btn-active-bg: #e9a621; --bs-btn-active-border-color: #e9a621; }
.btn-outline-light { --bs-btn-border-color: rgba(255,255,255,.55); }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 .25rem rgba(242, 179, 61, .45); border-color: var(--sm-maize); }

/* ---- forms ---- */
.form-control, .form-select { border-radius: .8rem; border: 1.5px solid var(--sm-line); background-color: #fff; padding: .65rem .9rem; }
.form-label { font-weight: 700; font-size: .9rem; }

/* ---- cards, tables, alerts, badges ---- */
.card { border: 1px solid var(--sm-line); border-radius: 1.1rem; background: #fff; box-shadow: 0 1px 0 rgba(43, 36, 24, .04), 0 8px 24px -16px rgba(43, 36, 24, .25); }
.card.shadow-sm { box-shadow: 0 1px 0 rgba(43, 36, 24, .04), 0 8px 24px -16px rgba(43, 36, 24, .25) !important; }
.card-footer { background: transparent; border-top: 1px solid var(--sm-line); font-weight: 700; }
.table { --bs-table-bg: transparent; --bs-table-striped-bg: rgba(241, 231, 206, .35); --bs-table-hover-bg: rgba(242, 179, 61, .12); }
.table > thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--sm-muted); border-bottom: 2px solid var(--sm-line); }
.badge { border-radius: 999px; font-weight: 700; letter-spacing: .01em; }
.text-bg-warning { background-color: var(--sm-maize) !important; color: var(--sm-forest-deep) !important; }
.page-link { border-radius: .6rem; margin: 0 .15rem; }

/* ---- console navigation ---- */
.sm-nav { box-shadow: 0 6px 20px -12px rgba(18, 51, 39, .8); }
.sm-nav .navbar-nav .nav-link { color: rgba(255, 255, 255, .78); font-weight: 600; border-radius: .7rem; padding: .45rem .8rem; margin: 0 .1rem; }
.sm-nav .navbar-nav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.sm-nav .navbar-nav .nav-link.active { color: var(--sm-forest-deep); background: var(--sm-maize); }
.sm-nav .navbar-nav .nav-link.disabled { color: rgba(255, 255, 255, .4); }
.sm-nav .navbar-nav .nav-link.active .badge { background: var(--sm-forest) !important; color: #fff !important; }

/* ---- dashboard tiles ---- */
.sm-tile { position: relative; overflow: hidden; }
.sm-tile .display-5 { font-size: 2rem; }

/* ---- sign-in pages ---- */
.sm-auth { min-height: calc(100vh - 7rem); display: grid; place-items: center; padding: 2rem 1rem; }
.sm-auth-card { width: 100%; max-width: 26rem; }
.sm-auth-head { border-radius: 1.4rem 1.4rem 0 0; padding: 1.6rem 1.6rem 1.4rem; color: #fff; }
.sm-auth-head h1 { color: #fff; margin: .6rem 0 .1rem; font-size: 1.6rem; }
.sm-auth-head p { margin: 0; color: var(--sm-maize); font-weight: 700; }
.sm-auth-body { border-radius: 0 0 1.4rem 1.4rem; background: #fff; border: 1px solid var(--sm-line); border-top: 0; padding: 1.6rem; box-shadow: 0 24px 40px -28px rgba(18, 51, 39, .55); }

/* ---- landing page ---- */
.sm-hero { color: #fff; padding: 1.2rem 0 5.5rem; position: relative; border-radius: 0 0 2.5rem 2.5rem; overflow: hidden; }
.sm-hero h1 { color: #fff; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.02; max-width: 15ch; }
.sm-hero h1 em { font-style: normal; color: var(--sm-maize); }
.sm-hero .lead { color: rgba(255, 255, 255, .85); max-width: 38rem; }
.sm-hero .container { position: relative; z-index: 1; }
.sm-steps { margin-top: -3rem; position: relative; z-index: 2; }
.sm-step { height: 100%; padding: 1.4rem; }
.sm-step .num { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .8rem; background: var(--sm-maize-soft); color: #8a5a00; font-weight: 800; margin-bottom: .8rem; }
.sm-step:nth-child(2) .num { background: #d3ebd8; color: var(--sm-forest); }
.sm-step:nth-child(3) .num { background: #ffdbcd; color: var(--sm-terracotta); }
.sm-chip { display: inline-block; padding: .35rem .8rem; border-radius: 999px; background: #fff; border: 1px solid var(--sm-line); font-weight: 700; font-size: .9rem; margin: .25rem .2rem; }
.sm-footer { color: var(--sm-muted); font-size: .9rem; }

@media (prefers-reduced-motion: no-preference) {
    .btn, .card, .sm-nav .nav-link { transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease; }
    .btn:hover { transform: translateY(-1px); }
}

/* ---- admin console: left sidebar ---- */
.sm-sidebar { --bs-offcanvas-width: 17rem; --bs-offcanvas-bg: var(--sm-forest); --bs-offcanvas-color: #fff; display: flex; flex-direction: column; color: #fff; border: 0; }
.sm-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.1rem .9rem; }
.sm-sidebar-head .sm-brand { font-size: 1.05rem; }
.sm-sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: .4rem .75rem; }
.sm-sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: rgba(255, 255, 255, .8); font-weight: 600; border-radius: .8rem; padding: .6rem .8rem; margin-bottom: .15rem; }
.sm-sidebar .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.sm-sidebar .nav-link.active { color: var(--sm-forest-deep); background: var(--sm-maize); }
.sm-sidebar .nav-link.active .badge { background: var(--sm-forest) !important; color: #fff !important; }
.sm-sidebar .nav-link.disabled { color: rgba(255, 255, 255, .4); cursor: default; }
.sm-sidebar .nav-link .badge { margin-left: auto !important; }
.sm-nav-icon { flex: none; opacity: .95; }
.sm-sidebar-foot { padding: .9rem 1.1rem 1.1rem; border-top: 1px solid rgba(255, 255, 255, .14); }
.sm-user { display: flex; align-items: center; gap: .7rem; margin-bottom: .8rem; min-width: 0; }
.sm-avatar { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--sm-maize); color: var(--sm-forest-deep); font-weight: 800; }
.sm-user-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sm-user-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-user-text small { color: var(--sm-maize); text-transform: capitalize; font-weight: 600; }
.sm-topbar { display: flex; align-items: center; gap: .8rem; padding: .6rem 1rem; position: sticky; top: 0; z-index: 1020; box-shadow: 0 6px 20px -12px rgba(18, 51, 39, .8); }
.sm-content { min-height: 100vh; min-width: 0; }

@media (min-width: 992px) {
    .sm-sidebar { position: fixed !important; top: 0; bottom: 0; left: 0; width: 17rem; z-index: 1030; transform: none !important; visibility: visible !important; background-color: var(--sm-forest) !important; box-shadow: 8px 0 28px -20px rgba(18, 51, 39, .9); }
    .sm-content { margin-left: 17rem; }
}

/* Gold is for fills and accents; as text on white it is too pale to read, so text uses the deep maize-brown. */
.text-warning { color: #8a5a00 !important; }

/* ======================================================================================================
   Console content and list views
   ====================================================================================================== */

/* Breathing room at the left and right edges (it grows with the screen), and a comfortable reading width. */
.sm-content > main.container-fluid {
    padding-left: clamp(1rem, 3.4vw, 3rem);
    padding-right: clamp(1rem, 3.4vw, 3rem);
    padding-top: 1.75rem !important;
    padding-bottom: 3rem !important;
    max-width: 96rem;
    margin-inline: auto;
}
.sm-content h1, .sm-content .h4 { letter-spacing: -.02em; }
.sm-content h1.h4 { font-size: 1.65rem; }
.breadcrumb { margin-bottom: 1rem; font-size: .9rem; }
.breadcrumb-item a { font-weight: 600; text-decoration: none; }

/* Filter bars above a list */
.sm-content form.row.g-2 { margin-bottom: 1.25rem !important; }
.sm-content form.row .form-control, .sm-content form.row .form-select { min-width: 13rem; }

/* The list itself: a rounded panel with roomy rows */
.card > .table-responsive { border-radius: 1.1rem; }
.card > .table-responsive > .table { min-width: 46rem; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .95rem 1.15rem; border-bottom-color: var(--sm-line); }
.table > thead > tr > th, .table-light, .table-light > th, .table-light > td { background: var(--sm-sand) !important; color: var(--sm-muted); }
.table > thead > tr > th { padding-top: .85rem; padding-bottom: .85rem; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.table > thead > tr > th:first-child, .table > tbody > tr > td:first-child { padding-left: 1.5rem; }
.table > thead > tr > th:last-child, .table > tbody > tr > td:last-child { padding-right: 1.5rem; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table > tbody > tr { transition: background-color .12s ease; }
.table > tbody > tr:hover > * { background-color: rgba(242, 179, 61, .10); }
.table td { vertical-align: middle; }
.table td.fw-semibold, .table td .fw-semibold { color: var(--sm-forest-deep); }
.table td.text-end .btn, .table td .btn-sm { white-space: nowrap; }
.table td.text-center.text-muted { padding: 3rem 1rem; font-size: 1rem; }
.card-footer { padding: .85rem 1.5rem; }

/* Soft status pills in the app's own colours (instead of Bootstrap's blue, cyan and black) */
.badge { padding: .42em .8em; font-size: .74rem; }
.badge.text-bg-secondary { background-color: #ece0c2 !important; color: #5d5443 !important; }
.badge.text-bg-info { background-color: #d3ebd8 !important; color: #14402f !important; }
.badge.text-bg-success { background-color: var(--sm-leaf) !important; color: #fff !important; }
.badge.text-bg-warning { background-color: var(--sm-maize-soft) !important; color: #6b4500 !important; }
.badge.text-bg-danger { background-color: #ffdbcd !important; color: #8f2f0f !important; }
.badge.text-bg-dark { background-color: #3a3226 !important; color: #fff !important; }
.badge.text-bg-primary { background-color: #dbe7ff !important; color: #1d4691 !important; }
.badge.text-bg-light { background-color: rgba(255, 255, 255, .14) !important; color: rgba(255, 255, 255, .7) !important; }
.sm-sidebar .badge.text-bg-warning, .sm-sidebar .nav-link.active .badge { background-color: var(--sm-maize) !important; color: var(--sm-forest-deep) !important; }
.sm-sidebar .nav-link.active .badge { background-color: var(--sm-forest-deep) !important; color: #fff !important; }

/* Pagination */
.pagination { gap: .15rem; margin-bottom: 0; }
.page-link { border: 1px solid var(--sm-line); color: var(--sm-forest); font-weight: 700; padding: .45rem .8rem; }
.page-item.active .page-link { background: var(--sm-forest); border-color: var(--sm-forest); color: #fff; }
.page-item.disabled .page-link { background: transparent; color: var(--sm-muted); }

@media (max-width: 575.98px) {
    .sm-content form.row .form-control, .sm-content form.row .form-select { min-width: 0; width: 100%; }
    .table > :not(caption) > * > * { padding: .8rem .9rem; }
}

/* Lists are square-cornered: the panel, its table and its footer. */
.card:has(> .table-responsive), .card:has(> .table-responsive) > .table-responsive, .card:has(> .table-responsive) > .card-footer,
.card:has(> .table), .card:has(> .table) > .table { border-radius: 0 !important; }

/* Dashboard cards: smaller type so a long figure such as "TZS 19,337,750" fits on one line. */
.sm-tile .card-body { padding: 1.1rem 1.25rem; }
.sm-tile h2.h6 { font-size: .72rem; letter-spacing: .07em; margin-bottom: .7rem !important; }
.sm-tile .display-5 { font-size: clamp(1.35rem, 1.1rem + .7vw, 1.8rem); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm-tile .card-body p.text-muted { font-size: .82rem; line-height: 1.35; }
.sm-tile .card-footer { font-size: .78rem; padding: .6rem 1.25rem; }

/* Any panel that holds a list (table, timeline, history) is square-cornered, wherever the list sits inside it. */
.card:has(.table), .card:has(.list-group), .card:has(.table) > *, .card:has(.list-group) > *,
.card .table-responsive, .card .list-group, .card .list-group-item, .card .table { border-radius: 0 !important; }
.card:has(.table) > .card-header:first-child, .card:has(.list-group) > .card-header:first-child { border-radius: 0 !important; }

/* ---- cards in the consoles: square, no heavy outline, just a soft lift off the page ---- */
.sm-content .card { border: 0; border-radius: 0 !important; box-shadow: 0 1px 2px rgba(43, 36, 24, .07), 0 8px 20px -14px rgba(43, 36, 24, .32); }
.sm-content .card.shadow-sm { box-shadow: 0 1px 2px rgba(43, 36, 24, .07), 0 8px 20px -14px rgba(43, 36, 24, .32) !important; }
.sm-content .card-header { background: transparent; border-bottom: 1px solid rgba(224, 211, 179, .7); }
.sm-content .card-footer { border-top: 1px solid rgba(224, 211, 179, .7); }


/* ======================================================================================================
   Phones and tablets: a table becomes a stack of cards, one per row, every field labelled and visible.
   (public/js/sokomazao.js copies each column heading onto its cells as data-label.)
   ====================================================================================================== */
@media (max-width: 991.98px) {
    .card > .table-responsive, .table-responsive { overflow-x: visible; }
    .card > .table-responsive > .table, .table.sm-stack { min-width: 0 !important; width: 100%; }

    .table.sm-stack, .table.sm-stack > tbody { display: block; }
    /* The headings are now on every cell, so the header row is hidden (but still read by screen readers). */
    .table.sm-stack > thead { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

    .table.sm-stack > tbody > tr { display: block; padding: .35rem 0; border-bottom: 8px solid var(--sm-cream); background: #fff; }
    .table.sm-stack > tbody > tr:last-child { border-bottom: 0; }
    .table.sm-stack > tbody > tr:hover > * { background-color: transparent; }

    .table.sm-stack > tbody > tr > td, .table.sm-stack > tbody > tr > th {
        display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
        padding: .45rem 1.1rem !important; border: 0 !important; text-align: right; min-width: 0; white-space: normal !important;
    }
    .table.sm-stack > tbody > tr > td::before, .table.sm-stack > tbody > tr > th::before {
        content: attr(data-label); flex: 0 0 38%; max-width: 38%; text-align: left;
        font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--sm-muted);
    }
    .table.sm-stack > tbody > tr > td > *:not(:only-child) { text-align: right; }

    /* The first field (usually the number or name) leads the card. */
    .table.sm-stack > tbody > tr > td:first-child { font-size: 1.02rem; padding-top: .7rem !important; }

    /* Cells with no heading (the buttons at the end of a row) sit across the bottom of the card. */
    .table.sm-stack > tbody > tr > td.sm-cell-actions { justify-content: flex-end; padding-bottom: .8rem !important; }
    .table.sm-stack > tbody > tr > td.sm-cell-actions::before { content: none; }

    /* Messages such as "No orders yet" stay a single centred block. */
    .table.sm-stack > tbody > tr.sm-row-message > td { display: block; text-align: center !important; }
    .table.sm-stack > tbody > tr.sm-row-message > td::before { content: none; }
}

/* The currency code on a dashboard card: small, in capitals, on its own line above the figure. */
.sm-cur { font-size: .7rem; font-weight: 800; letter-spacing: .12em; color: var(--sm-muted); line-height: 1; margin-bottom: .2rem !important; }

/* ---- the sidebar folds down to an icon strip (desktop) ---- */
.sm-collapse-btn { align-items: center; justify-content: center; width: 2rem; height: 2rem; padding: 0; border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .08); color: #fff; border-radius: .6rem; flex: none; }
.sm-collapse-btn:hover { background: rgba(255, 255, 255, .18); }
.sm-collapse-btn svg { transition: transform .2s ease; }
.sm-signout { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }

@media (min-width: 992px) {
    .sm-sidebar, .sm-content { transition: width .2s ease, margin-left .2s ease; }

    html.sm-collapsed .sm-sidebar { width: 4.75rem; }
    html.sm-collapsed .sm-content { margin-left: 4.75rem; }
    html.sm-collapsed .sm-collapse-btn svg { transform: rotate(180deg); }

    html.sm-collapsed .sm-sidebar-head { flex-direction: column; gap: .7rem; padding: 1rem .5rem .8rem; }
    html.sm-collapsed .sm-sidebar-head .sm-brand span { display: none; }
    html.sm-collapsed .sm-sidebar-nav { padding: .4rem .6rem; overflow-x: hidden; }
    html.sm-collapsed .sm-sidebar .nav-link { position: relative; justify-content: center; padding: .7rem .5rem; }
    html.sm-collapsed .sm-sidebar .sm-nav-label { display: none; }
    html.sm-collapsed .sm-sidebar .nav-link .badge { position: absolute; top: .2rem; right: .2rem; margin: 0 !important; padding: .25em .45em; font-size: .6rem; }
    html.sm-collapsed .sm-sidebar .nav-link.disabled .badge { display: none; }
    html.sm-collapsed .sm-sidebar-foot { padding: .8rem .5rem 1rem; }
    html.sm-collapsed .sm-sidebar .sm-user { justify-content: center; margin-bottom: .6rem; }
    html.sm-collapsed .sm-sidebar .sm-user-text { display: none; }
    html.sm-collapsed .sm-sidebar .sm-signout { padding-left: 0; padding-right: 0; }
}

/* Tables inside a column of a detail page (goods, payments) always fit their panel: no sideways scrolling.
   Their cells tighten and wrap instead. */
.row [class*="col-"] .card > .table-responsive { overflow-x: visible; }
.row [class*="col-"] .card > .table-responsive > .table { min-width: 0 !important; width: 100%; table-layout: auto; }
.row [class*="col-"] .card .table > :not(caption) > * > * { padding: .75rem .7rem; white-space: normal; overflow-wrap: anywhere; }
.row [class*="col-"] .card .table > thead > tr > th { white-space: normal; letter-spacing: .04em; }
.row [class*="col-"] .card .table > thead > tr > th:first-child, .row [class*="col-"] .card .table > tbody > tr > td:first-child { padding-left: 1rem; }
.row [class*="col-"] .card .table > thead > tr > th:last-child, .row [class*="col-"] .card .table > tbody > tr > td:last-child { padding-right: 1rem; }

/* ======================================================================================================
   Plain business look: flat colour, small corners, thin neutral borders, no gradients, glows or ornaments.
   ====================================================================================================== */
:root { --sm-radius: 4px; --bs-border-radius: 4px; --bs-border-radius-lg: 6px; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .display-5, .display-4 { font-weight: 700; letter-spacing: 0; }
.sm-content h1.h4 { font-size: 1.5rem; letter-spacing: 0; }
body { -webkit-font-smoothing: auto; }

/* flat brand surfaces (the woven pattern and gradients are gone) */
.sm-pattern, .sm-sidebar.sm-pattern, .sm-topbar.sm-pattern, .sm-auth-head.sm-pattern, .sm-hero.sm-pattern {
    background-image: none !important; background-color: var(--sm-forest) !important;
}
.sm-sidebar, .sm-topbar { box-shadow: none !important; }
@media (min-width: 992px) { .sm-sidebar { background-color: var(--sm-forest) !important; border-right: 0; } }
.sm-sidebar-head { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.sm-sidebar-foot { background: transparent; border-top: 1px solid rgba(255, 255, 255, .14); }

/* navigation: the current page is a lighter block, not a gold gradient pill */
.sm-sidebar .nav-link { border-radius: var(--sm-radius); font-weight: 500; }
.sm-sidebar .nav-link.active { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: none; font-weight: 700; }
.sm-sidebar .nav-link:hover:not(.active):not(.disabled) { background: rgba(255, 255, 255, .09); }
.sm-sidebar .nav-link.active .badge { background-color: var(--sm-maize) !important; color: var(--sm-forest-deep) !important; }
.sm-avatar { background: rgba(255, 255, 255, .18); color: #fff; border-radius: var(--sm-radius); }
.sm-collapse-btn { border-radius: var(--sm-radius); }

/* buttons and fields */
.btn, .btn-lg { border-radius: var(--sm-radius); font-weight: 600; }
.btn:hover { transform: none; }
.btn-maize { --bs-btn-bg: var(--sm-forest); --bs-btn-border-color: var(--sm-forest); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--sm-forest-deep); --bs-btn-hover-border-color: var(--sm-forest-deep); --bs-btn-hover-color: #fff; }
.form-control, .form-select { border-radius: var(--sm-radius); border: 1px solid #cdbf9f; }
.form-label { font-weight: 600; }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 .2rem rgba(27, 77, 62, .25); border-color: var(--sm-forest); }

/* cards and lists: a thin neutral outline, no shadow, square corners */
.card, .sm-content .card, .sm-content .card.shadow-sm, .card.shadow-sm { border: 1px solid var(--sm-line) !important; border-radius: 0 !important; box-shadow: none !important; }
.sm-content .card-header, .sm-content .card-footer { border-color: var(--sm-line); background: var(--sm-sand); }
.sm-tile .card-body { padding: 1rem 1.25rem; }
.table > thead > tr > th, .table-light, .table-light > th, .table-light > td { background: var(--sm-sand) !important; }
.table > tbody > tr:hover > * { background-color: rgba(27, 77, 62, .05); }

/* messages: a plain box, no coloured stripe down one edge */
.alert { border: 1px solid transparent; border-radius: var(--sm-radius); border-left-width: 1px; padding: .75rem 1rem; }
.alert-success { background: #e4f1e8; border-color: #b9d9c2; color: #17402b; }
.alert-danger { background: #fbe7e1; border-color: #efc0b3; color: #7a2410; }
.alert-warning { background: #fdf0d0; border-color: #ecd391; color: #5c3d00; }
.alert-info { background: #e3edf8; border-color: #bcd1ea; color: #1d3f6b; }

/* status labels: small rectangles */
.badge { border-radius: 3px; font-weight: 600; letter-spacing: 0; padding: .35em .6em; }
.page-link { border-radius: var(--sm-radius); }
.sm-chip { border-radius: var(--sm-radius); }

/* dashboard figures: no ornaments, the tone shows in the number */
.sm-tile { border-top: 1px solid var(--sm-line); }
.sm-tile .display-5 { font-weight: 700; }

/* sign-in */
.sm-auth-head { border-radius: 6px 6px 0 0; }
.sm-auth-body { border-radius: 0 0 6px 6px; box-shadow: none; border-color: var(--sm-line); }
.sm-auth-head h1 { font-size: 1.5rem; }
.sm-auth-head p { color: rgba(255, 255, 255, .8); font-weight: 500; }

/* landing */
.sm-hero { border-radius: 0; padding-bottom: 5rem; }
.sm-hero h1 em { color: #fff; }
.sm-step .num, .sm-step:nth-child(2) .num, .sm-step:nth-child(3) .num { background: var(--sm-sand); color: var(--sm-forest); border-radius: var(--sm-radius); }
.card.sm-step { box-shadow: none; }

@media (prefers-reduced-motion: no-preference) { .btn, .card, .sm-nav .nav-link { transition: none; } }
.sm-tile .card-footer { background: transparent; border-top: 1px solid var(--sm-line); }

/* ======================================================================================================
   Public home page
   ====================================================================================================== */
.sm-hero { background: var(--sm-forest); color: #fff; padding: .6rem 0 2.5rem; border-radius: 0; }
.sm-hero h1 { color: #fff; font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; max-width: 22ch; font-weight: 700; }
.sm-hero .lead { color: rgba(255, 255, 255, .9); max-width: 40rem; font-size: 1.1rem; }
.sm-toplink { color: rgba(255, 255, 255, .85); text-decoration: none; font-weight: 500; }
.sm-toplink:hover { color: #fff; text-decoration: underline; }

.sm-search { background: #fff; padding: .85rem; border-radius: 6px; max-width: 58rem; }
.sm-search .form-control-lg, .sm-search .form-select-lg, .sm-search .btn-lg { font-size: 1rem; padding-top: .7rem; padding-bottom: .7rem; }
.sm-facts { color: rgba(255, 255, 255, .85); font-size: .95rem; }
.sm-facts strong { color: #fff; font-size: 1.15rem; }

.sm-section { padding: 3.25rem 0; }
.sm-section-tinted { background: var(--sm-sand); border-top: 1px solid var(--sm-line); border-bottom: 1px solid var(--sm-line); }

.sm-filter { display: inline-block; padding: .4rem .85rem; border: 1px solid #cdbf9f; border-radius: 4px; background: #fff; color: var(--sm-ink); text-decoration: none; font-weight: 500; font-size: .92rem; }
.sm-filter:hover { border-color: var(--sm-forest); color: var(--sm-forest); }
.sm-filter.is-on { background: var(--sm-forest); border-color: var(--sm-forest); color: #fff; font-weight: 600; }

.sm-item { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--sm-line); padding: 1.1rem; }
.sm-item:hover { border-color: var(--sm-forest); }
.sm-item-cat { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--sm-muted); }
.sm-empty { background: #fff; border: 1px solid var(--sm-line); padding: 2.5rem 1rem; text-align: center; }

.sm-role-tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid #cdbf9f; margin-bottom: 1.75rem; }
.sm-role-tab { background: transparent; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; padding: .7rem 1.1rem; font-weight: 500; color: var(--sm-muted); }
.sm-role-tab:hover { color: var(--sm-forest); }
.sm-role-tab.is-on { color: var(--sm-forest); border-bottom-color: var(--sm-forest); font-weight: 700; }
.sm-role-panel[hidden] { display: none; }

.sm-flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-bottom: 1.75rem; border: 1px solid var(--sm-line); background: #fff; }
.sm-flow > li { padding: 1.15rem 1.1rem; border-right: 1px solid var(--sm-line); }
.sm-flow > li:last-child { border-right: 0; }
.sm-flow-num { display: inline-flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; margin-bottom: .7rem; background: var(--sm-forest); color: #fff; font-weight: 700; font-size: .85rem; border-radius: 3px; }
@media (max-width: 991.98px) {
    .sm-flow { grid-template-columns: 1fr; }
    .sm-flow > li { border-right: 0; border-bottom: 1px solid var(--sm-line); display: grid; grid-template-columns: 2.4rem 1fr; column-gap: .75rem; }
    .sm-flow > li:last-child { border-bottom: 0; }
    .sm-flow-num { grid-row: span 2; margin-bottom: 0; }
}

.sm-footer-bar { background: var(--sm-forest-deep); color: rgba(255, 255, 255, .8); padding: 1.1rem 0; font-size: .9rem; }
.sm-footer-bar a { color: #fff; }
.sm-app-download { display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; font-weight: 600; }
.sm-app-download:hover { text-decoration: underline; }
.sm-footer-plain { color: var(--sm-muted); font-size: .85rem; padding: 1rem 0 1.5rem; }
.sm-footer-plain a { color: var(--sm-forest-deep, #1b5e20); }

/* Item photos on the home page: a fixed 4:3 frame, the photo cropped to fill it */
.sm-item { padding: 0; }
.sm-item > :not(.sm-item-photo) { margin-left: 1.1rem; margin-right: 1.1rem; }
.sm-item > .sm-item-cat { margin-top: 1rem; }
.sm-item > a.btn { margin-bottom: 1.1rem; }
.sm-item-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; background: var(--sm-sand); border-bottom: 1px solid var(--sm-line); }

/* Item cards: the main button, then call and WhatsApp, then a quiet sign-in line */
.sm-item > a.btn { margin-bottom: .7rem; }
.sm-item-contact { display: flex; gap: .5rem; margin-bottom: .6rem !important; }
.sm-item-contact a { flex: 1 1 0; text-align: center; padding: .4rem .5rem; border: 1px solid #cdbf9f; border-radius: 4px; color: var(--sm-forest); font-weight: 600; font-size: .88rem; text-decoration: none; background: #fff; }
.sm-item-contact a:hover { border-color: var(--sm-forest); background: var(--sm-sand); }
.sm-item-signin { font-size: .82rem; color: var(--sm-muted); padding-bottom: 1.1rem; }
.sm-request-photo { display: block; width: 100%; height: 100%; min-height: 9rem; object-fit: cover; }
.sm-item-signin a { color: var(--sm-forest); font-weight: 600; }
@media (max-width: 575.98px) { .sm-request-photo { max-height: 11rem; } }
:root { --bs-link-color-rgb: 27, 77, 62; --bs-link-hover-color-rgb: 18, 51, 39; }

/* ---- Home page hero: a photo under a flat deep-green tint, with the menu on it ---- */
.sm-hero { position: relative; background-color: var(--sm-forest); background-size: cover; background-position: center; background-repeat: no-repeat; padding-top: 0; }
.sm-hero::before { content: ""; position: absolute; inset: 0; background: rgba(14, 40, 31, .80); }
.sm-hero > * { position: relative; }
.sm-sitebar { border-bottom: 1px solid rgba(255, 255, 255, .28); margin-bottom: 2.25rem; }
.sm-sitebar .sm-brand { color: #fff; }
.sm-sitebar .sm-toplink { color: rgba(255, 255, 255, .92); font-weight: 600; }
.sm-sitebar .btn-outline-light { --bs-btn-border-color: rgba(255, 255, 255, .7); --bs-btn-hover-color: var(--sm-forest-deep); --bs-btn-hover-bg: #fff; }
@media (min-width: 992px) { .sm-hero { padding-bottom: 3.25rem; } }
.sm-hero::before { background: rgba(14, 40, 31, .84); }
@media (min-width: 992px) {
    /* On wide screens the text sits on the left, so the tint is strongest there and the photo shows through on the right. */
    .sm-hero::before { background: linear-gradient(90deg, rgba(14, 40, 31, .92) 0%, rgba(14, 40, 31, .84) 42%, rgba(14, 40, 31, .38) 100%); }
}

/* ---- Home page, light version (?hero=light): white menu, light top section, produce photos beside the search ---- */
.sm-hero-light { background: #fff; color: var(--sm-ink); padding-bottom: 3rem; }
.sm-hero-light::before { display: none; }
.sm-hero-light .sm-sitebar { background: #fff; border-bottom: 3px solid var(--sm-forest-deep); margin-bottom: 2.5rem; }
.sm-hero-light .sm-sitebar .sm-brand { color: var(--sm-forest); }
.sm-hero-light .sm-sitebar .sm-toplink { color: var(--sm-ink); }
.sm-hero-light .sm-sitebar .sm-toplink:hover { color: var(--sm-forest); }
.sm-hero-light .sm-sitebar .btn-outline-light { --bs-btn-color: var(--sm-forest); --bs-btn-border-color: var(--sm-forest); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--sm-forest); --bs-btn-hover-border-color: var(--sm-forest); }
.sm-hero-light h1 { color: var(--sm-forest-deep); }
.sm-hero-light .lead { color: var(--sm-ink); }
.sm-hero-light .opacity-75 { color: var(--sm-muted); opacity: 1 !important; }
.sm-hero-light .sm-search { background: var(--sm-sand); border: 1px solid var(--sm-line); }
.sm-hero-light .sm-facts { color: var(--sm-muted); }
.sm-hero-light .sm-facts strong { color: var(--sm-forest-deep); }

.sm-hero-photos { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: .6rem; aspect-ratio: 5 / 4; }
.sm-hero-photo { display: block; width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--sm-line); }
.sm-hero-photo-tall { grid-row: span 2; }

/* ---- Home page, plain green version (?hero=green): one green, a pale line under the menu, bolder links ---- */
.sm-hero-green::before { display: none; }
.sm-hero-green .sm-sitebar { border-bottom: 1px solid rgba(255, 255, 255, .4); margin-bottom: 3rem; }
.sm-hero-green .sm-sitebar .sm-toplink { font-weight: 700; font-size: 1rem; }
.sm-hero-green .sm-sitebar .sm-brand { font-size: 1.35rem; }
.sm-hero-green { padding-bottom: 3.25rem; }

/* ---- Settings: small drawings of the home page top designs, to pick from ---- */
.sm-hero-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; }
.sm-choice { display: block; margin: 0; cursor: pointer; }
.sm-choice input { position: absolute; opacity: 0; pointer-events: none; }
.sm-choice-card { display: block; border: 2px solid var(--sm-line); padding: .5rem; background: #fff; }
.sm-choice:hover .sm-choice-card { border-color: #9fb8ab; }
.sm-choice input:checked + .sm-choice-card { border-color: var(--sm-forest); box-shadow: 0 0 0 1px var(--sm-forest); }
.sm-choice input:focus-visible + .sm-choice-card { outline: 3px solid rgba(27, 77, 62, .35); outline-offset: 2px; }
.sm-choice-name { display: block; margin-top: .55rem; font-weight: 600; font-size: .92rem; }
.sm-choice input:checked + .sm-choice-card .sm-choice-name::before { content: "Selected: "; color: var(--sm-forest); }
.sm-choice-wrap > a { display: inline-block; margin-top: .35rem; }

.sm-mini { display: block; position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--sm-forest); border: 1px solid var(--sm-line); }
.sm-mini-bar { display: flex; align-items: center; justify-content: space-between; height: 15%; padding: 0 6%; border-bottom: 1px solid rgba(255, 255, 255, .4); }
.sm-mini-bar i { width: 7%; aspect-ratio: 1; background: var(--sm-maize); }
.sm-mini-bar b { width: 16%; height: 56%; border: 1px solid rgba(255, 255, 255, .8); }
.sm-mini-body { display: flex; align-items: center; gap: 6%; height: 85%; padding: 0 6%; }
.sm-mini-text { flex: 1; display: flex; flex-direction: column; gap: 7%; }
.sm-mini-text em { display: block; height: 9px; background: #fff; width: 88%; }
.sm-mini-text em + em { width: 62%; }
.sm-mini-text u { display: block; height: 16px; background: #fff; margin-top: 6px; border-radius: 2px; }

.sm-mini-photo { background: linear-gradient(90deg, rgba(14, 40, 31, .9), rgba(14, 40, 31, .5)), var(--photo) center / cover no-repeat; }
.sm-mini-light { background: #fff; }
.sm-mini-light .sm-mini-bar { border-bottom: 2px solid var(--sm-forest-deep); }
.sm-mini-light .sm-mini-bar i { background: var(--sm-maize); }
.sm-mini-light .sm-mini-bar b { border-color: var(--sm-forest); }
.sm-mini-light .sm-mini-text em { background: var(--sm-forest-deep); }
.sm-mini-light .sm-mini-text u { background: var(--sm-sand); border: 1px solid var(--sm-line); }
.sm-mini-photos { width: 44%; align-self: stretch; margin: 8% 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; }
.sm-mini-photos span { background-size: cover; background-position: center; }
.sm-mini-photos span:first-child { grid-row: span 2; }

/* ---- Top navigation bar for the consoles with only a few sections (seller, buyer, transporter, warehouse) ---- */
.sm-topnav { background: var(--sm-forest); position: sticky; top: 0; z-index: 1030; border-bottom: 3px solid var(--sm-forest-deep); }
.sm-topnav .navbar { padding: 0; }
.sm-topnav-inner { max-width: 96rem; margin-inline: auto; padding-left: clamp(1rem, 3.4vw, 3rem); padding-right: clamp(1rem, 3.4vw, 3rem); gap: 1rem; }
.sm-topnav .sm-brand { padding: .8rem 0; font-size: 1.1rem; }
.sm-topnav-links { align-items: stretch; margin-left: 1.5rem; }
.sm-topnav .nav-link { display: flex; align-items: center; gap: .5rem; color: rgba(255, 255, 255, .82); font-weight: 600; padding: 1.05rem 1.1rem; border-bottom: 3px solid transparent; margin-bottom: -3px; border-radius: 0; }
.sm-topnav .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.sm-topnav .nav-link.active { color: #fff; border-bottom-color: #fff; background: rgba(255, 255, 255, .1); }
.sm-topnav .nav-link.disabled { color: rgba(255, 255, 255, .4); }
.sm-topnav .nav-link .badge { margin-left: .25rem; }
.sm-topnav-user { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; color: #fff; }
.sm-topnav-user .sm-user-text { min-width: 0; }
.sm-topnav-user .sm-signout { display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap; }
.sm-topnav .navbar-toggler { border-color: rgba(255, 255, 255, .5); margin: .6rem 0; }
.sm-main-top { max-width: 96rem; margin-inline: auto; padding-left: clamp(1rem, 3.4vw, 3rem); padding-right: clamp(1rem, 3.4vw, 3rem); padding-top: 1.75rem !important; padding-bottom: 3rem !important; }
@media (max-width: 991.98px) {
    .sm-topnav-links { margin-left: 0; border-top: 1px solid rgba(255, 255, 255, .2); }
    .sm-topnav .nav-link { padding: .8rem .25rem; border-bottom: 0; margin-bottom: 0; }
    .sm-topnav .nav-link.active { background: rgba(255, 255, 255, .12); }
    .sm-topnav-user { border-top: 1px solid rgba(255, 255, 255, .2); padding: .8rem 0 1rem; }
    .sm-topnav-user form { margin-left: auto; }
}

/* ---- Seller console: listing thumbnails and photo grids ---- */
.sm-thumb { display: block; width: 4rem; height: 3rem; object-fit: cover; border: 1px solid var(--sm-line); background: var(--sm-sand); }
.sm-thumb-empty { background: var(--sm-sand); }
.sm-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .5rem; }
.sm-photo-grid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--sm-line); }
@media (max-width: 991.98px) { .table.sm-stack > tbody > tr > td > .sm-thumb { margin-left: auto; } }

/* ---- Conversation thread (inquiries): the other person's messages on the left, yours on the right ---- */
.sm-thread { display: flex; flex-direction: column; gap: .75rem; max-height: 32rem; overflow-y: auto; }
.sm-bubble-row { display: flex; }
.sm-bubble-row.is-mine { justify-content: flex-end; }
.sm-bubble { max-width: 85%; padding: .6rem .85rem; background: var(--sm-sand); border: 1px solid var(--sm-line); }
.sm-bubble-row.is-mine .sm-bubble { background: #e4f1e8; border-color: #b9d9c2; }
.sm-bubble-meta { font-size: .75rem; color: var(--sm-muted); }

/* ---- The name in the top bar opens the profile ---- */
.sm-topnav-profile { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; padding: .25rem .5rem; margin: 0 -.5rem; }
.sm-topnav-profile:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---- Notifications list ---- */
.sm-notice { padding: 0; }
.sm-notice form { margin: 0; }
.sm-notice-body { display: block; width: 100%; text-align: left; background: transparent; border: 0; padding: .9rem 1.25rem; color: inherit; }
.sm-notice-body:hover { background: rgba(27, 77, 62, .05); }
.sm-notice-title { display: block; font-weight: 600; }
.sm-notice-text { display: block; color: var(--sm-ink); }
.sm-notice-meta { display: block; font-size: .78rem; color: var(--sm-muted); margin-top: .15rem; }
.sm-notice.is-unread { background: #f1f7f3; }
.sm-notice.is-unread .sm-notice-title::before { content: ""; display: inline-block; width: .5rem; height: .5rem; background: var(--sm-forest); margin-right: .5rem; vertical-align: .1rem; }

/* Between a tablet and a wide desktop the bar is compact so it fits: text-only links, the avatar without the name, and Sign out as an icon. */
@media (min-width: 992px) and (max-width: 1279.98px) {
    .sm-topnav .sm-nav-icon { display: none; }
    .sm-topnav .nav-link { padding: 1.05rem .7rem; }
    .sm-topnav-links { margin-left: .5rem; }
    .sm-topnav-user .sm-user-text { display: none; }
    .sm-topnav-user .sm-signout .sm-nav-label { display: none; }
}
