body.jbt-home-active {
  --jbt-navy:#06284a;
  --jbt-navy-2:#0a3b68;
  --jbt-blue:#1265b3;
  --jbt-blue-2:#1687df;
  --jbt-gold:#f0b323;
  --jbt-light:#f4f8fc;
  --jbt-text:#12304d;
  --jbt-muted:#71849a;
  --jbt-border:#e3ebf3;
  background:#f4f8fc !important;
}

/* ================= SIDEBAR ================= */

body.jbt-home-active .jbt-sidebar {
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  width:242px;
  z-index:1050;
  background:linear-gradient(180deg,#06284a 0%,#07365f 55%,#062743 100%);
  color:#fff;
  padding:18px 13px;
  box-shadow:8px 0 30px rgba(0,30,60,.14);
  font-family:Inter,Arial,sans-serif;
  overflow:hidden;
}

.jbt-side-brand {
  display:flex;
  align-items:center;
  gap:10px;
  padding:5px 9px 18px;
  border-bottom:1px solid rgba(255,255,255,.12);
}

.jbt-side-brand img {
  width:54px;
  height:54px;
  object-fit:contain;
  background:#fff;
  border-radius:12px;
  padding:3px;
}

.jbt-side-brand strong {
  display:block;
  font-size:19px;
  letter-spacing:.2px;
}

.jbt-side-brand strong em {
  color:var(--jbt-gold);
  font-style:normal;
}

.jbt-side-brand span {
  display:block;
  font-size:9px;
  opacity:.72;
  margin-top:3px;
  white-space:nowrap;
}

.jbt-side-section {
  margin:20px 10px 7px;
  font-size:9px;
  letter-spacing:1.7px;
  color:#8fb0cb;
  font-weight:700;
}

.jbt-sidebar button {
  width:100%;
  border:0;
  background:transparent;
  color:#dbe8f4;
  text-align:left;
  padding:10px 11px;
  margin:2px 0;
  border-radius:9px;
  font-size:13px;
  cursor:pointer;
  transition:.18s ease;
}

.jbt-sidebar button .jbt-nav-icon {
  display:inline-flex;
  width:23px;
  justify-content:center;
  font-size:15px;
}

.jbt-sidebar button span {
  margin-left:7px;
}

.jbt-sidebar button:hover {
  background:rgba(255,255,255,.08);
  color:#fff;
}

.jbt-sidebar button.active {
  background:linear-gradient(90deg,#1268b9,#0f5ba3);
  color:#fff;
  box-shadow:0 5px 16px rgba(0,0,0,.14);
}

.jbt-sidebar button.active::after {
  content:"";
  float:right;
  width:3px;
  height:18px;
  margin-top:0;
  border-radius:4px;
  background:var(--jbt-gold);
}

.jbt-side-bottom {
  position:absolute;
  left:22px;
  right:20px;
  bottom:18px;
  font-size:10px;
  opacity:.8;
  line-height:1.6;
  text-align:center;
}

.jbt-side-bottom .jbt-bottom-line {
  color:var(--jbt-gold);
  font-weight:700;
  letter-spacing:1.3px;
}

.jbt-side-bottom small {
  opacity:.65;
  letter-spacing:1px;
}

/* ================= MAIN AREA ================= */

body.jbt-home-active .jbt-dashboard-content {
  margin-left:242px !important;
  padding:22px 28px 45px !important;
  background:#f4f8fc;
  min-height:calc(100vh - 60px);
}

body.jbt-home-active .jbt-hide-default-head {
  display:none !important;
}

/* ================= TOP BAR ================= */

.jbt-topbar {
  height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:14px;
}

.jbt-search {
  width:380px;
  background:#fff;
  border:1px solid var(--jbt-border);
  border-radius:10px;
  padding:10px 14px;
  color:#7b8da0;
  font-size:12px;
  box-shadow:0 2px 8px rgba(20,60,100,.04);
}

.jbt-userbar {
  display:flex;
  align-items:center;
  gap:14px;
  color:#61758b;
  font-size:12px;
}

.jbt-user-avatar {
  width:34px;
  height:34px;
  border-radius:50%;
  background:#e7eef6;
  color:var(--jbt-blue);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
}

/* ================= HERO ================= */

.jbt-hero {
  min-height:188px;
  border-radius:16px;
  padding:28px 34px;
  margin-bottom:18px;
  background:
    linear-gradient(100deg,rgba(6,40,74,.97),rgba(13,91,155,.90)),
    linear-gradient(120deg,#0a3158,#1687df);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:relative;
  overflow:hidden;
  box-shadow:0 10px 30px rgba(8,50,90,.16);
}

.jbt-hero::after {
  content:"";
  position:absolute;
  right:-80px;
  top:-100px;
  width:380px;
  height:380px;
  border-radius:50%;
  border:45px solid rgba(255,255,255,.05);
}

.jbt-hero-text {
  position:relative;
  z-index:2;
}

.jbt-eyebrow {
  font-size:11px;
  letter-spacing:1.8px;
  opacity:.78;
  margin-bottom:7px;
}

.jbt-hero h1 {
  margin:0;
  font-size:31px;
  font-weight:700;
}

.jbt-hero h1 span {
  color:#4fa9ee;
}

.jbt-hero p {
  margin:9px 0 0;
  font-size:13px;
  opacity:.83;
}

.jbt-hero-badge {
  position:relative;
  z-index:2;
  text-align:right;
  line-height:1.9;
  font-size:14px;
}

.jbt-hero-badge strong {
  color:#fff;
  display:block;
}

.jbt-hero-badge span {
  color:var(--jbt-gold);
  font-weight:700;
  letter-spacing:2px;
}

/* ================= SECTION ================= */

.jbt-section-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin:18px 2px 10px;
}

.jbt-section-head h3 {
  margin:0;
  color:#122e4a;
  font-size:17px;
  font-weight:700;
}

.jbt-view-all {
  color:#1265b3;
  font-size:11px;
  cursor:pointer;
}

/* ================= KPI ================= */

.jbt-kpi-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.jbt-kpi {
  background:#fff;
  border:1px solid var(--jbt-border);
  border-radius:13px;
  padding:16px;
  display:flex;
  align-items:center;
  gap:13px;
  box-shadow:0 3px 12px rgba(30,70,110,.045);
  cursor:pointer;
  transition:.18s;
}

.jbt-kpi:hover {
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(30,70,110,.10);
}

.jbt-kpi-icon {
  width:49px;
  height:49px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eaf3fc;
  color:#1265b3;
  font-size:21px;
}

.jbt-kpi-info {
  min-width:0;
}

.jbt-kpi-label {
  color:#617892;
  font-size:11px;
}

.jbt-kpi-value {
  color:#082e55;
  font-size:24px;
  font-weight:700;
  margin-top:2px;
}

.jbt-kpi-change {
  color:#18a957;
  font-size:10px;
  margin-top:2px;
}

/* ================= BUSINESS UNITS ================= */

.jbt-business-grid {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}

.jbt-business-card {
  border:1px solid var(--jbt-border);
  border-radius:13px;
  min-height:92px;
  padding:17px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  transition:.18s;
}

.jbt-business-card:hover {
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(30,70,110,.09);
}

.jbt-business-icon {
  width:48px;
  height:48px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:23px;
  background:#eef5fb;
  color:#1265b3;
}

.jbt-business-card:nth-child(1) .jbt-business-icon {
  background:#fff3e5;
  color:#db8b16;
}

.jbt-business-card:nth-child(3) .jbt-business-icon {
  background:#fff5df;
  color:#cf8d13;
}

.jbt-business-text {
  flex:1;
  margin-left:13px;
}

.jbt-business-text strong {
  display:block;
  font-size:14px;
  color:#10345c;
}

.jbt-business-text span {
  display:block;
  margin-top:5px;
  color:#75899e;
  font-size:10px;
}

.jbt-arrow {
  width:30px;
  height:30px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 8px rgba(0,0,0,.08);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#1265b3;
  font-size:17px;
}

/* ================= OPERATIONS ================= */

.jbt-operation-grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.jbt-operation {
  border-radius:13px;
  padding:15px;
  min-height:82px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  cursor:pointer;
  border:1px solid rgba(200,215,230,.55);
}

.jbt-operation:nth-child(1){background:#eefaf3}
.jbt-operation:nth-child(2){background:#edf5fd}
.jbt-operation:nth-child(3){background:#fff7e9}
.jbt-operation:nth-child(4){background:#f3effc}

.jbt-operation-main {
  display:flex;
  align-items:center;
  gap:11px;
}

.jbt-operation-icon {
  font-size:23px;
}

.jbt-operation strong {
  display:block;
  color:#11375e;
  font-size:13px;
}

.jbt-operation span {
  display:block;
  margin-top:4px;
  color:#72879d;
  font-size:10px;
}

/* ================= BOTTOM PANELS ================= */

.jbt-bottom-grid {
  display:grid;
  grid-template-columns:1fr 1.25fr 1fr;
  gap:14px;
  margin-top:18px;
}

.jbt-panel {
  background:#fff;
  border:1px solid var(--jbt-border);
  border-radius:13px;
  padding:17px;
  min-height:210px;
  box-shadow:0 3px 12px rgba(30,70,110,.035);
}

.jbt-panel-title {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:13px;
}

.jbt-panel-title strong {
  font-size:14px;
  color:#142f49;
}

.jbt-action-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:9px;
}

.jbt-action {
  border:1px solid #e1eaf3;
  background:#fbfdff;
  border-radius:9px;
  padding:11px;
  color:#143b63;
  font-size:11px;
  cursor:pointer;
  text-align:left;
}

.jbt-action:hover {
  background:#eef6fd;
  border-color:#c9dfef;
}

.jbt-activity {
  display:grid;
  grid-template-columns:8px 1fr auto;
  gap:9px;
  align-items:center;
  padding:8px 0;
  border-bottom:1px solid #eef2f6;
  font-size:11px;
}

.jbt-dot {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#18a957;
}

.jbt-activity strong {
  display:block;
  color:#234766;
}

.jbt-activity span {
  color:#8294a7;
  font-size:9px;
}

.jbt-alert {
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:9px 0;
  border-bottom:1px solid #eef2f6;
}

.jbt-alert-dot {
  width:9px;
  height:9px;
  margin-top:4px;
  border-radius:50%;
  background:#f0a300;
}

.jbt-alert strong {
  display:block;
  font-size:11px;
  color:#173a5e;
}

.jbt-alert span {
  display:block;
  color:#8294a7;
  font-size:9px;
  margin-top:2px;
}

.jbt-footer {
  margin-top:17px;
  padding-top:13px;
  border-top:1px solid #e4ebf2;
  color:#8091a4;
  font-size:9px;
  display:flex;
  justify-content:space-between;
}

/* ================= RESPONSIVE ================= */

@media(max-width:1150px) {
  .jbt-kpi-grid {grid-template-columns:repeat(2,1fr)}
  .jbt-operation-grid {grid-template-columns:repeat(2,1fr)}
  .jbt-bottom-grid {grid-template-columns:1fr 1fr}
  .jbt-bottom-grid .jbt-panel:last-child {grid-column:1/-1}
}

@media(max-width:850px) {
  body.jbt-home-active .jbt-sidebar {
    width:68px;
    padding:15px 8px;
  }

  .jbt-side-brand {
    justify-content:center;
    padding:0 0 15px;
  }

  .jbt-side-brand img {
    width:43px;
    height:43px;
  }

  .jbt-side-brand div,
  .jbt-side-section,
  .jbt-sidebar button span,
  .jbt-side-bottom {
    display:none;
  }

  .jbt-sidebar button {
    text-align:center;
    padding:11px 4px;
  }

  .jbt-sidebar button .jbt-nav-icon {
    width:auto;
    font-size:18px;
  }

  body.jbt-home-active .jbt-dashboard-content {
    margin-left:68px !important;
    padding:14px !important;
  }

  .jbt-topbar {display:none}
  .jbt-hero {padding:23px; min-height:150px}
  .jbt-hero h1 {font-size:24px}
  .jbt-hero-badge {display:none}
  .jbt-business-grid {grid-template-columns:1fr}
}

@media(max-width:600px) {
  .jbt-kpi-grid,
  .jbt-operation-grid,
  .jbt-bottom-grid {
    grid-template-columns:1fr;
  }

  .jbt-bottom-grid .jbt-panel:last-child {
    grid-column:auto;
  }

  .jbt-hero {
    border-radius:12px;
    padding:20px;
  }

  .jbt-hero h1 {
    font-size:21px;
  }

  .jbt-hero p {
    font-size:11px;
  }

  .jbt-section-head h3 {
    font-size:15px;
  }

  .jbt-footer {
    flex-direction:column;
    gap:5px;
  }
}

/* =========================================================
   JBT ERP - RESPONSIVE DASHBOARD V2
   Full-width / Device-responsive layout
   ========================================================= */

body.jbt-home-active {
    overflow-x: hidden !important;
}

/* Remove Frappe workspace width restrictions */
body.jbt-home-active .layout-main,
body.jbt-home-active .layout-main-section,
body.jbt-home-active .layout-main-section-wrapper,
body.jbt-home-active .page-container,
body.jbt-home-active .workspace-container {
    width: 100% !important;
    max-width: none !important;
}

/* Main dashboard area */
body.jbt-home-active .jbt-dashboard-content {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    padding: 0 30px 36px 272px !important;
    margin: 0 !important;
}

/* Keep dashboard sections fluid */
body.jbt-home-active .jbt-dashboard-content > *,
body.jbt-home-active .jbt-main-dashboard > * {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
}

/* Hero */
body.jbt-home-active .jbt-hero {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* KPI */
body.jbt-home-active .jbt-kpi-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
}

/* Business Units */
body.jbt-home-active .jbt-business-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
}

/* Operations */
body.jbt-home-active .jbt-operations-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 18px !important;
}

/* Lower dashboard panels */
body.jbt-home-active .jbt-bottom-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
}

/* Prevent cards from forcing horizontal scroll */
body.jbt-home-active .jbt-dashboard-content .card,
body.jbt-home-active .jbt-dashboard-content [class*="card"] {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Large screens */
@media (min-width: 1800px) {
    body.jbt-home-active .jbt-dashboard-content {
        padding-left: 282px !important;
        padding-right: 42px !important;
    }

    body.jbt-home-active .jbt-kpi-grid,
    body.jbt-home-active .jbt-business-grid,
    body.jbt-home-active .jbt-operations-grid,
    body.jbt-home-active .jbt-bottom-grid {
        gap: 22px !important;
    }
}

/* Laptop */
@media (max-width: 1366px) {
    body.jbt-home-active .jbt-dashboard-content {
        padding-left: 260px !important;
        padding-right: 22px !important;
    }

    body.jbt-home-active .jbt-kpi-grid {
        gap: 14px !important;
    }

    body.jbt-home-active .jbt-business-grid,
    body.jbt-home-active .jbt-operations-grid,
    body.jbt-home-active .jbt-bottom-grid {
        gap: 14px !important;
    }
}

/* Tablet */
@media (max-width: 1000px) {
    body.jbt-home-active .jbt-dashboard-content {
        padding-left: 94px !important;
        padding-right: 18px !important;
    }

    body.jbt-home-active .jbt-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.jbt-home-active .jbt-business-grid,
    body.jbt-home-active .jbt-operations-grid,
    body.jbt-home-active .jbt-bottom-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* Mobile */
@media (max-width: 650px) {
    body.jbt-home-active {
        padding-bottom: 70px !important;
    }

    body.jbt-home-active .jbt-dashboard-content {
        width: 100% !important;
        padding: 0 12px 24px 12px !important;
        margin: 0 !important;
    }

    body.jbt-home-active .jbt-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    body.jbt-home-active .jbt-business-grid,
    body.jbt-home-active .jbt-operations-grid,
    body.jbt-home-active .jbt-bottom-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    body.jbt-home-active .jbt-hero {
        min-height: auto !important;
    }

    body.jbt-home-active .jbt-sidebar {
        display: none !important;
    }
}

/* Small mobile */
@media (max-width: 420px) {
    body.jbt-home-active .jbt-dashboard-content {
        padding-left: 9px !important;
        padding-right: 9px !important;
    }

    body.jbt-home-active .jbt-kpi-grid {
        gap: 8px !important;
    }
}


/* =========================================================
   JBT ERP - MODERN V3 VISUAL POLISH
   ========================================================= */

/* Modern SVG icons */
.jbt-nav-icon svg,
.jbt-kpi-icon svg,
.jbt-business-icon svg,
.jbt-operation-icon svg,
.jbt-top-icon svg,
.jbt-top-action svg {
    width: 21px;
    height: 21px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.jbt-nav-icon svg {
    width: 20px;
    height: 20px;
}

.jbt-top-icon svg {
    width: 19px;
    height: 19px;
}

/* Clearer typography */
body.jbt-home-active .jbt-main-dashboard {
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

body.jbt-home-active .jbt-section-head h3 {
    font-size: 17px !important;
    font-weight: 700 !important;
    letter-spacing: -.15px;
}

body.jbt-home-active .jbt-kpi-label {
    font-size: 14px !important;
    font-weight: 600 !important;
}

body.jbt-home-active .jbt-kpi-value {
    font-size: 27px !important;
    font-weight: 750 !important;
    line-height: 1.15;
}

body.jbt-home-active .jbt-business-text strong,
body.jbt-home-active .jbt-operation-main strong {
    font-size: 15px !important;
    font-weight: 700 !important;
}

body.jbt-home-active .jbt-business-text span,
body.jbt-home-active .jbt-operation-main span {
    font-size: 13px !important;
}

body.jbt-home-active .jbt-action {
    font-size: 13px !important;
    font-weight: 600 !important;
}

/* Modern top bar */
body.jbt-home-active .jbt-topbar {
    min-height: 58px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 20px !important;
}

body.jbt-home-active .jbt-search-btn {
    cursor: pointer !important;
    border: 1px solid #dbe5ef !important;
    background: #fff !important;
    color: #5d7085 !important;
    border-radius: 12px !important;
    min-height: 42px !important;
    padding: 0 13px !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 1 480px !important;
    max-width: 650px !important;
    text-align: left !important;
    box-shadow: 0 2px 8px rgba(12, 44, 78, .04) !important;
}

body.jbt-home-active .jbt-search-btn:hover {
    border-color: #b8cde0 !important;
    box-shadow: 0 4px 14px rgba(12, 44, 78, .08) !important;
}

body.jbt-home-active .jbt-search-text {
    flex: 1;
    font-size: 13px;
}

body.jbt-home-active .jbt-search-btn kbd {
    font-size: 11px;
    padding: 3px 7px;
    border: 1px solid #dbe5ef;
    border-radius: 6px;
    background: #f7fafd;
    color: #7c8da0;
}

body.jbt-home-active .jbt-userbar {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
}

body.jbt-home-active .jbt-top-action,
body.jbt-home-active .jbt-profile-btn {
    border: 0 !important;
    background: transparent !important;
    cursor: pointer !important;
}

body.jbt-home-active .jbt-top-action {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 10px !important;
    color: #526b83 !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.jbt-home-active .jbt-top-action:hover {
    background: #edf4fa !important;
    color: #1265b3 !important;
}

body.jbt-home-active .jbt-notify-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    top: 7px;
    right: 7px;
    border-radius: 50%;
    background: #e84b4b;
    border: 2px solid #fff;
}

body.jbt-home-active .jbt-profile-btn {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 3px 6px !important;
    border-radius: 10px !important;
}

body.jbt-home-active .jbt-profile-btn:hover {
    background: #edf4fa !important;
}

body.jbt-home-active .jbt-user-avatar {
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg,#0b477d,#1687df) !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
}

body.jbt-home-active .jbt-user-name {
    color: #29445e;
    font-size: 12px;
}

/* Better icon containers */
body.jbt-home-active .jbt-kpi-icon,
body.jbt-home-active .jbt-business-icon,
body.jbt-home-active .jbt-operation-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Wider desktop spacing */
@media (min-width: 1600px) {
    body.jbt-home-active .jbt-dashboard-content {
        padding-right: 34px !important;
    }

    body.jbt-home-active .jbt-main-dashboard {
        width: 100% !important;
    }

    body.jbt-home-active .jbt-kpi-value {
        font-size: 29px !important;
    }
}

/* Mobile top bar */
@media (max-width: 650px) {
    body.jbt-home-active .jbt-topbar {
        gap: 8px !important;
    }

    body.jbt-home-active .jbt-search-btn {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0 9px !important;
    }

    body.jbt-home-active .jbt-search-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.jbt-home-active .jbt-search-btn kbd,
    body.jbt-home-active .jbt-user-name {
        display: none !important;
    }
}



/* =========================================================
   JBT ERP — FINAL UI PASS 01
   ========================================================= */

.jbt-home-active {
  --jbt-navy: #07345c;
  --jbt-navy-2: #0b416f;
  --jbt-blue: #1475c9;
  --jbt-gold: #f2b233;
  --jbt-text: #17324d;
  --jbt-muted: #61758a;
  --jbt-border: #dce6ef;
  --jbt-bg: #f4f7fa;
}

/* Reduce excessive left whitespace */
.jbt-home-active .jbt-sidebar {
  width: 218px !important;
}

.jbt-home-active .jbt-main,
.jbt-home-active .jbt-content {
  margin-left: 218px !important;
}

.jbt-home-active .jbt-dashboard,
.jbt-home-active .jbt-content-inner {
  width: calc(100% - 32px) !important;
  max-width: none !important;
}

/* Typography */
.jbt-home-active .jbt-dashboard {
  font-size: 14px;
  color: var(--jbt-text);
}

.jbt-home-active .jbt-dashboard h1,
.jbt-home-active .jbt-dashboard h2,
.jbt-home-active .jbt-dashboard h3,
.jbt-home-active .jbt-dashboard h4 {
  color: var(--jbt-text);
  letter-spacing: -.15px;
}

.jbt-home-active .jbt-dashboard .jbt-section-title {
  font-size: 17px !important;
  font-weight: 750 !important;
}

.jbt-home-active .jbt-dashboard .jbt-card-title {
  font-size: 14px !important;
  font-weight: 700 !important;
}

.jbt-home-active .jbt-dashboard .jbt-card-subtitle,
.jbt-home-active .jbt-dashboard .jbt-muted {
  font-size: 12px !important;
  color: var(--jbt-muted) !important;
}

/* KPI */
.jbt-home-active .jbt-kpi-card {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.jbt-home-active .jbt-kpi-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20,117,201,.35) !important;
  box-shadow: 0 8px 24px rgba(7,52,92,.10) !important;
}

.jbt-home-active .jbt-kpi-card strong,
.jbt-home-active .jbt-kpi-card .jbt-value {
  font-size: 26px !important;
  color: var(--jbt-text) !important;
}

/* Modules / actions */
.jbt-home-active .jbt-module-card,
.jbt-home-active .jbt-operation-card,
.jbt-home-active .jbt-dashboard-card {
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.jbt-home-active .jbt-module-card:hover,
.jbt-home-active .jbt-operation-card:hover,
.jbt-home-active .jbt-dashboard-card:hover {
  transform: translateY(-2px);
  border-color: rgba(20,117,201,.32) !important;
  box-shadow: 0 8px 24px rgba(7,52,92,.10) !important;
}

/* Sidebar footer */
.jbt-home-active .jbt-sidebar-footer {
  margin: auto 12px 12px;
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.72);
  font-size: 10px;
  line-height: 1.5;
}

.jbt-home-active .jbt-sidebar-footer .jbt-version {
  color: #fff;
  font-weight: 700;
}

.jbt-home-active .jbt-sidebar-footer .jbt-production {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.jbt-home-active .jbt-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.12);
}

/* Settings */
.jbt-home-active .jbt-settings-nav {
  width: calc(100% - 20px);
  margin: 4px 10px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.86);
  display: flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.jbt-home-active .jbt-settings-nav:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.jbt-home-active .jbt-settings-nav .jbt-nav-icon {
  width: 19px;
  height: 19px;
  display: inline-flex;
}

.jbt-home-active .jbt-settings-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jbt-home-active .jbt-settings-nav .jbt-nav-arrow {
  margin-left: auto;
  font-size: 18px;
  opacity: .7;
}

/* Top bar interaction */
.jbt-home-active .jbt-search-btn,
.jbt-home-active .jbt-notification-btn,
.jbt-home-active .jbt-help-btn,
.jbt-home-active .jbt-profile-btn,
.jbt-home-active .jbt-user-btn {
  transition: background .15s ease, transform .15s ease;
}

.jbt-home-active .jbt-search-btn:hover,
.jbt-home-active .jbt-notification-btn:hover,
.jbt-home-active .jbt-help-btn:hover,
.jbt-home-active .jbt-profile-btn:hover,
.jbt-home-active .jbt-user-btn:hover {
  background: #eaf2f9 !important;
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 900px) {
  .jbt-home-active .jbt-sidebar {
    width: 76px !important;
  }

  .jbt-home-active .jbt-main,
  .jbt-home-active .jbt-content {
    margin-left: 76px !important;
  }

  .jbt-home-active .jbt-sidebar-footer {
    text-align: center;
    padding: 8px 2px;
  }

  .jbt-home-active .jbt-sidebar-footer .jbt-version,
  .jbt-home-active .jbt-sidebar-footer .jbt-production,
  .jbt-home-active .jbt-settings-nav span:not(.jbt-nav-icon) {
    display: none;
  }

  .jbt-home-active .jbt-settings-nav {
    justify-content: center;
    padding: 0;
  }
}

@media (max-width: 600px) {
  .jbt-home-active .jbt-sidebar {
    width: 64px !important;
  }

  .jbt-home-active .jbt-main,
  .jbt-home-active .jbt-content {
    margin-left: 64px !important;
  }

  .jbt-home-active .jbt-dashboard {
    width: calc(100% - 16px) !important;
    margin: 0 8px;
  }
}


/* =========================================================
   JBT ERP — TOP BAR & SETTINGS INTERACTION
   ========================================================= */

.jbt-home-active .jbt-main-dashboard {
  position: relative;
}

.jbt-home-active .jbt-profile-menu,
.jbt-home-active .jbt-settings-menu {
  position: absolute;
  z-index: 9999;
  background: #fff;
  border: 1px solid #dce6ef;
  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(7,52,92,.16);
  color: #17324d;
  overflow: hidden;
}

.jbt-home-active .jbt-profile-menu {
  top: 58px;
  right: 8px;
  width: 290px;
}

.jbt-home-active .jbt-settings-menu {
  left: 185px;
  bottom: 62px;
  width: 245px;
}

.jbt-home-active .jbt-profile-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px;
}

.jbt-home-active .jbt-profile-head strong {
  display: block;
  font-size: 13px;
  color: #17324d;
}

.jbt-home-active .jbt-profile-head span:not(.jbt-menu-arrow) {
  display: block;
  margin-top: 2px;
  color: #718399;
  font-size: 11px;
}

.jbt-home-active .jbt-profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1475c9;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.jbt-home-active .jbt-menu-arrow {
  margin-left: auto;
  color: #9aaabd;
  font-size: 18px;
}

.jbt-home-active .jbt-profile-menu button,
.jbt-home-active .jbt-settings-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  color: #27435d;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.jbt-home-active .jbt-profile-menu button:hover,
.jbt-home-active .jbt-settings-menu button:hover {
  background: #f2f7fb;
  color: #07345c;
}

.jbt-home-active .jbt-profile-menu button > span:first-child,
.jbt-home-active .jbt-settings-menu button > span:first-child {
  width: 20px;
  text-align: center;
  color: #1475c9;
  font-weight: 700;
}

.jbt-home-active .jbt-profile-menu button kbd {
  margin-left: auto;
  border: 1px solid #dce6ef;
  border-radius: 5px;
  padding: 2px 5px;
  background: #f7f9fb;
  color: #718399;
  font-size: 9px;
}

.jbt-home-active .jbt-profile-divider {
  height: 1px;
  background: #e7edf2;
  margin: 4px 0;
}

.jbt-home-active .jbt-profile-menu .jbt-logout-item {
  color: #c0392b;
}

.jbt-home-active .jbt-profile-menu .jbt-logout-item > span:first-child {
  color: #c0392b;
}

.jbt-home-active .jbt-settings-title {
  padding: 13px 15px 9px;
  color: #07345c;
  font-size: 13px;
  font-weight: 750;
  border-bottom: 1px solid #e7edf2;
}

@media (max-width: 700px) {
  .jbt-home-active .jbt-profile-menu {
    right: 5px;
    width: min(290px, calc(100vw - 20px));
  }

  .jbt-home-active .jbt-settings-menu {
    left: 70px;
    bottom: 60px;
    width: min(245px, calc(100vw - 85px));
  }
}

/* ============================================================
   JBT SETTINGS SUBMENU — FINAL
   ============================================================ */

.jbt-settings-menu {
  min-width: 245px;
  padding: 8px;
  background: #ffffff;
  border: 1px solid rgba(9, 49, 87, 0.12);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(9, 49, 87, 0.20);
  animation: jbtSettingsMenuIn 0.15s ease-out;
}

.jbt-settings-menu button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #173b5f;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.jbt-settings-menu button:hover {
  background: #eef6ff;
  color: #0b67b2;
}

.jbt-settings-menu-icon {
  width: 22px;
  text-align: center;
  font-size: 16px;
  flex: 0 0 22px;
}

@keyframes jbtSettingsMenuIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 700px) {
  .jbt-settings-menu {
    min-width: 220px;
  }
}


