body[data-mobibiz-colours="dashboard"] {
  background: #f3f7f5;
  color: #16352c;
}

.topbar { background: #064e3b; }
.simple-service-open #emeraldOverview,
body.emerald-simple .simple-home,
body.emerald-simple .simple-tools-heading { display: none !important; }

.emerald-overview { margin: 16px 0; min-width: 0; }
.emerald-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.emerald-heading > div:first-child { flex: 1 1 16rem; min-width: 0; }
.emerald-report-scope, .emerald-report-filters, .emerald-date-controls { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; max-width: 100%; }
.emerald-report-filters[hidden], .emerald-date-controls[hidden] { display: none; }
.emerald-heading :is(select,input), .emerald-panel :is(select,input[type=date],input[type=search]) { min-height: 40px; max-width: 100%; padding: 8px; border: 1px solid #b8d4c6; border-radius: 8px; background: #fff; color: #173b30; font: inherit; }
.emerald-stock details { min-width: 0; width: 100%; }
.emerald-stock summary { cursor: pointer; overflow-wrap: anywhere; }
.emerald-heading h2 { margin: 5px 0; font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.035em; }
.emerald-eyebrow { color: #286551; font-size: .75rem; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.emerald-business-name { margin: 0; color: #4e675d; overflow-wrap: anywhere; }
.emerald-status { color: #4e675d; font-size: .825rem; margin: 16px 0 10px; }
.emerald-error { color: #a12823; }
.emerald-muted { color: #4e675d; font-size: .85rem; line-height: 1.45; margin: 6px 0 12px; }

.emerald-heading button,
.emerald-actions button,
.emerald-more-actions > summary,
.emerald-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid #bcd2c6;
  border-radius: 8px;
  background: #fff;
  color: #07563f;
  text-decoration: none;
  text-align: center;
  font: inherit;
  font-size: .875rem;
  font-weight: 650;
  cursor: pointer;
}
.emerald-heading button:disabled { opacity: .6; cursor: wait; }
.emerald-link.primary { background: #087252; border-color: #087252; color: #fff; }
.emerald-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.emerald-more-actions { position: relative; }
.emerald-more-actions > summary { display: list-item; align-content: center; list-style-position: inside; }
.emerald-more-actions > div {
  position: absolute;
  z-index: 4;
  inset: calc(100% + 5px) auto auto 0;
  display: grid;
  gap: 3px;
  width: max-content;
  max-width: min(80vw, 245px);
  padding: 6px;
  border: 1px solid #bcd2c6;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 6px 18px #16352c20;
}
.emerald-more-actions :is(a, button) { justify-content: start; border-color: transparent; }
.emerald-actions :is(a, button):hover,
.emerald-panel .emerald-link:hover { box-shadow: 0 0 0 1px #087252; }

.emerald-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.emerald-kpi, .emerald-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid #d7e4dd;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 2px #16352c08;
}
.emerald-kpi h3 { margin: 0; font-size: .875rem; font-weight: 650; color: #3d5b4e; }
.emerald-kpi strong { display: block; margin: 8px 0 4px; font-size: clamp(1.18rem, 2.35vw, 1.75rem); overflow-wrap: anywhere; }
.emerald-kpi p { margin: 0; color: #4e675d; font-size: .77rem; }
.emerald-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.emerald-columns > :only-child { grid-column: 1 / -1; }
.emerald-panel h3 { margin: 0; font-size: 1.075rem; }
.emerald-period-total { display: block; margin-top: 8px; font-size: 1.5rem; overflow-wrap: anywhere; }
.emerald-chart { display: flex; gap: 7px; height: 128px; margin: 20px 0 28px; }
.emerald-axis { width: 3.1rem; flex: none; position: relative; color: #4e675d; font-size: .68rem; }
.emerald-axis span { position: absolute; right: 0; transform: translateY(-50%); white-space: nowrap; }
.emerald-axis-high { top: 0; }
.emerald-axis-zero { top: var(--zero); }
.emerald-axis-low { top: 100%; }
.emerald-plot {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  min-width: 0;
  background: repeating-linear-gradient(to bottom, #eaf0ed 0 1px, transparent 1px 25%);
}
.emerald-plot::before { content: ''; position: absolute; top: var(--zero); width: 100%; border-top: 1px solid #8da99a; }
.emerald-day { position: relative; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
.emerald-day:hover, .emerald-day:focus-visible { background: #08725214; z-index: 1; }
.emerald-bar { position: absolute; display: block; width: 61%; left: 19.5%; min-height: 1px; border-radius: 4px 4px 0 0; background: #087c58; }
.emerald-bar.negative { background: #aa483b; border-radius: 0 0 4px 4px; }
.emerald-bar.zero { background: #779388; }
.emerald-day-label { position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: .65rem; }
.emerald-readout { margin: 0 0 10px; min-height: 1.3em; font-size: .8rem; }
.emerald-data { font-size: .81rem; }
.emerald-data summary { cursor: pointer; color: #08694d; font-weight: 650; }
.emerald-data table { width: 100%; margin-top: 8px; text-align: left; border-collapse: collapse; }
.emerald-data :is(td, th) { padding: 6px 3px; border-bottom: 1px solid #e4eee8; overflow-wrap: anywhere; }
.emerald-ai { margin-top: 12px; }
.emerald-stock { padding: 0; margin: 0 0 12px; list-style: none; }
.emerald-stock li { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 9px 0; border-bottom: 1px solid #e4eee8; font-size: .875rem; overflow-wrap: anywhere; }
.emerald-stock-count { flex: none; padding: 4px 7px; border-radius: 6px; color: #794910; background: #fff3da; font-size: .75rem; }
.emerald-stock-count.out { color: #9d302a; background: #ffefec; }

.emerald-more-tools { min-width: 0; margin: 12px 0; padding: 12px; border: 1px solid #d7e4dd; border-radius: 12px; background: #fff; }
.emerald-more-tools > summary { cursor: pointer; color: #07563f; font-weight: 700; }
.emerald-more-tools[open] > summary { margin-bottom: 10px; }
.simple-service-open .emerald-more-tools { display: none; }

#emeraldHeaderBranch { color: #fff; }
#emeraldHeaderBranch[hidden] { display: none; }
#emeraldHeaderBranch label { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: .875rem; font-weight: 650; }
#emeraldHeaderBranch select { max-width: min(230px, 100%); min-height: 38px; padding: 4px 8px; border: 1px solid #aacabd; border-radius: 8px; background: #f5faf7; color: #153d32; font: inherit; font-size: 1rem; }
#emeraldHeaderBranch [role="status"]:not(:empty) { display: block; margin-top: 4px; font-size: .8rem; }
.emerald-owner #branchManager > p:empty { display: none; }
.emerald-owner #branchManager { min-width: 0; overflow-wrap: anywhere; }
.emerald-owner .dashboard-nav.simple-tools { grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 0; }
.emerald-owner .dashboard-nav.simple-tools a { min-height: 37px; padding: 7px 8px !important; border-color: transparent !important; border-radius: 7px !important; }
.emerald-owner .dashboard-nav.simple-tools a:hover { background: #eef7f2 !important; }
.emerald-owner #dashboard > .welcome { display: none; }

@media (min-width: 841px) {
  body.emerald-owner .container { max-width: 1440px !important; }
  body.emerald-owner:not(.simple-service-open) #dashboard[style*="display: block"] {
    display: grid !important;
    grid-template-columns: minmax(168px, 206px) minmax(0, 1fr);
    gap: 12px 20px;
    align-items: start;
  }
  .emerald-owner:not(.simple-service-open) #dashboard > * { grid-column: 2; }
  .emerald-owner:not(.simple-service-open) #dashboard > .emerald-more-tools { grid-column: 1; grid-row: 1 / span 2; }
  .emerald-owner .emerald-overview, .emerald-owner .emerald-more-tools { margin-top: 0; }
}

@media (max-width: 1050px) {
  .emerald-columns { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 840px) {
  .emerald-owner .emerald-more-tools { margin: 0 0 12px; }
  .emerald-owner .dashboard-nav.simple-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emerald-owner #emeraldHeaderBranch { grid-column: 1 / -1; }
  .emerald-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .emerald-actions :is(a, button, summary), .emerald-heading button { min-height: 44px; }
  .emerald-actions { position: relative; }
  .emerald-more-actions { position: static; }
  .emerald-more-actions > div { inset-inline: auto 0; }
}

@media (max-width: 600px) {
  body.emerald-owner .topbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.emerald-owner .topbar .brand { grid-area: 1 / 1 / 2 / 3; font-size: 16px; white-space: normal; }
  body.emerald-owner .topbar #dashboardHomeButton { grid-area: 1 / 3 / 2 / 4; }
  body.emerald-owner .topbar #dashboardSettingsButton { grid-area: 1 / 4 / 2 / 5; }
  body.emerald-owner .topbar #emeraldHeaderBranch { grid-area: 2 / 1 / 3 / 3; }
  body.emerald-owner .topbar #mobibizPortfolioLink { grid-area: 2 / 3 / 3 / 4; white-space: normal; }
  body.emerald-owner .topbar .logout { grid-area: 2 / 4 / 3 / 5; }
  body.emerald-owner .topbar > div:last-child > a { display: none; }
}

@media (max-width: 420px) {
  .emerald-kpi, .emerald-panel { padding: 12px; }
  .emerald-axis { width: 2rem; }
  .emerald-day-label { font-size: .58rem; }
  .emerald-owner .container { padding-inline: 12px; }
}

/* Owner navigation */
.emerald-owner .emerald-more-tools {background:#104b42;border-color:#104b42;border-radius:15px;padding:12px;color:#f4fbf7;}
.emerald-owner .emerald-more-tools > summary {color:#d7eee5;font-size:.85rem;letter-spacing:.035em;padding:8px 5px;}
.emerald-owner .dashboard-nav.simple-tools {grid-template-columns:minmax(0,1fr);gap:3px;}
.emerald-owner .dashboard-nav.simple-tools a,.emerald-owner .owner-nav-home,.emerald-owner .owner-other-pos > summary {box-sizing:border-box;width:100%;min-height:40px;display:flex;align-items:center;justify-content:flex-start;gap:9px;padding:9px 11px!important;border:1px solid transparent!important;border-radius:8px!important;background:transparent!important;color:#e8f5ef!important;text-decoration:none;text-align:left;font:600 14px/1.35 system-ui,sans-serif!important;white-space:normal!important;cursor:pointer;box-shadow:none!important;}
.emerald-owner .dashboard-nav.simple-tools a:hover,.emerald-owner .owner-nav-home:hover,.emerald-owner .owner-other-pos > summary:hover {background:#23665a!important;color:white!important;}
.emerald-owner .dashboard-nav.simple-tools [aria-current=page] {background:#18a783!important;color:#082e25!important;font-weight:750!important;}
.emerald-owner .owner-nav-home[hidden],.emerald-owner .dashboard-nav.simple-tools a[style*="display: none"] {display:none!important;}
.emerald-owner .owner-other-pos {border-top:1px solid #ffffff26;padding-top:6px;margin-top:5px;}
.emerald-owner .owner-other-pos > summary::after {content:'+';margin-left:auto;font-size:18px;}
.emerald-owner .owner-other-pos[open] > summary::after {content:'−';}
.emerald-owner .owner-other-pos-links {margin-left:9px;border-left:1px solid #80b5a5;padding-left:6px;}
.emerald-owner .owner-other-pos-links a {font-size:13px!important;font-weight:500!important;}
@media(min-width:841px){
 body.emerald-owner #dashboard[style*="display: block"] {display:grid!important;grid-template-columns:minmax(205px,234px) minmax(0,1fr);gap:12px 20px;align-items:start;}
 body.emerald-owner #dashboard > * {grid-column:2;min-width:0;}
 body.emerald-owner #dashboard > .emerald-more-tools {grid-column:1;grid-row:1 / span 2;position:sticky;top:12px;max-height:calc(100vh - 24px);overflow:auto;scrollbar-width:thin;display:block;}
 body.emerald-owner.simple-service-open .emerald-more-tools {display:block;}
 body.emerald-owner.simple-service-open .dashboard-nav.simple-tools {display:grid!important;}
 .emerald-owner .emerald-more-tools {margin-top:0;}
}
@media(max-width:840px){.emerald-owner .dashboard-nav.simple-tools {grid-template-columns:minmax(0,1fr);}.emerald-owner .emerald-more-tools {max-height:70vh;overflow:auto;}}

/* Compact owner task groups */
.emerald-owner .owner-grouped-nav {gap:4px;}
.emerald-owner .owner-nav-group {margin:0;padding:0;border:0;min-width:0;}
.emerald-owner .owner-nav-group > summary {list-style:none;box-sizing:border-box;width:100%;min-height:42px;display:flex;align-items:center;gap:8px;padding:9px 11px;border-radius:8px;color:#e8f5ef;font:650 14px/1.35 system-ui,sans-serif;cursor:pointer;}
.emerald-owner .owner-nav-group > summary::-webkit-details-marker {display:none;}
.emerald-owner .owner-nav-group > summary::after {content:'+';font-size:18px;line-height:1;margin-left:auto;font-weight:500;}
.emerald-owner .owner-nav-group[open] > summary::after {content:'−';}
.emerald-owner .owner-nav-group > summary:hover,.emerald-owner .owner-nav-group[open] > summary {background:#23665a;color:white;}
.emerald-owner .owner-nav-group[data-active] > summary {box-shadow:inset 3px 0 #18a783;}
.emerald-owner .owner-group-items {padding:3px 0 5px 8px;margin-left:13px;border-left:1px solid #87b8a6;}
.emerald-owner .owner-grouped-nav .owner-group-items {min-width:0;}
.emerald-owner .owner-group-items :is(a,button.owner-nav-home) {font-size:13px!important;font-weight:500!important;min-height:36px!important;padding:7px 9px!important;}
.emerald-owner .owner-group-badge {font-size:12px;min-width:22px;text-align:center;padding:2px 6px;margin-left:auto;background:#d9f4e8;color:#104b42;border-radius:99px;font-weight:750;}
.emerald-owner .owner-nav-group > summary:has(.owner-group-badge:not([hidden]))::after {margin-left:0;}
.emerald-owner .owner-group-badge[hidden] {display:none!important;}
.emerald-owner .emerald-more-actions > div {max-height:min(65vh,450px);overflow:auto;}
.emerald-owner .owner-group-items [hidden] {display:none!important;}
@media(max-width:840px){.emerald-owner .owner-nav-group > summary {min-height:44px;}.emerald-owner .owner-group-items :is(a,button.owner-nav-home) {min-height:42px!important;}}

/* One shared, touch-friendly owner menu for Android, Windows and the website. */
@media(max-width:840px){
 .emerald-owner #dashboard > .emerald-more-tools{width:100%;box-sizing:border-box;max-height:none;overflow:visible;margin-bottom:12px;padding:8px;}
 .emerald-owner .emerald-more-tools > summary{min-height:44px;box-sizing:border-box;padding:12px 10px;font-size:15px;}
 .emerald-owner .emerald-more-tools[open] .dashboard-nav.simple-tools{display:grid!important;grid-template-columns:minmax(0,1fr);gap:4px;}
 .emerald-owner.simple-service-open .emerald-more-tools{display:block;}
 .emerald-owner .owner-nav-group > summary{min-height:44px;padding:10px 12px;}
 .emerald-owner .owner-group-items a,.emerald-owner .owner-group-items button.owner-nav-home{font-size:14px!important;min-height:44px!important;}
 .emerald-owner .owner-group-items{min-width:0;overflow-wrap:anywhere;}
}
