/* Tabler pilot (RECON_THEME=tabler). Loaded after style.css, only on pages whose body has the class tb-layout.
   Tabler 1.7.5 is loaded before style.css. This file gives the app Tabler's own layout and palette:
   a 16rem dark vertical sidebar, a white top header, Tabler's colours, type, cards and forms.
   The menu markup and permissions stay in base.html; only the look changes. */

/* ---------- 1. Bootstrap side effects on the app's own .row (a plain flex row) ---------- */
.row:not(.tbr){--tblr-gutter-x:0;--tblr-gutter-y:0;margin:0}
.row:not(.tbr)>*{flex-shrink:1;width:auto;max-width:100%;margin-top:0}
/* Bootstrap's row gutter padding is removed from plain items only; bars, cards and forms keep their own padding */
.row:not(.tbr)>:is(div,span,p,label,small,b,strong,h1,h2,h3,h4,ul):not(.row):not(.card):not(.hv-filterbar):not(.flash):not(.alert):not(.btn):not(.card-header){padding-left:0;padding-right:0}
.row.tbr{gap:0;align-items:stretch}
.row.tbr.align-items-center{align-items:center}

/* ---------- 2. Tabler palette and type: the app's colour tokens point at Tabler's ---------- */
html:has(body.tb-layout){font-size:16px}
body.tb-layout{
  --tb-sidebar:#1f3a5f;   /* Elevy brand navy, as on the current site: sidebar, logo area and phone header */
  --ink:var(--tblr-body-color);--muted:var(--tblr-secondary);--line:var(--tblr-border-color);
  --bg:var(--tblr-body-bg);--card:var(--tblr-bg-surface);--soft:var(--tblr-bg-surface-secondary);
  --brand:var(--tb-sidebar);--brand2:var(--tblr-primary);
  --pos:var(--tblr-green);--neg:var(--tblr-red);--warn:var(--tblr-yellow);
  font-family:var(--tblr-font-sans-serif);font-size:.875rem;line-height:1.4285714;
  color:var(--tblr-body-color);background:var(--tblr-body-bg)}