/* JBT DASHBOARD SPACING V2 */

/*
   Desktop layout:
   Sidebar is approximately 180px.
   Keep only a small 16px visual gap between
   navigation and dashboard content.
*/

body.jbt-home-active .jbt-main-dashboard {
  margin-left: 196px !important;
  width: calc(100% - 212px) !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Keep topbar aligned with dashboard */
body.jbt-home-active .jbt-topbar {
  width: 100% !important;
  margin-left: 0 !important;
}

/* Reduce unnecessary top spacing */
body.jbt-home-active .jbt-dashboard {
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Main content should use available screen width */
body.jbt-home-active .jbt-main-dashboard,
body.jbt-home-active .jbt-dashboard {
  box-sizing: border-box !important;
}

/* Keep responsive behavior */
@media (max-width: 900px) {
  body.jbt-home-active .jbt-main-dashboard {
    margin-left: 196px !important;
    width: calc(100% - 212px) !important;
  }
}

@media (max-width: 600px) {
  body.jbt-home-active .jbt-main-dashboard {
    margin-left: 76px !important;
    width: calc(100% - 92px) !important;
  }

  body.jbt-home-active .jbt-dashboard {
    width: 100% !important;
    margin: 0 !important;
  }
}


/* JBT CONTENT ALIGNMENT V3 */

/*
   FINAL DESKTOP ALIGNMENT
   Remove the extra Frappe/JBT wrapper offset.
   Keep the sidebar unchanged.
*/

body.jbt-home-active .jbt-main,
body.jbt-home-active .jbt-content {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

body.jbt-home-active .jbt-main-dashboard {
  margin-left: 196px !important;
  padding-left: 0 !important;
  padding-right: 16px !important;
  width: calc(100% - 196px) !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

body.jbt-home-active .jbt-dashboard {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  width: 100% !important;
  max-width: none !important;
  box-sizing: border-box !important;
}

/* Remove Frappe layout section spacing around the custom dashboard */
body.jbt-home-active .layout-main-section,
body.jbt-home-active .layout-main-section-wrapper,
body.jbt-home-active .page-body {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
}

/* Keep topbar and dashboard aligned */
body.jbt-home-active .jbt-topbar {
  margin-left: 0 !important;
  margin-right: 0 !important;
  width: 100% !important;
}

/* Desktop */
@media (min-width: 901px) {
  body.jbt-home-active .jbt-main-dashboard {
    margin-left: 196px !important;
    width: calc(100% - 196px) !important;
  }
}

/* Tablet */
@media (max-width: 900px) and (min-width: 601px) {
  body.jbt-home-active .jbt-main-dashboard {
    margin-left: 196px !important;
    width: calc(100% - 196px) !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  body.jbt-home-active .jbt-main,
  body.jbt-home-active .jbt-content {
    margin-left: 0 !important;
  }

  body.jbt-home-active .jbt-main-dashboard {
    margin-left: 76px !important;
    width: calc(100% - 76px) !important;
  }
}

/* JBT NAVIGATION FIXED + INDEPENDENT SCROLL V1 */
@media (min-width: 601px) {
  body.jbt-home-active .jbt-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;

    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;

    height: 100vh !important;
    max-height: 100vh !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    box-sizing: border-box !important;
    flex: 0 0 218px !important;
  }

  body.jbt-home-active .jbt-sidebar::-webkit-scrollbar {
    width: 6px;
  }

  body.jbt-home-active .jbt-sidebar {
    scrollbar-width: thin;
  }
}

/* JBT NAVIGATION FOOTER FIX V1 */
@media (min-width: 601px) {

  body.jbt-home-active .jbt-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    height: 100vh !important;
    max-height: 100vh !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    box-sizing: border-box !important;

    /* Reserve space so navigation items never hide behind footer */
    padding-bottom: 78px !important;
  }

  body.jbt-home-active .jbt-sidebar-footer {
    position: fixed !important;
    left: 0 !important;
    bottom: 0 !important;

    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;

    box-sizing: border-box !important;

    z-index: 100 !important;

    background: #08385f !important;

    margin: 0 !important;
    padding: 10px 12px !important;
  }

}

/* JBT SOURCE NAVIGATION STRUCTURE V1 */

@media (min-width: 601px) {

  body.jbt-home-active .jbt-sidebar {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;

    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;

    height: 100vh !important;
    max-height: 100vh !important;

    display: flex !important;
    flex-direction: column !important;

    overflow: hidden !important;
    padding-bottom: 0 !important;

    box-sizing: border-box !important;
  }

  body.jbt-home-active .jbt-nav-scroll {
    flex: 1 1 auto !important;
    min-height: 0 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    box-sizing: border-box !important;

    scrollbar-width: auto !important;
  }

  body.jbt-home-active .jbt-nav-scroll::-webkit-scrollbar {
    width: 7px !important;
  }

  body.jbt-home-active .jbt-nav-scroll::-webkit-scrollbar-thumb {
    border-radius: 8px !important;
    background: rgba(255,255,255,.35) !important;
  }

  body.jbt-home-active .jbt-nav-scroll::-webkit-scrollbar-track {
    background: transparent !important;
  }

  body.jbt-home-active .jbt-sidebar-footer,
  body.jbt-home-active .jbt-side-bottom {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;

    width: 100% !important;

    flex: 0 0 78px !important;
    min-height: 78px !important;

    box-sizing: border-box !important;

    z-index: 100 !important;

    background: #08385f !important;
  }
}


/* =========================================================
   JBT ZOOM DESKTOP FIX V1
   Keep desktop navigation/layout at high browser zoom.
   Mobile responsive rules remain for touch devices.
   ========================================================= */

@media (hover: hover) and (pointer: fine) {

  body.jbt-home-active .jbt-sidebar {
    width: 218px !important;
    min-width: 218px !important;
    max-width: 218px !important;
    flex: 0 0 218px !important;
  }

  body.jbt-home-active .jbt-main,
  body.jbt-home-active .jbt-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  body.jbt-home-active .jbt-main-dashboard {
    margin-left: 196px !important;
    width: calc(100% - 196px) !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  body.jbt-home-active .jbt-dashboard {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}



/* =========================================================
   JBT ZOOM DESKTOP FIX V2
   Force desktop navigation/layout on real desktop devices,
   even when browser zoom reduces CSS viewport below 600px.
   ========================================================= */

body.jbt-home-active.jbt-desktop-zoom .jbt-sidebar {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;

  width: 218px !important;
  min-width: 218px !important;
  max-width: 218px !important;

  height: 100vh !important;
  max-height: 100vh !important;

  display: flex !important;
  flex-direction: column !important;

  overflow: hidden !important;

  flex: 0 0 218px !important;

  box-sizing: border-box !important;
}

body.jbt-home-active.jbt-desktop-zoom .jbt-nav-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;

  overflow-y: auto !important;
  overflow-x: hidden !important;

  box-sizing: border-box !important;
}

body.jbt-home-active.jbt-desktop-zoom .jbt-main,
body.jbt-home-active.jbt-desktop-zoom .jbt-content {
  margin-left: 0 !important;
  padding-left: 0 !important;
}

body.jbt-home-active.jbt-desktop-zoom .jbt-main-dashboard {
  margin-left: 196px !important;
  padding-left: 0 !important;
  padding-right: 16px !important;

  width: calc(100% - 196px) !important;
  max-width: none !important;

  box-sizing: border-box !important;
}

body.jbt-home-active.jbt-desktop-zoom .jbt-dashboard {
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}


/* Keep sidebar footer at bottom */
body.jbt-home-active.jbt-desktop-zoom .jbt-sidebar-footer,
body.jbt-home-active.jbt-desktop-zoom .jbt-side-bottom {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;

  width: 100% !important;

  flex: 0 0 78px !important;
  min-height: 78px !important;

  box-sizing: border-box !important;
}


/* Restore sidebar labels on desktop zoom */
body.jbt-home-active.jbt-desktop-zoom
.jbt-settings-nav span:not(.jbt-nav-icon),
body.jbt-home-active.jbt-desktop-zoom
.jbt-sidebar-footer .jbt-version,
body.jbt-home-active.jbt-desktop-zoom
.jbt-sidebar-footer .jbt-production {
  display: initial !important;
}


/* =========================================================
   END JBT ZOOM DESKTOP FIX V2
   ========================================================= */

