:root{
  /* Koneta brand: navy, cyan and orange. */
  --brand-navy: #06134B;
  --brand-cyan: #5DCAEA;
  --brand-orange: #EB7B3B;
  --primary: var(--brand-navy);
  --primary-dark: #14255F;
  --primary-deep: #06134B;
  --primary-light: #BCEAF6;
  --primary-soft: #EAF8FC;

  --accent: var(--brand-orange);
  --teal: #5DCAEA;
  --green: #2DBE7F;
  --yellow: #EB7B3B;
  --danger: #E56B6F;

  --surface: #F5F8FC;
  --surface-2: #EDF3FA;
  --card: #FFFFFF;

  --text: #06134B;
  --muted: #56627A;

  --radius: 16px;
  --shadow: 0 12px 34px rgba(6, 19, 75, .12);
  --shadow-sm: 0 8px 22px rgba(6, 19, 75, .08);
  --ring: 0 0 0 .22rem rgba(93, 202, 234, .24);

  --border: rgba(6, 19, 75, .12);
  --border-strong: rgba(6, 19, 75, .18);

  /* Bootstrap utilities, links, pagination and form controls share the brand. */
  --bs-primary: #06134B;
  --bs-primary-rgb: 6, 19, 75;
  --bs-primary-text-emphasis: #06134B;
  --bs-primary-bg-subtle: #EAF8FC;
  --bs-primary-border-subtle: #BCEAF6;
  --bs-info: #5DCAEA;
  --bs-info-rgb: 93, 202, 234;
  --bs-info-text-emphasis: #16647B;
  --bs-warning: #EB7B3B;
  --bs-warning-rgb: 235, 123, 59;
  --bs-warning-text-emphasis: #793710;
  --bs-warning-bg-subtle: #FFF1E8;
  --bs-warning-border-subtle: #F8B994;
  --bs-link-color: #06134B;
  --bs-link-color-rgb: 6, 19, 75;
  --bs-link-hover-color: #14255F;
  --bs-link-hover-color-rgb: 20, 37, 95;
  --bs-focus-ring-color: rgba(93, 202, 234, .35);
}