/* ---------- 3. Desktop: Tabler vertical layout ---------- */
@media (min-width:992px){
  body.tb-layout{padding-left:16rem;padding-top:3.5rem}
  body.tb-layout main{padding:1.5rem 1.5rem 3rem;max-width:1320px}
  body.tb-layout .crumbs{padding-left:0;background:transparent;border:0}
  body.tb-layout .crumbs-in{max-width:1320px;padding:1rem 1.5rem 0}

  /* white top header */
  body.tb-layout header.appbar{position:fixed;top:0;left:16rem;right:0;height:3.5rem;z-index:1030;flex-wrap:nowrap;
    background:var(--tblr-bg-surface);border-bottom:1px solid var(--tblr-border-color);padding:0 1.5rem;gap:.75rem;color:var(--tblr-body-color)}
  /* brand sits at the top of the dark sidebar */
  body.tb-layout header.appbar .brand{position:fixed;top:0;left:0;width:16rem;height:3.5rem;margin:0;padding:0 1.5rem;z-index:1032;
    display:flex;align-items:center;background:var(--tb-sidebar);border-bottom:1px solid rgba(255,255,255,.06)}
  body.tb-layout header.appbar .brand img{height:2rem}

  /* dark sidebar */
  body.tb-layout header.appbar .nav{position:fixed;top:3.5rem;left:0;bottom:0;width:16rem;z-index:1031;display:flex;flex-direction:column;
    background:var(--tb-sidebar);border:0;box-shadow:none;padding:.75rem 0;overflow-y:auto}
  body.tb-layout header.appbar .nav .top{flex-direction:row;justify-content:flex-start;align-items:center;gap:.75rem;width:100%;
    min-height:2.5rem;padding:.5rem 1.5rem;border-radius:0;background:transparent;box-shadow:none;
    font-size:.875rem;font-weight:400;line-height:1.25rem;text-align:left;white-space:nowrap;color:rgba(255,255,255,.7)}
  body.tb-layout header.appbar .nav .top .ic{width:1.25rem;height:1.25rem}
  body.tb-layout header.appbar .nav .top span{display:block;flex:1}
  body.tb-layout header.appbar .nav .dd>.top i{display:inline-block;width:.4rem;height:.4rem;margin:0 .15rem 0 0;opacity:.6;
    border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);transition:transform .15s}
  body.tb-layout header.appbar .nav .dd.open>.top i,body.tb-layout header.appbar .nav .dd.on>.top i{transform:rotate(-135deg)}
  body.tb-layout header.appbar .nav .top:hover{color:#fff;background:transparent}
  body.tb-layout header.appbar .nav .top.on,body.tb-layout header.appbar .nav .dd.on>.top{color:#fff;background:rgba(255,255,255,.06);box-shadow:none}
  body.tb-layout header.appbar .nav .dd.open>.top{color:#fff;background:transparent}

  /* sub-menus open inside the sidebar, like Tabler: the current section stays open, others open on click */
  body.tb-layout header.appbar .nav .menu{position:static;display:none;min-width:0;max-height:none;overflow:visible;
    background:transparent;border:0;border-radius:0;box-shadow:none;padding:.125rem 0 .5rem}
  body.tb-layout header.appbar .nav .dd.open>.menu,body.tb-layout header.appbar .nav .dd.on>.menu{display:block}
  /* sidebar items keep their height; when groups are open the sidebar scrolls instead of squashing them */
  body.tb-layout header.appbar .nav>*{flex-shrink:0}
  body.tb-layout header.appbar .nav{flex-wrap:nowrap;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.25) transparent}
  body.tb-layout header.appbar .nav .dd:not(.open):not(.on):hover>.menu{display:none}
  body.tb-layout header.appbar .nav .dd:hover>.menu::before{display:none}
  body.tb-layout header.appbar .nav .mi{padding:.375rem 1.5rem .375rem 3.5rem;border-radius:0;background:transparent;color:rgba(255,255,255,.6)}
  body.tb-layout header.appbar .nav .mi b{font-size:.875rem;font-weight:400;color:inherit}
  body.tb-layout header.appbar .nav .mi:hover,body.tb-layout header.appbar .nav .mi:hover b{color:#fff;background:transparent;text-decoration:none}
  body.tb-layout header.appbar .nav .mi.on{background:transparent}
  body.tb-layout header.appbar .nav .mi.on b{color:#fff;font-weight:500}

  /* top header controls on white */
  body.tb-layout header.appbar .navsearch{display:block;margin:0 auto 0 0}
  body.tb-layout header.appbar .navsearch input{width:18rem;padding:.4375rem .75rem;font-size:.875rem;border-radius:var(--tblr-border-radius);
    background:var(--tblr-bg-surface);border:1px solid var(--tblr-border-color);color:var(--tblr-body-color)}
  body.tb-layout header.appbar .navsearch input::placeholder{color:var(--tblr-secondary)}
  body.tb-layout header.appbar .iconbtn{width:2rem;height:2rem;margin:0;color:var(--tblr-secondary);background:transparent;border:1px solid var(--tblr-border-color)}
  body.tb-layout header.appbar .iconbtn:hover{background:var(--tblr-bg-surface-secondary);color:var(--tblr-body-color)}
  body.tb-layout header.appbar .switch{color:var(--tblr-body-color);background:var(--tblr-bg-surface);border:1px solid var(--tblr-border-color);
    border-radius:var(--tblr-border-radius);padding:.375rem .75rem;font-size:.875rem;font-weight:500}
  body.tb-layout header.appbar .avatar{width:2rem;height:2rem;border:0;border-radius:50%;font-size:.875rem;font-weight:600;
    background:rgba(var(--tblr-primary-rgb),.12);color:var(--tblr-primary)}
}

/* ---------- 4. Phones and tablets: the app's compact rail, in Tabler's dark colour ---------- */
@media (max-width:991.98px){
  body.tb-layout header.appbar,body.tb-layout header.appbar .nav{background:var(--tb-sidebar)}
}

/* ---------- 5. Shared elements in Tabler style ---------- */
body.tb-layout .card{background:var(--tblr-bg-surface);border:1px solid var(--tblr-border-color-translucent, var(--tblr-border-color));
  border-radius:var(--tblr-border-radius-lg);box-shadow:var(--tblr-shadow-card)}
body.tb-layout .flash{background:var(--tblr-bg-surface);color:var(--tblr-body-color);border:1px solid var(--tblr-border-color);
  border-left:3px solid var(--tblr-yellow);border-radius:var(--tblr-border-radius);box-shadow:var(--tblr-shadow-card)}
body.tb-layout .btn,body.tb-layout button{border-radius:var(--tblr-border-radius);font-weight:500}
body.tb-layout .btn{padding:.4375rem 1rem;font-size:.875rem;line-height:1.4285714}
body.tb-layout main input,body.tb-layout main select,body.tb-layout main textarea{border-color:var(--tblr-border-color);
  border-radius:var(--tblr-border-radius);font-size:.875rem;padding:.4375rem .75rem}
body.tb-layout th{background:var(--tblr-bg-surface-secondary);color:var(--tblr-secondary);font-size:.75rem;font-weight:500;
  text-transform:uppercase;letter-spacing:.04em}

/* ---------- 6. Page content ---------- */
.tb .page-header{margin:.25rem 0 1.5rem}
.tb .tb-section{font-size:1rem;font-weight:600;margin:2rem 0 1rem}
.tb .alert{margin-bottom:1rem;color:var(--tblr-body-color)}
.tb .card-link{padding:0;height:100%;margin-bottom:0;color:inherit;text-decoration:none}
.tb .card-link:hover{text-decoration:none}
.tb details.allfy>summary{font-size:.9375rem;font-weight:600;color:var(--tblr-body-color)}

/* headline KPI cards (the shared _kpi_cards partial) as Tabler stat cards */
.tb .kpi{padding:1rem 1.25rem}
.tb .kpi .l{font-size:.75rem;font-weight:500;letter-spacing:.04em;text-transform:uppercase;line-height:1rem;color:var(--tblr-secondary)}
.tb .kpi .v{font-size:1.5rem;font-weight:600;line-height:2rem;margin-top:.5rem;letter-spacing:0;color:var(--tblr-body-color)}
.tb .kpi .s{font-size:.8125rem;line-height:1.25rem;color:var(--tblr-secondary);margin-top:.25rem}
.tb .kpi .v.pos{color:var(--tblr-green)}.tb .kpi .v.neg{color:var(--tblr-red)}.tb .kpi .v.warn{color:var(--tblr-yellow)}
.tb .kgroup{font-size:.75rem;font-weight:600;letter-spacing:.04em;color:var(--tblr-secondary);margin:1.25rem 0 0}

/* each KPI group has 6 cards: 6, 3 or 2 per row so no row is left with one card */
.tb .kpi .v{white-space:nowrap}
@media (min-width:1600px){.tb:not(.tb-auto) .grid.g4{grid-template-columns:repeat(6,minmax(0,1fr))}}
@media (min-width:700px) and (max-width:1599.98px){.tb:not(.tb-auto) .grid.g4{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:699.98px){
  .tb .grid.g4{grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}
  .tb .kpi{padding:.75rem}
  .tb .kpi .l{font-size:.6875rem}
  .tb .kpi .v{font-size:1.125rem;line-height:1.5rem}
  .tb .kpi .s{font-size:.75rem;line-height:1.1rem}
}

/* ---------- 7. Tabler dashboard home ---------- */
/* Tabler cards carry their own .card-body padding: drop the app's .card padding and margin on them */
.tb .card.tbc{padding:0;margin-bottom:0}
.tb .card.tbc .card-header{padding:1rem 1.25rem;background:transparent;border-bottom:1px solid var(--tblr-border-color)}
.tb .card.tbc .card-title{font-size:1rem;font-weight:600;margin:0}
.tb .card.tbc .card-body .card-title{margin-bottom:1rem}
body.tb-layout .btn.btn-sm{padding:.25rem .625rem;font-size:.75rem}
.tb .h1{font-size:1.5rem;font-weight:600;line-height:2rem}
.tb .icon{width:1.25rem;height:1.25rem;stroke-width:1.75}
.tb .icon-sm{width:1rem;height:1rem}
.tb .avatar .icon{width:1.25rem;height:1.25rem}

/* chart boxes */
.tb .tb-chart{position:relative;height:70px}
.tb .tb-chart-edge{position:relative;height:72px;margin-top:.75rem}
.tb .tb-chart-sm{position:relative;height:200px}
.tb .tb-chart-lg{position:relative;height:290px}
.tb .tb-spark{position:relative;height:28px;width:96px;overflow:hidden}
.tb .tb-gauge{position:relative;height:170px}
.tb .tb-gauge-v{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding-top:.75rem}
.tb .tb-map svg{display:block;width:100%;height:auto;max-height:300px}

/* call-to-action card in the brand navy */
body.tb-layout .tb .card.tb-cta{background-color:var(--tb-sidebar);color:rgba(255,255,255,.78);border:0;
  background-image:radial-gradient(rgba(255,255,255,.12) 1px,transparent 1px);background-size:16px 16px;background-position:right top}
.tb .tb-cta .card-body{display:flex;flex-direction:column;justify-content:center;padding:1.75rem}
.tb .tb-cta-icon{width:3rem;height:3rem;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.12);color:#fff;margin-bottom:1rem}
.tb .tb-cta-title{font-size:1.5rem;font-weight:700;line-height:1.2;color:#fff;text-transform:uppercase;letter-spacing:.02em;margin-bottom:.5rem}
.tb .tb-cta .btn-primary{align-self:flex-start;background:#fff;color:var(--tb-sidebar);border-color:#fff}

/* months and platform tables */
.tb .card-table th{white-space:normal;vertical-align:bottom}   /* headers may wrap; figures stay on one line */
.tb .card-table td,.tb .card-table th{padding:.65rem .9rem}
.tb .card-table td:first-child,.tb .card-table th:first-child{padding-left:1.25rem}
.tb .card.tbc .card-header{display:flex;align-items:center;gap:.5rem}

/* ---------- 8. Tabler monthly dashboard ---------- */
.tb .tb-month{min-width:11rem;padding:.4375rem 2rem .4375rem .75rem;font-size:.875rem;font-weight:500}
.tb .tabs{margin:0 0 1.25rem}
.tb .tb-detail h2{font-size:1.0625rem;font-weight:600;margin:2rem 0 .75rem}
.tb .tb-detail h3{font-size:.9375rem;font-weight:600}
.tb .tb-detail .card{padding:1rem 1.25rem}
.tb .tb-detail details.card>summary{font-weight:600}

/* wide data tables (monthly dashboard detail, KPI section): sentence-case headers so the columns stay narrow */
.tb .tb-detail th,.tb details.allfy th{text-transform:none;letter-spacing:0;font-size:.8125rem;font-weight:600;
  color:var(--tblr-secondary);line-height:1.25;padding-top:.6rem;padding-bottom:.6rem}
.tb .tb-detail table.fit th,.tb .tb-detail table.fit td{padding-left:.45rem;padding-right:.45rem}

/* Key ratios card */
.tb .datagrid{--tblr-datagrid-padding:1.25rem;grid-template-columns:repeat(auto-fit,minmax(13rem,1fr))}
.tb .datagrid-content{font-size:1.125rem;font-weight:600;line-height:1.6rem}

/* detail sections with their title moved into a Tabler card header (done by the page script) */
.tb .card.tb-has-head{margin-top:1.5rem}
.tb .card.tb-has-head>.card-header{display:flex;align-items:center;gap:.5rem;margin:-1rem -1.25rem 1rem;padding:.85rem 1.25rem;
  background:transparent;border-bottom:1px solid var(--tblr-border-color)}
.tb .card.tb-has-head>.card-header .card-title{font-size:1rem;font-weight:600;margin:0 auto 0 0}
.tb .card.tb-has-head>.card-header .card-title .muted{font-size:.8125rem;font-weight:400}
.tb .grid.g2>div>.card.tb-has-head,.tb .grid.g2>.card.tb-has-head{margin-top:0}

/* column headers in the Tabler pages: small, quiet, sort arrows only on hover or on the sorted column */
.tb th,.tb .tb-detail th,.tb details.allfy th{font-size:.75rem;font-weight:600;line-height:1.2;color:var(--tblr-secondary);
  text-transform:none;letter-spacing:0;vertical-align:bottom;padding-top:.55rem;padding-bottom:.55rem}
.tb th.sortable::after{opacity:0;margin-left:2px}
.tb th.sortable:hover::after{opacity:.6}
.tb th.sortable.sort-asc::after,.tb th.sortable.sort-desc::after{opacity:.9}
.tb th small,.tb th .muted{font-size:.6875rem;font-weight:400}
/* the platform column stays on one line */
.tb .tb-detail table tr>td:first-child,.tb .tb-detail table tr>th:first-child,.tb .card-table tr>td:first-child{white-space:nowrap}

/* every column header centred, horizontally and vertically; the first column (names) stays left */
.tb table th,.tb table th.n,.tb table th.hdr-r{text-align:center;vertical-align:middle}
.tb table tr>th:first-child{text-align:left}
.tb table th small,.tb table th .muted{display:block}
.tb table th{vertical-align:middle!important}

/* ---------- 9. Pages that opt in (GST, Files & fees, ...) ---------- */
:where(.tb-auto) h1{font-size:1.375rem;font-weight:700;line-height:1.3;margin:0 0 .25rem;color:var(--tblr-body-color)}
:where(.tb-auto) h2{font-size:1.0625rem;font-weight:600;margin:1.75rem 0 .75rem}
:where(.tb-auto) h3{font-size:.9375rem;font-weight:600}
.tb-auto .card{padding:1rem 1.25rem}
.tb-auto details.card>summary{font-weight:600}
.tb-auto details>summary h2{display:inline}

/* opted-in pages: KPI rows of any size, 4 per row on desktop and 2 on smaller screens */


/* one header style on every Tabler page: sentence case, small, grey */
.tb table th{text-transform:none;letter-spacing:0;font-size:.75rem;font-weight:600;color:var(--tblr-secondary)}
.tb-auto table tr>td:first-child,.tb-auto table tr>th:first-child{white-space:nowrap}

/* file pickers and other inputs never wider than their box (phones) */
.tb input[type=file]{max-width:100%;min-width:0}

/* Tabler makes every .card a vertical flex column: cards that are also the app's .row stay side by side */
.tb .card.row:not(.tbr){flex-direction:row;flex-wrap:wrap;align-items:center}
/* KPI rows on opted-in pages: as many cards as fit (4 on GST, 5 on Sales and channels), 2 on phones */
.tb-auto .grid.g4{grid-template-columns:repeat(auto-fit,minmax(11rem,1fr))}
@media (max-width:699.98px){.tb-auto .grid.g4{grid-template-columns:repeat(2,minmax(0,1fr))}}
.tb-auto .hv-grid{grid-template-columns:repeat(auto-fit,minmax(11rem,1fr))}
@media (max-width:699.98px){.tb-auto .hv-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* buttons and fields inside the app's rows keep their own padding (Bootstrap's row gutter set it to 0) */
.tb .row:not(.tbr)>button,.tb .row:not(.tbr)>.btn,.tb .row:not(.tbr)>a.btn{padding:.4375rem 1rem;line-height:1.25;align-self:center}
.tb .row:not(.tbr)>.btn.sm,.tb .row:not(.tbr)>.btn-sm{padding:.25rem .625rem}
.tb .row:not(.tbr)>input,.tb .row:not(.tbr)>select,.tb .row:not(.tbr)>textarea{padding:.4375rem .75rem}
.tb .row:not(.tbr) label>input,.tb .row:not(.tbr) label>select{padding:.4375rem .75rem}
/* the "i" icon never shrinks into an oval */
.tb .hint-i{flex-shrink:0;flex-grow:0}
.tb .card-title .hint-i,.tb h2 .hint-i,.tb h3 .hint-i{margin-left:.4rem;vertical-align:middle}
.tb .row:not(.tbr)>.hint-i{width:20px;height:20px;min-width:20px;padding:0;align-self:center}

/* spend and orders chart, order status funnel */
.tb .tb-chart-xl{position:relative;height:320px}
.tb .tb-funnel{display:flex;flex-direction:column;align-items:center;gap:6px}
.tb .tb-funnel-row{width:100%;display:grid;grid-template-columns:6.75rem minmax(0,1fr);align-items:center;gap:.5rem}
.tb .tb-funnel-l{font-size:.8125rem;color:var(--tblr-secondary);white-space:nowrap}
.tb .tb-funnel-track{display:flex;justify-content:center}
.tb .tb-funnel-bar{display:flex;align-items:center;justify-content:center;min-height:2.1rem;padding:0 .5rem;
  color:#fff;font-size:.8125rem;border-radius:3px;white-space:nowrap}
.tb .tb-funnel-bar b{font-weight:700}
.tb .tb-f1{background:#2f62b5}.tb .tb-f2{background:#4f86c6}.tb .tb-f3{background:#4794a0}.tb .tb-f4{background:#479476}.tb .tb-f5{background:#55a04c}

/* fields, dropdowns and buttons in a filter or form row: one height, one padding */
.tb .row:not(.tbr) select,.tb .row:not(.tbr) input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]){
  height:2.375rem;padding:.4375rem .75rem;font-size:.875rem;line-height:1.25;border-radius:var(--tblr-border-radius)}
.tb .row:not(.tbr) select{padding-right:2rem}
.tb .row:not(.tbr) button:not(.hint-i):not(.chip),.tb .row:not(.tbr) .btn{min-height:2.375rem;padding:.4375rem 1rem;font-size:.875rem;line-height:1.25}
.tb .row:not(.tbr) .btn-sm,.tb .row:not(.tbr) .btn.sm{min-height:0;padding:.25rem .625rem;font-size:.75rem}

/* (generic Tabler headings use :where() so a page's own heading styles, such as the Brands banner, always win) */
/* card that is also a flex row (e.g. Targets import): header spans the full width */
.tb .card.row.tb-has-head>.card-header{flex:0 0 calc(100% + 2.5rem);width:calc(100% + 2.5rem);max-width:none;margin:-1rem -1.25rem .25rem}

/* sidebar accordion: one group open at a time; the current section closes when another opens or when clicked */
@media (min-width:992px){
  body.tb-layout header.appbar .nav .dd.on.shut:not(.open)>.menu{display:none}
  body.tb-layout header.appbar .nav .dd.on.shut:not(.open)>.top i{transform:rotate(45deg)}
}

/* a label wrapping its field: the field sits under the label text, like the rest of the site */
.tb label>input:not([type=checkbox]):not([type=radio]):not([type=hidden]),.tb label>select,.tb label>textarea{display:block;margin-top:.25rem}

/* fields never push a card wider than the screen */
.tb input:not([type=checkbox]):not([type=radio]),.tb select,.tb textarea{max-width:100%}

/* login, OTP and password reset pages: card centred, fields full width */
body.auth.tb-layout{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px 16px}
body.auth.tb-layout .login{width:100%;max-width:400px;margin:0 auto;padding:28px 26px}
body.auth.tb-layout .login label{display:block;margin:0 0 12px;font-weight:500}
body.auth.tb-layout .login input:not([type=checkbox]):not([type=hidden]){display:block;width:100%;max-width:none;margin-top:6px;box-sizing:border-box}
body.auth.tb-layout .login button{width:100%}