html, body { background: var(--surface); color: var(--text); }
body {
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Safer default typography that feels app-like */
h1,h2,h3,h4,h5{ letter-spacing: -.02em; }

a { color: var(--primary-deep); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

.bg-surface{ background: var(--surface) !important; }

/* Brand fills stay bright; small colored text needs contrast on light cards. */
.text-info{ color:var(--bs-info-text-emphasis) !important; }
.text-warning{ color:var(--bs-warning-text-emphasis) !important; }

.container, .container-fluid { padding-left: 14px; padding-right: 14px; }
@media (min-width: 992px) { .container { max-width: 1024px; } }

.skip-link{
  position:absolute; left:-999px; top:10px;
  background: #fff; color: var(--primary-deep);
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 9999;
}
.skip-link:focus{ left: 14px; outline: none; box-shadow: var(--ring); }

.app-navbar{
  background: var(--surface) !important;
  border-bottom: 1px solid rgba(93,202,234,.4);
  box-shadow: 0 4px 18px rgba(6, 19, 75, .06);
  transition: background .5s ease, box-shadow .5s ease;
}

/* Offline state: the navbar desaturates to slate until connectivity returns. */
body.is-offline .app-navbar{
  background: #E5EAF2 !important;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.app-navbar .navbar-brand{ font-weight: 950; }
.brand-lockup{ min-width: 0; }
.brand-name{
  font-weight: 950;
  letter-spacing: -.02em;
}
.brand-mark{
  width: 34px;
  height: 34px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 22px rgba(15, 23, 42, .18);
}
.brand-mark--nav{
  width: 30px;
  height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.28);
}
.brand-mark--menu{
  width: 28px;
  height: 28px;
  border-radius: 9px;
}

.brand-logo{
  display: block;
  width: 168px;
  max-width: 100%;
  height: auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
@media (max-width: 575.98px){
  .app-navbar .brand-logo{
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
  }
}

/* Icon button: premium, compact header actions */
.icon-btn{
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.20);
  background: rgba(255,255,255,.10);
  color: #fff;
}
.icon-btn:hover{
  background: rgba(255,255,255,.16);
  color: #fff;
}
.icon-btn:focus-visible{ outline: none; box-shadow: 0 0 0 .22rem rgba(255,255,255,.22); }
.icon-btn i{ font-size: 20px; line-height: 1; }
.icon-btn.dropdown-toggle::after{ display:none; }

.avatar{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.18);
  border: 1px solid rgba(255,255,255,.24);
  color: #fff;
  font-weight: 950;
  font-size: 13px;
}
.navbar .navbar-brand{
  font-weight: 900;
  letter-spacing: -.01em;
}
.app-main{ padding-top: 16px !important; padding-bottom: 18px !important; }

/* Give mobile room for the bottom nav */
@media (max-width: 991.98px){
  .app-main{ padding-bottom: calc(92px + env(safe-area-inset-bottom)) !important; }
}

.page-title{ font-weight: 900; letter-spacing: -.02em; margin: 0; color: var(--text); }
.page-subtitle{ color: var(--muted); margin-top: 2px; }

.card, .app-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-header{
  background: transparent;
  border-bottom: 0;
  padding: 14px 14px 0 14px;
}
.card-body{ padding: 14px; }

.kpi{
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

/* KPI tiles inspired by mobile dashboards */
.kpi-tile{
  border-radius: 18px;
  padding: 14px;
  color: #fff;
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.kpi-tile::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 220px at 0% 0%, rgba(255,255,255,.16), transparent 55%);
  pointer-events: none;
}
.kpi-tile .kpi-icon{
  width: 38px; height: 38px; border-radius: 14px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
}
.kpi-tile .kpi-label{
  color: rgba(255,255,255,.82);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 10px;
}
.kpi-tile .kpi-value{
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.02em;
  line-height: 1.0;
  margin-top: 2px;
}

.kpi-tile--blue{ background: linear-gradient(135deg, var(--primary-dark), var(--primary)); }
.kpi-tile--purple{ background: linear-gradient(135deg, var(--primary-deep), var(--primary-dark)); border-top: 3px solid var(--brand-cyan); }
.kpi-tile--teal{ background: var(--brand-cyan); color: var(--brand-navy); }
.kpi-tile--orange{ background: linear-gradient(135deg, var(--brand-orange), #F8B994); color: var(--brand-navy); }
.kpi-tile--teal .kpi-label, .kpi-tile--orange .kpi-label{ color: var(--brand-navy); }

.kpi .kpi-label{
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.kpi .kpi-value{
  font-size: 28px;
  font-weight: 950;
  letter-spacing: -.02em;
  line-height: 1.0;
  margin-top: 4px;
  color: var(--text);
}
.kpi .kpi-help{ color: var(--muted); font-size: 12px; margin-top: 6px; }

.btn{
  border-radius: 12px;
  font-weight: 800;
  padding: .58rem .9rem;
}
.btn-sm{
  padding: .42rem .7rem;
  border-radius: 12px;
  font-weight: 800;
}

.btn-primary{
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: var(--primary-deep);
  --bs-btn-active-border-color: var(--primary-deep);
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
  --bs-btn-focus-shadow-rgb: 93, 202, 234;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary-dark);
  color: #fff;
}
.btn-primary:hover{
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-dark));
  border-color: var(--primary-deep);
  color: #fff;
}

.btn-outline-primary{
  --bs-btn-color: var(--primary-deep);
  --bs-btn-border-color: var(--primary-deep);
  --bs-btn-hover-bg: var(--primary-deep);
  --bs-btn-hover-border-color: var(--primary-deep);
  --bs-btn-active-bg: var(--primary-deep);
  --bs-btn-active-border-color: var(--primary-deep);
  --bs-btn-disabled-color: var(--primary-deep);
  --bs-btn-disabled-border-color: var(--primary-deep);
  border-color: rgba(93, 202, 234, .48);
  color: var(--primary-deep);
  background: rgba(234, 248, 252, .55);
}
.btn-outline-primary:hover{
  background: var(--primary-soft);
  border-color: rgba(20, 37, 95, .55);
  color: var(--primary-deep);
}

.btn-outline-light{ border-color: rgba(255,255,255,.38) !important; }
.btn-warning{
  --bs-btn-color: var(--brand-navy);
  --bs-btn-bg: var(--brand-orange);
  --bs-btn-border-color: var(--brand-orange);
  --bs-btn-hover-color: var(--brand-navy);
  --bs-btn-hover-bg: #F39865;
  --bs-btn-hover-border-color: #F39865;
  --bs-btn-active-color: var(--brand-navy);
  --bs-btn-active-bg: #F8B994;
  --bs-btn-active-border-color: #F8B994;
  --bs-btn-disabled-bg: var(--brand-orange);
  --bs-btn-disabled-border-color: var(--brand-orange);
}
.btn-info{
  --bs-btn-bg: var(--brand-cyan);
  --bs-btn-border-color: var(--brand-cyan);
  --bs-btn-hover-bg: #BCEAF6;
  --bs-btn-hover-border-color: #BCEAF6;
  --bs-btn-active-bg: #BCEAF6;
  --bs-btn-active-border-color: #BCEAF6;
}
.form-check-input:checked{
  background-color: var(--primary);
  border-color: var(--primary);
}
.pagination{
  --bs-pagination-active-bg: var(--primary);
  --bs-pagination-active-border-color: var(--primary);
  --bs-pagination-focus-box-shadow: var(--ring);
}
.btn:focus-visible{ box-shadow: var(--ring); outline: none; }

.form-control, .form-select{
  border-radius: 12px;
  border-color: var(--border);
  padding: .62rem .78rem;
  background: #fff;
  color: var(--text);
}
.form-control:focus, .form-select:focus{
  border-color: rgba(93, 202, 234, .58);
  box-shadow: var(--ring);
}
label.form-label{
  font-weight: 800;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.table-wrap{ overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table{ min-width: 560px; }
.table{ margin-bottom: 0; }
.table thead th{
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-top: 0;
}
.table td, .table th{ padding: .75rem .6rem; vertical-align: middle; }

.chip{
  display:inline-flex; align-items:center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  font-weight: 900; font-size: 12px;
  border: 1px solid var(--border);
}
.chip .dot{ width: 8px; height: 8px; border-radius: 50%; }

.chip-assigned{ background: rgba(93, 202, 234, .14); color: var(--primary-deep); }
.chip-assigned .dot{ background: var(--primary); }

.chip-sold{ background: rgba(235, 123, 59, .16); color: #793710; }
.chip-sold .dot{ background: var(--yellow); }

.chip-lost{ background: rgba(229, 107, 111, .12); color: #B54B50; }
.chip-lost .dot{ background: var(--danger); }

.chip-planned{ background: rgba(93, 202, 234, .12); color: var(--brand-navy); }
.chip-planned .dot{ background: var(--teal); }

/* Status pill (scan/search results) */
.status-pill{
  display:inline-flex; align-items:center; gap:8px;
  padding: 6px 10px; border-radius: 999px;
  font-weight: 900; font-size: 12px;
  border: 1px solid var(--border);
}
.status-pill::before{
  content:'';
  width:8px; height:8px; border-radius:50%;
  background: rgba(6, 19, 75, .35);
}

.status-in-stock{ background: rgba(45, 190, 127, .12); color: #217A56; }
.status-in-stock::before{ background: var(--green); }

.status-assigned{ background: rgba(93, 202, 234, .14); color: var(--primary-deep); }
.status-assigned::before{ background: var(--primary); }

.status-sold{ background: rgba(235, 123, 59, .16); color: #793710; }
.status-sold::before{ background: var(--yellow); }

.status-lost{ background: rgba(229, 107, 111, .12); color: #B54B50; }
.status-lost::before{ background: var(--danger); }

.overdue-badge{
  display:inline-flex; align-items:center;
  padding: 4px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 900;
  background: rgba(235, 123, 59, .20);
  color: #793710;
}

/* Insight card inspired by the warehouse analytics screens */
.insight-card{
  border-radius: 22px;
  padding: 18px;
  color: #fff;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.18);
  background:
    radial-gradient(1200px 480px at 10% 10%, rgba(255,255,255,.24), transparent 60%),
    linear-gradient(135deg, var(--primary-deep), var(--primary-dark));
}
.insight-card .tag{
  display:inline-flex; gap:8px; align-items:center;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 900; font-size: 12px;
}
.insight-card .title{
  font-weight: 950;
  font-size: 22px;
  line-height: 1.15;
  margin-top: 12px;
}
.insight-card .subtitle{ color: rgba(255,255,255,.84); margin-top: 8px; }

/* Bottom navigation */
.bottom-nav{
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  height: 66px;
  padding: 10px 12px;
  display:flex;
  justify-content: space-between;
  gap: 8px;
  border-radius: 22px;
  background: var(--brand-navy);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(93,202,234,.2);
  box-shadow: 0 14px 40px rgba(6, 19, 75, .14);
  z-index: 10000;
}
.bottom-nav__item{
  flex:1;
  min-width: 0;
  display:flex;
  flex-direction: column;
  align-items:center;
  justify-content:center;
  gap: 4px;
  color: #D7E4F3;
  font-weight: 900;
  font-size: 11px;
  border-radius: 16px;
}
.bottom-nav__item i{ font-size: 18px; line-height: 1; color:var(--brand-cyan); }
.bottom-nav__item.is-active{
  color: var(--brand-navy);
  background: var(--brand-cyan);
  box-shadow: inset 0 -3px 0 var(--brand-orange);
}
.bottom-nav__item.is-active i{ color:var(--brand-navy); }
.bottom-nav__item:not(.is-active):hover{ color:var(--brand-cyan); background:rgba(93,202,234,.1); text-decoration:none; }
.bottom-nav__item:focus-visible{ outline:none; box-shadow: var(--ring); }

/* Scan screen frame */
.scan-frame{
  position: relative;
  height: 220px;
  border-radius: 22px;
  background:
    radial-gradient(900px 260px at 20% 0%, rgba(93, 202, 234, .22), transparent 55%),
    radial-gradient(900px 260px at 80% 100%, rgba(6, 19, 75, .12), transparent 55%),
    rgba(6, 19, 75, .03);
  border: 1px dashed rgba(6, 19, 75, .24);
  overflow: hidden;
}

.scan-video{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.06) saturate(1.02);
}
.scan-frame__target{
  position:absolute;
  left: 16px; right: 16px; top: 34px; bottom: 46px;
  border-radius: 22px;
  border: 2px solid rgba(6, 19, 75, .22);
}
.scan-frame__target:before{
  content:'';
  position:absolute;
  left: 12%; right: 12%; top: 50%;
  height: 2px;
  background: rgba(93, 202, 234, .72);
  box-shadow: 0 0 0 6px rgba(93, 202, 234, .12);
}
.scan-frame__hint{
  position:absolute;
  left: 0; right: 0; bottom: 14px;
  text-align:center;
  font-weight: 900;
  color: var(--muted);
  font-size: 12px;
}

.row-overdue{
  background: rgba(235, 123, 59, .18) !important;
  border-left: 4px solid var(--yellow);
}

.sale-details summary{ list-style:none; cursor:pointer; }
.sale-details summary::-webkit-details-marker{ display:none; }
.sale-details[open] summary{ background: rgba(93, 202, 234, .10); }

.mini-meta{ color: var(--muted); font-size: 12px; }
.section-title{ font-weight: 900; letter-spacing: -.01em; margin-bottom: 8px; }

@media (max-width: 576px){
  .table-wrap table{ min-width: 520px; }
}

/* Header action buttons (nice on mobile): keep a single row, allow horizontal scroll */
.action-grid{ display:flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 575.98px){
  .action-grid{
    flex-wrap: nowrap;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
  }
  .action-grid .btn{ white-space: nowrap; }
}

/* Recent sales mobile cards */
.sale-card{
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  background: #fff;
}
.sale-card__top{ display:flex; align-items:flex-start; justify-content:space-between; gap: 10px; }
.sale-card__device{ font-weight: 950; letter-spacing: -.01em; color: var(--text); }
.sale-card__meta{ color: var(--muted); font-size: 12px; }
.sale-card__amount{ font-weight: 950; color: var(--primary-deep); }
.sale-card__actions{ display:flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Leaderboard list */
.leaderboard{
  list-style: none;
  padding-left: 0;
  margin: 0;
  display:flex;
  flex-direction: column;
  gap: 8px;
}
.leaderboard__item{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.72);
}
.leaderboard__rank{
  width: 28px; height: 28px;
  border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  background: rgba(93, 202, 234, .16);
  border: 1px solid rgba(93, 202, 234, .24);
  color: var(--primary-deep);
  font-weight: 950;
}

/* Offcanvas + modal refinements */
.offcanvas{
  border-top-right-radius: 22px;
  border-bottom-right-radius: 22px;
  border-right: 1px solid var(--border);
}
.offcanvas-header{
  border-bottom: 1px solid rgba(6, 19, 75, .08);
}
.app-navlink{
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 900;
  color: var(--text);
}
.app-navlink:hover{
  background: rgba(93, 202, 234, .12);
  text-decoration:none;
}

/* Navy anchors navigation; cyan marks selection and orange adds emphasis. */
.app-sidebar{
  --bs-offcanvas-width: min(320px, calc(100vw - 32px));
  --bs-offcanvas-bg: var(--brand-navy);
  --bs-offcanvas-color: #EAF8FC;
  z-index:1060;
  border-right: 1px solid rgba(93,202,234,.22);
  border-top: 3px solid var(--brand-orange);
  box-shadow: 12px 0 40px rgba(6,19,75,.2);
}
.app-sidebar ~ .offcanvas-backdrop{ z-index:1055; }
.app-sidebar .offcanvas-header{ padding:22px 20px; border-bottom:1px solid rgba(93,202,234,.18); }
.app-sidebar .offcanvas-title{ color:#fff; font-weight:800; letter-spacing:-.02em; }
.app-sidebar__subtitle{ margin-top:4px; color:var(--brand-cyan); font-size:12px; }
.app-sidebar .brand-mark--menu{ width:42px; height:42px; box-shadow:none; }
.app-sidebar .btn-close{ filter:invert(1); opacity:.8; }
.app-sidebar .btn-close:hover{ opacity:1; }
.app-sidebar .btn-close:focus-visible{ opacity:1; box-shadow:0 0 0 3px var(--brand-cyan); }
.app-sidebar .offcanvas-body{ padding:20px 16px; scrollbar-color:var(--brand-cyan) transparent; scrollbar-width:thin; overscroll-behavior:contain; }
.app-sidebar__section{ color:var(--brand-cyan); padding:14px 12px 6px; font-size:11px; letter-spacing:.1em; }
.app-sidebar .app-navlink{ color:#EAF8FC; border-left:3px solid transparent; border-radius:10px; padding:11px 12px; font-size:14px; font-weight:650; }
.app-sidebar .app-navlink i{ color:var(--brand-cyan); }
.app-sidebar .app-navlink:hover{ color:#fff; background:rgba(93,202,234,.12); }
.app-sidebar .app-navlink:focus-visible{ outline:2px solid var(--brand-cyan); outline-offset:2px; }
.app-sidebar .app-navlink[aria-current="page"]{ color:var(--brand-navy); background:var(--brand-cyan); border-left-color:var(--brand-orange); font-weight:800; }
.app-sidebar .app-navlink[aria-current="page"] i{ color:var(--brand-navy); }
.app-modal{
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* Backwards compatibility */
.overdue{
  background: rgba(235, 123, 59, .18) !important;
  border-left: 4px solid var(--yellow);
}

/* ===== Premium horizontal pill strip (no wrap + scroll) ===== */
.pill-strip-container {
  position: relative;
}

.pill-strip {
  display: flex;
  flex-wrap: nowrap !important;
  gap: 0.5rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0.25rem 0.35rem;
  scrollbar-width: none;
  white-space: nowrap;
}

.pill-strip::-webkit-scrollbar {
  display: none;
}

/* each pill should never shrink or wrap */
.pill-strip .pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.42rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  background: transparent;
  color: var(--primary-deep);
  border: 1px solid rgba(93, 202, 234, .38);
}

/* active state */
.pill-strip .pill--active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-color: var(--primary-dark);
  color: #fff;
}

/* danger (Lost) */
.pill-strip .pill--danger {
  color: #B54B50;
  border-color: rgba(229, 107, 111, .35);
}
.pill-strip .pill--danger.pill--active {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* subtle fades to hint scroll */
.pill-strip-container::after,
.pill-strip-container::before {
  content: "";
  position: absolute;
  top: 0;
  width: 28px;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.pill-strip-container::after {
  right: 0;
  background: linear-gradient(to right, rgba(255,255,255,0), var(--surface));
}

.pill-strip-container::before {
  left: 0;
  background: linear-gradient(to left, rgba(255,255,255,0), var(--surface));
}

/* Overdue pill — matches row highlight color */
.pill--overdue {
  border-color: var(--yellow);
  color: #793710;
}

.pill--overdue.pill--active {
  background-color: var(--yellow);
  border-color: var(--yellow);
  color: var(--brand-navy);
}

/* Top navbar should always be above sticky table headers */
.navbar,
.top-nav,
.app-navbar {
  position: sticky;
  top: 0;
  z-index: 1050;
}

/* Bottom nav (if you have one) */
.bottom-nav,
.app-bottom-nav,
.mobile-nav {
  position: fixed;
  bottom: 0;
  z-index: 1050;
}

.navbar.fixed-top,
.navbar.fixed-bottom { z-index: 1050; }
/* =================================================================
   Extended component set, styled to the
   Koneta palette (navy #06134B, cyan #5DCAEA, orange #EB7B3B).
   ================================================================= */

/* --- Extra KPI tile variants ------------------------------------- */
.kpi-tile--green{  background: linear-gradient(135deg, #22A06B, var(--green)); }
.kpi-tile--indigo{ background: linear-gradient(135deg, var(--primary-deep), #06134B); }
.kpi-tile--red{    background: linear-gradient(135deg, #C9545A, var(--danger)); }

/* --- Revenue section header --------------------------------------- */
.revenue-section-header{ display:flex; align-items:center; gap:8px; margin-bottom:.5rem; }
.revenue-section-header .revenue-badge{
  background: rgba(45,190,127,.12); color:#217A56;
  font-size:11px; font-weight:800; padding:2px 8px; border-radius:20px;
  text-transform:uppercase; letter-spacing:.06em;
}

/* --- Additional status pills -------------------------------------- */
.status-pending{ background: rgba(235, 123, 59,.18); color:#793710; }
.status-pending::before{ background: var(--yellow); }
.status-self{ background: rgba(93, 202, 234,.14); color: var(--primary-deep); }
.status-self::before{ background: var(--primary); }
.status-neutral{ background: rgba(6, 19, 75,.08); color: var(--muted); }
.status-neutral::before{ background: rgba(6, 19, 75,.45); }

/* --- Touch targets & responsive charts ---------------------------- */
.form-control-sm, .form-select-sm{ min-height: 44px; }
.chart-wrap{ height: 200px; }
@media (min-width: 576px){ .chart-wrap{ height: 240px; } }
@media (min-width: 992px){ .chart-wrap{ height: 280px; } }

/* --- Business Overview card --------------------------------------- */
.ovw-card{
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.ovw-hero{
  background: linear-gradient(135deg, var(--primary-deep), var(--primary-dark));
  padding: 20px 18px 18px;
}
.ovw-hero__eyebrow{
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.78);
  margin-bottom: 4px;
}
.ovw-hero__value{
  font-size: 34px; font-weight: 950;
  line-height: 1.05; letter-spacing: -.025em;
  color: #fff;
}
@media(max-width: 360px){ .ovw-hero__value{ font-size: 26px; } }
.ovw-hero__link{
  color: rgba(255,255,255,.78);
  font-size: 22px; text-decoration: none; line-height: 1; flex-shrink: 0;
}
.ovw-hero__link:hover{ color: #fff; text-decoration: none; }
.ovw-hero__subs{
  display: flex; align-items: center; gap: 10px;
  margin-top: 14px; flex-wrap: wrap; row-gap: 8px;
}
.ovw-hero__sub{ display: flex; flex-direction: column; gap: 1px; }
.ovw-hero__sub-label{
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: rgba(255,255,255,.68);
}
.ovw-hero__sub-val{ font-size: 14px; font-weight: 800; color: #fff; }
.ovw-hero__sep{
  width: 1px; height: 26px;
  background: rgba(255,255,255,.28);
  flex-shrink: 0;
}
@media(max-width: 340px){ .ovw-hero__sep{ display: none; } }

.ovw-stats{
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--card);
  border-top: 1px solid var(--border);
}
@media(min-width: 576px){ .ovw-stats{ grid-template-columns: repeat(4, 1fr); } }
.ovw-stat{
  padding: 14px 16px;
  text-decoration: none; color: inherit;
  position: relative; transition: background .15s;
}
.ovw-stat:hover{ background: var(--primary-soft); text-decoration: none; }
.ovw-stat + .ovw-stat::before{
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 1px;
  background: var(--border-strong);
}
@media(max-width: 575px){
  .ovw-stat:nth-child(2)::before{ display: none; }
  .ovw-stat:nth-child(1),
  .ovw-stat:nth-child(2){ border-bottom: 1px solid var(--border-strong); }
}
.ovw-stat__val{
  font-size: 28px; font-weight: 950;
  line-height: 1.05; letter-spacing: -.025em;
  color: var(--text);
}
.ovw-stat__lbl{
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-top: 3px;
}
.ovw-stat__meta{ font-size: 11px; color: var(--muted); margin-top: 3px; }
.ovw-stat--teal   .ovw-stat__val{ color: #217A56; }
.ovw-stat--purple .ovw-stat__val{ color: #06134B; }
.ovw-stat--gold   .ovw-stat__val{ color: var(--primary-deep); }

/* Commission alert strip */
.ovw-alert{
  padding: 10px 16px;
  background: var(--primary-soft);
  border-top: 1px solid var(--border-strong);
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  font-size: 12px; color: var(--text);
}
.ovw-alert i{ color: var(--primary-deep); flex-shrink: 0; }
.ovw-alert a{
  margin-left: auto;
  font-size: 12px; font-weight: 700;
  color: var(--primary-deep); text-decoration: none; white-space: nowrap;
}
.ovw-alert a:hover{ text-decoration: underline; }

/* --- Mobile UX refinements ---------------------------------------- */
/* Inline 10px stat labels bumped to 11px for legibility on small screens */
[style*="font-size:10px"] { font-size: 11px !important; }
@media (max-width: 479px) { .hero-sep { display: none !important; } }
.table .btn-sm { min-height: 36px; padding: .3rem .7rem; }
/* Sticky thead inside overflow containers misbehaves on iOS — pin it off there */
@supports (-webkit-touch-callout: none) {
  .table-responsive thead.sticky-top,
  .table-wrap thead.sticky-top { position: static; }
}
/* Keep toasts above the bottom nav and readable on mobile */
@media (max-width: 991.98px) {
  .toast-container.position-fixed.top-0.end-0 {
    top: auto !important;
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: 12px; left: 12px;
    padding: 0;
  }
  .toast-container.position-fixed.top-0.end-0 .toast { width: 100%; max-width: 100%; }
}
.d-grid.gap-2 .btn { width: 100%; }


/* Navigation uses the same light canvas as the transparent navy wordmark. */
.app-navbar .navbar-brand{ color:var(--brand-navy); }
.app-navbar .icon-btn{ color:var(--brand-navy); background:rgba(6,19,75,.04); border-color:var(--border); }
.app-navbar .icon-btn:hover{ background:var(--primary-soft); }
.app-navbar .avatar{ background:rgba(93,202,234,.18); color:var(--brand-navy); border:1px solid rgba(93,202,234,.3); flex-shrink:0; }
.app-navbar .btn-outline-light{ color:var(--brand-navy); border-color:var(--border) !important; }
.app-navbar .btn-outline-light:hover{ background:var(--primary-soft); }
